\ 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/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 74096f997..45c50e170 100644
--- a/apps/documenteditor/mobile/resources/css/app-ios.css
+++ b/apps/documenteditor/mobile/resources/css/app-ios.css
@@ -7785,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 41bc3be45..5579331dc 100644
--- a/apps/documenteditor/mobile/resources/css/app-material.css
+++ b/apps/documenteditor/mobile/resources/css/app-material.css
@@ -7646,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..f254d7e78 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(){
@@ -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/view/FileMenuPanels.js b/apps/presentationeditor/main/app/view/FileMenuPanels.js
index 1a9277247..e973efb28 100644
--- a/apps/presentationeditor/main/app/view/FileMenuPanels.js
+++ b/apps/presentationeditor/main/app/view/FileMenuPanels.js
@@ -208,6 +208,16 @@ define([
'
',
'
',
'
','
',
+ '
',
+ '
',
+ '
',
+ '
','
',
+ '
',
+ '
',
+ '
',
+ '
',
+ '
',
+ '
','
',
'
',
'
',
'
',
@@ -331,6 +341,26 @@ define([
]
});
+ this.cmbMacros = new Common.UI.ComboBox({
+ el : $markup.findById('#fms-cmb-macros'),
+ style : 'width: 160px;',
+ editable : false,
+ cls : 'input-group-nr',
+ data : [
+ { value: 2, displayValue: this.txtStopMacros, descValue: this.txtStopMacrosDesc },
+ { value: 0, displayValue: this.txtWarnMacros, descValue: this.txtWarnMacrosDesc },
+ { value: 1, displayValue: this.txtRunMacros, descValue: this.txtRunMacrosDesc }
+ ]
+ }).on('selected', function(combo, record) {
+ me.lblMacrosDesc.text(record.descValue);
+ });
+ this.lblMacrosDesc = $markup.findById('#fms-lbl-macros');
+
+ this.chPaste = new Common.UI.CheckBox({
+ el: $markup.findById('#fms-chb-paste-settings'),
+ labelText: this.strPasteButton
+ });
+
this.btnApply = new Common.UI.Button({
el: $markup.findById('#fms-btn-apply')
});
@@ -367,6 +397,7 @@ define([
/** coauthoring begin **/
$('tr.coauth.changes', this.el)[mode.isEdit && !mode.isOffline && mode.canCoAuthoring ? 'show' : 'hide']();
/** coauthoring end **/
+ $('tr.macros', this.el)[(mode.customization && mode.customization.macros===false) ? 'hide' : 'show']();
},
updateSettings: function() {
@@ -409,6 +440,12 @@ define([
}
this.chAlignGuides.setValue(Common.Utils.InternalSettings.get("pe-settings-showsnaplines"));
+
+ item = this.cmbMacros.store.findWhere({value: Common.Utils.InternalSettings.get("pe-macros-mode")});
+ this.cmbMacros.setValue(item ? item.get('value') : 0);
+ this.lblMacrosDesc.text(item ? item.get('descValue') : this.txtWarnMacrosDesc);
+
+ this.chPaste.setValue(Common.Utils.InternalSettings.get("pe-settings-paste-button"));
},
applySettings: function() {
@@ -430,6 +467,11 @@ define([
Common.localStorage.setItem("pe-settings-forcesave", this.chForcesave.isChecked() ? 1 : 0);
Common.Utils.InternalSettings.set("pe-settings-showsnaplines", this.chAlignGuides.isChecked());
+ Common.localStorage.setItem("pe-macros-mode", this.cmbMacros.getValue());
+ Common.Utils.InternalSettings.set("pe-macros-mode", Common.localStorage.getItem("pe-macros-mode"));
+
+ Common.localStorage.setItem("pe-settings-paste-button", this.chPaste.isChecked() ? 1 : 0);
+
Common.localStorage.save();
if (this.menu) {
@@ -484,7 +526,16 @@ define([
strForcesave: 'Always save to server (otherwise save to server on document close)',
txtSpellCheck: 'Spell Checking',
strSpellCheckMode: 'Turn on spell checking option',
- txtCacheMode: 'Default cache mode'
+ txtCacheMode: 'Default cache mode',
+ strMacrosSettings: 'Macros Settings',
+ txtWarnMacros: 'Show Notification',
+ txtRunMacros: 'Enable All',
+ txtStopMacros: 'Disable All',
+ txtWarnMacrosDesc: 'Disable all macros with notification',
+ txtRunMacrosDesc: 'Enable all macros without notification',
+ txtStopMacrosDesc: 'Disable all macros without notification',
+ strPaste: 'Cut, copy and paste',
+ strPasteButton: 'Show Paste Options button when content is pasted'
}, PE.Views.FileMenuPanels.Settings || {}));
PE.Views.FileMenuPanels.RecentFiles = Common.UI.BaseView.extend({
diff --git a/apps/presentationeditor/main/locale/en.json b/apps/presentationeditor/main/locale/en.json
index 05c8e526d..cd66ef7f1 100644
--- a/apps/presentationeditor/main/locale/en.json
+++ b/apps/presentationeditor/main/locale/en.json
@@ -625,6 +625,8 @@
"PE.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.",
"PE.Controllers.Main.warnNoLicenseUsers": "This version of %1 editors has certain limitations for concurrent users. If you need more please consider purchasing a commercial license.",
"PE.Controllers.Main.warnProcessRightsChange": "You have been denied the right to edit the file.",
+ "PE.Controllers.Main.textHasMacros": "The file contains automatic macros. Do you want to run macros?",
+ "PE.Controllers.Main.textRemember": "Remember my choice",
"PE.Controllers.Statusbar.zoomText": "Zoom {0}%",
"PE.Controllers.Toolbar.confirmAddFontName": "The font you are going to save is not available on the current device. The text style will be displayed using one of the system fonts, the saved font will be used when it is available. Do you want to continue?",
"PE.Controllers.Toolbar.textAccent": "Accents",
@@ -1259,6 +1261,15 @@
"PE.Views.FileMenuPanels.Settings.txtPt": "Point",
"PE.Views.FileMenuPanels.Settings.txtSpellCheck": "Spell Checking",
"PE.Views.FileMenuPanels.Settings.txtWin": "as Windows",
+ "PE.Views.FileMenuPanels.Settings.strMacrosSettings": "Macros Settings",
+ "PE.Views.FileMenuPanels.Settings.txtWarnMacros": "Show Notification",
+ "PE.Views.FileMenuPanels.Settings.txtRunMacros": "Enable All",
+ "PE.Views.FileMenuPanels.Settings.txtStopMacros": "Disable All",
+ "PE.Views.FileMenuPanels.Settings.txtWarnMacrosDesc": "Disable all macros with notification",
+ "PE.Views.FileMenuPanels.Settings.txtRunMacrosDesc": "Enable all macros without notification",
+ "PE.Views.FileMenuPanels.Settings.txtStopMacrosDesc": "Disable all macros without notification",
+ "PE.Views.FileMenuPanels.Settings.strPaste": "Cut, copy and paste",
+ "PE.Views.FileMenuPanels.Settings.strPasteButton": "Show Paste Options button when content is pasted",
"PE.Views.HeaderFooterDialog.applyAllText": "Apply to all",
"PE.Views.HeaderFooterDialog.applyText": "Apply",
"PE.Views.HeaderFooterDialog.diffLanguage": "You can’t use a date format in a different language than the slide master. To change the master, click 'Apply to all' instead of 'Apply'",
diff --git a/apps/presentationeditor/mobile/app/controller/Main.js b/apps/presentationeditor/mobile/app/controller/Main.js
index 6cb144489..9ebdba405 100644
--- a/apps/presentationeditor/mobile/app/controller/Main.js
+++ b/apps/presentationeditor/mobile/app/controller/Main.js
@@ -227,6 +227,14 @@ define([
if (!me.editorConfig.customization || !(me.editorConfig.customization.loaderName || me.editorConfig.customization.loaderLogo))
$('#editor_sdk').append('
');
+ var value = Common.localStorage.getItem("pe-mobile-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-mobile-macros-mode", value);
+
// if (this.appOptions.location == 'us' || this.appOptions.location == 'ca')
// Common.Utils.Metric.setDefaultMetric(Common.Utils.Metric.c_MetricUnits.inch);
},
@@ -257,10 +265,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);
@@ -1278,6 +1292,51 @@ define([
return false;
},
+ onRunAutostartMacroses: function() {
+ var me = this,
+ enable = !this.editorConfig.customization || (this.editorConfig.customization.macros!==false);
+ if (enable) {
+ var value = Common.Utils.InternalSettings.get("pe-mobile-macros-mode");
+ if (value==1)
+ this.api.asc_runAutostartMacroses();
+ else if (value === 0) {
+ uiApp.modal({
+ title: this.notcriticalErrorTitle,
+ text: this.textHasMacros,
+ afterText: '',
+ buttons: [{
+ text: this.textYes,
+ onClick: function () {
+ var dontshow = $('input[name="checkbox-show-macros"]').prop('checked');
+ if (dontshow) {
+ Common.Utils.InternalSettings.set("pe-mobile-macros-mode", 1);
+ Common.localStorage.setItem("pe-mobile-macros-mode", 1);
+ }
+ setTimeout(function() {
+ me.api.asc_runAutostartMacroses();
+ }, 1);
+ }
+ },
+ {
+ text: this.textNo,
+ onClick: function () {
+ var dontshow = $('input[name="checkbox-show-macros"]').prop('checked');
+ if (dontshow) {
+ Common.Utils.InternalSettings.set("pe-mobile-macros-mode", 2);
+ Common.localStorage.setItem("pe-mobile-macros-mode", 2);
+ }
+ }
+ }]
+ });
+ }
+ }
+ },
+
// Translation
leavePageText: 'You have unsaved changes in this document. Click \'Stay on this Page\' to await the autosave of the document. Click \'Leave this Page\' to discard all the unsaved changes.',
criticalErrorTitle: 'Error',
@@ -1442,7 +1501,11 @@ define([
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.',
- errorOpensource: 'Files can be opened for viewing only. Mobile web editors are not available in the Open Source version.'
+ errorOpensource: 'Files can be opened for viewing only. Mobile web editors are not available in the Open Source version.',
+ textHasMacros: 'The file contains automatic macros. Do you want to run macros?',
+ textRemember: 'Remember my choice',
+ textYes: 'Yes',
+ textNo: 'No'
}
})(), PE.Controllers.Main || {}))
});
\ No newline at end of file
diff --git a/apps/presentationeditor/mobile/app/controller/Settings.js b/apps/presentationeditor/mobile/app/controller/Settings.js
index d902cdc49..c939fd041 100644
--- a/apps/presentationeditor/mobile/app/controller/Settings.js
+++ b/apps/presentationeditor/mobile/app/controller/Settings.js
@@ -176,6 +176,7 @@ define([
Common.Utils.addScrollIfNeed('.page[data-page=settings-info-view]', '.page[data-page=settings-info-view] .page-content');
Common.Utils.addScrollIfNeed('.page[data-page=settings-about-view]', '.page[data-page=settings-about-view] .page-content');
Common.Utils.addScrollIfNeed('.page[data-page=color-schemes-view]', '.page[data-page=color-schemes-view] .page-content');
+ Common.Utils.addScrollIfNeed('.page[data-page=settings-macros-view]', '.page[data-page=settings-macros-view] .page-content');
me.initSettings(pageId);
},
@@ -193,9 +194,25 @@ define([
me.initPageColorSchemes();
} else if ('#settings-info-view' == pageId) {
me.initPageInfo();
+ } else if ('#settings-macros-view' == pageId) {
+ me.initPageMacrosSettings();
}
},
+ initPageMacrosSettings: function() {
+ var me = this,
+ $pageMacrosSettings = $('.page[data-page="settings-macros-view"] input:radio[name=macros-settings]'),
+ value = Common.Utils.InternalSettings.get("pe-mobile-macros-mode") || 0;
+ $pageMacrosSettings.single('change', _.bind(me.onChangeMacrosSettings, me));
+ $pageMacrosSettings.val([value]);
+ },
+
+ onChangeMacrosSettings: function(e) {
+ var value = parseInt($(e.currentTarget).val());
+ Common.Utils.InternalSettings.set("pe-mobile-macros-mode", value);
+ Common.localStorage.setItem("pe-mobile-macros-mode", value);
+ },
+
initPageInfo: function() {
var document = Common.SharedSettings.get('document') || {},
info = document.info || {};
diff --git a/apps/presentationeditor/mobile/app/template/Settings.template b/apps/presentationeditor/mobile/app/template/Settings.template
index aa13a05ab..20012e9a2 100644
--- a/apps/presentationeditor/mobile/app/template/Settings.template
+++ b/apps/presentationeditor/mobile/app/template/Settings.template
@@ -476,7 +476,6 @@
');
+
+ var value = Common.localStorage.getItem("sse-mobile-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("sse-mobile-macros-mode", value);
},
loadDocument: function(data) {
@@ -270,10 +278,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);
@@ -1483,6 +1497,51 @@ define([
return false;
},
+ onRunAutostartMacroses: function() {
+ var me = this,
+ enable = !this.editorConfig.customization || (this.editorConfig.customization.macros!==false);
+ if (enable) {
+ var value = Common.Utils.InternalSettings.get("sse-mobile-macros-mode");
+ if (value==1)
+ this.api.asc_runAutostartMacroses();
+ else if (value === 0) {
+ uiApp.modal({
+ title: this.notcriticalErrorTitle,
+ text: this.textHasMacros,
+ afterText: '',
+ buttons: [{
+ text: this.textYes,
+ onClick: function () {
+ var dontshow = $('input[name="checkbox-show-macros"]').prop('checked');
+ if (dontshow) {
+ Common.Utils.InternalSettings.set("sse-mobile-macros-mode", 1);
+ Common.localStorage.setItem("sse-mobile-macros-mode", 1);
+ }
+ setTimeout(function() {
+ me.api.asc_runAutostartMacroses();
+ }, 1);
+ }
+ },
+ {
+ text: this.textNo,
+ onClick: function () {
+ var dontshow = $('input[name="checkbox-show-macros"]').prop('checked');
+ if (dontshow) {
+ Common.Utils.InternalSettings.set("sse-mobile-macros-mode", 2);
+ Common.localStorage.setItem("sse-mobile-macros-mode", 2);
+ }
+ }
+ }]
+ });
+ }
+ }
+ },
+
leavePageText: 'You have unsaved changes in this document. Click \'Stay on this Page\' to await the autosave of the document. Click \'Leave this Page\' to discard all the unsaved changes.',
criticalErrorTitle: 'Error',
notcriticalErrorTitle: 'Warning',
@@ -1666,7 +1725,11 @@ define([
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.',
- errorOpensource: 'Files can be opened for viewing only. Mobile web editors are not available in the Open Source version.'
+ errorOpensource: 'Files can be opened for viewing only. Mobile web editors are not available in the Open Source version.',
+ textHasMacros: 'The file contains automatic macros. Do you want to run macros?',
+ textRemember: 'Remember my choice',
+ textYes: 'Yes',
+ textNo: 'No'
}
})(), SSE.Controllers.Main || {}))
});
\ No newline at end of file
diff --git a/apps/spreadsheeteditor/mobile/app/controller/Settings.js b/apps/spreadsheeteditor/mobile/app/controller/Settings.js
index 847826eed..dcea13ddf 100644
--- a/apps/spreadsheeteditor/mobile/app/controller/Settings.js
+++ b/apps/spreadsheeteditor/mobile/app/controller/Settings.js
@@ -258,6 +258,8 @@ define([
me.initRegSettings();
} else if ('#settings-info-view' == pageId) {
me.initPageInfo();
+ } else if ('#settings-macros-view' == pageId) {
+ me.initPageMacrosSettings();
} else {
var _userCount = SSE.getController('Main').returnUserCount();
if (_userCount > 0) {
@@ -266,6 +268,20 @@ define([
}
},
+ initPageMacrosSettings: function() {
+ var me = this,
+ $pageMacrosSettings = $('.page[data-page="settings-macros-view"] input:radio[name=macros-settings]'),
+ value = Common.Utils.InternalSettings.get("sse-mobile-macros-mode") || 0;
+ $pageMacrosSettings.single('change', _.bind(me.onChangeMacrosSettings, me));
+ $pageMacrosSettings.val([value]);
+ },
+
+ onChangeMacrosSettings: function(e) {
+ var value = parseInt($(e.currentTarget).val());
+ Common.Utils.InternalSettings.set("sse-mobile-macros-mode", value);
+ Common.localStorage.setItem("sse-mobile-macros-mode", value);
+ },
+
initPageInfo: function() {
var document = Common.SharedSettings.get('document') || {},
info = document.info || {};
diff --git a/apps/spreadsheeteditor/mobile/app/template/Settings.template b/apps/spreadsheeteditor/mobile/app/template/Settings.template
index 5b9cfd20c..fa64ef10e 100644
--- a/apps/spreadsheeteditor/mobile/app/template/Settings.template
+++ b/apps/spreadsheeteditor/mobile/app/template/Settings.template
@@ -579,6 +579,19 @@
+