summaryrefslogtreecommitdiff
path: root/loleaflet
diff options
context:
space:
mode:
authorgokaysatir <gokaysatir@collabora.com>2020-09-22 14:39:09 +0300
committerJan Holesovsky <kendy@collabora.com>2020-09-30 15:10:19 +0200
commit805ff2f2a8c1672b9ca0fef2b7364f9e9f38761b (patch)
tree7c926f8b2c7862220f142ffc4525efaee62c3c56 /loleaflet
parent03eab0459b4a67a88b98a4f1e31aa8af25aa3ba4 (diff)
Online: Copy hyperlink location. / Online side.
Unused selection variable has been removed. "clipboardchanged" event is activated. LOK_CALLBACK_CLIPBOARD_CHANGED is handled according to existence of payload. Change-Id: I6e37cb2ca4d4c59e55555ba3397cb00dbb7eafa2 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/103165 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Diffstat (limited to 'loleaflet')
-rw-r--r--loleaflet/src/layer/tile/TileLayer.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js
index 6f4445084..41ff45a07 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -643,6 +643,15 @@ L.TileLayer = L.GridLayer.extend({
// hack for ios and android to get selected text into hyperlink insertion dialog
this._selectedTextContent = textMsg.substr(22);
}
+ else if (textMsg.startsWith('clipboardchanged')) {
+ var jMessage = textMsg.substr(17);
+ jMessage = JSON.parse(jMessage);
+
+ if (jMessage.mimeType === 'text/plain') {
+ this._map._clip.setTextSelectionHTML(jMessage.content);
+ this._map._clip._execCopyCutPaste('copy');
+ }
+ }
else if (textMsg.startsWith('textselectionend:')) {
this._onTextSelectionEndMsg(textMsg);
}