loleaflet/src/control/Control.ContextMenu.js | 18 +----------------- loleaflet/src/control/Control.Menubar.js | 20 +++++++++++--------- 2 files changed, 12 insertions(+), 26 deletions(-)
New commits: commit e98f71d9acc3d4aa2a5ca07c4fa1160dc8ca1797 Author: Jan Holesovsky <ke...@collabora.com> AuthorDate: Mon May 20 18:50:41 2019 +0200 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Mon May 20 21:50:11 2019 +0200 The Internal Copy / Internal Cut / Internal Paste is just confusing. Every user so far is confused of the existence of two clipboards - the system one, and the Online internal one. We are able to detect that the copy / paste is happening inside the document and perform the "internal copy / paste" accordingly, so let's do what the other online office suites do, and just warn when the user tries to access copy / paste from the menu. Change-Id: I904fc120fcf65b8ad4ba8fb5178803f976d707f4 Reviewed-on: https://gerrit.libreoffice.org/72613 Reviewed-by: Michael Meeks <michael.me...@collabora.com> Tested-by: Andras Timar <andras.ti...@collabora.com> diff --git a/loleaflet/src/control/Control.ContextMenu.js b/loleaflet/src/control/Control.ContextMenu.js index 08eec4031..0bc64c95f 100644 --- a/loleaflet/src/control/Control.ContextMenu.js +++ b/loleaflet/src/control/Control.ContextMenu.js @@ -20,8 +20,7 @@ L.Control.ContextMenu = L.Control.extend({ * in following list is just for reference and ease of locating uno command * from context menu structure. */ - general: ['Cut', 'Copy', 'Paste', 'PasteSpecialMenu', 'PasteUnformatted', - 'NumberingStart', 'ContinueNumbering', 'IncrementLevel', 'DecrementLevel', + general: ['NumberingStart', 'ContinueNumbering', 'IncrementLevel', 'DecrementLevel', 'OpenHyperlinkOnCursor', 'CopyHyperlinkLocation', 'RemoveHyperlink', 'AnchorMenu', 'SetAnchorToPage', 'SetAnchorToPara', 'SetAnchorAtChar', 'SetAnchorToChar', 'SetAnchorToFrame', @@ -126,18 +125,6 @@ L.Control.ContextMenu = L.Control.extend({ // Get the translated text associated with the command itemName = _UNO(item.command, docType, true); - switch (commandName) { - case 'Cut': - itemName = _('Internal Cut'); - break; - case 'Copy': - itemName = _('Internal Copy'); - break; - case 'Paste': - itemName = _('Internal Paste'); - break; - } - contextMenu[item.command] = { name: _(itemName) }; @@ -155,9 +142,6 @@ L.Control.ContextMenu = L.Control.extend({ isLastItemText = true; } else if (item.type === 'menu') { itemName = item.text; - if (itemName.replace('~', '') === 'Paste Special') { - itemName = _('Internal Paste Special'); - } var submenu = this._createContextMenuStructure(item); // ignore submenus with all items disabled if (Object.keys(submenu).length === 0) { diff --git a/loleaflet/src/control/Control.Menubar.js b/loleaflet/src/control/Control.Menubar.js index 53febfd85..e739715a9 100644 --- a/loleaflet/src/control/Control.Menubar.js +++ b/loleaflet/src/control/Control.Menubar.js @@ -36,9 +36,9 @@ L.Control.Menubar = L.Control.extend({ {uno: '.uno:Redo'}, {name: _('Repair'), id: 'repair', type: 'action'}, {type: 'separator'}, - {uno: '.uno:Cut'}, - {uno: '.uno:Copy'}, - {uno: '.uno:Paste'}, + {name: _UNO('.uno:Cut'), id: 'warn-copy-paste', type: 'action'}, + {name: _UNO('.uno:Copy'), id: 'warn-copy-paste', type: 'action'}, + {name: _UNO('.uno:Paste'), id: 'warn-copy-paste', type: 'action'}, {uno: '.uno:SelectAll'}, {type: 'separator'}, {uno: '.uno:SearchDialog'}, @@ -255,9 +255,9 @@ L.Control.Menubar = L.Control.extend({ {uno: '.uno:Redo'}, {name: _('Repair'), id: 'repair', type: 'action'}, {type: 'separator'}, - {uno: '.uno:Cut'}, - {uno: '.uno:Copy'}, - {uno: '.uno:Paste'}, + {name: _UNO('.uno:Cut'), id: 'warn-copy-paste', type: 'action'}, + {name: _UNO('.uno:Copy'), id: 'warn-copy-paste', type: 'action'}, + {name: _UNO('.uno:Paste'), id: 'warn-copy-paste', type: 'action'}, {uno: '.uno:SelectAll'}, {type: 'separator'}, {uno: '.uno:SearchDialog'} @@ -343,9 +343,9 @@ L.Control.Menubar = L.Control.extend({ {uno: '.uno:Redo'}, {name: _('Repair'), id: 'repair', type: 'action'}, {type: 'separator'}, - {uno: '.uno:Cut'}, - {uno: '.uno:Copy'}, - {uno: '.uno:Paste'}, + {name: _UNO('.uno:Cut'), id: 'warn-copy-paste', type: 'action'}, + {name: _UNO('.uno:Copy'), id: 'warn-copy-paste', type: 'action'}, + {name: _UNO('.uno:Paste'), id: 'warn-copy-paste', type: 'action'}, {uno: '.uno:SelectAll'}, {type: 'separator'}, {uno: '.uno:SearchDialog'} @@ -793,6 +793,8 @@ L.Control.Menubar = L.Control.extend({ this._map.remove(); } else if (id === 'repair') { this._map._socket.sendMessage('commandvalues command=.uno:DocumentRepair'); + } else if (id === 'warn-copy-paste') { + vex.dialog.alert(_('<p>Your browser has very limited access to the clipboard, so use these keyboard shortcuts:<ul><li><b>Ctrl+C</b>: For copying.</li><li><b>Ctrl+X</b>: For cutting.</li><li><b>Ctrl+P</b>: For pasting.</li></ul></p>')); } // Inform the host if asked if ($(item).data('postmessage') === 'true') { _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits