diff --git a/apps/api/documents/api.js b/apps/api/documents/api.js index 0f8d84ec8..57fab51b9 100644 --- a/apps/api/documents/api.js +++ b/apps/api/documents/api.js @@ -134,7 +134,10 @@ spellcheck: true, compatibleFeatures: false, unit: 'cm' // cm, pt, inch, - mentionShare : true // customize tooltip for mention + mentionShare : true // customize tooltip for mention, + macros: true // can run macros in document + plugins: true // can run plugins in document + macrosMode: 'warn' // warn about automatic macros, 'enable', 'disable', 'warn' }, plugins: { autostart: ['asc.{FFE1F462-1EA2-4391-990D-4CC84940B754}'], diff --git a/apps/common/main/lib/component/CheckBox.js b/apps/common/main/lib/component/CheckBox.js index c42f26253..354046ecb 100644 --- a/apps/common/main/lib/component/CheckBox.js +++ b/apps/common/main/lib/component/CheckBox.js @@ -95,7 +95,7 @@ define([ value : 'unchecked', template : _.template(''), initialize : function(options) { Common.UI.BaseView.prototype.initialize.call(this, options); diff --git a/apps/common/main/lib/component/ComboBoxFonts.js b/apps/common/main/lib/component/ComboBoxFonts.js index 03cf4cf7d..a109a10e7 100644 --- a/apps/common/main/lib/component/ComboBoxFonts.js +++ b/apps/common/main/lib/component/ComboBoxFonts.js @@ -76,7 +76,7 @@ define([ '
  • ', '<% _.each(items, function(item) { %>', '
  • ', - '', + '', '
  • ', '<% }); %>', '', @@ -380,7 +380,7 @@ define([ onInsertItem: function(item) { $(this.el).find('ul').prepend(_.template([ '
  • ', - '', + '', '
  • ' ].join(''))({ item: item.attributes, diff --git a/apps/common/main/lib/component/InputField.js b/apps/common/main/lib/component/InputField.js index d46057f61..df8164441 100644 --- a/apps/common/main/lib/component/InputField.js +++ b/apps/common/main/lib/component/InputField.js @@ -88,7 +88,7 @@ define([ 'placeholder="<%= placeHolder %>" ', 'value="<%= value %>"', '>', - '', + '', '' ].join('')), @@ -414,7 +414,7 @@ define([ 'placeholder="<%= placeHolder %>" ', 'value="<%= value %>"', '>', - '', + '', '
    ' + '' + '
    ', diff --git a/apps/common/main/lib/component/LoadMask.js b/apps/common/main/lib/component/LoadMask.js index d7922f81b..e0792ec67 100644 --- a/apps/common/main/lib/component/LoadMask.js +++ b/apps/common/main/lib/component/LoadMask.js @@ -167,7 +167,7 @@ define([ }, isVisible: function() { - return !_.isEmpty(loaderEl); + return !!ownerEl.ismasked; }, updatePosition: function() { diff --git a/apps/common/main/lib/component/RadioBox.js b/apps/common/main/lib/component/RadioBox.js index b26e23aa8..1c9a6c360 100644 --- a/apps/common/main/lib/component/RadioBox.js +++ b/apps/common/main/lib/component/RadioBox.js @@ -72,7 +72,7 @@ define([ rendered : false, template : _.template(''), initialize : function(options) { Common.UI.BaseView.prototype.initialize.call(this, options); diff --git a/apps/common/main/lib/component/SynchronizeTip.js b/apps/common/main/lib/component/SynchronizeTip.js index 022d63193..9ddedf973 100644 --- a/apps/common/main/lib/component/SynchronizeTip.js +++ b/apps/common/main/lib/component/SynchronizeTip.js @@ -128,7 +128,7 @@ define([ }, textDontShow : 'Don\'t show this message again', - textSynchronize : 'The document has been changed by another user.
    Please click to save your changes and reload the updates.' + textSynchronize : 'The document has been changed by another user.
    Please click to save your changes and reload the updates.' } })(), Common.UI.SynchronizeTip || {})); }); diff --git a/apps/common/main/lib/component/TabBar.js b/apps/common/main/lib/component/TabBar.js index 31eaddea4..8a0a84a0f 100644 --- a/apps/common/main/lib/component/TabBar.js +++ b/apps/common/main/lib/component/TabBar.js @@ -225,7 +225,7 @@ define([ } } } - !tab.disabled && Common.NotificationCenter.trigger('edit:complete', this.bar); + !tab.disabled && Common.NotificationCenter.trigger('edit:complete', 'tab'); }, this), dblclick: $.proxy(function() { this.trigger('tab:dblclick', this, this.tabs.indexOf(tab), tab); @@ -311,7 +311,7 @@ define([ }, tabs: [], - template: _.template(' + + @@ -872,4 +886,55 @@ + + + +
    + +
    +
    +
    +
    +
      +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    +
    + +
    +
    +
    \ No newline at end of file diff --git a/apps/documenteditor/mobile/app/view/Settings.js b/apps/documenteditor/mobile/app/view/Settings.js index 4d34d2997..9f665b35f 100644 --- a/apps/documenteditor/mobile/app/view/Settings.js +++ b/apps/documenteditor/mobile/app/view/Settings.js @@ -59,7 +59,8 @@ define([ _canHelp = true, _canPrint = false, _canReview = false, - _isReviewOnly = false; + _isReviewOnly = false, + _isShowMacros = true; return { // el: '.view-main', @@ -120,6 +121,7 @@ define([ if (mode.customization) { _canHelp = (mode.customization.help!==false); + _isShowMacros = (mode.customization.macros!==false); } }, @@ -149,6 +151,7 @@ define([ if (!_canPrint) $layour.find('#settings-print').hide(); if (!_canReview) $layour.find('#settings-review').hide(); if (_isReviewOnly) $layour.find('#settings-review').addClass('disabled'); + if (!_isShowMacros) $layour.find('#settings-macros').hide(); return $layour.html(); } @@ -332,7 +335,14 @@ define([ textUploaded: 'Uploaded', textLastModified: 'Last Modified', textLastModifiedBy: 'Last Modified By', - textCreated: 'Created' + textCreated: 'Created', + textMacrosSettings: 'Macros Settings', + textDisableAll: 'Disable All', + textDisableAllMacrosWithoutNotification: 'Disable all macros without notification', + textShowNotification: 'Show Notification', + textDisableAllMacrosWithNotification: 'Disable all macros with notification', + textEnableAll: 'Enable All', + textEnableAllMacrosWithoutNotification: 'Enable all macros without notification' } diff --git a/apps/documenteditor/mobile/app/view/add/AddOther.js b/apps/documenteditor/mobile/app/view/add/AddOther.js index 61947bff8..28547d3c9 100644 --- a/apps/documenteditor/mobile/app/view/add/AddOther.js +++ b/apps/documenteditor/mobile/app/view/add/AddOther.js @@ -68,14 +68,24 @@ define([ $('#add-other-link').single('click', _.bind(me.showLink, me)); $('#add-other-pagenumber').single('click', _.bind(me.showPagePosition, me)); - $('#add-other-footnote').single('click', _.bind(me.showPageFootnote, me)); - $('#add-other-break').single('click', _.bind(me.showPageBreak, me)); - if (this.hideInsertComments) { - $('#item-comment').hide(); + if (this.isDisableComment) { + $('#item-comment').addClass('disabled'); } else { - $('#item-comment').show(); + $('#item-comment').removeClass('disabled'); $('#add-other-comment').single('click', _.bind(me.showPageComment, me)); } + if (this.isDisableBreak) { + $('#item-break').addClass('disabled'); + } else { + $('#item-break').removeClass('disabled'); + $('#add-other-break').single('click', _.bind(me.showPageBreak, me)); + } + if (this.isDisableFootnote) { + $('#item-footnote').addClass('disabled'); + } else { + $('#item-footnote').removeClass('disabled'); + $('#add-other-footnote').single('click', _.bind(me.showPageFootnote, me)); + } me.initControls(); }, diff --git a/apps/documenteditor/mobile/locale/en.json b/apps/documenteditor/mobile/locale/en.json index 91156dc42..1d6e5134d 100644 --- a/apps/documenteditor/mobile/locale/en.json +++ b/apps/documenteditor/mobile/locale/en.json @@ -282,6 +282,10 @@ "DE.Controllers.Main.warnNoLicense": "This version of %1 editors has certain limitations for concurrent connections to the document server.
    If you need more please consider purchasing a commercial license.", "DE.Controllers.Main.warnNoLicenseUsers": "This version of %1 editors has certain limitations for concurrent users.
    If you need more please consider purchasing a commercial license.", "DE.Controllers.Main.warnProcessRightsChange": "You have been denied the right to edit the file.", + "DE.Controllers.Main.textHasMacros": "The file contains automatic macros.
    Do you want to run macros?", + "DE.Controllers.Main.textRemember": "Remember my choice", + "DE.Controllers.Main.textYes": "Yes", + "DE.Controllers.Main.textNo": "No", "DE.Controllers.Search.textNoTextFound": "Text not Found", "DE.Controllers.Search.textReplaceAll": "Replace All", "DE.Controllers.Settings.notcriticalErrorTitle": "Warning", @@ -570,5 +574,12 @@ "DE.Views.Settings.textVersion": "Version", "DE.Views.Settings.textWords": "Words", "DE.Views.Settings.unknownText": "Unknown", + "DE.Views.Settings.textMacrosSettings": "Macros Settings", + "DE.Views.Settings.textDisableAll": "Disable All", + "DE.Views.Settings.textDisableAllMacrosWithoutNotification": "Disable all macros without notification", + "DE.Views.Settings.textShowNotification": "Show Notification", + "DE.Views.Settings.textDisableAllMacrosWithNotification": "Disable all macros with notification", + "DE.Views.Settings.textEnableAll": "Enable All", + "DE.Views.Settings.textEnableAllMacrosWithoutNotification": "Enable all macros without notification", "DE.Views.Toolbar.textBack": "Back" } \ No newline at end of file diff --git a/apps/documenteditor/mobile/resources/css/app-ios.css b/apps/documenteditor/mobile/resources/css/app-ios.css index fbc571974..45c50e170 100644 --- a/apps/documenteditor/mobile/resources/css/app-ios.css +++ b/apps/documenteditor/mobile/resources/css/app-ios.css @@ -6559,17 +6559,6 @@ html.pixel-ratio-3 .document-menu .list-block li:last-child li .item-inner:after padding: 16px 0; word-wrap: break-word; } -.page-comments p, -.add-comment p, -.page-view-comments p, -.container-edit-comment p, -.container-add-reply p, -.page-edit-comment p, -.page-add-reply p, -.page-edit-reply p { - margin: 0; - word-break: break-word; -} .page-comments .list-reply, .add-comment .list-reply, .page-view-comments .list-reply, @@ -6665,6 +6654,24 @@ html.pixel-ratio-3 .document-menu .list-block li:last-child li .item-inner:after max-width: 100%; padding-right: 15px; } +.page-comments .comment-text pre, +.add-comment .comment-text pre, +.page-view-comments .comment-text pre, +.container-edit-comment .comment-text pre, +.container-add-reply .comment-text pre, +.page-edit-comment .comment-text pre, +.page-add-reply .comment-text pre, +.page-edit-reply .comment-text pre, +.page-comments .reply-text pre, +.add-comment .reply-text pre, +.page-view-comments .reply-text pre, +.container-edit-comment .reply-text pre, +.container-add-reply .reply-text pre, +.page-edit-comment .reply-text pre, +.page-add-reply .reply-text pre, +.page-edit-reply .reply-text pre { + white-space: pre-wrap; +} .page-comments .reply-item, .add-comment .reply-item, .page-view-comments .reply-item, @@ -7778,3 +7785,10 @@ html.pixel-ratio-3 .numbers li { -o-animation: flickerAnimation 2s infinite ease-in-out; animation: flickerAnimation 2s infinite ease-in-out; } +.page-macros-settings[data-page="macros-settings-view"] .list-block li.media-item .item-title { + font-weight: normal; +} +.page-macros-settings[data-page="macros-settings-view"] .list-block li.media-item .item-subtitle { + font-size: 14px; + color: #8e8e93; +} diff --git a/apps/documenteditor/mobile/resources/css/app-material.css b/apps/documenteditor/mobile/resources/css/app-material.css index 65118842b..ff00967da 100644 --- a/apps/documenteditor/mobile/resources/css/app-material.css +++ b/apps/documenteditor/mobile/resources/css/app-material.css @@ -6129,17 +6129,6 @@ html.phone .document-menu .list-block .item-link { .page-edit-reply .list-block .item-inner:after { content: none; } -.page-comments p, -.page-add-comment p, -.page-view-comments p, -.container-edit-comment p, -.container-add-reply p, -.page-edit-comment p, -.page-add-reply p, -.page-edit-reply p { - margin: 0; - word-break: break-word; -} .page-comments .list-reply, .page-add-comment .list-reply, .page-view-comments .list-reply, @@ -6234,6 +6223,24 @@ html.phone .document-menu .list-block .item-link { max-width: 100%; padding-right: 15px; } +.page-comments .comment-text pre, +.page-add-comment .comment-text pre, +.page-view-comments .comment-text pre, +.container-edit-comment .comment-text pre, +.container-add-reply .comment-text pre, +.page-edit-comment .comment-text pre, +.page-add-reply .comment-text pre, +.page-edit-reply .comment-text pre, +.page-comments .reply-text pre, +.page-add-comment .reply-text pre, +.page-view-comments .reply-text pre, +.container-edit-comment .reply-text pre, +.container-add-reply .reply-text pre, +.page-edit-comment .reply-text pre, +.page-add-reply .reply-text pre, +.page-edit-reply .reply-text pre { + white-space: pre-wrap; +} .page-comments .reply-item, .page-add-comment .reply-item, .page-view-comments .reply-item, @@ -6328,7 +6335,7 @@ html.phone .document-menu .list-block .item-link { outline: none; width: 100%; font-size: 15px; - border: 1px solid #c4c4c4; + border: none; border-radius: 3px; min-height: 100px; } @@ -7639,3 +7646,10 @@ html.pixel-ratio-3 .numbers li { -o-animation: flickerAnimation 2s infinite ease-in-out; animation: flickerAnimation 2s infinite ease-in-out; } +.page-macros-settings[data-page="macros-settings-view"] .list-block li.media-item .item-title { + font-weight: normal; +} +.page-macros-settings[data-page="macros-settings-view"] .list-block li.media-item .item-subtitle { + font-size: 14px; + color: #9e9e9e; +} diff --git a/apps/documenteditor/mobile/resources/less/app-ios.less b/apps/documenteditor/mobile/resources/less/app-ios.less index 379577dd0..7afcfe9cb 100644 --- a/apps/documenteditor/mobile/resources/less/app-ios.less +++ b/apps/documenteditor/mobile/resources/less/app-ios.less @@ -276,3 +276,18 @@ input, textarea { animation: flickerAnimation 2s infinite ease-in-out; } } + +// Macros settings +.page-macros-settings[data-page="macros-settings-view"] { + .list-block { + li.media-item { + .item-title { + font-weight: normal; + } + .item-subtitle { + font-size: 14px; + color: @gray; + } + } + } +} diff --git a/apps/documenteditor/mobile/resources/less/app-material.less b/apps/documenteditor/mobile/resources/less/app-material.less index 351b81974..b74cd4923 100644 --- a/apps/documenteditor/mobile/resources/less/app-material.less +++ b/apps/documenteditor/mobile/resources/less/app-material.less @@ -275,3 +275,18 @@ input, textarea { animation: flickerAnimation 2s infinite ease-in-out; } } + +// Macros settings +.page-macros-settings[data-page="macros-settings-view"] { + .list-block { + li.media-item { + .item-title { + font-weight: normal; + } + .item-subtitle { + font-size: 14px; + color: @gray; + } + } + } +} diff --git a/apps/presentationeditor/embed/js/ApplicationController.js b/apps/presentationeditor/embed/js/ApplicationController.js index ffaf30b11..244aa0e0e 100644 --- a/apps/presentationeditor/embed/js/ApplicationController.js +++ b/apps/presentationeditor/embed/js/ApplicationController.js @@ -100,9 +100,16 @@ PE.ApplicationController = new(function(){ docInfo.put_VKey(docConfig.vkey); docInfo.put_Token(docConfig.token); docInfo.put_Permissions(_permissions); + docInfo.put_EncryptedInfo(config.encryptionKeys); + + var enable = !config.customization || (config.customization.macros!==false); + docInfo.asc_putIsEnabledMacroses(!!enable); + enable = !config.customization || (config.customization.plugins!==false); + docInfo.asc_putIsEnabledPlugins(!!enable); if (api) { api.asc_registerCallback('asc_onGetEditorPermissions', onEditorPermissions); + api.asc_registerCallback('asc_onRunAutostartMacroses', onRunAutostartMacroses); api.asc_setDocInfo(docInfo); api.asc_getEditorPermissions(config.licenseUrl, config.customerId); api.asc_enableKeyEvents(true); @@ -580,6 +587,12 @@ PE.ApplicationController = new(function(){ } if (api) api.asc_DownloadAs(new Asc.asc_CDownloadOptions(Asc.c_oAscFileType.PPTX, true)); } + + function onRunAutostartMacroses() { + if (!config.customization || (config.customization.macros!==false)) + if (api) api.asc_runAutostartMacroses(); + } + // Helpers // ------------------------- diff --git a/apps/presentationeditor/main/app/controller/LeftMenu.js b/apps/presentationeditor/main/app/controller/LeftMenu.js index b01c7b60d..40321834a 100644 --- a/apps/presentationeditor/main/app/controller/LeftMenu.js +++ b/apps/presentationeditor/main/app/controller/LeftMenu.js @@ -326,6 +326,10 @@ define([ value = Common.localStorage.getBool("pe-settings-spellcheck", true); Common.Utils.InternalSettings.set("pe-settings-spellcheck", value); this.api.asc_setSpellCheck(value); + + value = parseInt(Common.localStorage.getItem("pe-settings-paste-button")); + Common.Utils.InternalSettings.set("pe-settings-paste-button", value); + this.api.asc_setVisiblePasteButton(!!value); } this.api.put_ShowSnapLines(Common.Utils.InternalSettings.get("pe-settings-showsnaplines")); diff --git a/apps/presentationeditor/main/app/controller/Main.js b/apps/presentationeditor/main/app/controller/Main.js index ca3c069e6..5ab438963 100644 --- a/apps/presentationeditor/main/app/controller/Main.js +++ b/apps/presentationeditor/main/app/controller/Main.js @@ -342,6 +342,14 @@ define([ $('#editor-container').append('
    '); } + var value = Common.localStorage.getItem("pe-macros-mode"); + if (value === null) { + value = this.editorConfig.customization ? this.editorConfig.customization.macrosMode : 'warn'; + value = (value == 'enable') ? 1 : (value == 'disable' ? 2 : 0); + } else + value = parseInt(value); + Common.Utils.InternalSettings.set("pe-macros-mode", value); + Common.Controllers.Desktop.init(this.appOptions); }, @@ -373,10 +381,16 @@ define([ docInfo.put_Token(data.doc.token); docInfo.put_Permissions(_permissions); docInfo.put_EncryptedInfo(this.editorConfig.encryptionKeys); + + var enable = !this.editorConfig.customization || (this.editorConfig.customization.macros!==false); + docInfo.asc_putIsEnabledMacroses(!!enable); + enable = !this.editorConfig.customization || (this.editorConfig.customization.plugins!==false); + docInfo.asc_putIsEnabledPlugins(!!enable); } this.api.asc_registerCallback('asc_onGetEditorPermissions', _.bind(this.onEditorPermissions, this)); this.api.asc_registerCallback('asc_onLicenseChanged', _.bind(this.onLicenseChanged, this)); + this.api.asc_registerCallback('asc_onRunAutostartMacroses', _.bind(this.onRunAutostartMacroses, this)); this.api.asc_setDocInfo(docInfo); this.api.asc_getEditorPermissions(this.editorConfig.licenseUrl, this.editorConfig.customerId); @@ -760,6 +774,11 @@ define([ me.api.asc_setIsForceSaveOnUserSave(me.appOptions.forcesave); } + value = Common.localStorage.getItem("pe-settings-paste-button"); + if (value===null) value = '1'; + Common.Utils.InternalSettings.set("pe-settings-paste-button", parseInt(value)); + me.api.asc_setVisiblePasteButton(!!parseInt(value)); + if (me.needToUpdateVersion) Common.NotificationCenter.trigger('api:disconnect'); var timer_sl = setInterval(function(){ @@ -1245,7 +1264,7 @@ define([ config.closable = false; if (this.appOptions.canBackToFolder && !this.appOptions.isDesktopApp && typeof id !== 'string') { - config.msg += '

    ' + this.criticalErrorExtText; + config.msg += '

    ' + this.criticalErrorExtText; config.callback = function(btn) { if (btn == 'ok') { Common.NotificationCenter.trigger('goback', true); @@ -1883,6 +1902,36 @@ define([ }}); }, + onRunAutostartMacroses: function() { + var me = this, + enable = !this.editorConfig.customization || (this.editorConfig.customization.macros!==false); + if (enable) { + var value = Common.Utils.InternalSettings.get("pe-macros-mode"); + if (value==1) + this.api.asc_runAutostartMacroses(); + else if (value === 0) { + Common.UI.warning({ + msg: this.textHasMacros + '
    ', + buttons: ['yes', 'no'], + primary: 'yes', + dontshow: true, + textDontShow: this.textRemember, + callback: function(btn, dontshow){ + if (dontshow) { + Common.Utils.InternalSettings.set("pe-macros-mode", (btn == 'yes') ? 1 : 2); + Common.localStorage.setItem("pe-macros-mode", (btn == 'yes') ? 1 : 2); + } + if (btn == 'yes') { + setTimeout(function() { + me.api.asc_runAutostartMacroses(); + }, 1); + } + } + }); + } + } + }, + // Translation 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', @@ -2234,7 +2283,9 @@ define([ textCustomLoader: 'Please note that according to the terms of the license you are not entitled to change the loader.
    Please contact our Sales Department to get a quote.', waitText: 'Please, wait...', errorFileSizeExceed: 'The file size exceeds the limitation set for your server.
    Please contact your Document Server administrator for details.', - errorUpdateVersionOnDisconnect: 'Internet connection has been restored, and the file version has been changed.
    Before you can continue working, you need to download the file or copy its content to make sure nothing is lost, and then reload this page.' + errorUpdateVersionOnDisconnect: 'Internet connection has been restored, and the file version has been changed.
    Before you can continue working, you need to download the file or copy its content to make sure nothing is lost, and then reload this page.', + textHasMacros: 'The file contains automatic macros.
    Do you want to run macros?', + textRemember: 'Remember my choice' } })(), PE.Controllers.Main || {})) }); diff --git a/apps/presentationeditor/main/app/template/FileMenu.template b/apps/presentationeditor/main/app/template/FileMenu.template index d67b35cfe..a2c9eb462 100644 --- a/apps/presentationeditor/main/app/template/FileMenu.template +++ b/apps/presentationeditor/main/app/template/FileMenu.template @@ -1,36 +1,36 @@
    -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • -
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • -
    -
    -
    -
    -
    -
    -
    -
    -
    +
    +
    +
    +
    +
    +
    +
    +
    +
    \ No newline at end of file diff --git a/apps/presentationeditor/main/app/template/LeftMenu.template b/apps/presentationeditor/main/app/template/LeftMenu.template index 33401f1b9..7471d770d 100644 --- a/apps/presentationeditor/main/app/template/LeftMenu.template +++ b/apps/presentationeditor/main/app/template/LeftMenu.template @@ -12,9 +12,9 @@
    -
    -
    +
    diff --git a/apps/presentationeditor/main/app/template/StatusBar.template b/apps/presentationeditor/main/app/template/StatusBar.template index f4d7afebb..16159833c 100644 --- a/apps/presentationeditor/main/app/template/StatusBar.template +++ b/apps/presentationeditor/main/app/template/StatusBar.template @@ -11,9 +11,9 @@