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

New commits:
commit 52bfff983e49043c03bdef5f64131171e1bb3f93
Author:     Henry Castro <hcas...@collabora.com>
AuthorDate: Thu Apr 18 18:26:33 2019 -0400
Commit:     Jan Holesovsky <ke...@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 <hcas...@collabora.com>
    Tested-by: Henry Castro <hcas...@collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/71371
    Reviewed-by: Ashod Nakashian <ashnak...@gmail.com>
    Reviewed-by: Jan Holesovsky <ke...@collabora.com>
    Tested-by: Jan Holesovsky <ke...@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;
                });
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to