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

Mihai Varga mihai.varga at collabora.com
Tue Aug 4 03:37:41 PDT 2015


 loleaflet/debug/document/document_simple_example.html |    2 ++
 loleaflet/src/layer/tile/TileLayer.js                 |    7 +++++--
 2 files changed, 7 insertions(+), 2 deletions(-)

New commits:
commit 52baf442980fd1d6de916bfe77ddae30194dec4d
Author: Mihai Varga <mihai.varga at collabora.com>
Date:   Tue Aug 4 13:37:18 2015 +0300

    loleaflet: only send the timestamp when provided

diff --git a/loleaflet/debug/document/document_simple_example.html b/loleaflet/debug/document/document_simple_example.html
index ec279af..4f2fbb5 100644
--- a/loleaflet/debug/document/document_simple_example.html
+++ b/loleaflet/debug/document/document_simple_example.html
@@ -49,6 +49,7 @@
     var filePath = getParameterByName('file_path');
     var host = getParameterByName('host');
     var edit = getParameterByName('edit') === 'true';
+    var timeStamp = getParameterByName('timestamp');
     if (filePath === '') {
         vex.dialog.alert('Wrong file_path, usage: file_path=/path/to/doc/');
     }
@@ -80,6 +81,7 @@
         doc: filePath,
         useSocket : true,
         edit: edit,
+        timeStamp: timeStamp,
         readOnly: false
     });
     map.addLayer(docLayer);
diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js
index bc248b4..6f3326f 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -99,8 +99,11 @@ L.TileLayer = L.GridLayer.extend({
 			return;
 		}
 		if (this.options.doc) {
-		        var timestamp = Math.round(+new Date()/1000);
-			this.sendMessage('load url=' + this.options.doc + ( this.options.doc.indexOf('?') !== -1 ? '&' : '?' ) + 'timestamp=' + timestamp);
+			var msg = 'load url=' + this.options.doc;
+			if (this.options.timeStamp) {
+				msg += '?timestamp=' + this.options.timeStamp;
+			}
+			this.sendMessage(msg);
 			this.sendMessage('status');
 		}
 		this._map.on('drag resize zoomend', this._updateScrollOffset, this);


More information about the Libreoffice-commits mailing list