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

Pranav Kant pranavk at collabora.co.uk
Tue Aug 30 15:46:46 UTC 2016


 loleaflet/dist/leaflet.css            |    4 +++
 loleaflet/dist/toolbar/toolbar.js     |   41 +++++++++++++++++++++++++++++-----
 loleaflet/src/layer/tile/TileLayer.js |    2 -
 loleaflet/src/map/Map.js              |    3 +-
 4 files changed, 43 insertions(+), 7 deletions(-)

New commits:
commit d223f2a0e41d8166321044d151de452870f09f3c
Author: Pranav Kant <pranavk at collabora.co.uk>
Date:   Tue Aug 30 20:23:11 2016 +0530

    loleaflet: Notifications when new user joins, leaves
    
    Change-Id: I71b9ffb82fa2a0104df6f2600558b1b094f1195f

diff --git a/loleaflet/dist/toolbar/toolbar.js b/loleaflet/dist/toolbar/toolbar.js
index 2df22ae..95fbc7e 100644
--- a/loleaflet/dist/toolbar/toolbar.js
+++ b/loleaflet/dist/toolbar/toolbar.js
@@ -508,6 +508,9 @@ var formatButtons = {
 
 var takeEditPopupMessage = '<div>' + _('You are viewing now.') + '<br/>' + _('Click here to take edit.') + '</div>';
 var takeEditPopupTimeout = null;
+var userJoinedPopupMessage = '<div>' + _('%user has joined') + '</div>';
+var userLeftPopupMessage = '<div>' + _('%user has left') + '</div>';
+var userPopupTimeout = null;
 
 function toggleButton(toolbar, state, command)
 {
@@ -1362,10 +1365,36 @@ map.on('statusindicator', function (e) {
 
 // TODO: Dynamically add/remove users from list
 map.on('addview', function(e) {
+	$('#tb_toolbar-down_item_userlist')
+		.w2overlay({
+			class: 'loleaflet-font',
+			html: userJoinedPopupMessage.replace('%user', e.username),
+			style: 'padding: 5px'
+		});
+	clearTimeout(userPopupTimeout);
+	userPopupTimeout = setTimeout(function() {
+		$('#tb_toolbar-down_item_userlist').w2overlay('');
+		clearTimeout(userPopupTimeout);
+		userPopupTimeout = null;
+	}, 3000);
+
 	onChangeUserList();
 });
 
 map.on('removeview', function(e) {
+	$('#tb_toolbar-down_item_userlist')
+		.w2overlay({
+			class: 'loleaflet-font',
+			html: userLeftPopupMessage.replace('%user', e.username),
+			style: 'padding: 5px'
+		});
+	clearTimeout(userPopupTimeout);
+	userPopupTimeout = setTimeout(function() {
+		$('#tb_toolbar-down_item_userlist').w2overlay('');
+		clearTimeout(userPopupTimeout);
+		userPopupTimeout = null;
+	}, 3000);
+
 	onChangeUserList();
 });
 
commit 394054ecbf5a89a1a69a00344f1bb63c22a4b2cc
Author: Pranav Kant <pranavk at collabora.co.uk>
Date:   Tue Aug 30 20:33:28 2016 +0530

    loleaflet: Include username in removeview signal
    
    Change-Id: I6b9cdf2712d130d09c7bddcbe68042eacfacb8bb

diff --git a/loleaflet/src/map/Map.js b/loleaflet/src/map/Map.js
index 3f7acc3..1d01ff7 100644
--- a/loleaflet/src/map/Map.js
+++ b/loleaflet/src/map/Map.js
@@ -130,8 +130,9 @@ L.Map = L.Evented.extend({
 	},
 
 	removeView: function(viewid) {
+		var username = this._viewInfo[viewid];
 		delete this._viewInfo[viewid];
-		this.fire('removeview', {viewId: viewid});
+		this.fire('removeview', {viewId: viewid, username: username});
 	},
 
 	getViewName: function(viewid) {
commit aca73d2ac52e0ab4c7b64f7575447cb2b65a21c8
Author: Pranav Kant <pranavk at collabora.co.uk>
Date:   Tue Aug 30 20:22:12 2016 +0530

    loleaflet: Don't use input for userlist; use menu list
    
    Change-Id: I29244e3989fa5ca52c701c05996669cd548a0109

diff --git a/loleaflet/dist/toolbar/toolbar.js b/loleaflet/dist/toolbar/toolbar.js
index 9f7eedb..2df22ae 100644
--- a/loleaflet/dist/toolbar/toolbar.js
+++ b/loleaflet/dist/toolbar/toolbar.js
@@ -11,14 +11,14 @@ function onDelete(e) {
 }
 
 function onChangeUserList() {
-	var usernames = [];
+	var usernames = ['You'];
+	var userlist = w2ui['toolbar-down'].get('userlist');
 	for (var viewid in map._viewInfo) {
 		usernames.push(map._viewInfo[viewid]);
 	}
 
-	$('#userlist').w2field('list', {
-		items: usernames
-	});
+	userlist.items = usernames;
+	w2ui['toolbar-down'].refresh();
 }
 
 function resizeToolbar() {
@@ -478,7 +478,9 @@ $(function () {
 			{type: 'html',  id: 'right'},
 			{type: 'html',    id: 'modifiedstatuslabel', html: '<div id="modifiedstatuslabel" class="loleaflet-font"></div>'},
 			{type: 'break'},
-			{type: 'html', id: 'userlistcontainer', html: '<div class="loleaflet-font"><label>' + _('Users:') + ' </label><input id="userlist" type="list" /></div>'},
+			{type: 'menu', id: 'userlist', caption: _('Users'), items: [
+				_('You'),
+			]},
 			{type: 'break'},
 			{type: 'button',  id: 'prev', img: 'prev', hint: _('Previous page')},
 			{type: 'button',  id: 'next', img: 'next', hint: _('Next page')},
commit 491876b537ce3fed87388ea9ede9b0aa33fc2fda
Author: Pranav Kant <pranavk at collabora.co.uk>
Date:   Tue Aug 30 19:35:00 2016 +0530

    loleaflet: Show cursor name on hover
    
    Change-Id: Ibca3a5e80a21c83e27ba47a6fe39f788a261c1e5

diff --git a/loleaflet/dist/leaflet.css b/loleaflet/dist/leaflet.css
index f3521a4..047fa0b 100644
--- a/loleaflet/dist/leaflet.css
+++ b/loleaflet/dist/leaflet.css
@@ -593,6 +593,10 @@ a.leaflet-control-buttons:hover:first-child {
         font-size: 9px;
         }
 
+div.leaflet-cursor-container:hover > .leaflet-cursor-header {
+        visibility: visible !important;
+        }
+
 .blinking-cursor {
 	-webkit-animation: 1s blink step-end 0s infinite;
 	-moz-animation: 1s blink step-end 0s infinite;
commit c4a01564e602fa960785118a0a29b5baecc86717
Author: Pranav Kant <pranavk at collabora.co.uk>
Date:   Tue Aug 30 19:34:47 2016 +0530

    loleaflet: Cursor name timeout increased to 3s
    
    Change-Id: I9fb36c90669af91a9da557e43de263a7900d66d9

diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js
index db783db..a2d6850 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -1134,7 +1134,7 @@ 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: 3000, // hide after some interval
 				headerName: this._map.getViewName(viewId)
 			};
 			viewCursorMarker = L.cursor(viewCursorPos, viewCursorOptions);


More information about the Libreoffice-commits mailing list