diff --git a/apps/api/documents/api.js b/apps/api/documents/api.js index bd8ed790e..274993c62 100644 --- a/apps/api/documents/api.js +++ b/apps/api/documents/api.js @@ -219,8 +219,9 @@ uiTheme: 'theme-dark' // set interface theme: id or default-dark/default-light }, coEditing: { - mode: 'fast', // , 'fast' or 'strict'. if 'fast' and 'customization.autosave'=false -> set 'customization.autosave'=true - change: true, // can change co-authoring mode + mode: 'fast', // , 'fast' or 'strict'. if 'fast' and 'customization.autosave'=false -> set 'customization.autosave'=true. 'fast' - default for editor + // for viewer: 'strict' is default, offline viewer; 'fast' - live viewer, show changes from other users + change: true, // can change co-authoring mode. true - default for editor, false - default for viewer }, plugins: { autostart: ['asc.{FFE1F462-1EA2-4391-990D-4CC84940B754}'], diff --git a/apps/api/wopi/editor-wopi.ejs b/apps/api/wopi/editor-wopi.ejs index 28b1860fd..ad460d53a 100644 --- a/apps/api/wopi/editor-wopi.ejs +++ b/apps/api/wopi/editor-wopi.ejs @@ -302,7 +302,7 @@ div { "uiTheme": queryParams.thm==="1" ? "default-light" : (queryParams.thm==="2" ? "default-dark" : undefined) }, "coEditing": { - "mode": "fast", + "mode": userAuth.mode !== "view" ? "fast" : "strict", "change": false }, "wopi": { diff --git a/apps/documenteditor/main/app/controller/LeftMenu.js b/apps/documenteditor/main/app/controller/LeftMenu.js index 79efd4733..3bcb075ad 100644 --- a/apps/documenteditor/main/app/controller/LeftMenu.js +++ b/apps/documenteditor/main/app/controller/LeftMenu.js @@ -458,6 +458,10 @@ define([ default: value = (fast_coauth) ? Asc.c_oAscCollaborativeMarksShowType.None : Asc.c_oAscCollaborativeMarksShowType.LastChanges; } this.api.SetCollaborativeMarksShowType(value); + } else if (!this.mode.isEdit && !this.mode.isRestrictedEdit && !this.mode.isOffline && this.mode.canChangeCoAuthoring) { // viewer + fast_coauth = Common.localStorage.getBool("de-settings-view-coauthmode", false); + Common.Utils.InternalSettings.set("de-settings-coauthmode", fast_coauth); + this.api.asc_SetFastCollaborative(fast_coauth); } value = Common.localStorage.getBool("de-settings-livecomment", true); diff --git a/apps/documenteditor/main/app/controller/Main.js b/apps/documenteditor/main/app/controller/Main.js index 2040262e7..f841a5cf7 100644 --- a/apps/documenteditor/main/app/controller/Main.js +++ b/apps/documenteditor/main/app/controller/Main.js @@ -473,6 +473,9 @@ define([ docInfo.put_Lang(this.editorConfig.lang); docInfo.put_Mode(this.editorConfig.mode); + if (typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.mode!==undefined) + docInfo.put_CoEditingMode(this.editorConfig.coEditing.mode); + var enable = !this.editorConfig.customization || (this.editorConfig.customization.macros!==false); docInfo.asc_putIsEnabledMacroses(!!enable); enable = !this.editorConfig.customization || (this.editorConfig.customization.plugins!==false); @@ -1544,7 +1547,9 @@ define([ Common.NotificationCenter.on('comments:cleardummy', _.bind(this.onClearDummyComment, this)); Common.NotificationCenter.on('comments:showdummy', _.bind(this.onShowDummyComment, this)); - this.appOptions.canChangeCoAuthoring = this.appOptions.isEdit && this.appOptions.canCoAuthoring && !(typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.change===false); + // change = true by default in editor, change = false by default in viewer + this.appOptions.canChangeCoAuthoring = this.appOptions.isEdit && this.appOptions.canCoAuthoring && !(typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.change===false) || + !this.appOptions.isEdit && !this.appOptions.isRestrictedEdit && (typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.change===true) ; this.loadCoAuthSettings(); this.applyModeCommonElements(); @@ -1591,6 +1596,16 @@ define([ Common.Utils.InternalSettings.set((fastCoauth) ? "de-settings-showchanges-fast" : "de-settings-showchanges-strict", value); } else if (!this.appOptions.isEdit && this.appOptions.isRestrictedEdit) { fastCoauth = true; + } else if (!this.appOptions.isEdit && !this.appOptions.isRestrictedEdit && !this.appOptions.isOffline) { // viewer + if (!this.appOptions.canChangeCoAuthoring) { //can't change co-auth. mode. Use coEditing.mode or 'strict' by default + value = this.editorConfig.coEditing && this.editorConfig.coEditing.mode==='fast' ? 1 : 0; + } else { + value = Common.localStorage.getItem("de-settings-view-coauthmode"); + if (value===null) { + value = this.editorConfig.coEditing && this.editorConfig.coEditing.mode==='fast' ? 1 : 0; + } + } + fastCoauth = (parseInt(value) == 1); } else { fastCoauth = false; autosave = 0; diff --git a/apps/documenteditor/main/app/view/FileMenuPanels.js b/apps/documenteditor/main/app/view/FileMenuPanels.js index f12ea2fb0..53cead4e9 100644 --- a/apps/documenteditor/main/app/view/FileMenuPanels.js +++ b/apps/documenteditor/main/app/view/FileMenuPanels.js @@ -293,7 +293,7 @@ define([ '
', '', '', - '', + '', '', '', '', @@ -305,6 +305,10 @@ define([ '', '
', '','', + '', + '
', + '', + '', '', '
', '', @@ -577,6 +581,14 @@ define([ /** coauthoring end **/ + this.chLiveViewer = new Common.UI.CheckBox({ + el: $markup.findById('#fms-chb-live-viewer'), + labelText: this.strShowOthersChanges, + dataHint: '2', + dataHintDirection: 'left', + dataHintOffset: 'small' + }); + var itemsTemplate = _.template([ '<% _.each(items, function(item) { %>', @@ -743,6 +755,7 @@ define([ $('tr.coauth', this.el)[mode.isEdit && mode.canCoAuthoring ? 'show' : 'hide'](); $('tr.coauth.changes-mode', this.el)[mode.isEdit && !mode.isOffline && mode.canCoAuthoring && mode.canChangeCoAuthoring ? 'show' : 'hide'](); $('tr.coauth.changes-show', this.el)[mode.isEdit && !mode.isOffline && mode.canCoAuthoring ? 'show' : 'hide'](); + $('tr.live-viewer', this.el)[!mode.isEdit && !mode.isRestrictedEdit && !mode.isOffline && mode.canChangeCoAuthoring ? 'show' : 'hide'](); $('tr.view-review', this.el)[mode.canViewReview ? 'show' : 'hide'](); $('tr.spellcheck', this.el)[mode.isEdit && Common.UI.FeaturesManager.canChange('spellcheck') ? 'show' : 'hide'](); $('tr.comments', this.el)[mode.canCoAuthoring ? 'show' : 'hide'](); @@ -777,6 +790,8 @@ define([ this.rbCoAuthModeStrict.setValue(!fast_coauth); this.fillShowChanges(fast_coauth); + this.chLiveViewer.setValue(Common.Utils.InternalSettings.get("de-settings-coauthmode")); + value = Common.Utils.InternalSettings.get((fast_coauth) ? "de-settings-showchanges-fast" : "de-settings-showchanges-strict"); this.rbShowChangesNone.setValue(value=='none'); @@ -853,13 +868,15 @@ define([ this.mode.canChangeCoAuthoring && Common.localStorage.setItem("de-settings-coauthmode", this.rbCoAuthModeFast.getValue() ? 1 : 0 ); Common.localStorage.setItem(this.rbCoAuthModeFast.getValue() ? "de-settings-showchanges-fast" : "de-settings-showchanges-strict", this.rbShowChangesNone.getValue()?'none':this.rbShowChangesLast.getValue()?'last':'all'); + } else if (!this.mode.isEdit && !this.mode.isRestrictedEdit && !this.mode.isOffline && this.mode.canChangeCoAuthoring) { // viewer + Common.localStorage.setItem("de-settings-view-coauthmode", this.chLiveViewer.isChecked() ? 1 : 0); } /** coauthoring end **/ Common.localStorage.setItem("de-settings-fontrender", this.cmbFontRender.getValue()); var item = this.cmbFontRender.store.findWhere({value: 'custom'}); Common.localStorage.setItem("de-settings-cachemode", item && !item.get('checked') ? 0 : 1); Common.localStorage.setItem("de-settings-unit", this.cmbUnit.getValue()); - if (this.mode.canChangeCoAuthoring || !Common.Utils.InternalSettings.get("de-settings-coauthmode")) + if (this.mode.isEdit && (this.mode.canChangeCoAuthoring || !Common.Utils.InternalSettings.get("de-settings-coauthmode"))) Common.localStorage.setItem("de-settings-autosave", this.chAutosave.isChecked() ? 1 : 0); if (this.mode.canForcesave) Common.localStorage.setItem("de-settings-forcesave", this.chForcesave.isChecked() ? 1 : 0); @@ -927,7 +944,7 @@ define([ strZoom: 'Default Zoom Value', /** coauthoring begin **/ - strShowChanges: 'Realtime Collaboration Changes', + strShowChanges: 'Real-time Collaboration Changes', txtAll: 'View All', txtNone: 'View Nothing', txtLast: 'View Last', @@ -984,7 +1001,8 @@ define([ txtFastTip: 'Real-time co-editing. All changes are saved automatically', txtStrictTip: 'Use the \'Save\' button to sync the changes you and others make', strIgnoreWordsInUPPERCASE: 'Ignore words in UPPERCASE', - strIgnoreWordsWithNumbers: 'Ignore words with numbers' + strIgnoreWordsWithNumbers: 'Ignore words with numbers', + strShowOthersChanges: 'Show changes from other users' }, DE.Views.FileMenuPanels.Settings || {})); DE.Views.FileMenuPanels.RecentFiles = Common.UI.BaseView.extend({ diff --git a/apps/documenteditor/mobile/src/controller/Main.jsx b/apps/documenteditor/mobile/src/controller/Main.jsx index e673ca908..8675fc898 100644 --- a/apps/documenteditor/mobile/src/controller/Main.jsx +++ b/apps/documenteditor/mobile/src/controller/Main.jsx @@ -132,7 +132,10 @@ class MainController extends Component { docInfo.put_EncryptedInfo(this.editorConfig.encryptionKeys); docInfo.put_Lang(this.editorConfig.lang); docInfo.put_Mode(this.editorConfig.mode); - + + if (typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.mode!==undefined) + docInfo.put_CoEditingMode(this.editorConfig.coEditing.mode); + let enable = !this.editorConfig.customization || (this.editorConfig.customization.macros !== false); docInfo.asc_putIsEnabledMacroses(!!enable); enable = !this.editorConfig.customization || (this.editorConfig.customization.plugins !== false); diff --git a/apps/presentationeditor/main/app/controller/LeftMenu.js b/apps/presentationeditor/main/app/controller/LeftMenu.js index 9a9837ba7..cf536f9a6 100644 --- a/apps/presentationeditor/main/app/controller/LeftMenu.js +++ b/apps/presentationeditor/main/app/controller/LeftMenu.js @@ -349,6 +349,10 @@ define([ Common.Utils.InternalSettings.set("pe-settings-coauthmode", fast_coauth); this.api.asc_SetFastCollaborative(fast_coauth); } + } else if (!this.mode.isEdit && !this.mode.isRestrictedEdit && !this.mode.isOffline && this.mode.canChangeCoAuthoring) { // viewer + fast_coauth = Common.localStorage.getBool("pe-settings-view-coauthmode", false); + Common.Utils.InternalSettings.set("pe-settings-coauthmode", fast_coauth); + this.api.asc_SetFastCollaborative(fast_coauth); } /** coauthoring end **/ diff --git a/apps/presentationeditor/main/app/controller/Main.js b/apps/presentationeditor/main/app/controller/Main.js index 679b38131..69237409d 100644 --- a/apps/presentationeditor/main/app/controller/Main.js +++ b/apps/presentationeditor/main/app/controller/Main.js @@ -429,7 +429,10 @@ define([ docInfo.put_EncryptedInfo(this.editorConfig.encryptionKeys); docInfo.put_Lang(this.editorConfig.lang); docInfo.put_Mode(this.editorConfig.mode); - + + if (typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.mode!==undefined) + docInfo.put_CoEditingMode(this.editorConfig.coEditing.mode); + var enable = !this.editorConfig.customization || (this.editorConfig.customization.macros!==false); docInfo.asc_putIsEnabledMacroses(!!enable); enable = !this.editorConfig.customization || (this.editorConfig.customization.plugins!==false); @@ -1191,7 +1194,9 @@ define([ this.appOptions.canBrandingExt && this.editorConfig.customization && Common.UI.LayoutManager.init(this.editorConfig.customization.layout); this.editorConfig.customization && Common.UI.FeaturesManager.init(this.editorConfig.customization.features, this.appOptions.canBrandingExt); - this.appOptions.canChangeCoAuthoring = this.appOptions.isEdit && this.appOptions.canCoAuthoring && !(typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.change===false); + // change = true by default in editor, change = false by default in viewer + this.appOptions.canChangeCoAuthoring = this.appOptions.isEdit && this.appOptions.canCoAuthoring && !(typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.change===false) || + !this.appOptions.isEdit && !this.appOptions.isRestrictedEdit && (typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.change===true) ; this.loadCoAuthSettings(); this.applyModeCommonElements(); @@ -1233,6 +1238,16 @@ define([ fastCoauth = (value===null || parseInt(value) == 1); } else if (!this.appOptions.isEdit && this.appOptions.isRestrictedEdit) { fastCoauth = true; + } else if (!this.appOptions.isEdit && !this.appOptions.isRestrictedEdit && !this.appOptions.isOffline) { // viewer + if (!this.appOptions.canChangeCoAuthoring) { //can't change co-auth. mode. Use coEditing.mode or 'strict' by default + value = this.editorConfig.coEditing && this.editorConfig.coEditing.mode==='fast' ? 1 : 0; + } else { + value = Common.localStorage.getItem("pe-settings-view-coauthmode"); + if (value===null) { + value = this.editorConfig.coEditing && this.editorConfig.coEditing.mode==='fast' ? 1 : 0; + } + } + fastCoauth = (parseInt(value) == 1); } else { fastCoauth = false; autosave = 0; diff --git a/apps/presentationeditor/main/app/view/FileMenuPanels.js b/apps/presentationeditor/main/app/view/FileMenuPanels.js index 6f716a269..f0deaf2ed 100644 --- a/apps/presentationeditor/main/app/view/FileMenuPanels.js +++ b/apps/presentationeditor/main/app/view/FileMenuPanels.js @@ -234,6 +234,13 @@ define([ '', '', '', + '', + '', + '', + '', + '
', + '', + '', '', '', '', @@ -392,6 +399,14 @@ define([ }); this.rbCoAuthModeStrict.$el.parent().on('click', function (){me.rbCoAuthModeStrict.setValue(true);}); + this.chLiveViewer = new Common.UI.CheckBox({ + el: $markup.findById('#fms-chb-live-viewer'), + labelText: this.strShowOthersChanges, + dataHint: '2', + dataHintDirection: 'left', + dataHintOffset: 'small' + }); + this.chAutosave = new Common.UI.CheckBox({ el: $markup.findById('#fms-chb-autosave'), labelText: this.textAutoSave, @@ -578,6 +593,7 @@ define([ /** coauthoring begin **/ $('tr.coauth.changes', this.el)[mode.isEdit && !mode.isOffline && mode.canCoAuthoring && mode.canChangeCoAuthoring ? 'show' : 'hide'](); /** coauthoring end **/ + $('tr.live-viewer', this.el)[!mode.isEdit && !mode.isRestrictedEdit && !mode.isOffline && mode.canChangeCoAuthoring ? 'show' : 'hide'](); $('tr.macros', this.el)[(mode.customization && mode.customization.macros===false) ? 'hide' : 'show'](); $('tr.spellcheck', this.el)[mode.isEdit && Common.UI.FeaturesManager.canChange('spellcheck') ? 'show' : 'hide'](); @@ -610,6 +626,7 @@ define([ this.rbCoAuthModeFast.setValue(fast_coauth); this.rbCoAuthModeStrict.setValue(!fast_coauth); /** coauthoring end **/ + this.chLiveViewer.setValue(Common.Utils.InternalSettings.get("pe-settings-coauthmode")); value = Common.Utils.InternalSettings.get("pe-settings-fontrender"); item = this.cmbFontRender.store.findWhere({value: parseInt(value)}); @@ -666,13 +683,15 @@ define([ /** coauthoring begin **/ if (this.mode.isEdit && !this.mode.isOffline && this.mode.canCoAuthoring && this.mode.canChangeCoAuthoring) { Common.localStorage.setItem("pe-settings-coauthmode", this.rbCoAuthModeFast.getValue()); + } else if (!this.mode.isEdit && !this.mode.isRestrictedEdit && !this.mode.isOffline && this.mode.canChangeCoAuthoring) { // viewer + Common.localStorage.setItem("pe-settings-view-coauthmode", this.chLiveViewer.isChecked() ? 1 : 0); } /** coauthoring end **/ Common.localStorage.setItem("pe-settings-fontrender", this.cmbFontRender.getValue()); var item = this.cmbFontRender.store.findWhere({value: 'custom'}); Common.localStorage.setItem("pe-settings-cachemode", item && !item.get('checked') ? 0 : 1); Common.localStorage.setItem("pe-settings-unit", this.cmbUnit.getValue()); - if (this.mode.canChangeCoAuthoring || !Common.Utils.InternalSettings.get("pe-settings-coauthmode")) + if (this.mode.isEdit && (this.mode.canChangeCoAuthoring || !Common.Utils.InternalSettings.get("pe-settings-coauthmode"))) Common.localStorage.setItem("pe-settings-autosave", this.chAutosave.isChecked() ? 1 : 0); if (this.mode.canForcesave) Common.localStorage.setItem("pe-settings-forcesave", this.chForcesave.isChecked() ? 1 : 0); @@ -757,7 +776,8 @@ define([ txtFastTip: 'Real-time co-editing. All changes are saved automatically', txtStrictTip: 'Use the \'Save\' button to sync the changes you and others make', strIgnoreWordsInUPPERCASE: 'Ignore words in UPPERCASE', - strIgnoreWordsWithNumbers: 'Ignore words with numbers' + strIgnoreWordsWithNumbers: 'Ignore words with numbers', + strShowOthersChanges: 'Show changes from other users' }, PE.Views.FileMenuPanels.Settings || {})); PE.Views.FileMenuPanels.RecentFiles = Common.UI.BaseView.extend({ diff --git a/apps/presentationeditor/mobile/src/controller/Main.jsx b/apps/presentationeditor/mobile/src/controller/Main.jsx index cd4bb85da..a28803971 100644 --- a/apps/presentationeditor/mobile/src/controller/Main.jsx +++ b/apps/presentationeditor/mobile/src/controller/Main.jsx @@ -124,6 +124,9 @@ class MainController extends Component { docInfo.put_Lang(this.editorConfig.lang); docInfo.put_Mode(this.editorConfig.mode); + if (typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.mode!==undefined) + docInfo.put_CoEditingMode(this.editorConfig.coEditing.mode); + let enable = !this.editorConfig.customization || (this.editorConfig.customization.macros !== false); docInfo.asc_putIsEnabledMacroses(!!enable); enable = !this.editorConfig.customization || (this.editorConfig.customization.plugins !== false); diff --git a/apps/spreadsheeteditor/main/app/controller/LeftMenu.js b/apps/spreadsheeteditor/main/app/controller/LeftMenu.js index fb1f2b32d..f4a12ab42 100644 --- a/apps/spreadsheeteditor/main/app/controller/LeftMenu.js +++ b/apps/spreadsheeteditor/main/app/controller/LeftMenu.js @@ -449,6 +449,10 @@ define([ Common.Utils.InternalSettings.set("sse-settings-coauthmode", fast_coauth); this.api.asc_SetFastCollaborative(fast_coauth); } + } else if (!this.mode.isEdit && !this.mode.isRestrictedEdit && !this.mode.isOffline && this.mode.canChangeCoAuthoring) { // viewer + fast_coauth = Common.localStorage.getBool("sse-settings-view-coauthmode", false); + Common.Utils.InternalSettings.set("sse-settings-coauthmode", fast_coauth); + this.api.asc_SetFastCollaborative(fast_coauth); } /** coauthoring end **/ diff --git a/apps/spreadsheeteditor/main/app/controller/Main.js b/apps/spreadsheeteditor/main/app/controller/Main.js index cb89960de..e38e48a33 100644 --- a/apps/spreadsheeteditor/main/app/controller/Main.js +++ b/apps/spreadsheeteditor/main/app/controller/Main.js @@ -504,6 +504,9 @@ define([ docInfo.put_Lang(this.editorConfig.lang); docInfo.put_Mode(this.editorConfig.mode); + if (typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.mode!==undefined) + docInfo.put_CoEditingMode(this.editorConfig.coEditing.mode); + var enable = !this.editorConfig.customization || (this.editorConfig.customization.macros!==false); docInfo.asc_putIsEnabledMacroses(!!enable); enable = !this.editorConfig.customization || (this.editorConfig.customization.plugins!==false); @@ -1279,8 +1282,10 @@ define([ this.appOptions.canHelp = !((typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.help===false); this.appOptions.isRestrictedEdit = !this.appOptions.isEdit && this.appOptions.canComments; + // change = true by default in editor, change = false by default in viewer this.appOptions.canChangeCoAuthoring = this.appOptions.isEdit && !(this.appOptions.isEditDiagram || this.appOptions.isEditMailMerge || this.appOptions.isEditOle) && this.appOptions.canCoAuthoring && - !(typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.change===false); + !(typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.change===false) || + !this.appOptions.isEdit && !this.appOptions.isRestrictedEdit && (typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.change===true) ; if (!this.appOptions.isEditDiagram && !this.appOptions.isEditMailMerge && !this.appOptions.isEditOle) { this.appOptions.canBrandingExt = params.asc_getCanBranding() && (typeof this.editorConfig.customization == 'object' || this.editorConfig.plugins); @@ -1337,6 +1342,16 @@ define([ fastCoauth = (value===null || parseInt(value) == 1); } else if (!this.appOptions.isEdit && this.appOptions.isRestrictedEdit) { fastCoauth = true; + } else if (!this.appOptions.isEdit && !this.appOptions.isRestrictedEdit && !this.appOptions.isOffline) { // viewer + if (!this.appOptions.canChangeCoAuthoring) { //can't change co-auth. mode. Use coEditing.mode or 'strict' by default + value = this.editorConfig.coEditing && this.editorConfig.coEditing.mode==='fast' ? 1 : 0; + } else { + value = Common.localStorage.getItem("sse-settings-view-coauthmode"); + if (value===null) { + value = this.editorConfig.coEditing && this.editorConfig.coEditing.mode==='fast' ? 1 : 0; + } + } + fastCoauth = (parseInt(value) == 1); } else { fastCoauth = false; autosave = 0; diff --git a/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js b/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js index 31fbeeb3f..4c05c5ecb 100644 --- a/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js +++ b/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js @@ -189,7 +189,7 @@ define([ template: _.template([ '
', '
', - '', + '
', '', '', '', @@ -206,7 +206,7 @@ define([ '', '', '', - '', + '', '', '', '', @@ -224,6 +224,10 @@ define([ '', '', '', + '', + '', + '', + '', '', '', '', @@ -380,6 +384,14 @@ define([ this.rbCoAuthModeStrict.$el.parent().on('click', function (){me.rbCoAuthModeStrict.setValue(true);}); /** coauthoring end **/ + this.chLiveViewer = new Common.UI.CheckBox({ + el: $markup.findById('#fms-chb-live-viewer'), + labelText: this.strShowOthersChanges, + dataHint: '2', + dataHintDirection: 'left', + dataHintOffset: 'small' + }); + this.cmbZoom = new Common.UI.ComboBox({ el : $markup.findById('#fms-cmb-zoom'), style : 'width: 160px;', @@ -744,6 +756,7 @@ define([ $('tr.forcesave', this.el)[mode.canForcesave ? 'show' : 'hide'](); $('tr.comments', this.el)[mode.canCoAuthoring ? 'show' : 'hide'](); $('tr.coauth.changes', this.el)[mode.isEdit && !mode.isOffline && mode.canCoAuthoring && mode.canChangeCoAuthoring ? 'show' : 'hide'](); + $('tr.live-viewer', this.el)[!mode.isEdit && !mode.isRestrictedEdit && !mode.isOffline && mode.canChangeCoAuthoring ? 'show' : 'hide'](); $('tr.macros', this.el)[(mode.customization && mode.customization.macros===false) ? 'hide' : 'show'](); if ( !Common.UI.Themes.available() ) { @@ -771,6 +784,7 @@ define([ this.rbCoAuthModeFast.setValue(fast_coauth); this.rbCoAuthModeStrict.setValue(!fast_coauth); /** coauthoring end **/ + this.chLiveViewer.setValue(Common.Utils.InternalSettings.get("sse-settings-coauthmode")); value = Common.Utils.InternalSettings.get("sse-settings-fontrender"); item = this.cmbFontRender.store.findWhere({value: parseInt(value)}); @@ -897,13 +911,16 @@ define([ Common.localStorage.setItem("sse-settings-resolvedcomment", this.chResolvedComment.isChecked() ? 1 : 0); if (this.mode.isEdit && !this.mode.isOffline && this.mode.canCoAuthoring && this.mode.canChangeCoAuthoring) Common.localStorage.setItem("sse-settings-coauthmode", this.rbCoAuthModeFast.getValue()? 1 : 0); + else if (!this.mode.isEdit && !this.mode.isRestrictedEdit && !this.mode.isOffline && this.mode.canChangeCoAuthoring) { // viewer + Common.localStorage.setItem("sse-settings-view-coauthmode", this.chLiveViewer.isChecked() ? 1 : 0); + } /** coauthoring end **/ Common.localStorage.setItem("sse-settings-r1c1", this.chR1C1Style.isChecked() ? 1 : 0); Common.localStorage.setItem("sse-settings-fontrender", this.cmbFontRender.getValue()); var item = this.cmbFontRender.store.findWhere({value: 'custom'}); Common.localStorage.setItem("sse-settings-cachemode", item && !item.get('checked') ? 0 : 1); Common.localStorage.setItem("sse-settings-unit", this.cmbUnit.getValue()); - if (this.mode.canChangeCoAuthoring || !Common.Utils.InternalSettings.get("sse-settings-coauthmode")) + if (this.mode.isEdit && (this.mode.canChangeCoAuthoring || !Common.Utils.InternalSettings.get("sse-settings-coauthmode"))) Common.localStorage.setItem("sse-settings-autosave", this.chAutosave.isChecked() ? 1 : 0); if (this.mode.canForcesave) Common.localStorage.setItem("sse-settings-forcesave", this.chForcesave.isChecked() ? 1 : 0); @@ -1119,11 +1136,12 @@ define([ strIgnoreWordsWithNumbers: 'Ignore words with numbers', txtAutoCorrect: 'AutoCorrect options...', txtFastTip: 'Real-time co-editing. All changes are saved automatically', - txtStrictTip: 'Use the \'Save\' button to sync the changes you and others make' + txtStrictTip: 'Use the \'Save\' button to sync the changes you and others make', + strShowOthersChanges: 'Show changes from other users' }, SSE.Views.FileMenuPanels.MainSettingsGeneral || {})); - SSE.Views.FileMenuPanels.RecentFiles = Common.UI.BaseView.extend({ +SSE.Views.FileMenuPanels.RecentFiles = Common.UI.BaseView.extend({ el: '#panel-recentfiles', menu: undefined, diff --git a/apps/spreadsheeteditor/mobile/src/controller/Main.jsx b/apps/spreadsheeteditor/mobile/src/controller/Main.jsx index 43317069e..0b7925cf3 100644 --- a/apps/spreadsheeteditor/mobile/src/controller/Main.jsx +++ b/apps/spreadsheeteditor/mobile/src/controller/Main.jsx @@ -171,6 +171,9 @@ class MainController extends Component { docInfo.put_Lang(this.editorConfig.lang); docInfo.put_Mode(this.editorConfig.mode); + if (typeof this.editorConfig.coEditing == 'object' && this.editorConfig.coEditing.mode!==undefined) + docInfo.put_CoEditingMode(this.editorConfig.coEditing.mode); + const appOptions = this.props.storeAppOptions; let enable = !appOptions.customization || (appOptions.customization.macros !== false); docInfo.asc_putIsEnabledMacroses(!!enable);