[Libreoffice-commits] online.git: 4 commits - loleaflet/dist loleaflet/src
Pranav Kant
pranavk at collabora.co.uk
Thu Aug 25 13:48:10 UTC 2016
loleaflet/dist/leaflet.css | 9 +++++++++
loleaflet/src/layer/marker/Cursor.js | 10 ++++++++++
loleaflet/src/layer/tile/TileLayer.js | 5 ++++-
3 files changed, 23 insertions(+), 1 deletion(-)
New commits:
commit 620b322bd25c140322264ad8dfb809b69d9052d6
Author: Pranav Kant <pranavk at collabora.co.uk>
Date: Thu Aug 25 19:03:14 2016 +0530
loleaflet: Give hats the names
Put a placeholder for now; replace with real names when we have
them from loolwsd.
diff --git a/loleaflet/src/layer/marker/Cursor.js b/loleaflet/src/layer/marker/Cursor.js
index bd1efae..cebc657 100644
--- a/loleaflet/src/layer/marker/Cursor.js
+++ b/loleaflet/src/layer/marker/Cursor.js
@@ -52,6 +52,8 @@ L.Cursor = L.Layer.extend({
if (this.options.header) {
this._cursorHeader = L.DomUtil.create('div', 'leaflet-cursor-header', this._container);
+ this._cursorHeader.innerHTML = this.options.headerName;
+
setTimeout(L.bind(function() {
L.DomUtil.setStyle(this._cursorHeader, 'visibility', 'hidden');
}, this), this.options.headerTimeout);
diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js
index 7220012..6c1fe71 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -1112,7 +1112,8 @@ L.TileLayer = L.GridLayer.extend({
color: L.LOUtil.getViewIdHexColor(viewId),
blink: false,
header: true, // we want a 'hat' to our view cursors (which will contain view user names)
- headerTimeout: 1500 // hide after some interval
+ headerTimeout: 1500, // hide after some interval
+ headerName: 'Anonymous LOOL User'
};
viewCursorMarker = L.cursor(viewCursorPos, viewCursorOptions);
this._map.addLayer(viewCursorMarker);
commit 79aa4d5e0634f0c577c5346c398d7ab33cd1da4f
Author: Pranav Kant <pranavk at collabora.co.uk>
Date: Thu Aug 25 19:02:21 2016 +0530
loleaflet: Hide the hat after 1.5s of inactivity in cursor
diff --git a/loleaflet/src/layer/marker/Cursor.js b/loleaflet/src/layer/marker/Cursor.js
index eb3cbd7..bd1efae 100644
--- a/loleaflet/src/layer/marker/Cursor.js
+++ b/loleaflet/src/layer/marker/Cursor.js
@@ -51,6 +51,10 @@ L.Cursor = L.Layer.extend({
this._container = L.DomUtil.create('div', 'leaflet-cursor-container');
if (this.options.header) {
this._cursorHeader = L.DomUtil.create('div', 'leaflet-cursor-header', this._container);
+
+ setTimeout(L.bind(function() {
+ L.DomUtil.setStyle(this._cursorHeader, 'visibility', 'hidden');
+ }, this), this.options.headerTimeout);
}
this._cursor = L.DomUtil.create('div', 'leaflet-cursor', this._container);
if (this.options.blink) {
diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js
index 2bbf6ec..7220012 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -1111,7 +1111,8 @@ L.TileLayer = L.GridLayer.extend({
var viewCursorOptions = {
color: L.LOUtil.getViewIdHexColor(viewId),
blink: false,
- header: true // we want a 'hat' to our view cursors (which will contain view user names)
+ header: true, // we want a 'hat' to our view cursors (which will contain view user names)
+ headerTimeout: 1500 // hide after some interval
};
viewCursorMarker = L.cursor(viewCursorPos, viewCursorOptions);
this._map.addLayer(viewCursorMarker);
commit 3ff170a1949a920dfc1dc3737363783dd002fbbf
Author: Pranav Kant <pranavk at collabora.co.uk>
Date: Thu Aug 25 19:00:30 2016 +0530
loleaflet: Adjust the hat a bit; don't make it change cursor pos
diff --git a/loleaflet/dist/leaflet.css b/loleaflet/dist/leaflet.css
index 887703a..f4e8f4e 100644
--- a/loleaflet/dist/leaflet.css
+++ b/loleaflet/dist/leaflet.css
@@ -576,9 +576,10 @@ a.leaflet-control-buttons:hover:first-child {
.leaflet-cursor-header {
background: black;
height: 10px;
- width: 10px;
- top: -10px;
+ margin-top: -10px;
pointer-events: none;
+ color: white;
+ font-size: 9px;
}
.blinking-cursor {
commit 73f7e48c90be46647ac782fd6fa2503647ce2038
Author: Pranav Kant <pranavk at collabora.co.uk>
Date: Wed Aug 24 20:05:08 2016 +0530
loleaflet: A hat for colored cursors
diff --git a/loleaflet/dist/leaflet.css b/loleaflet/dist/leaflet.css
index 5b0c8f1..887703a 100644
--- a/loleaflet/dist/leaflet.css
+++ b/loleaflet/dist/leaflet.css
@@ -573,6 +573,14 @@ a.leaflet-control-buttons:hover:first-child {
pointer-events: none;
}
+.leaflet-cursor-header {
+ background: black;
+ height: 10px;
+ width: 10px;
+ top: -10px;
+ pointer-events: none;
+ }
+
.blinking-cursor {
-webkit-animation: 1s blink step-end 0s infinite;
-moz-animation: 1s blink step-end 0s infinite;
diff --git a/loleaflet/src/layer/marker/Cursor.js b/loleaflet/src/layer/marker/Cursor.js
index faa5177..eb3cbd7 100644
--- a/loleaflet/src/layer/marker/Cursor.js
+++ b/loleaflet/src/layer/marker/Cursor.js
@@ -49,12 +49,16 @@ L.Cursor = L.Layer.extend({
_initLayout: function () {
this._container = L.DomUtil.create('div', 'leaflet-cursor-container');
+ if (this.options.header) {
+ this._cursorHeader = L.DomUtil.create('div', 'leaflet-cursor-header', this._container);
+ }
this._cursor = L.DomUtil.create('div', 'leaflet-cursor', this._container);
if (this.options.blink) {
L.DomUtil.addClass(this._cursor, 'blinking-cursor');
}
if (this.options.color) {
+ L.DomUtil.setStyle(this._cursorHeader, 'background', this.options.color);
L.DomUtil.setStyle(this._cursor, 'background', this.options.color);
}
diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js
index 4bf102c..2bbf6ec 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -1110,7 +1110,8 @@ L.TileLayer = L.GridLayer.extend({
}
var viewCursorOptions = {
color: L.LOUtil.getViewIdHexColor(viewId),
- blink: false
+ blink: false,
+ header: true // we want a 'hat' to our view cursors (which will contain view user names)
};
viewCursorMarker = L.cursor(viewCursorPos, viewCursorOptions);
this._map.addLayer(viewCursorMarker);
More information about the Libreoffice-commits
mailing list