diff --git a/apps/api/documents/api.js b/apps/api/documents/api.js index 66f179591..8b9efb748 100644 --- a/apps/api/documents/api.js +++ b/apps/api/documents/api.js @@ -129,7 +129,8 @@ toolbarNoTabs: false, toolbarHideFileName: false, reviewDisplay: 'original', - spellcheck: true + spellcheck: true, + compatibleFeatures: false }, plugins: { autostart: ['asc.{FFE1F462-1EA2-4391-990D-4CC84940B754}'], diff --git a/apps/common/main/lib/view/Comments.js b/apps/common/main/lib/view/Comments.js index bdb95b10a..679ea505c 100644 --- a/apps/common/main/lib/view/Comments.js +++ b/apps/common/main/lib/view/Comments.js @@ -559,9 +559,13 @@ define([ add = $('.new-comment-ct', this.el), to = $('.add-link-ct', this.el), msgs = $('.messages-ct', this.el); - msgs.toggleClass('stretch', !mode.canComments); - if (!mode.canComments) { - add.hide(); to.hide(); + msgs.toggleClass('stretch', !mode.canComments || mode.compatibleFeatures); + if (!mode.canComments || mode.compatibleFeatures) { + if (mode.compatibleFeatures) { + add.remove(); to.remove(); + } else { + add.hide(); to.hide(); + } this.layout.changeLayout([{el: msgs[0], rely: false, stretch: true}]); } else { var container = $('#comments-box', this.el), diff --git a/apps/documenteditor/main/app/controller/Main.js b/apps/documenteditor/main/app/controller/Main.js index 243fdb58f..81d8f74eb 100644 --- a/apps/documenteditor/main/app/controller/Main.js +++ b/apps/documenteditor/main/app/controller/Main.js @@ -352,6 +352,7 @@ define([ this.appOptions.canRequestSaveAs = this.editorConfig.canRequestSaveAs; this.appOptions.canRequestInsertImage = this.editorConfig.canRequestInsertImage; this.appOptions.canRequestMailMergeRecipients = this.editorConfig.canRequestMailMergeRecipients; + this.appOptions.compatibleFeatures = (typeof (this.appOptions.customization) == 'object') && !!this.appOptions.customization.compatibleFeatures; appHeader = this.getApplication().getController('Viewport').getView('Common.Views.Header'); appHeader.setCanBack(this.appOptions.canBackToFolder === true, (this.appOptions.canBackToFolder) ? this.editorConfig.customization.goback.text : '') diff --git a/apps/documenteditor/main/app/controller/Toolbar.js b/apps/documenteditor/main/app/controller/Toolbar.js index c1bd8990a..71c5041ce 100644 --- a/apps/documenteditor/main/app/controller/Toolbar.js +++ b/apps/documenteditor/main/app/controller/Toolbar.js @@ -653,7 +653,8 @@ define([ var i = -1, type, paragraph_locked = false, header_locked = false, - image_locked = false; + image_locked = false, + in_image = false; while (++i < selectedObjects.length) { type = selectedObjects[i].get_ObjectType(); @@ -663,11 +664,15 @@ define([ } else if (type === Asc.c_oAscTypeSelectElement.Header) { header_locked = selectedObjects[i].get_ObjectValue().get_Locked(); } else if (type === Asc.c_oAscTypeSelectElement.Image) { + in_image = true; image_locked = selectedObjects[i].get_ObjectValue().get_Locked(); } } var need_disable = !this.api.can_AddQuotedComment() || paragraph_locked || header_locked || image_locked; + if (this.mode.compatibleFeatures) { + need_disable = need_disable || in_image; + } if ( this.btnsComment && this.btnsComment.length > 0 ) this.btnsComment.setDisabled(need_disable); }, @@ -829,6 +834,9 @@ define([ toolbar.listStylesAdditionalMenuItem.setDisabled(frame_pr===undefined); need_disable = !this.api.can_AddQuotedComment() || paragraph_locked || header_locked || image_locked; + if (this.mode.compatibleFeatures) { + need_disable = need_disable || in_image; + } if ( this.btnsComment && this.btnsComment.length > 0 ) this.btnsComment.setDisabled(need_disable); diff --git a/apps/documenteditor/main/app/view/DocumentHolder.js b/apps/documenteditor/main/app/view/DocumentHolder.js index 198369d9d..8a85358a6 100644 --- a/apps/documenteditor/main/app/view/DocumentHolder.js +++ b/apps/documenteditor/main/app/view/DocumentHolder.js @@ -1995,10 +1995,13 @@ define([ this.viewModeMenu = new Common.UI.Menu({ initMenu: function (value) { var isInChart = (value.imgProps && value.imgProps.value && !_.isNull(value.imgProps.value.get_ChartProperties())), + isInShape = (value.imgProps && value.imgProps.value && !_.isNull(value.imgProps.value.get_ShapeProperties())), signGuid = (value.imgProps && value.imgProps.value && me.mode.isSignatureSupport) ? value.imgProps.value.asc_getSignatureId() : undefined, signProps = (signGuid) ? me.api.asc_getSignatureSetup(signGuid) : null, isInSign = !!signProps && me._canProtect, canComment = !isInChart && me.api.can_AddQuotedComment() !== false && me.mode.canCoAuthoring && me.mode.canComments && !me._isDisabled; + if (me.mode.compatibleFeatures) + canComment = canComment && !isInShape; menuViewUndo.setVisible(me.mode.canCoAuthoring && me.mode.canComments && !me._isDisabled); menuViewUndo.setDisabled(!me.api.asc_getCanUndo() && !me._isDisabled); @@ -3625,8 +3628,11 @@ define([ text = me.api.can_AddHyperlink(); } /** coauthoring begin **/ - menuCommentSeparatorPara.setVisible(!isInChart && me.api.can_AddQuotedComment()!==false && me.mode.canCoAuthoring && me.mode.canComments); - menuAddCommentPara.setVisible(!isInChart && me.api.can_AddQuotedComment()!==false && me.mode.canCoAuthoring && me.mode.canComments); + var isVisible = !isInChart && me.api.can_AddQuotedComment()!==false && me.mode.canCoAuthoring && me.mode.canComments; + if (me.mode.compatibleFeatures) + isVisible = isVisible && !isInShape; + menuCommentSeparatorPara.setVisible(isVisible); + menuAddCommentPara.setVisible(isVisible); menuAddCommentPara.setDisabled(value.paraProps && value.paraProps.locked === true); /** coauthoring end **/ diff --git a/apps/presentationeditor/main/app/controller/Main.js b/apps/presentationeditor/main/app/controller/Main.js index 5ee8253c7..97cfb1195 100644 --- a/apps/presentationeditor/main/app/controller/Main.js +++ b/apps/presentationeditor/main/app/controller/Main.js @@ -319,6 +319,7 @@ define([ this.appOptions.canRequestSendNotify = this.editorConfig.canRequestSendNotify; this.appOptions.canRequestSaveAs = this.editorConfig.canRequestSaveAs; this.appOptions.canRequestInsertImage = this.editorConfig.canRequestInsertImage; + this.appOptions.compatibleFeatures = (typeof (this.appOptions.customization) == 'object') && !!this.appOptions.customization.compatibleFeatures; appHeader = this.getApplication().getController('Viewport').getView('Common.Views.Header'); appHeader.setCanBack(this.appOptions.canBackToFolder === true, (this.appOptions.canBackToFolder) ? this.editorConfig.customization.goback.text : '') diff --git a/apps/spreadsheeteditor/main/app/controller/Main.js b/apps/spreadsheeteditor/main/app/controller/Main.js index 386f0b9e2..3b6babb54 100644 --- a/apps/spreadsheeteditor/main/app/controller/Main.js +++ b/apps/spreadsheeteditor/main/app/controller/Main.js @@ -335,6 +335,7 @@ define([ this.appOptions.canRequestSendNotify = this.editorConfig.canRequestSendNotify; this.appOptions.canRequestSaveAs = this.editorConfig.canRequestSaveAs; this.appOptions.canRequestInsertImage = this.editorConfig.canRequestInsertImage; + this.appOptions.compatibleFeatures = (typeof (this.appOptions.customization) == 'object') && !!this.appOptions.customization.compatibleFeatures; this.headerView = this.getApplication().getController('Viewport').getView('Common.Views.Header'); this.headerView.setCanBack(this.appOptions.canBackToFolder === true, (this.appOptions.canBackToFolder) ? this.editorConfig.customization.goback.text : '') diff --git a/apps/spreadsheeteditor/main/app/controller/Toolbar.js b/apps/spreadsheeteditor/main/app/controller/Toolbar.js index 676a9661e..f37309543 100644 --- a/apps/spreadsheeteditor/main/app/controller/Toolbar.js +++ b/apps/spreadsheeteditor/main/app/controller/Toolbar.js @@ -2420,7 +2420,8 @@ define([ toolbar.btnDeleteCell.menu.items[1].setDisabled(this._state.controlsdisabled.cells_down); } - toolbar.lockToolbar(SSE.enumLock.commentLock, (selectionType == Asc.c_oAscSelectionType.RangeCells) && (info.asc_getComments().length>0 || info.asc_getLocked()), + toolbar.lockToolbar(SSE.enumLock.commentLock, (selectionType == Asc.c_oAscSelectionType.RangeCells) && (info.asc_getComments().length>0 || info.asc_getLocked()) || + this.toolbar.mode.compatibleFeatures && (selectionType != Asc.c_oAscSelectionType.RangeCells), { array: this.btnsComment }); toolbar.lockToolbar(SSE.enumLock.headerLock, info.asc_getLockedHeaderFooter(), {array: this.toolbar.btnsEditHeader});