diff --git a/apps/documenteditor/main/resources/less/app.less b/apps/documenteditor/main/resources/less/app.less index 04cf4099b6..54e4f6f2a0 100644 --- a/apps/documenteditor/main/resources/less/app.less +++ b/apps/documenteditor/main/resources/less/app.less @@ -86,6 +86,7 @@ @import "../../../../common/main/resources/less/combobox.less"; @import "../../../../common/main/resources/less/window.less"; @import "../../../../common/main/resources/less/spinner.less"; +@import "../../../../common/main/resources/less/loadmask.less"; @import "../../../../common/main/resources/less/checkbox.less"; @import "../../../../common/main/resources/less/radiobox.less"; @import "../../../../common/main/resources/less/dataview.less"; diff --git a/apps/presentationeditor/main/resources/less/app.less b/apps/presentationeditor/main/resources/less/app.less index aa030154a1..8a80c847c8 100644 --- a/apps/presentationeditor/main/resources/less/app.less +++ b/apps/presentationeditor/main/resources/less/app.less @@ -86,6 +86,7 @@ @import "../../../../common/main/resources/less/combobox.less"; @import "../../../../common/main/resources/less/window.less"; @import "../../../../common/main/resources/less/spinner.less"; +@import "../../../../common/main/resources/less/loadmask.less"; @import "../../../../common/main/resources/less/checkbox.less"; @import "../../../../common/main/resources/less/radiobox.less"; @import "../../../../common/main/resources/less/dataview.less"; diff --git a/apps/spreadsheeteditor/main/resources/less/app.less b/apps/spreadsheeteditor/main/resources/less/app.less index 9d4fc911f8..8244ff99a2 100644 --- a/apps/spreadsheeteditor/main/resources/less/app.less +++ b/apps/spreadsheeteditor/main/resources/less/app.less @@ -86,6 +86,7 @@ @import "../../../../common/main/resources/less/combobox.less"; @import "../../../../common/main/resources/less/window.less"; @import "../../../../common/main/resources/less/spinner.less"; +@import "../../../../common/main/resources/less/loadmask.less"; @import "../../../../common/main/resources/less/checkbox.less"; @import "../../../../common/main/resources/less/radiobox.less"; @import "../../../../common/main/resources/less/dataview.less"; diff --git a/test/documenteditor/main/js/ApplicationController.js b/test/documenteditor/main/js/ApplicationController.js index 718bbd6d5e..d704f28d8a 100644 --- a/test/documenteditor/main/js/ApplicationController.js +++ b/test/documenteditor/main/js/ApplicationController.js @@ -94,12 +94,8 @@ DE.ApplicationController = new(function(){ docInfo.put_Permissions(_permissions); docInfo.put_EncryptedInfo(config.encryptionKeys); - docInfo.asc_putIsEnabledMacroses(false); - docInfo.asc_putIsEnabledPlugins(false); - /* var enable = !config.customization || (config.customization.macros!==false); - docInfo.asc_putIsEnabledMacroses(!!enable); - enable = !config.customization || (config.customization.plugins!==false); - docInfo.asc_putIsEnabledPlugins(!!enable);*/ + docInfo.asc_putIsEnabledMacroses(true); + docInfo.asc_putIsEnabledPlugins(true); var type = /^(?:(pdf|djvu|xps))$/.exec(docConfig.fileType); @@ -137,12 +133,10 @@ DE.ApplicationController = new(function(){ api.asc_registerCallback('asc_onStartAction', onLongActionBegin); api.asc_registerCallback('asc_onEndAction', onLongActionEnd); - //Common.Gateway.on('processmouse', onProcessMouse); - //Common.Gateway.on('downloadas', onDownloadAs); + Common.Gateway.on('processmouse', onProcessMouse); + Common.Gateway.on('downloadas', onDownloadAs); Common.Gateway.on('requestclose', onRequestClose); - /*var downloadAs = function(format){ - api.asc_DownloadAs(new Asc.asc_CDownloadOptions(format)); - };*/ + // TODO: add asc_hasRequiredFields to sdk Common.Gateway.documentReady(); @@ -279,8 +273,6 @@ DE.ApplicationController = new(function(){ function onBeforeUnload () { common.localStorage.save(); } - // Helpers - // ------------------------- function onDocumentResize() { api && api.Resize(); @@ -314,7 +306,6 @@ DE.ApplicationController = new(function(){ if (api){ api.asc_registerCallback('asc_onError', onError); api.asc_registerCallback('asc_onDocumentContentReady', onDocumentContentReady); - //api.asc_registerCallback('asc_onOpenDocumentProgress', onOpenDocument); // Initialize api gateway Common.Gateway.on('init', loadConfig); @@ -334,14 +325,11 @@ DE.ApplicationController = new(function(){ convertationErrorText : 'Conversion failed.', downloadErrorText : 'Download failed.', criticalErrorTitle : 'Error', - notcriticalErrorTitle : 'Warning', scriptLoadError: 'The connection is too slow, some of the components could not be loaded. Please reload the page.', errorFilePassProtect: 'The file is password protected and cannot be opened.', errorAccessDeny: 'You are trying to perform an action you do not have rights for.
Please contact your Document Server administrator.', errorUserDrop: 'The file cannot be accessed right now.', unsupportedBrowserErrorText: 'Your browser is not supported.', - textLoadingDocument: 'Loading document', - txtClose: 'Close', 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.', errorSubmit: 'Submit failed.', diff --git a/test/presentationeditor/main/js/ApplicationController.js b/test/presentationeditor/main/js/ApplicationController.js index 38bf3bf32e..bcd50030c3 100644 --- a/test/presentationeditor/main/js/ApplicationController.js +++ b/test/presentationeditor/main/js/ApplicationController.js @@ -92,6 +92,9 @@ PE.ApplicationController = new(function(){ docInfo.put_Permissions(_permissions); docInfo.put_EncryptedInfo(config.encryptionKeys); + docInfo.asc_putIsEnabledMacroses(true); + docInfo.asc_putIsEnabledPlugins(true); + if (api) { api.asc_registerCallback('asc_onGetEditorPermissions', onEditorPermissions); api.asc_setDocInfo(docInfo); @@ -122,8 +125,8 @@ PE.ApplicationController = new(function(){ api.asc_registerCallback('asc_onStartAction', onLongActionBegin); api.asc_registerCallback('asc_onEndAction', onLongActionEnd); - //Common.Gateway.on('processmouse', onProcessMouse); - //Common.Gateway.on('downloadas', onDownloadAs); + Common.Gateway.on('processmouse', onProcessMouse); + Common.Gateway.on('downloadas', onDownloadAs); Common.Gateway.on('requestclose', onRequestClose); $('#editor_sdk').on('click', function(e) { diff --git a/test/spreadsheeteditor/main/js/ApplicationController.js b/test/spreadsheeteditor/main/js/ApplicationController.js index 1fc2739ef1..dca9bf1167 100644 --- a/test/spreadsheeteditor/main/js/ApplicationController.js +++ b/test/spreadsheeteditor/main/js/ApplicationController.js @@ -41,12 +41,6 @@ SSE.ApplicationController = new(function(){ var LoadingDocument = -256; - // Initialize analytics - // ------------------------- - -// Common.Analytics.initialize('UA-12442749-13', 'Embedded Spreadsheet Editor'); - - // Check browser // ------------------------- @@ -64,8 +58,6 @@ SSE.ApplicationController = new(function(){ function loadConfig(data) { config = $.extend(config, data.config); - /*config.canBackToFolder = (config.canBackToFolder!==false) && config.customization && config.customization.goback && - (config.customization.goback.url || config.customization.goback.requestClose && config.canRequestClose);*/ } function loadDocument(data) { @@ -103,6 +95,9 @@ SSE.ApplicationController = new(function(){ docInfo.put_Lang(config.lang); docInfo.put_Mode(config.mode); + docInfo.asc_putIsEnabledMacroses(true); + docInfo.asc_putIsEnabledPlugins(true); + if (api) { api.asc_registerCallback('asc_onGetEditorPermissions', onEditorPermissions); api.asc_setDocInfo(docInfo); @@ -152,8 +147,8 @@ SSE.ApplicationController = new(function(){ onLongActionEnd(Asc.c_oAscAsyncActionType['BlockInteraction'], LoadingDocument); api.asc_registerCallback('asc_onStartAction', onLongActionBegin); - //Common.Gateway.on('processmouse', onProcessMouse); - //Common.Gateway.on('downloadas', onDownloadAs); + Common.Gateway.on('processmouse', onProcessMouse); + Common.Gateway.on('downloadas', onDownloadAs); Common.Gateway.on('requestclose', onRequestClose); @@ -295,6 +290,14 @@ SSE.ApplicationController = new(function(){ } } + function onDownloadAs() { + if ( permissions.download === false) { + console.error(Asc.c_oAscError.ID.AccessDeny, me.errorAccessDeny); + return; + } + api.asc_DownloadAs(new Asc.asc_CDownloadOptions(Asc.c_oAscFileType.XLSX, true)); + } + function onRequestClose() { Common.Gateway.requestClose(); } @@ -373,11 +376,6 @@ SSE.ApplicationController = new(function(){ errorAccessDeny: 'You are trying to perform an action you do not have rights for.
Please contact your Document Server administrator.', errorUserDrop: 'The file cannot be accessed right now.', unsupportedBrowserErrorText: 'Your browser is not supported.', - textOf: 'of', - downloadTextText: 'Downloading spreadsheet...', - waitText: 'Please, wait...', - textLoadingDocument: 'Loading spreadsheet', - txtClose: 'Close', 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.', textGuest: 'Guest',