[Libreoffice-commits] online.git: 2 commits - loleaflet/src
Tomaž Vajngerl
tomaz.vajngerl at collabora.com
Thu Jan 21 11:35:21 PST 2016
loleaflet/src/layer/tile/TileLayer.js | 25 ++++++++++++++++++++++---
1 file changed, 22 insertions(+), 3 deletions(-)
New commits:
commit 2152c1420ab2e7eba8fd8b7a7e775b49958d044d
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.com>
Date: Thu Jan 21 20:32:39 2016 +0100
loleaflet: use IE11 clipboard function for cutting too
(cherry picked from commit a71d245f284873fe37951851889ed31e4a22898c)
diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js
index 54ae3ec..8135ad3 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -942,7 +942,12 @@ L.TileLayer = L.GridLayer.extend({
e = e.originalEvent;
e.preventDefault();
if (this._selectionTextContent) {
- e.clipboardData.setData('text/plain', this._selectionTextContent);
+ if (e.clipboardData) { // Standard
+ e.clipboardData.setData('text/plain', this._selectionTextContent);
+ }
+ else if (window.clipboardData) { // IE 11
+ window.clipboardData.setData('Text', this._selectionTextContent);
+ }
this._map._socket.sendMessage('uno .uno:Cut');
}
},
commit 58c12c9e5ce0aa5aaf980ceb609a765e8616fe24
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.com>
Date: Thu Jan 21 17:00:10 2016 +0100
loleaflet: IE11 has his own way to access the clipboard
(cherry picked from commit 26f061248ddd57cb9ab23307daa2a8f3cb6e3e8f)
diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js
index 846a7c6..54ae3ec 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -929,7 +929,12 @@ L.TileLayer = L.GridLayer.extend({
e = e.originalEvent;
e.preventDefault();
if (this._selectionTextContent) {
- e.clipboardData.setData('text/plain', this._selectionTextContent);
+ if (e.clipboardData) { // Standard
+ e.clipboardData.setData('text/plain', this._selectionTextContent);
+ }
+ else if (window.clipboardData) { // IE 11
+ window.clipboardData.setData('Text', this._selectionTextContent);
+ }
}
},
@@ -945,7 +950,16 @@ L.TileLayer = L.GridLayer.extend({
_onPaste: function (e) {
e = e.originalEvent;
e.preventDefault();
- this._map._socket.sendMessage('paste mimetype=text/plain;charset=utf-8\n' + e.clipboardData.getData('text/plain'));
+ var pasteString = null;
+ if (e.clipboardData) { // Standard
+ pasteString = e.clipboardData.getData('text/plain');
+ }
+ else if (window.clipboardData) { // IE 11
+ pasteString = window.clipboardData.getData('Text');
+ }
+ if (pasteString) {
+ this._map._socket.sendMessage('paste mimetype=text/plain;charset=utf-8\n' + pasteString);
+ }
},
_onDragOver: function (e) {
More information about the Libreoffice-commits
mailing list