diff --git a/apps/common/main/lib/controller/ReviewChanges.js b/apps/common/main/lib/controller/ReviewChanges.js index 1aa6ea402a..6f90ad3504 100644 --- a/apps/common/main/lib/controller/ReviewChanges.js +++ b/apps/common/main/lib/controller/ReviewChanges.js @@ -670,13 +670,13 @@ define([ } }); } else if (config.canViewReview) { - config.canViewReview = me.api.asc_HaveRevisionsChanges(true); // check revisions from all users + config.canViewReview = (config.isEdit || me.api.asc_HaveRevisionsChanges(true)); // check revisions from all users if (config.canViewReview) { var val = Common.localStorage.getItem(me.view.appPrefix + "review-mode"); if (val===null) val = me.appConfig.customization && /^(original|final|markup)$/i.test(me.appConfig.customization.reviewDisplay) ? me.appConfig.customization.reviewDisplay.toLocaleLowerCase() : 'original'; - me.turnDisplayMode(config.isRestrictedEdit ? 'markup' : val); // load display mode only in viewer - me.view.turnDisplayMode(config.isRestrictedEdit ? 'markup' : val); + me.turnDisplayMode((config.isEdit || config.isRestrictedEdit) ? 'markup' : val); // load display mode only in viewer + me.view.turnDisplayMode((config.isEdit || config.isRestrictedEdit) ? 'markup' : val); } } diff --git a/apps/common/mobile/lib/controller/Collaboration.js b/apps/common/mobile/lib/controller/Collaboration.js index 673092e464..63d5296a4e 100644 --- a/apps/common/mobile/lib/controller/Collaboration.js +++ b/apps/common/mobile/lib/controller/Collaboration.js @@ -209,7 +209,10 @@ define([ Common.Utils.addScrollIfNeed('.page[data-page=comments-view]', '.page[data-page=comments-view] .page-content'); } else { if(editor === 'DE' && !this.appConfig.canReview) { - $('#reviewing-settings').hide(); + this.canViewReview = me.api.asc_HaveRevisionsChanges(true); + if (!this.canViewReview) { + $('#reviewing-settings').hide(); + } } } }, @@ -282,6 +285,11 @@ define([ $('#settings-reject-all').removeClass('disabled'); $('#settings-review').removeClass('disabled'); } + if (!this.appConfig.canReview) { + $('#settings-review').hide(); + $('#settings-accept-all').hide(); + $('#settings-reject-all').hide(); + } }, onTrackChanges: function(e) { @@ -384,6 +392,10 @@ define([ $('#btn-prev-change').addClass('disabled'); $('#btn-next-change').addClass('disabled'); } + if (!this.appConfig.canReview) { + $('#btn-accept-change').addClass('disabled'); + $('#btn-reject-change').addClass('disabled'); + } }, onPrevChange: function() { diff --git a/apps/documenteditor/main/app/controller/DocumentHolder.js b/apps/documenteditor/main/app/controller/DocumentHolder.js index 18f1a82d51..55f341fbac 100644 --- a/apps/documenteditor/main/app/controller/DocumentHolder.js +++ b/apps/documenteditor/main/app/controller/DocumentHolder.js @@ -134,11 +134,14 @@ define([ } }, this)); diagramEditor.on('hide', _.bind(function(cmp, message) { - this.documentHolder.fireEvent('editcomplete', this.documentHolder); if (this.api) { this.api.asc_onCloseChartFrame(); this.api.asc_enableKeyEvents(true); } + var me = this; + setTimeout(function(){ + me.documentHolder.fireEvent('editcomplete', me.documentHolder); + }, 10); }, this)); } @@ -151,10 +154,13 @@ define([ this.api.asc_setMailMergeData(data); }, this)); mergeEditor.on('hide', _.bind(function(cmp, message) { - this.documentHolder.fireEvent('editcomplete', this.documentHolder); if (this.api) { this.api.asc_enableKeyEvents(true); } + var me = this; + setTimeout(function(){ + me.documentHolder.fireEvent('editcomplete', me.documentHolder); + }, 10); }, this)); } }, diff --git a/apps/documenteditor/main/app/controller/Main.js b/apps/documenteditor/main/app/controller/Main.js index b3058d6259..640e0b1046 100644 --- a/apps/documenteditor/main/app/controller/Main.js +++ b/apps/documenteditor/main/app/controller/Main.js @@ -2115,6 +2115,17 @@ define([ this.beforeShowDummyComment = true; }, + DisableMailMerge: function() { + this.appOptions.mergeFolderUrl = ""; + var toolbarController = this.getApplication().getController('Toolbar'); + toolbarController && toolbarController.DisableMailMerge(); + }, + + DisableVersionHistory: function() { + this.editorConfig.canUseHistory = false; + this.appOptions.canUseHistory = false; + }, + leavePageText: 'You have unsaved changes in this document. Click \'Stay on this Page\' then \'Save\' to save them. Click \'Leave this Page\' to discard all the unsaved changes.', criticalErrorTitle: 'Error', notcriticalErrorTitle: 'Warning', diff --git a/apps/documenteditor/main/app/controller/Toolbar.js b/apps/documenteditor/main/app/controller/Toolbar.js index 9c345baa7b..0a10d18f3e 100644 --- a/apps/documenteditor/main/app/controller/Toolbar.js +++ b/apps/documenteditor/main/app/controller/Toolbar.js @@ -2616,7 +2616,7 @@ define([ this.toolbar.btnRedo.setDisabled(this._state.can_redo!==true); this.toolbar.btnCopy.setDisabled(this._state.can_copycut!==true); this.toolbar.btnPrint.setDisabled(!this.toolbar.mode.canPrint); - if (this.toolbar.mode.fileChoiceUrl || this.toolbar.mode.canRequestMailMergeRecipients) + if (!this._state.mmdisable && (this.toolbar.mode.fileChoiceUrl || this.toolbar.mode.canRequestMailMergeRecipients)) this.toolbar.btnMailRecepients.setDisabled(false); this._state.activated = true; @@ -2624,6 +2624,11 @@ define([ this.onApiPageSize(props.get_W(), props.get_H()); }, + DisableMailMerge: function() { + this._state.mmdisable = true; + this.toolbar && this.toolbar.btnMailRecepients && this.toolbar.btnMailRecepients.setDisabled(true); + }, + updateThemeColors: function() { var updateColors = function(picker, defaultColorIndex) { if (picker) { diff --git a/apps/documenteditor/main/app/view/StyleTitleDialog.js b/apps/documenteditor/main/app/view/StyleTitleDialog.js index 9a0deabee5..238efe6895 100644 --- a/apps/documenteditor/main/app/view/StyleTitleDialog.js +++ b/apps/documenteditor/main/app/view/StyleTitleDialog.js @@ -71,6 +71,7 @@ define([ ].join(''); this.options.tpl = _.template(this.template)(this.options); + this.options.formats = this.options.formats || []; Common.UI.Window.prototype.initialize.call(this, this.options); }, @@ -100,6 +101,7 @@ define([ $window.find('.dlg-btn').on('click', _.bind(this.onBtnClick, this)); + this.options.formats.unshift({value: -1, displayValue: this.txtSameAs}); this.cmbNextStyle = new Common.UI.ComboBox({ el : $('#id-dlg-style-next-par'), style : 'width: 100%;', @@ -109,8 +111,7 @@ define([ data : this.options.formats, disabled : (this.options.formats.length==0) }); - if (this.options.formats.length>0) - this.cmbNextStyle.setValue(this.options.formats[0].value); + this.cmbNextStyle.setValue(-1); }, show: function() { @@ -128,8 +129,8 @@ define([ }, getNextStyle: function () { - var me = this; - return (me.options.formats.length>0) ? me.cmbNextStyle.getValue() : null; + var val = this.cmbNextStyle.getValue(); + return (val!=-1) ? val : null; }, onBtnClick: function(event) { @@ -161,7 +162,8 @@ define([ textHeader: 'Create New Style', txtEmpty: 'This field is required', txtNotEmpty: 'Field must not be empty', - textNextStyle: 'Next paragraph style' + textNextStyle: 'Next paragraph style', + txtSameAs: 'Same as created new style' }, DE.Views.StyleTitleDialog || {})) diff --git a/apps/documenteditor/main/locale/en.json b/apps/documenteditor/main/locale/en.json index 81107c5033..fe28eb861d 100644 --- a/apps/documenteditor/main/locale/en.json +++ b/apps/documenteditor/main/locale/en.json @@ -1873,6 +1873,7 @@ "DE.Views.StyleTitleDialog.textTitle": "Title", "DE.Views.StyleTitleDialog.txtEmpty": "This field is required", "DE.Views.StyleTitleDialog.txtNotEmpty": "Field must not be empty", + "DE.Views.StyleTitleDialog.txtSameAs": "Same as created new style", "DE.Views.TableFormulaDialog.cancelButtonText": "Cancel", "DE.Views.TableFormulaDialog.okButtonText": "OK", "DE.Views.TableFormulaDialog.textBookmark": "Paste Bookmark", diff --git a/apps/documenteditor/main/locale/ru.json b/apps/documenteditor/main/locale/ru.json index 3d8d69c365..57a23f1b80 100644 --- a/apps/documenteditor/main/locale/ru.json +++ b/apps/documenteditor/main/locale/ru.json @@ -1873,6 +1873,7 @@ "DE.Views.StyleTitleDialog.textTitle": "Название", "DE.Views.StyleTitleDialog.txtEmpty": "Это поле необходимо заполнить", "DE.Views.StyleTitleDialog.txtNotEmpty": "Поле не может быть пустым", + "DE.Views.StyleTitleDialog.txtSameAs": "Такой же, как создаваемый стиль", "DE.Views.TableFormulaDialog.cancelButtonText": "Отмена", "DE.Views.TableFormulaDialog.okButtonText": "ОК", "DE.Views.TableFormulaDialog.textBookmark": "Вставить закладку", diff --git a/apps/documenteditor/mobile/app.js b/apps/documenteditor/mobile/app.js index 465d67e692..cfd2b1b40f 100644 --- a/apps/documenteditor/mobile/app.js +++ b/apps/documenteditor/mobile/app.js @@ -183,7 +183,7 @@ require([ //Store Framework7 initialized instance for easy access window.uiApp = new Framework7({ // Default title for modals - modalTitle: '{{MOBILE_MODAL_TITLE}}', + modalTitle: '{{APP_TITLE_TEXT}}', // Enable tap hold events tapHold: true, diff --git a/apps/documenteditor/mobile/app/controller/Settings.js b/apps/documenteditor/mobile/app/controller/Settings.js index d122f1bf69..8269cbea5d 100644 --- a/apps/documenteditor/mobile/app/controller/Settings.js +++ b/apps/documenteditor/mobile/app/controller/Settings.js @@ -553,7 +553,18 @@ define([ }, onShowHelp: function () { - window.open('{{SUPPORT_URL}}', "_blank"); + var url = '{{HELP_URL}}'; + if (url.charAt(url.length-1) !== '/') { + url += '/'; + } + if (Common.SharedSettings.get('sailfish')) { + url+='mobile-applications/documents/sailfish/index.aspx'; + } else if (Common.SharedSettings.get('android')) { + url+='mobile-applications/documents/android/index.aspx'; + } else { + url+='mobile-applications/documents/index.aspx'; + } + window.open(url, "_blank"); this.hideModal(); }, diff --git a/apps/documenteditor/mobile/app/template/Settings.template b/apps/documenteditor/mobile/app/template/Settings.template index a3e6bc4b63..cde8bf0fd1 100644 --- a/apps/documenteditor/mobile/app/template/Settings.template +++ b/apps/documenteditor/mobile/app/template/Settings.template @@ -633,21 +633,21 @@

DOCUMENT EDITOR

-

<%= scope.textVersion %> {{PRODUCT_VERSION}}

+

<%= scope.textVersion %> <%= prodversion %>

-

{{PUBLISHER_NAME}}

-

{{PUBLISHER_ADDRESS}}

-

{{SUPPORT_EMAIL}}

-

{{PUBLISHER_PHONE}}

-

<% print(/^(?:https?:\/{2})?(\S+)/.exec('{{PUBLISHER_URL}}')[1]); %>

+

<%= publishername %>

+

<%= publisheraddr %>

+

<%= supportemail %>

+

<%= phonenum %>

+

<%= printed_url %>

diff --git a/apps/documenteditor/mobile/app/view/Settings.js b/apps/documenteditor/mobile/app/view/Settings.js index 84dbd7bcb0..16c8fb0c79 100644 --- a/apps/documenteditor/mobile/app/view/Settings.js +++ b/apps/documenteditor/mobile/app/view/Settings.js @@ -91,7 +91,14 @@ define([ phone : Common.SharedSettings.get('phone'), orthography: Common.SharedSettings.get('sailfish'), scope : this, - width : $(window).width() + width : $(window).width(), + prodversion: '{{PRODUCT_VERSION}}', + publishername: '{{PUBLISHER_NAME}}', + publisheraddr: '{{PUBLISHER_ADDRESS}}', + publisherurl: '{{PUBLISHER_URL}}', + printed_url: ("{{PUBLISHER_URL}}").replace(/https?:\/{2}/, "").replace(/\/$/,""), + supportemail: '{{SUPPORT_EMAIL}}', + phonenum: '{{PUBLISHER_PHONE}}' })); return this; diff --git a/apps/presentationeditor/mobile/app.js b/apps/presentationeditor/mobile/app.js index c2f9901d11..ec416bc5e9 100644 --- a/apps/presentationeditor/mobile/app.js +++ b/apps/presentationeditor/mobile/app.js @@ -181,7 +181,7 @@ require([ //Store Framework7 initialized instance for easy access window.uiApp = new Framework7({ // Default title for modals - modalTitle: '{{MOBILE_MODAL_TITLE}}', + modalTitle: '{{APP_TITLE_TEXT}}', // If it is webapp, we can enable hash navigation: // pushState: false, diff --git a/apps/presentationeditor/mobile/app/template/Settings.template b/apps/presentationeditor/mobile/app/template/Settings.template index d9b90cb1b5..13dfa79933 100644 --- a/apps/presentationeditor/mobile/app/template/Settings.template +++ b/apps/presentationeditor/mobile/app/template/Settings.template @@ -386,21 +386,21 @@

PRESENTATION EDITOR

-

<%= scope.textVersion %> {{PRODUCT_VERSION}}

+

<%= scope.textVersion %> <%= prodversion %>

-

Ascensio System SIA

-

{{PUBLISHER_ADDRESS}}

-

{{SUPPORT_EMAIL}}

-

{{PUBLISHER_PHONE}}

-

<% print(/^(?:https?:\/{2})?(\S+)/.exec('{{PUBLISHER_URL}}')[1]); %>

+

<%= publishername %>

+

<%= publisheraddr %>

+

<%= supportemail %>

+

<%= phonenum %>

+

<%= printed_url %>

diff --git a/apps/presentationeditor/mobile/app/view/Settings.js b/apps/presentationeditor/mobile/app/view/Settings.js index 11b6547166..e9986f8e33 100644 --- a/apps/presentationeditor/mobile/app/view/Settings.js +++ b/apps/presentationeditor/mobile/app/view/Settings.js @@ -92,7 +92,14 @@ define([ android: Common.SharedSettings.get('android'), phone: Common.SharedSettings.get('phone'), scope: this, - width: $(window).width() + width: $(window).width(), + prodversion: '{{PRODUCT_VERSION}}', + publishername: '{{PUBLISHER_NAME}}', + publisheraddr: '{{PUBLISHER_ADDRESS}}', + publisherurl: '{{PUBLISHER_URL}}', + printed_url: ("{{PUBLISHER_URL}}").replace(/https?:\/{2}/, "").replace(/\/$/,""), + supportemail: '{{SUPPORT_EMAIL}}', + phonenum: '{{PUBLISHER_PHONE}}' })); return this; @@ -180,7 +187,18 @@ define([ }, showHelp: function () { - window.open('{{SUPPORT_URL}}', "_blank"); + var url = '{{HELP_URL}}'; + if (url.charAt(url.length-1) !== '/') { + url += '/'; + } + if (Common.SharedSettings.get('sailfish')) { + url+='mobile-applications/documents/sailfish/index.aspx'; + } else if (Common.SharedSettings.get('android')) { + url+='mobile-applications/documents/android/index.aspx'; + } else { + url+='mobile-applications/documents/index.aspx'; + } + window.open(url, "_blank"); PE.getController('Settings').hideModal(); }, diff --git a/apps/spreadsheeteditor/main/app/controller/FormulaDialog.js b/apps/spreadsheeteditor/main/app/controller/FormulaDialog.js index b5f2ebde2b..5093269b19 100644 --- a/apps/spreadsheeteditor/main/app/controller/FormulaDialog.js +++ b/apps/spreadsheeteditor/main/app/controller/FormulaDialog.js @@ -335,7 +335,7 @@ define([ allFunctions.push(func); } - formulaGroup.set('functions', functions); + formulaGroup.set('functions', _.sortBy(functions, function (model) {return model.get('name'); })); store.push(formulaGroup); } diff --git a/apps/spreadsheeteditor/main/app/view/Spellcheck.js b/apps/spreadsheeteditor/main/app/view/Spellcheck.js index 33d8793186..1d6a3ad83f 100644 --- a/apps/spreadsheeteditor/main/app/view/Spellcheck.js +++ b/apps/spreadsheeteditor/main/app/view/Spellcheck.js @@ -146,7 +146,8 @@ define([ cls : 'input-group-nr', scroller : { suppressScrollX: true - } + }, + search: true }); this.btnToDictionary = new Common.UI.Button({ diff --git a/apps/spreadsheeteditor/mobile/app.js b/apps/spreadsheeteditor/mobile/app.js index 82d26b8e42..582f07fd78 100644 --- a/apps/spreadsheeteditor/mobile/app.js +++ b/apps/spreadsheeteditor/mobile/app.js @@ -167,7 +167,7 @@ require([ //Store Framework7 initialized instance for easy access window.uiApp = new Framework7({ // Default title for modals - modalTitle: '{{MOBILE_MODAL_TITLE}}', + modalTitle: '{{APP_TITLE_TEXT}}', // Enable tap hold events tapHold: true, diff --git a/apps/spreadsheeteditor/mobile/app/controller/Settings.js b/apps/spreadsheeteditor/mobile/app/controller/Settings.js index 878e9affb6..462a4eeb54 100644 --- a/apps/spreadsheeteditor/mobile/app/controller/Settings.js +++ b/apps/spreadsheeteditor/mobile/app/controller/Settings.js @@ -112,7 +112,18 @@ define([ 'Settings': { 'page:show' : this.onPageShow , 'settings:showhelp': function(e) { - window.open('{{SUPPORT_URL}}', "_blank"); + var url = '{{HELP_URL}}'; + if (url.charAt(url.length-1) !== '/') { + url += '/'; + } + if (Common.SharedSettings.get('sailfish')) { + url+='mobile-applications/documents/sailfish/index.aspx'; + } else if (Common.SharedSettings.get('android')) { + url+='mobile-applications/documents/android/index.aspx'; + } else { + url+='mobile-applications/documents/index.aspx'; + } + window.open(url, "_blank"); this.hideModal(); } } diff --git a/apps/spreadsheeteditor/mobile/app/template/Settings.template b/apps/spreadsheeteditor/mobile/app/template/Settings.template index a87da94884..0852487a33 100644 --- a/apps/spreadsheeteditor/mobile/app/template/Settings.template +++ b/apps/spreadsheeteditor/mobile/app/template/Settings.template @@ -436,21 +436,21 @@

SPREADSHEET EDITOR

-

<%= scope.textVersion %> {{PRODUCT_VERSION}}

+

<%= scope.textVersion %> <%= prodversion %>

-

{{PUBLISHER_NAME}}

-

{{PUBLISHER_ADDRESS}}

-

{{SUPPORT_EMAIL}}

-

{{PUBLISHER_PHONE}}

-

<% print(/^(?:https?:\/{2})?(\S+)/.exec('{{PUBLISHER_URL}}')[1]); %>

+

<%= publishername %>

+

<%= publisheraddr %>

+

<%= supportemail %>

+

<%= phonenum %>

+

<%= printed_url %>

diff --git a/apps/spreadsheeteditor/mobile/app/view/Settings.js b/apps/spreadsheeteditor/mobile/app/view/Settings.js index a385fcaafe..a8471525ff 100644 --- a/apps/spreadsheeteditor/mobile/app/view/Settings.js +++ b/apps/spreadsheeteditor/mobile/app/view/Settings.js @@ -101,7 +101,14 @@ define([ xltx: Asc.c_oAscFileType.XLTX, ots: Asc.c_oAscFileType.OTS }, - width : $(window).width() + width : $(window).width(), + prodversion: '{{PRODUCT_VERSION}}', + publishername: '{{PUBLISHER_NAME}}', + publisheraddr: '{{PUBLISHER_ADDRESS}}', + publisherurl: '{{PUBLISHER_URL}}', + printed_url: ("{{PUBLISHER_URL}}").replace(/https?:\/{2}/, "").replace(/\/$/,""), + supportemail: '{{SUPPORT_EMAIL}}', + phonenum: '{{PUBLISHER_PHONE}}' })); return this; diff --git a/build/Gruntfile.js b/build/Gruntfile.js index 37c317e186..6cf6ff6a0c 100644 --- a/build/Gruntfile.js +++ b/build/Gruntfile.js @@ -43,6 +43,9 @@ module.exports = function(grunt) { }, { from: /\{\{APP_TITLE_TEXT\}\}/g, to: process.env['APP_TITLE_TEXT'] || 'ONLYOFFICE' + }, { + from: /\{\{HELP_URL\}\}/g, + to: process.env['HELP_URL'] || 'https://helpcenter.onlyoffice.com' }]; var helpreplacements = [