[Libreoffice-commits] online.git: 2 commits - loleaflet/css loleaflet/js loleaflet/src

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Jan 30 15:58:26 UTC 2019


 loleaflet/css/loleaflet.css              |   11 +++++------
 loleaflet/css/spreadsheet.css            |    4 ++--
 loleaflet/js/toolbar.js                  |    2 +-
 loleaflet/src/layer/AnnotationManager.js |    3 ---
 loleaflet/src/layer/marker/Annotation.js |   12 ++++++------
 loleaflet/src/map/Map.js                 |    8 ++++----
 6 files changed, 18 insertions(+), 22 deletions(-)

New commits:
commit c7095ff3e1e76f53be86f19b6d033470532f1b3a
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Wed Jan 30 10:48:32 2019 +0100
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Wed Jan 30 16:55:02 2019 +0100

    Make avatar unified and colored
    
    Change-Id: I2991f8d6a5e0660c2ea857e397588f162f557c60

diff --git a/loleaflet/css/loleaflet.css b/loleaflet/css/loleaflet.css
index 798612ca7..a6aefc2b2 100644
--- a/loleaflet/css/loleaflet.css
+++ b/loleaflet/css/loleaflet.css
@@ -302,6 +302,11 @@ body {
 	display: inline-block;
 }
 
+.avatar-img {
+	border: solid 2px;
+	border-radius: 50%;
+}
+
 .loleaflet-annotation-author {
 	padding-left: 10px;
 	padding-right: 10px;
@@ -354,12 +359,6 @@ body {
 	font-size: 11px;
 }
 
-.loleaflet-annotation-userline {
-	background-color: darkblue;
-	width: 32px;
-	height: 6px;
-}
-
 .loleaflet-annotation-menubar {
 	margin: 0;
 	padding: 0;
diff --git a/loleaflet/js/toolbar.js b/loleaflet/js/toolbar.js
index 03f30803a..d6c7b755d 100644
--- a/loleaflet/js/toolbar.js
+++ b/loleaflet/js/toolbar.js
@@ -2338,7 +2338,7 @@ function getUserItem(viewId, userName, extraInfo, color) {
 	var html = '<tr class="' + className + '" id="user-' + viewId + '" onclick="onUseritemClicked(event)">' +
 		     '<td class=usercolor>';
 	if (extraInfo !== undefined && extraInfo.avatar !== undefined) {
-		html += '<img src="' + extraInfo.avatar + '" width="32" height="32" style="border: 5px solid ' + color  + ';" />';
+		html += '<img class="avatar-img" src="' + extraInfo.avatar + '" style="border-color: ' + color  + ';" />';
 	}
 
 	// TODO: Add mail and other links as sub-menu.
diff --git a/loleaflet/src/layer/AnnotationManager.js b/loleaflet/src/layer/AnnotationManager.js
index 80bdd01aa..c8a623639 100644
--- a/loleaflet/src/layer/AnnotationManager.js
+++ b/loleaflet/src/layer/AnnotationManager.js
@@ -796,15 +796,12 @@ L.AnnotationManager = L.Class.extend({
 		var initNeeded = (this._initialLayoutData === undefined);
 		var contentWrapperClass = $('.loleaflet-annotation-content-wrapper');
 		if (initNeeded && contentWrapperClass.length > 0) {
-			var userlineClass = $('.loleaflet-annotation-userline');
 			var contentAuthor = $('.loleaflet-annotation-content-author');
 			var dateClass = $('.loleaflet-annotation-date');
 
 			this._initialLayoutData = {
 				wrapperWidth: parseInt(contentWrapperClass.css('width')),
 				wrapperFontSize: parseInt(contentWrapperClass.css('font-size')),
-				authorLineWidth: parseInt(userlineClass.css('width')),
-				authorLineHeight: parseInt(userlineClass.css('height')),
 				authorContentHeight: parseInt(contentAuthor.css('height')),
 				dateFontSize: parseInt(dateClass.css('font-size')),
 			};
diff --git a/loleaflet/src/layer/marker/Annotation.js b/loleaflet/src/layer/marker/Annotation.js
index 2ea749f94..0eedb26a3 100644
--- a/loleaflet/src/layer/marker/Annotation.js
+++ b/loleaflet/src/layer/marker/Annotation.js
@@ -193,12 +193,11 @@ L.Annotation = L.Layer.extend({
 		var tr = L.DomUtil.create('tr', empty, tbody);
 		var tdImg = L.DomUtil.create(tagTd, 'loleaflet-annotation-img', tr);
 		var tdAuthor = L.DomUtil.create(tagTd, 'loleaflet-annotation-author', tr);
-		var imgAuthor = L.DomUtil.create('img', empty, tdImg);
+		var imgAuthor = L.DomUtil.create('img', 'avatar-img', tdImg);
 		imgAuthor.setAttribute('src', L.Icon.Default.imagePath + '/user.png');
 		imgAuthor.setAttribute('width', this.options.imgSize.x);
 		imgAuthor.setAttribute('height', this.options.imgSize.y);
 		this._authorAvatarImg = imgAuthor;
-		this._authorUserLine = L.DomUtil.create(tagDiv, 'loleaflet-annotation-userline', tdImg);
 		this._contentAuthor = L.DomUtil.create(tagDiv, 'loleaflet-annotation-content-author', tdAuthor);
 		this._contentDate = L.DomUtil.create(tagDiv, 'loleaflet-annotation-date', tdAuthor);
 
@@ -359,6 +358,11 @@ L.Annotation = L.Layer.extend({
 		$(this._nodeModifyText).text(this._data.text);
 		$(this._contentAuthor).text(this._data.author);
 		$(this._authorAvatarImg).attr('src', this._data.avatar);
+		var user = this._map.getViewId(this._data.author);
+		if (user >= 0) {
+			var color = L.LOUtil.rgbToHex(this._map.getViewColor(user));
+			$(this._authorAvatarImg).css('border-color', color);
+		}
 
 		var d = new Date(this._data.dateTime.replace(/,.*/, 'Z'));
 		var dateOptions = { weekday: 'short', year: 'numeric', month: 'short', day: 'numeric' };
@@ -385,10 +389,6 @@ L.Annotation = L.Layer.extend({
 		this._wrapper.style.width = wrapperWidth + 'px';
 		var wrapperFontSize = Math.round(initialLayoutData.wrapperFontSize * scaleFactor);
 		this._wrapper.style.fontSize = wrapperFontSize + 'px';
-		var authorLineWidth = Math.round(initialLayoutData.authorLineWidth * scaleFactor);
-		this._authorUserLine.style.width = authorLineWidth + 'px';
-		var authorLineHeight = Math.round(initialLayoutData.authorLineHeight * scaleFactor);
-		this._authorUserLine.style.height = authorLineHeight + 'px';
 		var contentAuthorHeight = Math.round(initialLayoutData.authorContentHeight * scaleFactor);
 		this._contentAuthor.style.height = contentAuthorHeight + 'px';
 		var dateFontSize = Math.round(initialLayoutData.dateFontSize * scaleFactor);
diff --git a/loleaflet/src/map/Map.js b/loleaflet/src/map/Map.js
index 06e26f6ca..a2c710eb5 100644
--- a/loleaflet/src/map/Map.js
+++ b/loleaflet/src/map/Map.js
@@ -271,10 +271,10 @@ L.Map = L.Evented.extend({
 	updateAvatars: function() {
 		if (this._docLayer && this._docLayer._annotations && this._docLayer._annotations._items) {
 			for (var idxAnno in this._docLayer._annotations._items) {
-				var username = this._docLayer._annotations._items[idxAnno]._data.author;
-				if (this._viewInfoByUserName[username]) {
-					$(this._docLayer._annotations._items[idxAnno]._authorAvatarImg).attr('src', this._viewInfoByUserName[username].userextrainfo.avatar);
-				}
+				var annotation = this._docLayer._annotations._items[idxAnno];
+				var username = annotation._data.author;
+				annotation._data.avatar = this._viewInfoByUserName[username].userextrainfo.avatar;
+				annotation._updateContent();
 			}
 		}
 	},
commit 9d96aa4b6b93eb87767c1dd51bdd1e35131b07d7
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Wed Jan 30 09:31:44 2019 +0100
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Wed Jan 30 16:54:51 2019 +0100

    Reduce readonly toolbar height in calc
    
    Change-Id: If1784b0626080792b7f80c57ff956367be390198

diff --git a/loleaflet/css/spreadsheet.css b/loleaflet/css/spreadsheet.css
index 8d39c9690..07f27f6e7 100644
--- a/loleaflet/css/spreadsheet.css
+++ b/loleaflet/css/spreadsheet.css
@@ -6,7 +6,7 @@
 }
 
 #document-container.spreadsheet-document.readonly {
-	top: 61px;
+	top: 56px;
 }
 
 #document-container.spreadsheet-document.tablet {
@@ -74,7 +74,7 @@
 }
 
 #spreadsheet-row-column-frame.readonly {
-        top: 41px;
+        top: 36px;
 }
 
 #spreadsheet-row-column-frame.tablet {


More information about the Libreoffice-commits mailing list