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

Pranav Kant pranavk at collabora.co.uk
Wed Jun 21 06:44:36 UTC 2017


 loleaflet/dist/images/custom_button.png |binary
 loleaflet/dist/toolbar/toolbar.js       |   10 +++++++++-
 loleaflet/src/layer/tile/TileLayer.js   |    4 +++-
 3 files changed, 12 insertions(+), 2 deletions(-)

New commits:
commit 6e46c760ce6928e5c2120499a44d79529e263e07
Author: Pranav Kant <pranavk at collabora.co.uk>
Date:   Wed Jun 21 12:12:25 2017 +0530

    Disable Copy from calc cells and formula bar
    
    ... of course only when DisableCopy is mentioned.
    
    Change-Id: Ia47c403a437384c673364f500c2137f54c1f4bad

diff --git a/loleaflet/dist/images/custom_button.png b/loleaflet/dist/images/custom_button.png
new file mode 100644
index 00000000..788cef39
Binary files /dev/null and b/loleaflet/dist/images/custom_button.png differ
diff --git a/loleaflet/dist/toolbar/toolbar.js b/loleaflet/dist/toolbar/toolbar.js
index cf79c558..b2657afb 100644
--- a/loleaflet/dist/toolbar/toolbar.js
+++ b/loleaflet/dist/toolbar/toolbar.js
@@ -953,6 +953,14 @@ map.on('wopiprops', function(e) {
 	if (e.HideSaveOption) {
 		w2ui['toolbar-up'].hide('save');
 	}
+	if (e.DisableCopy) {
+		$('input#formulaInput').bind('copy', function(evt) {
+			evt.preventDefault();
+		});
+		$('input#addressInput').bind('copy', function(evt) {
+			evt.preventDefault();
+		});
+	}
 });
 
 map.on('doclayerinit', function () {
@@ -1586,7 +1594,7 @@ function getUserItem(viewId, userName, extraInfo, color) {
 	var html = '<tr class="' + className + '" id="user-' + viewId + '" onclick="onUseritemClicked(event)">' +
 	             '<td class=usercolor style="background-color: ' + color  +';">';
 	if (extraInfo !== undefined && extraInfo.avatar !== undefined) {
-		html += '<img src="' + extraInfo.avatar + '" width="32" height="32" />'
+		html += '<img src="' + extraInfo.avatar + '" width="32" height="32" />';
 	}
 
 	// TODO: Add mail and other links as sub-menu.
diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js
index 986a2ca0..3dfe8ac2 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -509,7 +509,9 @@ L.TileLayer = L.GridLayer.extend({
 
 	_onCellFormulaMsg: function (textMsg) {
 		var formula = textMsg.substring(13);
-		this._selectionTextContent = formula;
+		if (!this._map['wopi'].DisableCopy) {
+			this._selectionTextContent = formula;
+		}
 		this._map.fire('cellformula', {formula: formula});
 	},
 


More information about the Libreoffice-commits mailing list