[Libreoffice-commits] online.git: Branch 'distro/collabora/milestone-7' - loleaflet/reference.html loleaflet/src

Marco Cecchetti marco.cecchetti at collabora.com
Tue Feb 2 11:05:14 UTC 2016


 loleaflet/reference.html             |    6 ++++++
 loleaflet/src/layer/marker/Cursor.js |    6 +++---
 loleaflet/src/map/Map.js             |    9 ++-------
 3 files changed, 11 insertions(+), 10 deletions(-)

New commits:
commit 80bbaf2c5531dd4c03ae130118c2fb423b843e9a
Author: Marco Cecchetti <marco.cecchetti at collabora.com>
Date:   Tue Feb 2 12:01:24 2016 +0100

    loleaflet: map option: cursorURL - local server path to cursors
    
    The meaning of the cursorURL option is changed: now it does not
    represent anymore the full URL including protocol and server but only
    the path local to the server.
    
    Map option curosr.HotSpot has been removed since not requested.
    
    cursorURL option has been documented in reference.html.
    
    Change-Id: I9ccc4756ade469018837af08b1d32a3fabddc958

diff --git a/loleaflet/reference.html b/loleaflet/reference.html
index bea6526..4724e54 100644
--- a/loleaflet/reference.html
+++ b/loleaflet/reference.html
@@ -1527,6 +1527,12 @@ unexpected behaviour.</h4>
 		<td>The zoom level at which the tile size in twips equals the default size (3000 x 3000).
             Unless you know what you are doing, this should not be modified.</td>
 	</tr>
+    <tr>
+		<td><code><b>cursorURL</b></code></td>
+		<td><code>String</code></td>
+		<td><code><span class="literal">'cursors'</span></code></td>
+		<td>The path (local to the server) where custom cursor files are stored.</td>
+	</tr>
 </table>
 
 <h2 id="loleaflet-general">General</h2>
diff --git a/loleaflet/src/layer/marker/Cursor.js b/loleaflet/src/layer/marker/Cursor.js
index 6d9a47a..4bb4cf5 100644
--- a/loleaflet/src/layer/marker/Cursor.js
+++ b/loleaflet/src/layer/marker/Cursor.js
@@ -91,7 +91,7 @@ L.cursor = function (latlng, options) {
 	return new L.Cursor(latlng, options);
 };
 
-L.Cursor.imagePath = (function () {
+L.Cursor.getCursorURL = function (localPath) {
 	var scripts = document.getElementsByTagName('script'),
 		leafletRe = /[\/^]leaflet[\-\._]?([\w\-\._]*)\.js\??/;
 
@@ -102,10 +102,10 @@ L.Cursor.imagePath = (function () {
 
 		if (src.match(leafletRe)) {
 			path = src.split(leafletRe)[0];
-			return (path ? path + '/' : '') + 'cursors';
+			return (path ? path + '/' : '') + localPath;
 		}
 	}
-}());
+};
 
 L.Cursor.hotSpot = {
 	fill: {x: 7, y: 16}
diff --git a/loleaflet/src/map/Map.js b/loleaflet/src/map/Map.js
index daec441..6549514 100644
--- a/loleaflet/src/map/Map.js
+++ b/loleaflet/src/map/Map.js
@@ -46,13 +46,8 @@ L.Map = L.Evented.extend({
 			this.setView(L.latLng(options.center), options.zoom, {reset: true});
 		}
 
-		if (options.cursorURL !== undefined) {
-			L.Cursor.imagePath = options.cursorURL;
-		}
-
-		if (options.cursorHotSpot !== undefined) {
-			L.Cursor.hotSpot = options.cursorHotSpot;
-		}
+		options.cursorURL = options.cursorURL || 'cursors';
+		L.Cursor.imagePath = L.Cursor.getCursorURL(options.cursorURL);
 
 		if (options.webserver === undefined) {
 			var protocol = window.location.protocol === 'file:' ? 'http:' : window.location.protocol;


More information about the Libreoffice-commits mailing list