Merge pull request #368 from ONLYOFFICE/feature/Bug_44415

Feature/bug 44415
This commit is contained in:
JuliaSvinareva 2020-03-19 15:22:57 +03:00 committed by GitHub
commit efa7f8eaf7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 182 additions and 51 deletions

View file

@ -121,31 +121,73 @@ define([
var res = me.api.Cut(); var res = me.api.Cut();
if (!res) { if (!res) {
_view.hideMenu(); _view.hideMenu();
uiApp.modal({ if (!Common.localStorage.getBool("de-hide-copy-cut-paste-warning")) {
title: me.textCopyCutPasteActions, uiApp.modal({
text : me.errorCopyCutPaste, title: me.textCopyCutPasteActions,
buttons: [{text: 'OK'}] text: me.errorCopyCutPaste,
}); afterText: '<label class="label-checkbox item-content no-ripple">' +
'<input type="checkbox" name="checkbox-show-cut">' +
'<div class="item-media" style="margin-top: 10px; display: flex; align-items: center;">' +
'<i class="icon icon-form-checkbox"></i><span style="margin-left: 10px;">' + me.textDoNotShowAgain + '</span>' +
'</div>' +
'</label>',
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) { } else if ('copy' == eventName) {
var res = me.api.Copy(); var res = me.api.Copy();
if (!res) { if (!res) {
_view.hideMenu(); _view.hideMenu();
uiApp.modal({ if (!Common.localStorage.getBool("de-hide-copy-cut-paste-warning")) {
title: me.textCopyCutPasteActions, uiApp.modal({
text : me.errorCopyCutPaste, title: me.textCopyCutPasteActions,
buttons: [{text: 'OK'}] text: me.errorCopyCutPaste,
}); afterText: '<label class="label-checkbox item-content no-ripple">' +
'<input type="checkbox" name="checkbox-show-copy">' +
'<div class="item-media" style="margin-top: 10px; display: flex; align-items: center;">' +
'<i class="icon icon-form-checkbox"></i><span style="margin-left: 10px;">' + me.textDoNotShowAgain + '</span>' +
'</div>' +
'</label>',
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) { } else if ('paste' == eventName) {
var res = me.api.Paste(); var res = me.api.Paste();
if (!res) { if (!res) {
_view.hideMenu(); _view.hideMenu();
uiApp.modal({ if (!Common.localStorage.getBool("de-hide-copy-cut-paste-warning")) {
title: me.textCopyCutPasteActions, uiApp.modal({
text: me.errorCopyCutPaste, title: me.textCopyCutPasteActions,
buttons: [{text: 'OK'}] text: me.errorCopyCutPaste,
}); afterText: '<label class="label-checkbox item-content no-ripple">' +
'<input type="checkbox" name="checkbox-show-paste">' +
'<div class="item-media" style="margin-top: 10px; display: flex; align-items: center;">' +
'<i class="icon icon-form-checkbox"></i><span style="margin-left: 10px;">' + me.textDoNotShowAgain + '</span>' +
'</div>' +
'</label>',
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) { } else if ('merge' == eventName) {
me.api.MergeCells(); me.api.MergeCells();
@ -585,7 +627,8 @@ define([
menuDeleteTable: 'Delete Table', menuDeleteTable: 'Delete Table',
menuReviewChange: 'Review Change', menuReviewChange: 'Review Change',
textCopyCutPasteActions: 'Copy, Cut and Paste Actions', 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: 'Do not show again'
} }
})(), DE.Controllers.DocumentHolder || {})) })(), DE.Controllers.DocumentHolder || {}))
}); });

View file

@ -90,7 +90,8 @@
"DE.Controllers.AddTable.textColumns": "Columns", "DE.Controllers.AddTable.textColumns": "Columns",
"DE.Controllers.AddTable.textRows": "Rows", "DE.Controllers.AddTable.textRows": "Rows",
"DE.Controllers.AddTable.textTableSize": "Table Size", "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": "Do not show again",
"DE.Controllers.DocumentHolder.menuAddLink": "Add Link", "DE.Controllers.DocumentHolder.menuAddLink": "Add Link",
"DE.Controllers.DocumentHolder.menuCopy": "Copy", "DE.Controllers.DocumentHolder.menuCopy": "Copy",
"DE.Controllers.DocumentHolder.menuCut": "Cut", "DE.Controllers.DocumentHolder.menuCut": "Cut",

View file

@ -107,31 +107,73 @@ define([
var res = me.api.Cut(); var res = me.api.Cut();
if (!res) { if (!res) {
_view.hideMenu(); _view.hideMenu();
uiApp.modal({ if (!Common.localStorage.getBool("pe-hide-copy-cut-paste-warning")) {
title: me.textCopyCutPasteActions, uiApp.modal({
text : me.errorCopyCutPaste, title: me.textCopyCutPasteActions,
buttons: [{text: 'OK'}] text: me.errorCopyCutPaste,
}); afterText: '<label class="label-checkbox item-content no-ripple">' +
'<input type="checkbox" name="checkbox-show-cut">' +
'<div class="item-media" style="margin-top: 10px; display: flex; align-items: center;">' +
'<i class="icon icon-form-checkbox"></i><span style="margin-left: 10px;">' + me.textDoNotShowAgain + '</span>' +
'</div>' +
'</label>',
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) { } else if ('copy' == eventName) {
var res = me.api.Copy(); var res = me.api.Copy();
if (!res) { if (!res) {
_view.hideMenu(); _view.hideMenu();
uiApp.modal({ if (!Common.localStorage.getBool("pe-hide-copy-cut-paste-warning")) {
title: me.textCopyCutPasteActions, uiApp.modal({
text : me.errorCopyCutPaste, title: me.textCopyCutPasteActions,
buttons: [{text: 'OK'}] text: me.errorCopyCutPaste,
}); afterText: '<label class="label-checkbox item-content no-ripple">' +
'<input type="checkbox" name="checkbox-show-copy">' +
'<div class="item-media" style="margin-top: 10px; display: flex; align-items: center;">' +
'<i class="icon icon-form-checkbox"></i><span style="margin-left: 10px;">' + me.textDoNotShowAgain + '</span>' +
'</div>' +
'</label>',
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) { } else if ('paste' == eventName) {
var res = me.api.Paste(); var res = me.api.Paste();
if (!res) { if (!res) {
_view.hideMenu(); _view.hideMenu();
uiApp.modal({ if (!Common.localStorage.getBool("pe-hide-copy-cut-paste-warning")) {
title: me.textCopyCutPasteActions, uiApp.modal({
text: me.errorCopyCutPaste, title: me.textCopyCutPasteActions,
buttons: [{text: 'OK'}] text: me.errorCopyCutPaste,
}); afterText: '<label class="label-checkbox item-content no-ripple">' +
'<input type="checkbox" name="checkbox-show-paste">' +
'<div class="item-media" style="margin-top: 10px; display: flex; align-items: center;">' +
'<i class="icon icon-form-checkbox"></i><span style="margin-left: 10px;">' + me.textDoNotShowAgain + '</span>' +
'</div>' +
'</label>',
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) { } else if ('delete' == eventName) {
me.api.asc_Remove(); me.api.asc_Remove();
@ -355,7 +397,8 @@ define([
menuMore: 'More', menuMore: 'More',
sheetCancel: 'Cancel', sheetCancel: 'Cancel',
textCopyCutPasteActions: 'Copy, Cut and Paste Actions', 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: 'Do not show again'
} }
})(), PE.Controllers.DocumentHolder || {})) })(), PE.Controllers.DocumentHolder || {}))
}); });

View file

@ -30,7 +30,8 @@
"PE.Controllers.AddTable.textColumns": "Columns", "PE.Controllers.AddTable.textColumns": "Columns",
"PE.Controllers.AddTable.textRows": "Rows", "PE.Controllers.AddTable.textRows": "Rows",
"PE.Controllers.AddTable.textTableSize": "Table Size", "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": "Do not show again",
"PE.Controllers.DocumentHolder.menuAddLink": "Add Link", "PE.Controllers.DocumentHolder.menuAddLink": "Add Link",
"PE.Controllers.DocumentHolder.menuCopy": "Copy", "PE.Controllers.DocumentHolder.menuCopy": "Copy",
"PE.Controllers.DocumentHolder.menuCut": "Cut", "PE.Controllers.DocumentHolder.menuCut": "Cut",

View file

@ -113,33 +113,74 @@ define([
var res = me.api.asc_Cut(); var res = me.api.asc_Cut();
if (!res) { if (!res) {
me.view.hideMenu(); me.view.hideMenu();
uiApp.modal({ if (!Common.localStorage.getBool("sse-hide-copy-cut-paste-warning")) {
title: me.textCopyCutPasteActions, uiApp.modal({
text : me.errorCopyCutPaste, title: me.textCopyCutPasteActions,
buttons: [{text: 'OK'}] text: me.errorCopyCutPaste,
}); afterText: '<label class="label-checkbox item-content no-ripple">' +
'<input type="checkbox" name="checkbox-show-cut">' +
'<div class="item-media" style="margin-top: 10px; display: flex; align-items: center;">' +
'<i class="icon icon-form-checkbox"></i><span style="margin-left: 10px;">' + me.textDoNotShowAgain + '</span>' +
'</div>' +
'</label>',
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; break;
case 'copy': case 'copy':
var res = me.api.asc_Copy(); var res = me.api.asc_Copy();
if (!res) { if (!res) {
me.view.hideMenu(); me.view.hideMenu();
uiApp.modal({ if (!Common.localStorage.getBool("sse-hide-copy-cut-paste-warning")) {
title: me.textCopyCutPasteActions, uiApp.modal({
text : me.errorCopyCutPaste, title: me.textCopyCutPasteActions,
buttons: [{text: 'OK'}] afterText: '<label class="label-checkbox item-content no-ripple">' +
}); '<input type="checkbox" name="checkbox-show-copy">' +
'<div class="item-media" style="margin-top: 10px; display: flex; align-items: center;">' +
'<i class="icon icon-form-checkbox"></i><span style="margin-left: 10px;">' + me.textDoNotShowAgain + '</span>' +
'</div>' +
'</label>',
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; break;
case 'paste': case 'paste':
var res = me.api.asc_Paste(); var res = me.api.asc_Paste();
if (!res) { if (!res) {
me.view.hideMenu(); me.view.hideMenu();
uiApp.modal({ if (!Common.localStorage.getBool("sse-hide-copy-cut-paste-warning")) {
title: me.textCopyCutPasteActions, uiApp.modal({
text: me.errorCopyCutPaste, title: me.textCopyCutPasteActions,
buttons: [{text: 'OK'}] text: me.errorCopyCutPaste,
}); afterText: '<label class="label-checkbox item-content no-ripple">' +
'<input type="checkbox" name="checkbox-show-paste">' +
'<div class="item-media" style="margin-top: 10px; display: flex; align-items: center;">' +
'<i class="icon icon-form-checkbox"></i><span style="margin-left: 10px;">' + me.textDoNotShowAgain + '</span>' +
'</div>' +
'</label>',
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; break;
case 'del': me.api.asc_emptyCells(Asc.c_oAscCleanOptions.All); break; case 'del': me.api.asc_emptyCells(Asc.c_oAscCleanOptions.All); break;
@ -422,7 +463,8 @@ define([
menuFreezePanes: 'Freeze Panes', menuFreezePanes: 'Freeze Panes',
menuUnfreezePanes: 'Unfreeze Panes', menuUnfreezePanes: 'Unfreeze Panes',
textCopyCutPasteActions: 'Copy, Cut and Paste Actions', 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: 'Do not show again'
} }
})(), SSE.Controllers.DocumentHolder || {})) })(), SSE.Controllers.DocumentHolder || {}))
}); });

View file

@ -23,7 +23,8 @@
"SSE.Controllers.AddLink.txtNotUrl": "This field should be a URL in the format 'http://www.example.com'", "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.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.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": "Do not show again",
"SSE.Controllers.DocumentHolder.menuAddLink": "Add Link", "SSE.Controllers.DocumentHolder.menuAddLink": "Add Link",
"SSE.Controllers.DocumentHolder.menuCell": "Cell", "SSE.Controllers.DocumentHolder.menuCell": "Cell",
"SSE.Controllers.DocumentHolder.menuCopy": "Copy", "SSE.Controllers.DocumentHolder.menuCopy": "Copy",