diff --git a/test/documenteditor/main/js/ApplicationController.js b/test/documenteditor/main/js/ApplicationController.js index f15c0fc5d..e67f0f34e 100644 --- a/test/documenteditor/main/js/ApplicationController.js +++ b/test/documenteditor/main/js/ApplicationController.js @@ -36,7 +36,6 @@ DE.ApplicationController = new(function(){ config = {}, docConfig = {}, permissions = {}, - maxPages = 0, created = false, appOptions = {}, _submitFail, $submitedTooltip, @@ -97,10 +96,12 @@ DE.ApplicationController = new(function(){ docInfo.put_Permissions(_permissions); docInfo.put_EncryptedInfo(config.encryptionKeys); - var enable = !config.customization || (config.customization.macros!==false); + 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_putIsEnabledPlugins(!!enable);*/ var type = /^(?:(pdf|djvu|xps))$/.exec(docConfig.fileType); @@ -110,7 +111,7 @@ DE.ApplicationController = new(function(){ if (api) { api.asc_registerCallback('asc_onGetEditorPermissions', onEditorPermissions); - api.asc_registerCallback('asc_onRunAutostartMacroses', onRunAutostartMacroses); + //api.asc_registerCallback('asc_onRunAutostartMacroses', onRunAutostartMacroses); api.asc_setDocInfo(docInfo); api.asc_getEditorPermissions(config.licenseUrl, config.customerId); api.asc_enableKeyEvents(true); @@ -135,9 +136,11 @@ DE.ApplicationController = new(function(){ if ( permissions.print!==false ) api.asc_Print(new Asc.asc_CDownloadOptions(null, false)); } + function onPrintUrl(url) { common.utils.dialogPrint(url, api); } + function onDownloadUrl(url, fileType) { Common.Gateway.downloadAs(url, fileType); } @@ -153,17 +156,13 @@ DE.ApplicationController = new(function(){ var zf = (config.customization && config.customization.zoom ? parseInt(config.customization.zoom) : -2); (zf == -1) ? api.zoomFitToPage() : ((zf == -2) ? api.zoomFitToWidth() : api.zoom(zf>0 ? zf : 100)); - - api.asc_registerCallback('asc_onStartAction', onLongActionBegin); api.asc_registerCallback('asc_onEndAction', onLongActionEnd); api.asc_registerCallback('asc_onHyperlinkClick', common.utils.openLink); api.asc_registerCallback('asc_onDownloadUrl', onDownloadUrl); - api.asc_registerCallback('asc_onPrint', onPrint); + //api.asc_registerCallback('asc_onPrint', onPrint); api.asc_registerCallback('asc_onPrintUrl', onPrintUrl); - - Common.Gateway.on('processmouse', onProcessMouse); Common.Gateway.on('downloadas', onDownloadAs); Common.Gateway.on('requestclose', onRequestClose); @@ -179,17 +178,14 @@ DE.ApplicationController = new(function(){ var licType = params.asc_getLicenseType(); appOptions.canLicense = (licType === Asc.c_oLicenseResult.Success || licType === Asc.c_oLicenseResult.SuccessLimit); - //appOptions.canFillForms = appOptions.canLicense && (permissions.fillForms===true) && (config.mode !== 'view'); + appOptions.canFillForms = appOptions.canLicense && (permissions.fillForms===true) && (config.mode !== 'view'); appOptions.canSubmitForms = appOptions.canLicense && (typeof (config.customization) == 'object') && !!config.customization.submitForm; //api.asc_setViewMode(!appOptions.canFillForms); - //api.asc_setViewMode(false); - /*if (appOptions.canFillForms) {*/ - //api.asc_setRestriction(Asc.c_oAscRestrictionType.OnlyForms); - //api.asc_SetFastCollaborative(true); - api.asc_setAutoSaveGap(1); - /*}*/ + api.asc_SetFastCollaborative(true); + api.asc_setAutoSaveGap(1); + onLongActionBegin(Asc.c_oAscAsyncActionType['BlockInteraction'], LoadingDocument); api.asc_LoadDocument(); @@ -203,12 +199,13 @@ DE.ApplicationController = new(function(){ function onError(id, level, errData) { if (id == Asc.c_oAscError.ID.LoadingScriptError) { - $('#id-critical-error-title').text(me.criticalErrorTitle); + /*$('#id-critical-error-title').text(me.criticalErrorTitle); $('#id-critical-error-message').text(me.scriptLoadError); $('#id-critical-error-close').text(me.txtClose).off().on('click', function(){ window.location.reload(); }); - $('#id-critical-error-dialog').css('z-index', 20002).modal('show'); + $('#id-critical-error-dialog').css('z-index', 20002).modal('show');*/ + console.error(me.criticalErrorTitle,me.scriptLoadError); return; } @@ -257,8 +254,8 @@ DE.ApplicationController = new(function(){ case Asc.c_oAscError.ID.Submit: message = me.errorSubmit; - _submitFail = true; - $submitedTooltip && $submitedTooltip.hide(); + /*_submitFail = true; + $submitedTooltip && $submitedTooltip.hide();*/ break; case Asc.c_oAscError.ID.EditingError: @@ -284,24 +281,24 @@ DE.ApplicationController = new(function(){ // report only critical errors //Common.Gateway.reportError(id, message); console.error(id,message); - $('#id-critical-error-title').text(me.criticalErrorTitle); + /*$('#id-critical-error-title').text(me.criticalErrorTitle); $('#id-critical-error-message').html(message); $('#id-critical-error-close').text(me.txtClose).off().on('click', function(){ window.location.reload(); - }); + });*/ } else { //Common.Gateway.reportWarning(id, message); console.warn(id, message); - $('#id-critical-error-title').text(me.notcriticalErrorTitle); + /*$('#id-critical-error-title').text(me.notcriticalErrorTitle); $('#id-critical-error-message').html(message); $('#id-critical-error-close').text(me.txtClose).off().on('click', function(){ $('#id-critical-error-dialog').modal('hide'); - }); + });*/ } - $('#id-critical-error-dialog').modal('show'); + //$('#id-critical-error-dialog').modal('show'); } function onExternalMessage(error) { diff --git a/test/documenteditor/main/locale/en.json b/test/documenteditor/main/locale/en.json index 9e26dfeeb..b0642f862 100644 --- a/test/documenteditor/main/locale/en.json +++ b/test/documenteditor/main/locale/en.json @@ -1 +1,25 @@ -{} \ No newline at end of file +{ + "DE.ApplicationController.errorDefaultMessage": "Error code: %1", + "DE.ApplicationController.unknownErrorText": "Unknown error.", + "DE.ApplicationController.convertationTimeoutText": "Conversion timeout exceeded.", + "DE.ApplicationController.convertationErrorText": "Conversion failed.", + "DE.ApplicationController.downloadErrorText": "Download failed.", + "DE.ApplicationController.criticalErrorTitle": "Error", + "DE.ApplicationController.notcriticalErrorTitle": "Warning", + "DE.ApplicationController.scriptLoadError": "The connection is too slow, some of the components could not be loaded. Please reload the page.", + "DE.ApplicationController.errorFilePassProtect": "The file is password protected and cannot be opened.", + "DE.ApplicationController.errorAccessDeny": "You are trying to perform an action you do not have rights for.
Please contact your Document Server administrator.", + "DE.ApplicationController.errorUserDrop": "The file cannot be accessed right now.", + "DE.ApplicationController.unsupportedBrowserErrorText": "Your browser is not supported.", + "DE.ApplicationController.textOf": "of", + "DE.ApplicationController.downloadTextText": "Downloading spreadsheet...", + "DE.ApplicationController.waitText": "Please, wait...", + "DE.ApplicationController.textLoadingDocument": "Loading spreadsheet", + "DE.ApplicationController.txtClose": "Close", + "DE.ApplicationController.errorFileSizeExceed": "The file size exceeds the limitation set for your server.
Please contact your Document Server administrator for details.", + "DE.ApplicationController.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.", + "DE.ApplicationController.textGuest": "Guest", + "DE.ApplicationController.textAnonymous": "Anonymous", + "DE.ApplicationController.errorForceSave": "An error occurred while saving the file. Please use the 'Download as' option to save the file to your computer hard drive or try again later.", + "DE.ApplicationController.errorLoadingFont": "Fonts are not loaded.
Please contact your Document Server administrator." +} \ No newline at end of file diff --git a/test/presentationeditor/main/js/ApplicationController.js b/test/presentationeditor/main/js/ApplicationController.js index efd87a6dc..a31dd8165 100644 --- a/test/presentationeditor/main/js/ApplicationController.js +++ b/test/presentationeditor/main/js/ApplicationController.js @@ -35,27 +35,17 @@ PE.ApplicationController = new(function(){ api, config = {}, docConfig = {}, - embedConfig = {}, permissions = {}, - maxPages = 0, - created = false, - currentPage = 0, - ttOffset = [0, -10], - labelDocName; + created = false; var LoadingDocument = -256; - // Initialize analytics - // ------------------------- - -// Common.Analytics.initialize('UA-12442749-13', 'Embedded Presentation Editor'); - - - // Check browser + // Check browser // ------------------------- if (typeof isBrowserSupported !== 'undefined' && !isBrowserSupported()){ - Common.Gateway.reportError(undefined, this.unsupportedBrowserErrorText); + //Common.Gateway.reportError(undefined, this.unsupportedBrowserErrorText); + console.error(this.unsupportedBrowserErrorText); return; } @@ -68,12 +58,6 @@ PE.ApplicationController = new(function(){ function loadConfig(data) { config = $.extend(config, data.config); - embedConfig = $.extend(embedConfig, data.config.embedded); - - //common.controller.modals.init(embedConfig); - - - config.canBackToFolder = (config.canBackToFolder!==false) && config.customization && config.customization.goback && (config.customization.goback.url || config.customization.goback.requestClose && config.canRequestClose); } @@ -111,29 +95,24 @@ PE.ApplicationController = new(function(){ docInfo.put_Permissions(_permissions); docInfo.put_EncryptedInfo(config.encryptionKeys); - var enable = !config.customization || (config.customization.macros!==false); + 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_putIsEnabledPlugins(!!enable);*/ if (api) { api.asc_registerCallback('asc_onGetEditorPermissions', onEditorPermissions); - api.asc_registerCallback('asc_onRunAutostartMacroses', onRunAutostartMacroses); + //api.asc_registerCallback('asc_onRunAutostartMacroses', onRunAutostartMacroses); api.asc_setDocInfo(docInfo); api.asc_getEditorPermissions(config.licenseUrl, config.customerId); api.asc_enableKeyEvents(true); - //Common.Analytics.trackEvent('Load', 'Start'); } - - embedConfig.docTitle = docConfig.title; - //labelDocName = $('#title-doc-name'); - //labelDocName.text(embedConfig.docTitle || '') } } - - function onLongActionBegin(type, id) { var text = ''; switch (id) @@ -184,11 +163,8 @@ PE.ApplicationController = new(function(){ hidePreloader(); onLongActionEnd(Asc.c_oAscAsyncActionType['BlockInteraction'], LoadingDocument); - - - api.asc_registerCallback('asc_onDownloadUrl', onDownloadUrl); - api.asc_registerCallback('asc_onPrint', onPrint); + //api.asc_registerCallback('asc_onPrint', onPrint); api.asc_registerCallback('asc_onPrintUrl', onPrintUrl); api.asc_registerCallback('asc_onHyperlinkClick', common.utils.openLink); api.asc_registerCallback('asc_onStartAction', onLongActionBegin); @@ -201,12 +177,6 @@ PE.ApplicationController = new(function(){ Common.Gateway.on('downloadas', onDownloadAs); Common.Gateway.on('requestclose', onRequestClose); - - - - - - $('#editor_sdk').on('click', function(e) { if ( e.target.localName == 'canvas' ) { e.currentTarget.focus(); @@ -216,8 +186,6 @@ PE.ApplicationController = new(function(){ } function onEditorPermissions(params) { - - onLongActionBegin(Asc.c_oAscAsyncActionType['BlockInteraction'], LoadingDocument); api.asc_setViewMode(false); @@ -230,21 +198,21 @@ PE.ApplicationController = new(function(){ me.loadMask && me.loadMask.setTitle(me.textLoadingDocument + ': ' + common.utils.fixedDigits(Math.min(Math.round(proc*100), 100), 3, " ") + '%'); } - var isplaymode; - function onPlayStart(e) { - /*if ( !isplaymode ) { - $('#box-preview').show(); - api.StartDemonstration('id-preview', currentPage); - } else { - isplaymode == 'play' ? - api.DemonstrationPause() : api.DemonstrationPlay(); - }*/ + /* var isplaymode; + function onPlayStart(e) { + if ( !isplaymode ) { + $('#box-preview').show(); + api.StartDemonstration('id-preview', currentPage); + } else { + isplaymode == 'play' ? + api.DemonstrationPause() : api.DemonstrationPlay(); + } - /*isplaymode != 'play' ? ($('#btn-play button').addClass('pause'), isplaymode = 'play') : - ($('#btn-play button').removeClass('pause'), isplaymode = 'pause');*/ + isplaymode != 'play' ? ($('#btn-play button').addClass('pause'), isplaymode = 'play') : + ($('#btn-play button').removeClass('pause'), isplaymode = 'pause'); } - /*function onPlayStop() { + function onPlayStop() { isplaymode = undefined; $('#page-number').val(currentPage + 1); //$('#btn-play button').removeClass('pause'); @@ -355,13 +323,13 @@ PE.ApplicationController = new(function(){ function onExternalMessage(error) { if (error) { - hidePreloader(); - /*$('#id-error-mask-title').text(me.criticalErrorTitle); - $('#id-error-mask-text').text(error.msg); - $('#id-error-mask').css('display', 'block');*/ + hidePreloader(); + /*$('#id-error-mask-title').text(me.criticalErrorTitle); + $('#id-error-mask-text').text(error.msg); + $('#id-error-mask').css('display', 'block');*/ console.error(error.msg); - //Common.Analytics.trackEvent('External Error'); + //Common.Analytics.trackEvent('External Error'); } } @@ -391,7 +359,7 @@ PE.ApplicationController = new(function(){ if (api) api.asc_DownloadAs(new Asc.asc_CDownloadOptions(Asc.c_oAscFileType.PPTX, false)); } - function onRunAutostartMacroses() { + function onRunAutostartMacroses() { if (!config.customization || (config.customization.macros!==false)) if (api) api.asc_runAutostartMacroses(); } @@ -459,7 +427,6 @@ PE.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 presentation...', waitText: 'Please, wait...', textLoadingDocument: 'Loading presentation', diff --git a/test/presentationeditor/main/locale/en.json b/test/presentationeditor/main/locale/en.json index 9e26dfeeb..54a51e933 100644 --- a/test/presentationeditor/main/locale/en.json +++ b/test/presentationeditor/main/locale/en.json @@ -1 +1,24 @@ -{} \ No newline at end of file +{ + "PE.ApplicationController.errorDefaultMessage": "Error code: %1", + "PE.ApplicationController.unknownErrorText": "Unknown error.", + "PE.ApplicationController.convertationTimeoutText": "Conversion timeout exceeded.", + "PE.ApplicationController.convertationErrorText": "Conversion failed.", + "PE.ApplicationController.downloadErrorText": "Download failed.", + "PE.ApplicationController.criticalErrorTitle": "Error", + "PE.ApplicationController.notcriticalErrorTitle": "Warning", + "PE.ApplicationController.scriptLoadError": "The connection is too slow, some of the components could not be loaded. Please reload the page.", + "PE.ApplicationController.errorFilePassProtect": "The file is password protected and cannot be opened.", + "PE.ApplicationController.errorAccessDeny": "You are trying to perform an action you do not have rights for.
Please contact your Document Server administrator.", + "PE.ApplicationController.errorUserDrop": "The file cannot be accessed right now.", + "PE.ApplicationController.unsupportedBrowserErrorText": "Your browser is not supported.", + "PE.ApplicationController.downloadTextText": "Downloading presentation...", + "PE.ApplicationController.waitText": "Please, wait...", + "PE.ApplicationController.textLoadingDocument": "Loading presentation", + "PE.ApplicationController.txtClose": "Close", + "PE.ApplicationController.errorFileSizeExceed": "The file size exceeds the limitation set for your server.
Please contact your Document Server administrator for details.", + "PE.ApplicationController.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.", + "PE.ApplicationController.textGuest": "Guest", + "PE.ApplicationController.textAnonymous": "Anonymous", + "PE.ApplicationController.errorForceSave": "An error occurred while saving the file. Please use the 'Download as' option to save the file to your computer hard drive or try again later.", + "PE.ApplicationController.errorLoadingFont": "Fonts are not loaded.
Please contact your Document Server administrator." +} \ No newline at end of file diff --git a/test/spreadsheeteditor/main/js/ApplicationController.js b/test/spreadsheeteditor/main/js/ApplicationController.js index 3fb3fa43f..f88ed3af2 100644 --- a/test/spreadsheeteditor/main/js/ApplicationController.js +++ b/test/spreadsheeteditor/main/js/ApplicationController.js @@ -42,8 +42,7 @@ SSE.ApplicationController = new(function(){ iframePrint = null; var $ttEl, $tooltip, - ttOffset = [6, -15], - labelDocName; + ttOffset = [6, -15]; var LoadingDocument = -256; @@ -58,6 +57,7 @@ SSE.ApplicationController = new(function(){ if (typeof isBrowserSupported !== 'undefined' && !isBrowserSupported()){ Common.Gateway.reportError(undefined, this.unsupportedBrowserErrorText); + console.error( this.unsupportedBrowserErrorText); return; } @@ -124,10 +124,12 @@ SSE.ApplicationController = new(function(){ docInfo.put_Lang(config.lang); docInfo.put_Mode(config.mode); - var enable = !config.customization || (config.customization.macros!==false); + 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_putIsEnabledPlugins(!!enable);*/ if (api) { api.asc_registerCallback('asc_onGetEditorPermissions', onEditorPermissions); @@ -189,7 +191,7 @@ SSE.ApplicationController = new(function(){ } function onPrintUrl(url) { - //common.utils.dialogPrint(url, api); + common.utils.dialogPrint(url, api); } function hidePreloader() { @@ -203,7 +205,7 @@ SSE.ApplicationController = new(function(){ api.asc_registerCallback('asc_onHyperlinkClick', common.utils.openLink); api.asc_registerCallback('asc_onDownloadUrl', onDownloadUrl); //api.asc_registerCallback('asc_onPrint', onPrint); - //api.asc_registerCallback('asc_onPrintUrl', onPrintUrl); + api.asc_registerCallback('asc_onPrintUrl', onPrintUrl); api.asc_registerCallback('asc_onStartAction', onLongActionBegin); Common.Gateway.on('processmouse', onProcessMouse); @@ -435,7 +437,8 @@ SSE.ApplicationController = new(function(){ function onDownloadAs() { if ( permissions.download === false) { - Common.Gateway.reportError(Asc.c_oAscError.ID.AccessDeny, me.errorAccessDeny); + //Common.Gateway.reportError(Asc.c_oAscError.ID.AccessDeny, me.errorAccessDeny); + console.error(Asc.c_oAscError.ID.AccessDeny, me.errorAccessDeny); return; } api.asc_DownloadAs(new Asc.asc_CDownloadOptions(Asc.c_oAscFileType.XLSX, true)); diff --git a/test/spreadsheeteditor/main/locale/en.json b/test/spreadsheeteditor/main/locale/en.json index 9e26dfeeb..1158e19de 100644 --- a/test/spreadsheeteditor/main/locale/en.json +++ b/test/spreadsheeteditor/main/locale/en.json @@ -1 +1,25 @@ -{} \ No newline at end of file +{ + "SSE.ApplicationController.errorDefaultMessage": "Error code: %1", + "SSE.ApplicationController.unknownErrorText": "Unknown error.", + "SSE.ApplicationController.convertationTimeoutText": "Conversion timeout exceeded.", + "SSE.ApplicationController.convertationErrorText": "Conversion failed.", + "SSE.ApplicationController.downloadErrorText": "Download failed.", + "SSE.ApplicationController.criticalErrorTitle": "Error", + "SSE.ApplicationController.notcriticalErrorTitle": "Warning", + "SSE.ApplicationController.scriptLoadError": "The connection is too slow, some of the components could not be loaded. Please reload the page.", + "SSE.ApplicationController.errorFilePassProtect": "The file is password protected and cannot be opened.", + "SSE.ApplicationController.errorAccessDeny": "You are trying to perform an action you do not have rights for.
Please contact your Document Server administrator.", + "SSE.ApplicationController.errorUserDrop": "The file cannot be accessed right now.", + "SSE.ApplicationController.unsupportedBrowserErrorText": "Your browser is not supported.", + "SSE.ApplicationController.textOf": "of", + "SSE.ApplicationController.downloadTextText": "Downloading spreadsheet...", + "SSE.ApplicationController.waitText": "Please, wait...", + "SSE.ApplicationController.textLoadingDocument": "Loading spreadsheet", + "SSE.ApplicationController.txtClose": "Close", + "SSE.ApplicationController.errorFileSizeExceed": "The file size exceeds the limitation set for your server.
Please contact your Document Server administrator for details.", + "SSE.ApplicationController.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.", + "SSE.ApplicationController.textGuest": "Guest", + "SSE.ApplicationController.textAnonymous": "Anonymous", + "SSE.ApplicationController.errorForceSave": "An error occurred while saving the file. Please use the 'Download as' option to save the file to your computer hard drive or try again later.", + "SSE.ApplicationController.errorLoadingFont": "Fonts are not loaded.
Please contact your Document Server administrator." + } \ No newline at end of file diff --git a/test/unit-tests/common/main/lib/controller/CellEditor.js b/test/unit-tests/common/main/lib/controller/CellEditor.js index 544ae9d69..ad2b29953 100644 --- a/test/unit-tests/common/main/lib/controller/CellEditor.js +++ b/test/unit-tests/common/main/lib/controller/CellEditor.js @@ -70,28 +70,18 @@ common.controller.CellEditor = new(function(){ api.isCEditorFocused = true; } + function onLayoutResize(o, r) { + if (r == 'cell:edit') { + o && common.localStorage.setBool('sse-celleditor-expand', false); + } + } + function events() { editor.$el.find('#ce-cell-name').on( 'keyup', onCellName); editor.$el.find('textarea#ce-cell-content').on( 'keyup', onKeyupCellEditor); editor.$el.find('textarea#ce-cell-content').on('blur', onBlurCellEditor); } - function createController() { - me = this; - if (created) - return me; - - created = true; - onLaunch(); - return me; - } - - function onLayoutResize(o, r) { - if (r == 'cell:edit') { - o && common.localStorage.setBool('sse-celleditor-expand', false); - } - } - function onLaunch(){ common.view.CellEditor.create(); editor = common.view.CellEditor; @@ -108,6 +98,15 @@ common.controller.CellEditor = new(function(){ this.namedrange_locked = false; } + function createController() { + me = this; + if (created) return me; + + created = true; + onLaunch(); + return me; + } + function onApiCellSelection(info){ editor.cell.updateInfo(info); } @@ -131,16 +130,6 @@ common.controller.CellEditor = new(function(){ this.namedrange_locked = (state == Asc.c_oAscDefinedNameReason.LockDefNameManager); } - function onInputKeyDown(e) { - /*if (common.ui.Keys.UP === e.keyCode || common.ui.Keys.DOWN === e.keyCode || - common.ui.Keys.TAB === e.keyCode || common.ui.Keys.RETURN === e.keyCode || common.ui.Keys.ESC === e.keyCode || - common.ui.Keys.LEFT === e.keyCode || common.ui.Keys.RIGHT === e.keyCode) { - var menu = $('#menu-formula-selection'); // for formula menu - if (menu.hasClass('open')) - menu.find('.dropdown-menu').trigger('keydown', e); - }*/ - } - function onApiDisconnect() { mode.isEdit = false; } @@ -153,7 +142,6 @@ common.controller.CellEditor = new(function(){ api.asc_registerCallback('asc_onEditCell', onApiEditCell); api.asc_registerCallback('asc_onCoAuthoringDisconnect', onApiDisconnect); api.asc_registerCallback('asc_onLockDefNameManager', onLockDefNameManager); - api.asc_registerCallback('asc_onInputKeyDown', onInputKeyDown); } function onApiSelectionChanged(info) { diff --git a/test/unit-tests/common/main/lib/view/CellEditor.js b/test/unit-tests/common/main/lib/view/CellEditor.js index 5e9cc970d..413eaf523 100644 --- a/test/unit-tests/common/main/lib/view/CellEditor.js +++ b/test/unit-tests/common/main/lib/view/CellEditor.js @@ -52,15 +52,17 @@ common.view.CellEditor = new(function (){ txt.scrollLeft = txt.scrollWidth; }); } + function updateCellInfo(info) { if (info) { me.$cellname.val(typeof(info)=='string' ? info : info.asc_getName()); } } + function cellNameDisabled(disabled){ (disabled) ? me.$cellname.attr('disabled', 'disabled') : me.$cellname.removeAttr('disabled'); - //this.btnNamedRanges.setDisabled(disabled); } + return { create: createView, cell: {