[Libreoffice-commits] online.git: loleaflet/src

gokaysatir (via logerrit) logerrit at kemper.freedesktop.org
Tue Aug 11 17:16:23 UTC 2020


 loleaflet/src/control/Control.AlertDialog.js |   12 ------------
 loleaflet/src/control/Control.ContextMenu.js |    2 +-
 loleaflet/src/control/Toolbar.js             |   16 +++++++++++++++-
 loleaflet/src/unocommands.js                 |    1 +
 4 files changed, 17 insertions(+), 14 deletions(-)

New commits:
commit 5287950d71f3324fb99b66b6d5fa77fb7ae46125
Author:     gokaysatir <gokaysatir at collabora.com>
AuthorDate: Sat Aug 8 20:32:27 2020 +0300
Commit:     Tamás Zolnai <tamas.zolnai at collabora.com>
CommitDate: Tue Aug 11 19:16:04 2020 +0200

    loleaflet: remove edit button from open hyperlink modal.
    
    Change-Id: I597281b136a41c49954c66f50fd546a209bba75a
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/100392
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
    Tested-by: Jenkins

diff --git a/loleaflet/src/control/Control.AlertDialog.js b/loleaflet/src/control/Control.AlertDialog.js
index c7cff3b8b..8118a30f1 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 b22be1c83..2af30b3ed 100644
--- a/loleaflet/src/control/Toolbar.js
+++ b/loleaflet/src/control/Toolbar.js
@@ -156,17 +156,31 @@ 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 = false;
 		var allowedCommands = ['.uno:Save', '.uno:WordCountDialog', '.uno:EditAnnotation', '.uno:InsertAnnotation', '.uno:DeleteAnnotation'];
+
 		for (var i in allowedCommands) {
 			if (allowedCommands[i] === command) {
 				isAllowedInReadOnly = true;
 				break;
 			}
 		}
+
 		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 be4f9f46e..75caedecd 100644
--- a/loleaflet/src/unocommands.js
+++ b/loleaflet/src/unocommands.js
@@ -230,6 +230,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