diff --git a/apps/api/documents/api.js b/apps/api/documents/api.js index 4eaf9b218..cd5ff8ee5 100644 --- a/apps/api/documents/api.js +++ b/apps/api/documents/api.js @@ -218,8 +218,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}'], @@ -980,6 +981,7 @@ iframe.frameBorder = 0; iframe.name = "frameEditor"; iframe.allowFullscreen = true; + iframe.title = "Online editor for text documents, spreadsheets, and presentations"; iframe.setAttribute("allowfullscreen",""); // for IE11 iframe.setAttribute("onmousewheel",""); // for Safari on Mac iframe.setAttribute("allow", "autoplay; camera; microphone; display-capture"); 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 9eccb802c..13f8d52fa 100644 --- a/apps/documenteditor/main/app/controller/LeftMenu.js +++ b/apps/documenteditor/main/app/controller/LeftMenu.js @@ -457,6 +457,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 ea7b89e84..bd0e9e0e3 100644 --- a/apps/documenteditor/main/app/controller/Main.js +++ b/apps/documenteditor/main/app/controller/Main.js @@ -1500,7 +1500,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(); @@ -1547,6 +1549,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 9572efa4a..f06e34f59 100644 --- a/apps/documenteditor/main/app/view/FileMenuPanels.js +++ b/apps/documenteditor/main/app/view/FileMenuPanels.js @@ -285,6 +285,10 @@ define([ '', '', '','', + '', + '', + '
', + '','', /** coauthoring end **/ '', '', @@ -480,6 +484,14 @@ define([ this.lblCoAuthMode = $markup.findById('#fms-lbl-coauth-mode'); /** 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) { %>', @@ -650,6 +662,8 @@ 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'](); @@ -682,9 +696,10 @@ define([ item = this.cmbCoAuthMode.store.findWhere({value: fast_coauth ? 1 : 0}); this.cmbCoAuthMode.setValue(item ? item.get('value') : 1); this.lblCoAuthMode.text(item ? item.get('descValue') : this.strCoAuthModeDescFast); - 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"); item = this.cmbShowChanges.store.findWhere({value: value}); this.cmbShowChanges.setValue(item ? item.get('value') : (fast_coauth) ? 'none' : 'last'); @@ -756,6 +771,8 @@ define([ if (this.mode.isEdit && !this.mode.isOffline && this.mode.canCoAuthoring) { this.mode.canChangeCoAuthoring && Common.localStorage.setItem("de-settings-coauthmode", this.cmbCoAuthMode.getValue()); Common.localStorage.setItem(this.cmbCoAuthMode.getValue() ? "de-settings-showchanges-fast" : "de-settings-showchanges-strict", this.cmbShowChanges.getValue()); + } 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()); @@ -882,7 +899,9 @@ define([ strReviewHover: 'Track Changes Display', txtChangesTip: 'Show by hover in tooltips', txtChangesBalloons: 'Show by click in balloons', - txtDarkMode: 'Turn on document dark mode' + txtDarkMode: 'Turn on document dark mode', + strShowOthersChanges: 'Show changes from other users', + txtLiveViewer: 'Real-time Collaboration Changes' }, DE.Views.FileMenuPanels.Settings || {})); DE.Views.FileMenuPanels.RecentFiles = Common.UI.BaseView.extend({