[Libreoffice-commits] online.git: Branch 'distro/collabora/co-4-2' - loleaflet/src
gokaysatir (via logerrit)
logerrit at kemper.freedesktop.org
Tue Aug 11 17:12:43 UTC 2020
loleaflet/src/control/Control.AlertDialog.js | 12 ------------
loleaflet/src/control/Control.ContextMenu.js | 2 +-
loleaflet/src/control/Toolbar.js | 15 ++++++++++++++-
loleaflet/src/unocommands.js | 1 +
4 files changed, 16 insertions(+), 14 deletions(-)
New commits:
commit 0c84261a2a915d2b1e1601d0b77646033c8f2da7
Author: gokaysatir <gokaysatir at collabora.com>
AuthorDate: Sat Aug 8 20:32:27 2020 +0300
Commit: Jan Holesovsky <kendy at collabora.com>
CommitDate: Tue Aug 11 19:12:24 2020 +0200
loleaflet: remove edit button from open hyperlink modal.
Change-Id: I597281b136a41c49954c66f50fd546a209bba75a
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/100534
Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
diff --git a/loleaflet/src/control/Control.AlertDialog.js b/loleaflet/src/control/Control.AlertDialog.js
index c73d87d92..67224907a 100644
--- a/loleaflet/src/control/Control.AlertDialog.js
+++ b/loleaflet/src/control/Control.AlertDialog.js
@@ -68,18 +68,6 @@ L.Control.AlertDialog = L.Control.extend({
});
}
- if (this._map.getDocType() != 'presentation') {
- buttonsList.push({
- text: _('Edit'),
- type: 'button',
- className: 'vex-dialog-button-secondary',
- click: function editClick () {
- vex.closeAll();
- e.map.showHyperlinkDialog();
- }
- });
- }
-
vex.dialog.open({
message: messageText,
showCloseButton: true,
diff --git a/loleaflet/src/control/Control.ContextMenu.js b/loleaflet/src/control/Control.ContextMenu.js
index c4449340e..107da8ba0 100644
--- a/loleaflet/src/control/Control.ContextMenu.js
+++ b/loleaflet/src/control/Control.ContextMenu.js
@@ -22,7 +22,7 @@ L.Control.ContextMenu = L.Control.extend({
*/
general: ['Cut', 'Copy', 'Paste', 'Delete',
'NumberingStart', 'ContinueNumbering', 'IncrementLevel', 'DecrementLevel',
- 'OpenHyperlinkOnCursor', 'CopyHyperlinkLocation', 'RemoveHyperlink',
+ 'OpenHyperlinkOnCursor', 'EditHyperlink', 'CopyHyperlinkLocation', 'RemoveHyperlink',
'AnchorMenu', 'SetAnchorToPage', 'SetAnchorToPara', 'SetAnchorAtChar',
'SetAnchorToChar', 'SetAnchorToFrame',
'WrapMenu', 'WrapOff', 'WrapOn', 'WrapIdeal', 'WrapLeft', 'WrapRight', 'WrapThrough',
diff --git a/loleaflet/src/control/Toolbar.js b/loleaflet/src/control/Toolbar.js
index 19b899d75..4bf98dc0e 100644
--- a/loleaflet/src/control/Toolbar.js
+++ b/loleaflet/src/control/Toolbar.js
@@ -156,8 +156,20 @@ L.Map.include({
this._socket.sendMessage(msg);
},
+ messageNeedsToBeRedirected: function(command) {
+ if (command === '.uno:EditHyperlink') {
+ var that = this;
+ setTimeout(function () { that.showHyperlinkDialog(); }, 500);
+ return true;
+ }
+ else {
+ return false;
+ }
+ },
+
sendUnoCommand: function (command, json) {
var isAllowedInReadOnly = command == '.uno:WordCountDialog';
+
var hasOpenedDialog = this.dialog.hasOpenedDialog();
if (hasOpenedDialog) {
$('.lokdialog_container').addClass('lokblink');
@@ -165,7 +177,8 @@ L.Map.include({
$('.lokdialog_container').removeClass('lokblink');
}, 600);
} else if (this.isPermissionEdit() || isAllowedInReadOnly) {
- this._socket.sendMessage('uno ' + command + (json ? ' ' + JSON.stringify(json) : ''));
+ if (!this.messageNeedsToBeRedirected(command))
+ this._socket.sendMessage('uno ' + command + (json ? ' ' + JSON.stringify(json) : ''));
}
},
diff --git a/loleaflet/src/unocommands.js b/loleaflet/src/unocommands.js
index 449880c74..50434e965 100644
--- a/loleaflet/src/unocommands.js
+++ b/loleaflet/src/unocommands.js
@@ -221,6 +221,7 @@ var unoCommandsArray = {
ObjectForwardOne:{global:{menu:_('Forward One'),},},
OnlineAutoFormat:{text:{menu:_('~While Typing'),},},
OpenHyperlinkOnCursor:{global:{menu:_('Open Hyperlink'),},},
+ EditHyperlink:{global:{menu:_('Edit Hyperlink'),},},
OutlineBullet:{global:{menu:_('~Bullets and Numbering...'),},},
OutlineFont:{global:{menu:_('Outline'),},},
Overline:{global:{menu:_('Overline'),},},
More information about the Libreoffice-commits
mailing list