From a6eb0b90d3097107162bfc238b95652b414f0e0f Mon Sep 17 00:00:00 2001 From: Julia Svinareva Date: Thu, 19 Mar 2020 14:52:52 +0300 Subject: [PATCH 1/2] [mobile] Bug 44415 (add checkbox) --- .../mobile/app/controller/DocumentHolder.js | 75 +++++++++++++++---- apps/documenteditor/mobile/locale/en.json | 3 +- .../mobile/app/controller/DocumentHolder.js | 75 +++++++++++++++---- apps/presentationeditor/mobile/locale/en.json | 3 +- .../mobile/app/controller/DocumentHolder.js | 74 ++++++++++++++---- apps/spreadsheeteditor/mobile/locale/en.json | 3 +- 6 files changed, 182 insertions(+), 51 deletions(-) diff --git a/apps/documenteditor/mobile/app/controller/DocumentHolder.js b/apps/documenteditor/mobile/app/controller/DocumentHolder.js index 85189d4cc..fb4985cac 100644 --- a/apps/documenteditor/mobile/app/controller/DocumentHolder.js +++ b/apps/documenteditor/mobile/app/controller/DocumentHolder.js @@ -121,31 +121,73 @@ define([ var res = me.api.Cut(); if (!res) { _view.hideMenu(); - uiApp.modal({ - title: me.textCopyCutPasteActions, - text : me.errorCopyCutPaste, - buttons: [{text: 'OK'}] - }); + if (!Common.localStorage.getBool("de-hide-copy-cut-paste-warning")) { + uiApp.modal({ + title: me.textCopyCutPasteActions, + text: me.errorCopyCutPaste, + afterText: '', + buttons: [{ + text: 'OK', + onClick: function () { + var dontshow = $('input[name="checkbox-show-cut"]').prop('checked'); + if (dontshow) Common.localStorage.setItem("de-hide-copy-cut-paste-warning", 1); + } + }] + }); + } } } else if ('copy' == eventName) { var res = me.api.Copy(); if (!res) { _view.hideMenu(); - uiApp.modal({ - title: me.textCopyCutPasteActions, - text : me.errorCopyCutPaste, - buttons: [{text: 'OK'}] - }); + if (!Common.localStorage.getBool("de-hide-copy-cut-paste-warning")) { + uiApp.modal({ + title: me.textCopyCutPasteActions, + text: me.errorCopyCutPaste, + afterText: '', + buttons: [{ + text: 'OK', + onClick: function () { + var dontshow = $('input[name="checkbox-show-copy"]').prop('checked'); + if (dontshow) Common.localStorage.setItem("de-hide-copy-cut-paste-warning", 1); + } + }] + }); + } } } else if ('paste' == eventName) { var res = me.api.Paste(); if (!res) { _view.hideMenu(); - uiApp.modal({ - title: me.textCopyCutPasteActions, - text: me.errorCopyCutPaste, - buttons: [{text: 'OK'}] - }); + if (!Common.localStorage.getBool("de-hide-copy-cut-paste-warning")) { + uiApp.modal({ + title: me.textCopyCutPasteActions, + text: me.errorCopyCutPaste, + afterText: '', + buttons: [{ + text: 'OK', + onClick: function () { + var dontshow = $('input[name="checkbox-show-paste"]').prop('checked'); + if (dontshow) Common.localStorage.setItem("de-hide-copy-cut-paste-warning", 1); + } + }] + }); + } } } else if ('merge' == eventName) { me.api.MergeCells(); @@ -585,7 +627,8 @@ define([ menuDeleteTable: 'Delete Table', menuReviewChange: 'Review Change', textCopyCutPasteActions: 'Copy, Cut and Paste Actions', - errorCopyCutPaste: 'Copy, cut and paste actions using the context menu will be performed within the current file only. You cannot copy or paste to or from other applications.' + errorCopyCutPaste: 'Copy, cut and paste actions using the context menu will be performed within the current file only.', + textDoNotShowAgain: 'Don\'t show again' } })(), DE.Controllers.DocumentHolder || {})) }); \ No newline at end of file diff --git a/apps/documenteditor/mobile/locale/en.json b/apps/documenteditor/mobile/locale/en.json index c823d9ccc..eff00933f 100644 --- a/apps/documenteditor/mobile/locale/en.json +++ b/apps/documenteditor/mobile/locale/en.json @@ -90,7 +90,8 @@ "DE.Controllers.AddTable.textColumns": "Columns", "DE.Controllers.AddTable.textRows": "Rows", "DE.Controllers.AddTable.textTableSize": "Table Size", - "DE.Controllers.DocumentHolder.errorCopyCutPaste": "Copy, cut and paste actions using the context menu will be performed within the current file only. You cannot copy or paste to or from other applications.", + "DE.Controllers.DocumentHolder.errorCopyCutPaste": "Copy, cut and paste actions using the context menu will be performed within the current file only.", + "DE.Controllers.DocumentHolder.textDoNotShowAgain": "Don\'t show again", "DE.Controllers.DocumentHolder.menuAddLink": "Add Link", "DE.Controllers.DocumentHolder.menuCopy": "Copy", "DE.Controllers.DocumentHolder.menuCut": "Cut", diff --git a/apps/presentationeditor/mobile/app/controller/DocumentHolder.js b/apps/presentationeditor/mobile/app/controller/DocumentHolder.js index 9f629e27d..2a565a4b9 100644 --- a/apps/presentationeditor/mobile/app/controller/DocumentHolder.js +++ b/apps/presentationeditor/mobile/app/controller/DocumentHolder.js @@ -107,31 +107,73 @@ define([ var res = me.api.Cut(); if (!res) { _view.hideMenu(); - uiApp.modal({ - title: me.textCopyCutPasteActions, - text : me.errorCopyCutPaste, - buttons: [{text: 'OK'}] - }); + if (!Common.localStorage.getBool("pe-hide-copy-cut-paste-warning")) { + uiApp.modal({ + title: me.textCopyCutPasteActions, + text: me.errorCopyCutPaste, + afterText: '', + buttons: [{ + text: 'OK', + onClick: function () { + var dontshow = $('input[name="checkbox-show-cut"]').prop('checked'); + if (dontshow) Common.localStorage.setItem("pe-hide-copy-cut-paste-warning", 1); + } + }] + }); + } } } else if ('copy' == eventName) { var res = me.api.Copy(); if (!res) { _view.hideMenu(); - uiApp.modal({ - title: me.textCopyCutPasteActions, - text : me.errorCopyCutPaste, - buttons: [{text: 'OK'}] - }); + if (!Common.localStorage.getBool("pe-hide-copy-cut-paste-warning")) { + uiApp.modal({ + title: me.textCopyCutPasteActions, + text: me.errorCopyCutPaste, + afterText: '', + buttons: [{ + text: 'OK', + onClick: function () { + var dontshow = $('input[name="checkbox-show-copy"]').prop('checked'); + if (dontshow) Common.localStorage.setItem("pe-hide-copy-cut-paste-warning", 1); + } + }] + }); + } } } else if ('paste' == eventName) { var res = me.api.Paste(); if (!res) { _view.hideMenu(); - uiApp.modal({ - title: me.textCopyCutPasteActions, - text: me.errorCopyCutPaste, - buttons: [{text: 'OK'}] - }); + if (!Common.localStorage.getBool("pe-hide-copy-cut-paste-warning")) { + uiApp.modal({ + title: me.textCopyCutPasteActions, + text: me.errorCopyCutPaste, + afterText: '', + buttons: [{ + text: 'OK', + onClick: function () { + var dontshow = $('input[name="checkbox-show-paste"]').prop('checked'); + if (dontshow) Common.localStorage.setItem("pe-hide-copy-cut-paste-warning", 1); + } + }] + }); + } } } else if ('delete' == eventName) { me.api.asc_Remove(); @@ -355,7 +397,8 @@ define([ menuMore: 'More', sheetCancel: 'Cancel', textCopyCutPasteActions: 'Copy, Cut and Paste Actions', - errorCopyCutPaste: 'Copy, cut and paste actions using the context menu will be performed within the current file only. You cannot copy or paste to or from other applications.' + errorCopyCutPaste: 'Copy, cut and paste actions using the context menu will be performed within the current file only.', + textDoNotShowAgain: 'Don\'t show again' } })(), PE.Controllers.DocumentHolder || {})) }); \ No newline at end of file diff --git a/apps/presentationeditor/mobile/locale/en.json b/apps/presentationeditor/mobile/locale/en.json index b1a031f06..f664b8f2b 100644 --- a/apps/presentationeditor/mobile/locale/en.json +++ b/apps/presentationeditor/mobile/locale/en.json @@ -30,7 +30,8 @@ "PE.Controllers.AddTable.textColumns": "Columns", "PE.Controllers.AddTable.textRows": "Rows", "PE.Controllers.AddTable.textTableSize": "Table Size", - "PE.Controllers.DocumentHolder.errorCopyCutPaste": "Copy, cut and paste actions using the context menu will be performed within the current file only. You cannot copy or paste to or from other applications.", + "PE.Controllers.DocumentHolder.errorCopyCutPaste": "Copy, cut and paste actions using the context menu will be performed within the current file only.", + "PE.Controllers.DocumentHolder.textDoNotShowAgain": "Don\'t show again", "PE.Controllers.DocumentHolder.menuAddLink": "Add Link", "PE.Controllers.DocumentHolder.menuCopy": "Copy", "PE.Controllers.DocumentHolder.menuCut": "Cut", diff --git a/apps/spreadsheeteditor/mobile/app/controller/DocumentHolder.js b/apps/spreadsheeteditor/mobile/app/controller/DocumentHolder.js index 6b6979587..c7c361a2b 100644 --- a/apps/spreadsheeteditor/mobile/app/controller/DocumentHolder.js +++ b/apps/spreadsheeteditor/mobile/app/controller/DocumentHolder.js @@ -113,33 +113,74 @@ define([ var res = me.api.asc_Cut(); if (!res) { me.view.hideMenu(); - uiApp.modal({ - title: me.textCopyCutPasteActions, - text : me.errorCopyCutPaste, - buttons: [{text: 'OK'}] - }); + if (!Common.localStorage.getBool("sse-hide-copy-cut-paste-warning")) { + uiApp.modal({ + title: me.textCopyCutPasteActions, + text: me.errorCopyCutPaste, + afterText: '', + buttons: [{ + text: 'OK', + onClick: function () { + var dontshow = $('input[name="checkbox-show-cut"]').prop('checked'); + if (dontshow) Common.localStorage.setItem("sse-hide-copy-cut-paste-warning", 1); + } + }] + }); + } } break; case 'copy': var res = me.api.asc_Copy(); if (!res) { me.view.hideMenu(); - uiApp.modal({ - title: me.textCopyCutPasteActions, - text : me.errorCopyCutPaste, - buttons: [{text: 'OK'}] - }); + if (!Common.localStorage.getBool("sse-hide-copy-cut-paste-warning")) { + uiApp.modal({ + title: me.textCopyCutPasteActions, + afterText: '', + buttons: [{ + text: 'OK', + onClick: function () { + var dontshow = $('input[name="checkbox-show-copy"]').prop('checked'); + if (dontshow) Common.localStorage.setItem("sse-hide-copy-cut-paste-warning", 1); + } + }] + }); + } } break; case 'paste': var res = me.api.asc_Paste(); if (!res) { me.view.hideMenu(); - uiApp.modal({ - title: me.textCopyCutPasteActions, - text: me.errorCopyCutPaste, - buttons: [{text: 'OK'}] - }); + if (!Common.localStorage.getBool("sse-hide-copy-cut-paste-warning")) { + uiApp.modal({ + title: me.textCopyCutPasteActions, + text: me.errorCopyCutPaste, + afterText: '', + buttons: [{ + text: 'OK', + onClick: function () { + var dontshow = $('input[name="checkbox-show-paste"]').prop('checked'); + if (dontshow) Common.localStorage.setItem("sse-hide-copy-cut-paste-warning", 1); + } + }] + }); + } } break; case 'del': me.api.asc_emptyCells(Asc.c_oAscCleanOptions.All); break; @@ -422,7 +463,8 @@ define([ menuFreezePanes: 'Freeze Panes', menuUnfreezePanes: 'Unfreeze Panes', textCopyCutPasteActions: 'Copy, Cut and Paste Actions', - errorCopyCutPaste: 'Copy, cut and paste actions using the context menu will be performed within the current file only. You cannot copy or paste to or from other applications.' + errorCopyCutPaste: 'Copy, cut and paste actions using the context menu will be performed within the current file only.', + textDoNotShowAgain: 'Don\'t show again' } })(), SSE.Controllers.DocumentHolder || {})) }); \ No newline at end of file diff --git a/apps/spreadsheeteditor/mobile/locale/en.json b/apps/spreadsheeteditor/mobile/locale/en.json index b3dc53d82..eb185ecf9 100644 --- a/apps/spreadsheeteditor/mobile/locale/en.json +++ b/apps/spreadsheeteditor/mobile/locale/en.json @@ -23,7 +23,8 @@ "SSE.Controllers.AddLink.txtNotUrl": "This field should be a URL in the format 'http://www.example.com'", "SSE.Controllers.AddOther.textEmptyImgUrl": "You need to specify image URL.", "SSE.Controllers.AddOther.txtNotUrl": "This field should be a URL in the format 'http://www.example.com'", - "SSE.Controllers.DocumentHolder.errorCopyCutPaste": "Copy, cut and paste actions using the context menu will be performed within the current file only. You cannot copy or paste to or from other applications.", + "SSE.Controllers.DocumentHolder.errorCopyCutPaste": "Copy, cut and paste actions using the context menu will be performed within the current file only.", + "SSE.Controllers.DocumentHolder.textDoNotShowAgain": "Don\'t show again", "SSE.Controllers.DocumentHolder.menuAddLink": "Add Link", "SSE.Controllers.DocumentHolder.menuCell": "Cell", "SSE.Controllers.DocumentHolder.menuCopy": "Copy", From 9f57ed1bd0357581bcadbee2afb5816398af56a8 Mon Sep 17 00:00:00 2001 From: Julia Svinareva Date: Thu, 19 Mar 2020 15:09:48 +0300 Subject: [PATCH 2/2] [mobile] fix translations --- apps/documenteditor/mobile/app/controller/DocumentHolder.js | 2 +- apps/documenteditor/mobile/locale/en.json | 2 +- apps/presentationeditor/mobile/app/controller/DocumentHolder.js | 2 +- apps/presentationeditor/mobile/locale/en.json | 2 +- apps/spreadsheeteditor/mobile/app/controller/DocumentHolder.js | 2 +- apps/spreadsheeteditor/mobile/locale/en.json | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/documenteditor/mobile/app/controller/DocumentHolder.js b/apps/documenteditor/mobile/app/controller/DocumentHolder.js index fb4985cac..4f99eea58 100644 --- a/apps/documenteditor/mobile/app/controller/DocumentHolder.js +++ b/apps/documenteditor/mobile/app/controller/DocumentHolder.js @@ -628,7 +628,7 @@ define([ menuReviewChange: 'Review Change', textCopyCutPasteActions: 'Copy, Cut and Paste Actions', errorCopyCutPaste: 'Copy, cut and paste actions using the context menu will be performed within the current file only.', - textDoNotShowAgain: 'Don\'t show again' + textDoNotShowAgain: 'Do not show again' } })(), DE.Controllers.DocumentHolder || {})) }); \ No newline at end of file diff --git a/apps/documenteditor/mobile/locale/en.json b/apps/documenteditor/mobile/locale/en.json index eff00933f..d7e83e9aa 100644 --- a/apps/documenteditor/mobile/locale/en.json +++ b/apps/documenteditor/mobile/locale/en.json @@ -91,7 +91,7 @@ "DE.Controllers.AddTable.textRows": "Rows", "DE.Controllers.AddTable.textTableSize": "Table Size", "DE.Controllers.DocumentHolder.errorCopyCutPaste": "Copy, cut and paste actions using the context menu will be performed within the current file only.", - "DE.Controllers.DocumentHolder.textDoNotShowAgain": "Don\'t show again", + "DE.Controllers.DocumentHolder.textDoNotShowAgain": "Do not show again", "DE.Controllers.DocumentHolder.menuAddLink": "Add Link", "DE.Controllers.DocumentHolder.menuCopy": "Copy", "DE.Controllers.DocumentHolder.menuCut": "Cut", diff --git a/apps/presentationeditor/mobile/app/controller/DocumentHolder.js b/apps/presentationeditor/mobile/app/controller/DocumentHolder.js index 2a565a4b9..720997653 100644 --- a/apps/presentationeditor/mobile/app/controller/DocumentHolder.js +++ b/apps/presentationeditor/mobile/app/controller/DocumentHolder.js @@ -398,7 +398,7 @@ define([ sheetCancel: 'Cancel', textCopyCutPasteActions: 'Copy, Cut and Paste Actions', errorCopyCutPaste: 'Copy, cut and paste actions using the context menu will be performed within the current file only.', - textDoNotShowAgain: 'Don\'t show again' + textDoNotShowAgain: 'Do not show again' } })(), PE.Controllers.DocumentHolder || {})) }); \ No newline at end of file diff --git a/apps/presentationeditor/mobile/locale/en.json b/apps/presentationeditor/mobile/locale/en.json index f664b8f2b..ea16c8286 100644 --- a/apps/presentationeditor/mobile/locale/en.json +++ b/apps/presentationeditor/mobile/locale/en.json @@ -31,7 +31,7 @@ "PE.Controllers.AddTable.textRows": "Rows", "PE.Controllers.AddTable.textTableSize": "Table Size", "PE.Controllers.DocumentHolder.errorCopyCutPaste": "Copy, cut and paste actions using the context menu will be performed within the current file only.", - "PE.Controllers.DocumentHolder.textDoNotShowAgain": "Don\'t show again", + "PE.Controllers.DocumentHolder.textDoNotShowAgain": "Do not show again", "PE.Controllers.DocumentHolder.menuAddLink": "Add Link", "PE.Controllers.DocumentHolder.menuCopy": "Copy", "PE.Controllers.DocumentHolder.menuCut": "Cut", diff --git a/apps/spreadsheeteditor/mobile/app/controller/DocumentHolder.js b/apps/spreadsheeteditor/mobile/app/controller/DocumentHolder.js index c7c361a2b..95ce3fea7 100644 --- a/apps/spreadsheeteditor/mobile/app/controller/DocumentHolder.js +++ b/apps/spreadsheeteditor/mobile/app/controller/DocumentHolder.js @@ -464,7 +464,7 @@ define([ menuUnfreezePanes: 'Unfreeze Panes', textCopyCutPasteActions: 'Copy, Cut and Paste Actions', errorCopyCutPaste: 'Copy, cut and paste actions using the context menu will be performed within the current file only.', - textDoNotShowAgain: 'Don\'t show again' + textDoNotShowAgain: 'Do not show again' } })(), SSE.Controllers.DocumentHolder || {})) }); \ No newline at end of file diff --git a/apps/spreadsheeteditor/mobile/locale/en.json b/apps/spreadsheeteditor/mobile/locale/en.json index eb185ecf9..44bd8993a 100644 --- a/apps/spreadsheeteditor/mobile/locale/en.json +++ b/apps/spreadsheeteditor/mobile/locale/en.json @@ -24,7 +24,7 @@ "SSE.Controllers.AddOther.textEmptyImgUrl": "You need to specify image URL.", "SSE.Controllers.AddOther.txtNotUrl": "This field should be a URL in the format 'http://www.example.com'", "SSE.Controllers.DocumentHolder.errorCopyCutPaste": "Copy, cut and paste actions using the context menu will be performed within the current file only.", - "SSE.Controllers.DocumentHolder.textDoNotShowAgain": "Don\'t show again", + "SSE.Controllers.DocumentHolder.textDoNotShowAgain": "Do not show again", "SSE.Controllers.DocumentHolder.menuAddLink": "Add Link", "SSE.Controllers.DocumentHolder.menuCell": "Cell", "SSE.Controllers.DocumentHolder.menuCopy": "Copy",