From ae09b32f5662dc008289b852e234bb9ccc432cad Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Sat, 28 Apr 2018 14:13:52 +0300 Subject: [PATCH] [Desktop] Don't show warning when open password-protected offline file --- apps/common/main/lib/view/OpenDialog.js | 15 ++++++++++++--- apps/documenteditor/main/app/controller/Main.js | 1 + .../main/app/controller/Main.js | 1 + .../spreadsheeteditor/main/app/controller/Main.js | 1 + 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/apps/common/main/lib/view/OpenDialog.js b/apps/common/main/lib/view/OpenDialog.js index a6b01b5ee..bf71587ca 100644 --- a/apps/common/main/lib/view/OpenDialog.js +++ b/apps/common/main/lib/view/OpenDialog.js @@ -55,10 +55,11 @@ define([ _.extend(_options, { closable : false, - width : (options.preview) ? 414 : ((options.type == Asc.c_oAscAdvancedOptionsID.DRM) ? 370 : 262), - height : (options.preview) ? 277 : ((options.type == Asc.c_oAscAdvancedOptionsID.CSV) ? 190 : 187), - header : true, preview : options.preview, + warning : options.warning, + width : (options.preview) ? 414 : ((options.type == Asc.c_oAscAdvancedOptionsID.DRM && options.warning) ? 370 : 262), + height : (options.preview) ? 277 : ((options.type == Asc.c_oAscAdvancedOptionsID.CSV) ? 190 : (options.warning ? 187 : 147)), + header : true, cls : 'open-dlg', contentTemplate : '', title : (options.type == Asc.c_oAscAdvancedOptionsID.DRM) ? t.txtTitleProtected : t.txtTitle.replace('%1', (options.type == Asc.c_oAscAdvancedOptionsID.CSV) ? 'CSV' : 'TXT'), @@ -70,12 +71,19 @@ define([ '
', '
', '<% if (type == Asc.c_oAscAdvancedOptionsID.DRM) { %>', + '<% if (warning) { %>', '
', '
', '
' + t.txtProtected+ '
', '', '
', '
', + '<% } else { %>', + '
', + '', + '
', + '
', + '<% } %>', '<% } else { %>', '
', '', @@ -120,6 +128,7 @@ define([ this.handler = _options.handler; this.type = _options.type; this.preview = _options.preview; + this.warning = _options.warning || false; this.closable = _options.closable; this.codepages = _options.codepages; this.settings = _options.settings; diff --git a/apps/documenteditor/main/app/controller/Main.js b/apps/documenteditor/main/app/controller/Main.js index b9190fa12..1ccb0a5de 100644 --- a/apps/documenteditor/main/app/controller/Main.js +++ b/apps/documenteditor/main/app/controller/Main.js @@ -1857,6 +1857,7 @@ define([ me._state.openDlg = new Common.Views.OpenDialog({ closable: me.appOptions.canRequestClose, type: type, + warning: !(me.appOptions.isDesktopApp && me.appOptions.isOffline), validatePwd: !!me._state.isDRM, handler: function (result, value) { me.isShowOpenDialog = false; diff --git a/apps/presentationeditor/main/app/controller/Main.js b/apps/presentationeditor/main/app/controller/Main.js index 1eca64551..c872fd5f7 100644 --- a/apps/presentationeditor/main/app/controller/Main.js +++ b/apps/presentationeditor/main/app/controller/Main.js @@ -1712,6 +1712,7 @@ define([ me._state.openDlg = new Common.Views.OpenDialog({ closable: me.appOptions.canRequestClose, type: type, + warning: !(me.appOptions.isDesktopApp && me.appOptions.isOffline), validatePwd: !!me._state.isDRM, handler: function (result, value) { me.isShowOpenDialog = false; diff --git a/apps/spreadsheeteditor/main/app/controller/Main.js b/apps/spreadsheeteditor/main/app/controller/Main.js index 3cdc62dc5..653f2a13b 100644 --- a/apps/spreadsheeteditor/main/app/controller/Main.js +++ b/apps/spreadsheeteditor/main/app/controller/Main.js @@ -1537,6 +1537,7 @@ define([ me._state.openDlg = new Common.Views.OpenDialog({ closable: me.appOptions.canRequestClose, type: type, + warning: !(me.appOptions.isDesktopApp && me.appOptions.isOffline), validatePwd: !!me._state.isDRM, handler: function (result, value) { me.isShowOpenDialog = false;