[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-4' - loleaflet/src

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Mon May 6 08:15:25 UTC 2019


 loleaflet/src/control/Control.LokDialog.js |   24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

New commits:
commit 52bfff983e49043c03bdef5f64131171e1bb3f93
Author:     Henry Castro <hcastro at collabora.com>
AuthorDate: Thu Apr 18 18:26:33 2019 -0400
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Mon May 6 10:15:07 2019 +0200

    loleaflet: add 'paste' event listener to dialog
    
    Change-Id: I2ec69117683e4dd75722b1873a373ee6b7ec7782
    Reviewed-on: https://gerrit.libreoffice.org/70961
    Reviewed-by: Henry Castro <hcastro at collabora.com>
    Tested-by: Henry Castro <hcastro at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/71371
    Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
    Reviewed-by: Jan Holesovsky <kendy at collabora.com>
    Tested-by: Jan Holesovsky <kendy at collabora.com>

diff --git a/loleaflet/src/control/Control.LokDialog.js b/loleaflet/src/control/Control.LokDialog.js
index 5961b165f..6b5f8756e 100644
--- a/loleaflet/src/control/Control.LokDialog.js
+++ b/loleaflet/src/control/Control.LokDialog.js
@@ -600,6 +600,30 @@ L.Control.LokDialog = L.Control.extend({
 			              // Keep map active while user is playing with sidebar/dialog.
 			              this._map.lastActiveTime = Date.now();
 		              }, this);
+		L.DomEvent.on(dlgInput, 'paste', function(e) {
+			var clipboardData = e.clipboardData || window.clipboardData;
+			var data, blob;
+
+			L.DomEvent.preventDefault(e);
+			if (clipboardData) {
+				data = clipboardData.getData('text/plain') || clipboardData.getData('Text');
+				if (data) {
+					var cmd = {
+						MimeType: {
+							type: 'string',
+							value: 'mimetype=text/plain;charset=utf-8'
+						},
+						Data: {
+							type: '[]byte',
+							value: data
+						}
+					};
+
+					blob = new Blob(['windowcommand ' + id + ' paste ', encodeURIComponent(JSON.stringify(cmd))]);
+					this._map._socket.sendMessage(blob);
+				}
+			}
+		}, this);
 		L.DomEvent.on(dlgInput, 'contextmenu', function() {
 			return false;
 		});


More information about the Libreoffice-commits mailing list