From 5f6a8dcc781732c15f7bcac41ba945dd0ff8fecc Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Mon, 2 Nov 2020 16:48:44 +0300 Subject: [PATCH 1/4] Bug 47219 --- apps/documenteditor/main/app/view/FileMenuPanels.js | 2 +- apps/documenteditor/mobile/app/controller/Settings.js | 2 +- apps/presentationeditor/main/app/view/FileMenuPanels.js | 2 +- apps/presentationeditor/mobile/app/controller/Settings.js | 2 +- apps/spreadsheeteditor/main/app/view/FileMenuPanels.js | 2 +- apps/spreadsheeteditor/mobile/app/controller/Settings.js | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/documenteditor/main/app/view/FileMenuPanels.js b/apps/documenteditor/main/app/view/FileMenuPanels.js index d37841fab..8bd418ea4 100644 --- a/apps/documenteditor/main/app/view/FileMenuPanels.js +++ b/apps/documenteditor/main/app/view/FileMenuPanels.js @@ -1136,7 +1136,7 @@ define([ var appname = (this.api) ? this.api.asc_getAppProps() : null; if (appname) { - appname = (appname.asc_getApplication() || '') + ' ' + (appname.asc_getAppVersion() || ''); + appname = (appname.asc_getApplication() || '') + (appname.asc_getAppVersion() ? ' ' : '') + (appname.asc_getAppVersion() || ''); this.lblApplication.text(appname); } this._ShowHideInfoItem(this.lblApplication, !!appname); diff --git a/apps/documenteditor/mobile/app/controller/Settings.js b/apps/documenteditor/mobile/app/controller/Settings.js index 2787d8455..d476fae33 100644 --- a/apps/documenteditor/mobile/app/controller/Settings.js +++ b/apps/documenteditor/mobile/app/controller/Settings.js @@ -442,7 +442,7 @@ define([ var appProps = (this.api) ? this.api.asc_getAppProps() : null; if (appProps) { - var appName = (appProps.asc_getApplication() || '') + ' ' + (appProps.asc_getAppVersion() || ''); + var appName = (appProps.asc_getApplication() || '') + (appProps.asc_getAppVersion() ? ' ' : '') + (appProps.asc_getAppVersion() || ''); appName ? $('#settings-doc-application').html(appName) : $('.display-application').remove(); } var props = (this.api) ? this.api.asc_getCoreProps() : null; diff --git a/apps/presentationeditor/main/app/view/FileMenuPanels.js b/apps/presentationeditor/main/app/view/FileMenuPanels.js index 6b4d09073..aa802e4ec 100644 --- a/apps/presentationeditor/main/app/view/FileMenuPanels.js +++ b/apps/presentationeditor/main/app/view/FileMenuPanels.js @@ -1007,7 +1007,7 @@ define([ var appname = (this.api) ? this.api.asc_getAppProps() : null; if (appname) { - appname = (appname.asc_getApplication() || '') + ' ' + (appname.asc_getAppVersion() || ''); + appname = (appname.asc_getApplication() || '') + (appname.asc_getAppVersion() ? ' ' : '') + (appname.asc_getAppVersion() || ''); this.lblApplication.text(appname); } this._ShowHideInfoItem(this.lblApplication, !!appname); diff --git a/apps/presentationeditor/mobile/app/controller/Settings.js b/apps/presentationeditor/mobile/app/controller/Settings.js index 4d3f3d1b3..ee921a5bb 100644 --- a/apps/presentationeditor/mobile/app/controller/Settings.js +++ b/apps/presentationeditor/mobile/app/controller/Settings.js @@ -226,7 +226,7 @@ define([ var appProps = (this.api) ? this.api.asc_getAppProps() : null; if (appProps) { - var appName = (appProps.asc_getApplication() || '') + ' ' + (appProps.asc_getAppVersion() || ''); + var appName = (appProps.asc_getApplication() || '') + (appProps.asc_getAppVersion() ? ' ' : '') + (appProps.asc_getAppVersion() || ''); appName ? $('#settings-pe-application').html(appName) : $('.display-application').remove(); } diff --git a/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js b/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js index 6660c975c..4a58c46b0 100644 --- a/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js +++ b/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js @@ -1862,7 +1862,7 @@ define([ var appname = (this.api) ? this.api.asc_getAppProps() : null; if (appname) { - appname = (appname.asc_getApplication() || '') + ' ' + (appname.asc_getAppVersion() || ''); + appname = (appname.asc_getApplication() || '') + (appname.asc_getAppVersion() ? ' ' : '') + (appname.asc_getAppVersion() || ''); this.lblApplication.text(appname); } this._ShowHideInfoItem(this.lblApplication, !!appname); diff --git a/apps/spreadsheeteditor/mobile/app/controller/Settings.js b/apps/spreadsheeteditor/mobile/app/controller/Settings.js index 4a0005217..ab7d32a02 100644 --- a/apps/spreadsheeteditor/mobile/app/controller/Settings.js +++ b/apps/spreadsheeteditor/mobile/app/controller/Settings.js @@ -295,7 +295,7 @@ define([ var appProps = (this.api) ? this.api.asc_getAppProps() : null; if (appProps) { - var appName = (appProps.asc_getApplication() || '') + ' ' + (appProps.asc_getAppVersion() || ''); + var appName = (appProps.asc_getApplication() || '') + (appProps.asc_getAppVersion() ? ' ' : '') + (appProps.asc_getAppVersion() || ''); appName ? $('#settings-sse-application').html(appName) : $('.display-application').remove(); } From 35bf0fac86bc70eb16ae6a89e9d5cbdc311f4706 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Mon, 2 Nov 2020 17:31:21 +0300 Subject: [PATCH 2/4] Fix Bug 47223 --- apps/common/mobile/lib/controller/Collaboration.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/apps/common/mobile/lib/controller/Collaboration.js b/apps/common/mobile/lib/controller/Collaboration.js index cab5f8398..621d1992d 100644 --- a/apps/common/mobile/lib/controller/Collaboration.js +++ b/apps/common/mobile/lib/controller/Collaboration.js @@ -1361,8 +1361,11 @@ define([ onEditComment: function(comment) { var value = $('#comment-text')[0].value.trim(); if (value && value.length > 0) { + this.getCurrentUser(); if (!_.isUndefined(this.onChangeComment)) { comment.comment = value; + comment.userid = this.currentUser.asc_getIdOriginal(); + comment.username = this.currentUser.asc_getUserName(); this.onChangeComment(comment); } if ($('.container-view-comment').length > 0) { @@ -1441,9 +1444,12 @@ define([ onEditReply: function(comment, indReply) { var value = $('.edit-reply-textarea')[0].value.trim(); if (value && value.length > 0) { + this.getCurrentUser(); if ($('.container-view-comment').length > 0) { if (!_.isUndefined(this.onChangeComment)) { comment.replys[indReply].reply = value; + comment.replys[indReply].userid = this.currentUser.asc_getIdOriginal(); + comment.replys[indReply].username = this.currentUser.asc_getUserName(); this.onChangeComment(comment); } if (Common.SharedSettings.get('phone')) { @@ -1460,6 +1466,8 @@ define([ } else { if (!_.isUndefined(this.onChangeComment)) { comment.replys[indReply].reply = value; + comment.replys[indReply].userid = this.currentUser.asc_getIdOriginal(); + comment.replys[indReply].username = this.currentUser.asc_getUserName(); this.onChangeComment(comment); } rootView.router.back(); From 537a3e2817485f74be400dc449f95255f3609a03 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Mon, 2 Nov 2020 18:38:20 +0300 Subject: [PATCH 3/4] Fix Bug 47212 --- .../mobile/lib/controller/Collaboration.js | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/apps/common/mobile/lib/controller/Collaboration.js b/apps/common/mobile/lib/controller/Collaboration.js index 621d1992d..555f6af8c 100644 --- a/apps/common/mobile/lib/controller/Collaboration.js +++ b/apps/common/mobile/lib/controller/Collaboration.js @@ -1542,7 +1542,9 @@ define([ date = (data.asc_getReply(i).asc_getOnlyOfficeTime()) ? new Date(this.stringOOToLocalDate(data.asc_getReply(i).asc_getOnlyOfficeTime())) : ((data.asc_getReply(i).asc_getTime() == '') ? new Date() : new Date(this.stringUtcToLocalDate(data.asc_getReply(i).asc_getTime()))); - var user = _.findWhere(editUsers, {idOriginal: data.asc_getReply(i).asc_getUserId()}); + var user = _.find(editUsers, function(item){ + return (item.asc_getIdOriginal()==data.asc_getReply(i).asc_getUserId()); + }); var username = data.asc_getReply(i).asc_getUserName(); replies.push({ ind : i, @@ -1563,8 +1565,10 @@ define([ readSDKComment: function(id, data) { var date = (data.asc_getOnlyOfficeTime()) ? new Date(this.stringOOToLocalDate(data.asc_getOnlyOfficeTime())) : ((data.asc_getTime() == '') ? new Date() : new Date(this.stringUtcToLocalDate(data.asc_getTime()))); - var user = _.findWhere(editUsers, {idOriginal: data.asc_getUserId()}), - groupname = id.substr(0, id.lastIndexOf('_')+1).match(/^(doc|sheet[0-9_]+)_/); + var user = _.find(editUsers, function(item){ + return (item.asc_getIdOriginal()==data.asc_getUserId()); + }); + var groupname = id.substr(0, id.lastIndexOf('_')+1).match(/^(doc|sheet[0-9_]+)_/); var username = data.asc_getUserName(); var comment = { uid : id, @@ -1605,7 +1609,9 @@ define([ date = (data.asc_getOnlyOfficeTime()) ? new Date(this.stringOOToLocalDate(data.asc_getOnlyOfficeTime())) : ((data.asc_getTime() == '') ? new Date() : new Date(this.stringUtcToLocalDate(data.asc_getTime()))); - var user = _.findWhere(editUsers, {idOriginal: data.asc_getUserId()}); + var user = _.find(editUsers, function(item){ + return (item.asc_getIdOriginal()==data.asc_getUserId()); + }); comment.comment = data.asc_getText(); comment.userid = data.asc_getUserId(); comment.username = data.asc_getUserName(); @@ -1625,7 +1631,9 @@ define([ dateReply = (data.asc_getReply(i).asc_getOnlyOfficeTime()) ? new Date(this.stringOOToLocalDate(data.asc_getReply(i).asc_getOnlyOfficeTime())) : ((data.asc_getReply(i).asc_getTime() == '') ? new Date() : new Date(this.stringUtcToLocalDate(data.asc_getReply(i).asc_getTime()))); - user = _.findWhere(editUsers, {idOriginal: data.asc_getReply(i).asc_getUserId()}); + user = _.find(editUsers, function(item){ + return (item.asc_getIdOriginal()==data.asc_getReply(i).asc_getUserId()); + }); var username = data.asc_getReply(i).asc_getUserName(); replies.push({ ind : i, From dabc31a8c71f7dce2d198af18e63e4433174fcb5 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Mon, 2 Nov 2020 19:14:32 +0300 Subject: [PATCH 4/4] Fix Bug 47163 --- .../documenteditor/mobile/app/controller/edit/EditText.js | 8 ++++---- .../mobile/app/controller/edit/EditText.js | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/apps/documenteditor/mobile/app/controller/edit/EditText.js b/apps/documenteditor/mobile/app/controller/edit/EditText.js index aa1c9bd8f..08f0ba0af 100644 --- a/apps/documenteditor/mobile/app/controller/edit/EditText.js +++ b/apps/documenteditor/mobile/app/controller/edit/EditText.js @@ -132,8 +132,8 @@ define([ _paragraphObject.get_SmallCaps() && $inputTextCaps.val(['small']).prop('prevValue', 'small'); _paragraphObject.get_AllCaps() && $inputTextCaps.val(['all']).prop('prevValue', 'all'); - _fontInfo.letterSpacing = Common.Utils.Metric.fnRecalcFromMM(_paragraphObject.get_TextSpacing()); - $('#letter-spacing .item-after label').text(_fontInfo.letterSpacing + ' ' + Common.Utils.Metric.getCurrentMetricName()); + _fontInfo.letterSpacing = (_paragraphObject.get_TextSpacing()===null || _paragraphObject.get_TextSpacing()===undefined) ? _paragraphObject.get_TextSpacing() : Common.Utils.Metric.fnRecalcFromMM(_paragraphObject.get_TextSpacing()); + $('#letter-spacing .item-after label').text((_fontInfo.letterSpacing===null || _fontInfo.letterSpacing===undefined) ? '' : _fontInfo.letterSpacing + ' ' + Common.Utils.Metric.getCurrentMetricName()); } }, @@ -327,9 +327,9 @@ define([ spacing = _fontInfo.letterSpacing; if ($button.hasClass('decrement')) { - spacing = Math.max(-100, --spacing); + spacing = (spacing===null || spacing===undefined) ? 0 : Math.max(-100, --spacing); } else { - spacing = Math.min(100, ++spacing); + spacing = (spacing===null || spacing===undefined) ? 0 : Math.min(100, ++spacing); } _fontInfo.letterSpacing = spacing; diff --git a/apps/presentationeditor/mobile/app/controller/edit/EditText.js b/apps/presentationeditor/mobile/app/controller/edit/EditText.js index 9f66c7b0b..6e85dd2b7 100644 --- a/apps/presentationeditor/mobile/app/controller/edit/EditText.js +++ b/apps/presentationeditor/mobile/app/controller/edit/EditText.js @@ -146,8 +146,8 @@ define([ _paragraphObject.get_SmallCaps() && $inputTextCaps.val(['small']).prop('prevValue', 'small'); _paragraphObject.get_AllCaps() && $inputTextCaps.val(['all']).prop('prevValue', 'all'); - _fontInfo.letterSpacing = Common.Utils.Metric.fnRecalcFromMM(_paragraphObject.get_TextSpacing()); - $('#letter-spacing .item-after label').text(_fontInfo.letterSpacing + ' ' + Common.Utils.Metric.getCurrentMetricName()); + _fontInfo.letterSpacing = (_paragraphObject.get_TextSpacing()===null || _paragraphObject.get_TextSpacing()===undefined) ? _paragraphObject.get_TextSpacing() : Common.Utils.Metric.fnRecalcFromMM(_paragraphObject.get_TextSpacing()); + $('#letter-spacing .item-after label').text((_fontInfo.letterSpacing===null || _fontInfo.letterSpacing===undefined) ? '' : _fontInfo.letterSpacing + ' ' + Common.Utils.Metric.getCurrentMetricName()); } _paragraphInfo.spaceBefore = _paragraphObject.get_Spacing().get_Before() < 0 ? _paragraphObject.get_Spacing().get_Before() : Common.Utils.Metric.fnRecalcFromMM(_paragraphObject.get_Spacing().get_Before()); @@ -304,9 +304,9 @@ define([ spacing = _fontInfo.letterSpacing; if ($button.hasClass('decrement')) { - spacing = Math.max(-100, --spacing); + spacing = (spacing===null || spacing===undefined) ? 0 : Math.max(-100, --spacing); } else { - spacing = Math.min(100, ++spacing); + spacing = (spacing===null || spacing===undefined) ? 0 : Math.min(100, ++spacing); } _fontInfo.letterSpacing = spacing;