From bc20db597bc796ba2d61c7afa047189334dbc888 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Fri, 3 Sep 2021 14:39:20 +0300 Subject: [PATCH] Fix Bug 44992 --- .../main/app/view/DocumentHolder.js | 17 ++++++++++++++--- apps/documenteditor/main/locale/en.json | 1 + .../main/app/view/DocumentHolder.js | 17 ++++++++++++++--- apps/presentationeditor/main/locale/en.json | 1 + .../main/app/controller/DocumentHolder.js | 19 +++++++++++++------ apps/spreadsheeteditor/main/locale/en.json | 1 + 6 files changed, 44 insertions(+), 12 deletions(-) diff --git a/apps/documenteditor/main/app/view/DocumentHolder.js b/apps/documenteditor/main/app/view/DocumentHolder.js index 2eae506fd..01e9ac917 100644 --- a/apps/documenteditor/main/app/view/DocumentHolder.js +++ b/apps/documenteditor/main/app/view/DocumentHolder.js @@ -443,8 +443,18 @@ define([ }); var onHyperlinkClick = function(url) { - if (url /*&& me.api.asc_getUrlType(url)>0*/) { - window.open(url); + if (url) { + if (me.api.asc_getUrlType(url)>0) + window.open(url); + else + Common.UI.warning({ + msg: me.txtWarnUrl, + buttons: ['yes', 'no'], + primary: 'yes', + callback: function(btn) { + (btn == 'yes') && window.open(url); + } + }); } }; @@ -4660,7 +4670,8 @@ define([ textRemPicture: 'Remove Image', textRemField: 'Remove Text Field', txtRemoveWarning: 'Do you want to remove this signature?
It can\'t be undone.', - notcriticalErrorTitle: 'Warning' + notcriticalErrorTitle: 'Warning', + txtWarnUrl: 'Clicking this link can be harmful to your device and data.
Are you sure you want to continue?' }, DE.Views.DocumentHolder || {})); }); \ No newline at end of file diff --git a/apps/documenteditor/main/locale/en.json b/apps/documenteditor/main/locale/en.json index c7053b371..1a50ea0b2 100644 --- a/apps/documenteditor/main/locale/en.json +++ b/apps/documenteditor/main/locale/en.json @@ -1591,6 +1591,7 @@ "DE.Views.DocumentHolder.txtUngroup": "Ungroup", "DE.Views.DocumentHolder.updateStyleText": "Update %1 style", "DE.Views.DocumentHolder.vertAlignText": "Vertical Alignment", + "DE.Views.DocumentHolder.txtWarnUrl": "Clicking this link can be harmful to your device and data.
Are you sure you want to continue?", "DE.Views.DropcapSettingsAdvanced.strBorders": "Borders & Fill", "DE.Views.DropcapSettingsAdvanced.strDropcap": "Drop Cap", "DE.Views.DropcapSettingsAdvanced.strMargins": "Margins", diff --git a/apps/presentationeditor/main/app/view/DocumentHolder.js b/apps/presentationeditor/main/app/view/DocumentHolder.js index e120004d1..063930144 100644 --- a/apps/presentationeditor/main/app/view/DocumentHolder.js +++ b/apps/presentationeditor/main/app/view/DocumentHolder.js @@ -443,8 +443,18 @@ define([ }); var onHyperlinkClick = function(url) { - if (url /*&& me.api.asc_getUrlType(url)>0*/) { - window.open(url); + if (url) { + if (me.api.asc_getUrlType(url)>0) + window.open(url); + else + Common.UI.warning({ + msg: me.txtWarnUrl, + buttons: ['yes', 'no'], + primary: 'yes', + callback: function(btn) { + (btn == 'yes') && window.open(url); + } + }); } }; @@ -3954,7 +3964,8 @@ define([ addToLayoutText: 'Add to Layout', txtResetLayout: 'Reset Slide', mniCustomTable: 'Insert Custom Table', - textFromStorage: 'From Storage' + textFromStorage: 'From Storage', + txtWarnUrl: 'Clicking this link can be harmful to your device and data.
Are you sure you want to continue?' }, PE.Views.DocumentHolder || {})); }); \ No newline at end of file diff --git a/apps/presentationeditor/main/locale/en.json b/apps/presentationeditor/main/locale/en.json index bdbe2ea6d..3fb5f21c2 100644 --- a/apps/presentationeditor/main/locale/en.json +++ b/apps/presentationeditor/main/locale/en.json @@ -1281,6 +1281,7 @@ "PE.Views.DocumentHolder.txtUnderbar": "Bar under text", "PE.Views.DocumentHolder.txtUngroup": "Ungroup", "PE.Views.DocumentHolder.vertAlignText": "Vertical Alignment", + "PE.Views.DocumentHolder.txtWarnUrl": "Clicking this link can be harmful to your device and data.
Are you sure you want to continue?", "PE.Views.DocumentPreview.goToSlideText": "Go to Slide", "PE.Views.DocumentPreview.slideIndexText": "Slide {0} of {1}", "PE.Views.DocumentPreview.txtClose": "Close slideshow", diff --git a/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js b/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js index 3385327c8..15a11225c 100644 --- a/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js +++ b/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js @@ -1523,11 +1523,17 @@ define([ }); return; } - // if (this.api.asc_getUrlType(url)>0) { - var newDocumentPage = window.open(url, '_blank'); - if (newDocumentPage) - newDocumentPage.focus(); - // } + if (this.api.asc_getUrlType(url)>0) + window.open(url, '_blank'); + else + Common.UI.warning({ + msg: this.txtWarnUrl, + buttons: ['yes', 'no'], + primary: 'yes', + callback: function(btn) { + (btn == 'yes') && window.open(url, '_blank'); + } + }); }, onApiAutofilter: function(config) { @@ -3957,7 +3963,8 @@ define([ textStopExpand: 'Stop automatically expanding tables', textAutoCorrectSettings: 'AutoCorrect options', txtLockSort: 'Data is found next to your selection, but you do not have sufficient permissions to change those cells.
Do you wish to continue with the current selection?', - txtRemoveWarning: 'Do you want to remove this signature?
It can\'t be undone.' + txtRemoveWarning: 'Do you want to remove this signature?
It can\'t be undone.', + txtWarnUrl: 'Clicking this link can be harmful to your device and data.
Are you sure you want to continue?' }, SSE.Controllers.DocumentHolder || {})); }); \ No newline at end of file diff --git a/apps/spreadsheeteditor/main/locale/en.json b/apps/spreadsheeteditor/main/locale/en.json index 4757f0849..6b7cd7272 100644 --- a/apps/spreadsheeteditor/main/locale/en.json +++ b/apps/spreadsheeteditor/main/locale/en.json @@ -587,6 +587,7 @@ "SSE.Controllers.DocumentHolder.txtUndoExpansion": "Undo table autoexpansion", "SSE.Controllers.DocumentHolder.txtUseTextImport": "Use text import wizard", "SSE.Controllers.DocumentHolder.txtWidth": "Width", + "SSE.Controllers.DocumentHolder.txtWarnUrl": "Clicking this link can be harmful to your device and data.
Are you sure you want to continue?", "SSE.Controllers.FormulaDialog.sCategoryAll": "All", "SSE.Controllers.FormulaDialog.sCategoryCube": "Cube", "SSE.Controllers.FormulaDialog.sCategoryDatabase": "Database",