From acb4d52781382ae54f6e892290860cfc134e0b0f Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Wed, 23 Jun 2021 18:49:47 +0300 Subject: [PATCH] [SSE] Edit protected range --- .../main/app/controller/Main.js | 33 +++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/apps/spreadsheeteditor/main/app/controller/Main.js b/apps/spreadsheeteditor/main/app/controller/Main.js index e874bb100..ad4b37ef1 100644 --- a/apps/spreadsheeteditor/main/app/controller/Main.js +++ b/apps/spreadsheeteditor/main/app/controller/Main.js @@ -2009,7 +2009,7 @@ define([ } }, - onConfirmAction: function(id, apiCallback) { + onConfirmAction: function(id, apiCallback, data) { var me = this; if (id == Asc.c_oAscConfirm.ConfirmReplaceRange || id == Asc.c_oAscConfirm.ConfirmReplaceFormulaInTable) { Common.UI.warning({ @@ -2040,6 +2040,31 @@ define([ me.onEditComplete(me.application.getController('DocumentHolder').getView('DocumentHolder')); }, this) }); + } else if (id == Asc.c_oAscConfirm.ConfirmChangeProtectRange) { + var win = new Common.Views.OpenDialog({ + title: this.txtUnlockRange, + closable: true, + type: Common.Utils.importTextType.DRM, + warning: true, + warningMsg: this.txtUnlockRangeWarning, + txtOpenFile: this.txtUnlockRangeDescription, + validatePwd: false, + buttons: [ + { + value: 'ok', + caption: this.txtUnlock + }, 'cancel'], + primary: 'ok', + handler: function (result, value) { + if (result == 'ok') { + if (me.api) { + me.api.asc_checkProtectedRangesPassword(value, data); + } + me.onEditComplete(me.application.getController('DocumentHolder').getView('DocumentHolder')); + } + } + }); + win.show(); } }, @@ -2957,7 +2982,11 @@ define([ txtQuarter: 'Qtr', txtOr: '%1 or %2', confirmReplaceFormulaInTable: 'Formulas in the header row will be removed and converted to static text.
Do you want to continue?', - errorChangeOnProtectedSheet: 'The cell or chart you are trying to change is on a protected sheet.
To make a change, unprotect the sheet. You might be requested to enter a password.' + errorChangeOnProtectedSheet: 'The cell or chart you are trying to change is on a protected sheet.
To make a change, unprotect the sheet. You might be requested to enter a password.', + txtUnlockRange: 'Unlock Range', + txtUnlockRangeWarning: 'A range you are trying to change is password protected.', + txtUnlockRangeDescription: 'Enter the password to change this range:', + txtUnlock: 'Unlock' } })(), SSE.Controllers.Main || {})) });