diff --git a/apps/common/main/lib/controller/ReviewChanges.js b/apps/common/main/lib/controller/ReviewChanges.js index 7d099256e..da5d1b2e1 100644 --- a/apps/common/main/lib/controller/ReviewChanges.js +++ b/apps/common/main/lib/controller/ReviewChanges.js @@ -526,12 +526,14 @@ define([ if (this.api) { this.api.asc_SetFastCollaborative(item.value==1); - var value = Common.localStorage.getItem(item.value ? this.view.appPrefix + "settings-showchanges-fast" : this.view.appPrefix + "settings-showchanges-strict"); - if (value !== null) - this.api.SetCollaborativeMarksShowType(value == 'all' ? Asc.c_oAscCollaborativeMarksShowType.All : - value == 'none' ? Asc.c_oAscCollaborativeMarksShowType.None : Asc.c_oAscCollaborativeMarksShowType.LastChanges); - else - this.api.SetCollaborativeMarksShowType(item.value ? Asc.c_oAscCollaborativeMarksShowType.None : Asc.c_oAscCollaborativeMarksShowType.LastChanges); + if (this.api.SetCollaborativeMarksShowType) { + var value = Common.localStorage.getItem(item.value ? this.view.appPrefix + "settings-showchanges-fast" : this.view.appPrefix + "settings-showchanges-strict"); + if (value !== null) + this.api.SetCollaborativeMarksShowType(value == 'all' ? Asc.c_oAscCollaborativeMarksShowType.All : + value == 'none' ? Asc.c_oAscCollaborativeMarksShowType.None : Asc.c_oAscCollaborativeMarksShowType.LastChanges); + else + this.api.SetCollaborativeMarksShowType(item.value ? Asc.c_oAscCollaborativeMarksShowType.None : Asc.c_oAscCollaborativeMarksShowType.LastChanges); + } value = Common.localStorage.getItem(this.view.appPrefix + "settings-autosave"); if (value===null && this.appConfig.customization && this.appConfig.customization.autosave===false) diff --git a/apps/spreadsheeteditor/main/app.js b/apps/spreadsheeteditor/main/app.js index d38cfe1ac..54af6659a 100644 --- a/apps/spreadsheeteditor/main/app.js +++ b/apps/spreadsheeteditor/main/app.js @@ -159,6 +159,7 @@ require([ 'Common.Controllers.Chat', 'Common.Controllers.Comments', 'Common.Controllers.Plugins' + ,'Common.Controllers.ReviewChanges' ] }); @@ -186,6 +187,7 @@ require([ 'common/main/lib/controller/Comments', 'common/main/lib/controller/Chat', 'common/main/lib/controller/Plugins' + ,'common/main/lib/controller/ReviewChanges' ], function() { app.start(); }); diff --git a/apps/spreadsheeteditor/main/app/controller/LeftMenu.js b/apps/spreadsheeteditor/main/app/controller/LeftMenu.js index 94cfd26db..7e249e3c1 100644 --- a/apps/spreadsheeteditor/main/app/controller/LeftMenu.js +++ b/apps/spreadsheeteditor/main/app/controller/LeftMenu.js @@ -86,6 +86,9 @@ define([ 'search:next': _.bind(this.onQuerySearch, this, 'next'), 'search:replace': _.bind(this.onQueryReplace, this), 'search:replaceall': _.bind(this.onQueryReplaceAll, this) + }, + 'Common.Views.ReviewChanges': { + 'collaboration:chat': _.bind(this.onShowHideChat, this) } }); Common.NotificationCenter.on('app:comment:add', _.bind(this.onAppAddComment, this)); @@ -759,6 +762,18 @@ define([ } }, + onShowHideChat: function(state) { + if (this.mode.canCoAuthoring && this.mode.canChat && !this.mode.isLightVersion) { + if (state) { + Common.UI.Menu.Manager.hideAll(); + this.leftMenu.showMenu('chat'); + } else { + this.leftMenu.btnChat.toggle(false, true); + this.leftMenu.onBtnMenuClick(this.leftMenu.btnChat); + } + } + }, + textNoTextFound : 'Text not found', newDocumentTitle : 'Unnamed document', textItemEntireCell : 'Entire cell contents', diff --git a/apps/spreadsheeteditor/main/app/controller/Main.js b/apps/spreadsheeteditor/main/app/controller/Main.js index e2998582b..daa0ad492 100644 --- a/apps/spreadsheeteditor/main/app/controller/Main.js +++ b/apps/spreadsheeteditor/main/app/controller/Main.js @@ -913,7 +913,8 @@ define([ toolbarController = application.getController('Toolbar'), statusbarController = application.getController('Statusbar'), rightmenuController = application.getController('RightMenu'), - fontsControllers = application.getController('Common.Controllers.Fonts'); + fontsControllers = application.getController('Common.Controllers.Fonts'), + reviewController = application.getController('Common.Controllers.ReviewChanges'); fontsControllers && fontsControllers.setApi(me.api); toolbarController && toolbarController.setApi(me.api); @@ -921,6 +922,8 @@ define([ rightmenuController && rightmenuController.setApi(me.api); + reviewController.setMode(me.appOptions).setConfig({config: me.editorConfig}, me.api); + if (statusbarController) { statusbarController.getView('Statusbar').changeViewMode(true); } diff --git a/apps/spreadsheeteditor/main/app/controller/Toolbar.js b/apps/spreadsheeteditor/main/app/controller/Toolbar.js index a64a8775c..4ca313386 100644 --- a/apps/spreadsheeteditor/main/app/controller/Toolbar.js +++ b/apps/spreadsheeteditor/main/app/controller/Toolbar.js @@ -2911,6 +2911,15 @@ define([ if ( config.isEdit ) me.toolbar.setApi(me.api); + + if (!config.isEditDiagram && !config.isEditMailMerge) { + var tab = {action: 'review', caption: me.toolbar.textTabCollaboration}; + var $panel = SSE.getController('Common.Controllers.ReviewChanges').createToolbarPanel(); + + if ( $panel ) { + me.toolbar.addTab(tab, $panel, 3); + } + } }); }, diff --git a/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js b/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js index b5143d50e..22e026f5b 100644 --- a/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js +++ b/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js @@ -1117,6 +1117,8 @@ define([ }); } + Common.NotificationCenter.on('collaboration:sharing', _.bind(this.changeAccessRights, this)); + return this; }, diff --git a/apps/spreadsheeteditor/main/app/view/LeftMenu.js b/apps/spreadsheeteditor/main/app/view/LeftMenu.js index b39fa6412..2d1326f96 100644 --- a/apps/spreadsheeteditor/main/app/view/LeftMenu.js +++ b/apps/spreadsheeteditor/main/app/view/LeftMenu.js @@ -255,7 +255,7 @@ define([ } if (this.mode.canChat) { this.panelChat['hide'](); - this.btnChat.toggle(false, true); + this.btnChat.toggle(false); } } /** coauthoring end **/ diff --git a/apps/spreadsheeteditor/main/app/view/Toolbar.js b/apps/spreadsheeteditor/main/app/view/Toolbar.js index dda3a9cc8..e9b1d6064 100644 --- a/apps/spreadsheeteditor/main/app/view/Toolbar.js +++ b/apps/spreadsheeteditor/main/app/view/Toolbar.js @@ -2078,6 +2078,7 @@ define([ textTabFile: 'File', textTabHome: 'Home', textTabInsert: 'Insert', - textSurface: 'Surface' + textSurface: 'Surface', + textTabCollaboration: 'Collaboration' }, SSE.Views.Toolbar || {})); }); \ No newline at end of file diff --git a/apps/spreadsheeteditor/main/app_dev.js b/apps/spreadsheeteditor/main/app_dev.js index f541535a3..4961f08d7 100644 --- a/apps/spreadsheeteditor/main/app_dev.js +++ b/apps/spreadsheeteditor/main/app_dev.js @@ -149,6 +149,7 @@ require([ 'Common.Controllers.Chat', 'Common.Controllers.Comments', 'Common.Controllers.Plugins' + ,'Common.Controllers.ReviewChanges' ] }); @@ -176,6 +177,7 @@ require([ 'common/main/lib/controller/Comments', 'common/main/lib/controller/Chat', 'common/main/lib/controller/Plugins' + ,'common/main/lib/controller/ReviewChanges' ], function() { window.compareVersions = true; app.start(); diff --git a/apps/spreadsheeteditor/main/locale/en.json b/apps/spreadsheeteditor/main/locale/en.json index 65b365378..18e02ca7a 100644 --- a/apps/spreadsheeteditor/main/locale/en.json +++ b/apps/spreadsheeteditor/main/locale/en.json @@ -112,6 +112,40 @@ "Common.Views.RenameDialog.okButtonText": "Ok", "Common.Views.RenameDialog.textName": "File name", "Common.Views.RenameDialog.txtInvalidName": "The file name cannot contain any of the following characters: ", + "Common.Views.ReviewChanges.hintNext": "To next change", + "Common.Views.ReviewChanges.hintPrev": "To previous change", + "Common.Views.ReviewChanges.tipAcceptCurrent": "Accept current change", + "Common.Views.ReviewChanges.tipRejectCurrent": "Reject current change", + "Common.Views.ReviewChanges.tipReview": "Track changes", + "Common.Views.ReviewChanges.tipReviewView": "Select the mode you want the changes to be displayed", + "Common.Views.ReviewChanges.tipSetDocLang": "Set document language", + "Common.Views.ReviewChanges.tipSetSpelling": "Spell checking", + "Common.Views.ReviewChanges.txtAccept": "Accept", + "Common.Views.ReviewChanges.txtAcceptAll": "Accept All Changes", + "Common.Views.ReviewChanges.txtAcceptChanges": "Accept changes", + "Common.Views.ReviewChanges.txtAcceptCurrent": "Accept Current Change", + "Common.Views.ReviewChanges.txtClose": "Close", + "Common.Views.ReviewChanges.txtDocLang": "Language", + "Common.Views.ReviewChanges.txtFinal": "All changes accepted (Preview)", + "Common.Views.ReviewChanges.txtMarkup": "All changes (Editing)", + "Common.Views.ReviewChanges.txtNext": "Next", + "Common.Views.ReviewChanges.txtOriginal": "All changes rejected (Preview)", + "Common.Views.ReviewChanges.txtPrev": "Previous", + "Common.Views.ReviewChanges.txtReject": "Reject", + "Common.Views.ReviewChanges.txtRejectAll": "Reject All Changes", + "Common.Views.ReviewChanges.txtRejectChanges": "Reject changes", + "Common.Views.ReviewChanges.txtRejectCurrent": "Reject Current Change", + "Common.Views.ReviewChanges.txtSpelling": "Spell Checking", + "Common.Views.ReviewChanges.txtTurnon": "Track Changes", + "Common.Views.ReviewChanges.txtView": "Display Mode", + "Common.Views.ReviewChanges.txtSharing": "Sharing", + "Common.Views.ReviewChanges.tipSharing": "Manage document access rights", + "Common.Views.ReviewChanges.txtCoAuthMode": "Co-editing Mode", + "Common.Views.ReviewChanges.tipCoAuthMode": "Set co-editing mode", + "Common.Views.ReviewChanges.strFast": "Fast", + "Common.Views.ReviewChanges.strStrict": "Strict", + "Common.Views.ReviewChanges.txtHistory": "Version History", + "Common.Views.ReviewChanges.tipHistory": "Show version history", "SSE.Controllers.DocumentHolder.alignmentText": "Alignment", "SSE.Controllers.DocumentHolder.centerText": "Center", "SSE.Controllers.DocumentHolder.deleteColumnText": "Delete Column", @@ -1649,6 +1683,7 @@ "SSE.Views.Toolbar.textTabFile": "File", "SSE.Views.Toolbar.textTabHome": "Home", "SSE.Views.Toolbar.textTabInsert": "Insert", + "SSE.Views.Toolbar.textTabCollaboration": "Collaboration", "SSE.Views.Toolbar.textTopBorders": "Top Borders", "SSE.Views.Toolbar.textUnderline": "Underline", "SSE.Views.Toolbar.textWinLossSpark": "Win/Loss",