From 02d9da502d4f376c8a76775da48fdd35f8aa3ddc Mon Sep 17 00:00:00 2001 From: ansuz Date: Mon, 30 Aug 2021 17:56:53 +0530 Subject: [PATCH 1/4] remove dead code --- customize.dist/src/less2/include/sidebar-layout.less | 1 - 1 file changed, 1 deletion(-) diff --git a/customize.dist/src/less2/include/sidebar-layout.less b/customize.dist/src/less2/include/sidebar-layout.less index 1b0c75932..564067fb7 100644 --- a/customize.dist/src/less2/include/sidebar-layout.less +++ b/customize.dist/src/less2/include/sidebar-layout.less @@ -69,7 +69,6 @@ background: @cp_sidebar-right-bg; color: @cp_sidebar-right-fg; overflow: auto; - //padding-bottom: 200px; // XXX what was the intent behind this? // Following rules are only in settings .cp-sidebarlayout-element { From 147ddd88bf0aa32e7f144155c9eeadab794ed19a Mon Sep 17 00:00:00 2001 From: ansuz Date: Mon, 30 Aug 2021 18:40:42 +0530 Subject: [PATCH 2/4] adjust font size for initials and emoji avatar size on small screens --- customize.dist/src/less2/include/toolbar.less | 9 +++++++-- www/kanban/app-kanban.less | 5 ++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/customize.dist/src/less2/include/toolbar.less b/customize.dist/src/less2/include/toolbar.less index 2092d72cc..6ccec507d 100644 --- a/customize.dist/src/less2/include/toolbar.less +++ b/customize.dist/src/less2/include/toolbar.less @@ -532,7 +532,13 @@ &> button { height: @toolbar_line-height; width: @toolbar_line-height; - span { font-size: unset; } + span { + .avatar_vars(36px); + font-size: @avatar-font-size; + .animal { + font-size: @avatar-font-size-animal; + } + } } &> button.cp-avatar.cp-avatar { media-tag { @@ -862,7 +868,6 @@ align-items: center; .animal { font-size: @avatar-font-size-animal; - } } &.cp-avatar { diff --git a/www/kanban/app-kanban.less b/www/kanban/app-kanban.less index 5996940e4..79d5a87a3 100644 --- a/www/kanban/app-kanban.less +++ b/www/kanban/app-kanban.less @@ -162,10 +162,9 @@ &.cp-cursor.cp-tippy-html { .avatar_vars(20px); background-color: var(--red); - // XXX figure out how to inherit this from avatar.less - font-size: @avatar-font-size; //var(11px; // 20px / 1.8 as per avatar.less.. + font-size: @avatar-font-size; &.animal { - font-size: @avatar-font-size-animal; //14px; // 20px / 1.8 * (6/5)... + font-size: @avatar-font-size-animal; } } } From 0ac368a5c9088ccfa274e90b348ce7b2985ae788 Mon Sep 17 00:00:00 2001 From: ansuz Date: Wed, 1 Sep 2021 16:07:16 +0530 Subject: [PATCH 3/4] resolve minor comments and clean up --- www/common/common-messaging.js | 2 +- www/common/common-ui-elements.js | 2 +- www/common/inner/common-mediatag.js | 15 +++++---------- www/common/sframe-common.js | 5 +---- www/common/toolbar.js | 8 +++++--- www/pad/cursor.js | 2 +- 6 files changed, 14 insertions(+), 20 deletions(-) diff --git a/www/common/common-messaging.js b/www/common/common-messaging.js index 1e6e26ce3..4a3eb2a91 100644 --- a/www/common/common-messaging.js +++ b/www/common/common-messaging.js @@ -18,7 +18,7 @@ define([ curvePublic: proxy.curvePublic, notifications: Util.find(proxy, ['mailboxes', 'notifications', 'channel']), avatar: proxy.profile && proxy.profile.avatar, - uid: proxy.uid, // XXX test without this and see if it breaks things + uid: proxy.uid, }; if (hash === false) { delete data.channel; } return data; diff --git a/www/common/common-ui-elements.js b/www/common/common-ui-elements.js index abf45b0bd..5bc8bf4f6 100644 --- a/www/common/common-ui-elements.js +++ b/www/common/common-ui-elements.js @@ -1991,7 +1991,7 @@ define([ var $displayName = $userAdmin.find('.'+displayNameCls); - var $avatar = $userAdmin.find('> button .cp-dropdown-button-title'); // XXX alt="User menu" + var $avatar = $userAdmin.find('> button .cp-dropdown-button-title'); var loadingAvatar; var to; var oldUrl = ''; diff --git a/www/common/inner/common-mediatag.js b/www/common/inner/common-mediatag.js index 21cb25e82..33e5d74f7 100644 --- a/www/common/inner/common-mediatag.js +++ b/www/common/inner/common-mediatag.js @@ -90,17 +90,12 @@ define([ // https://emojipedia.org/nature/ var ANIMALS = AppConfig.emojiAvatars || []; - var getRandomAnimal = function () { // XXX should never actually happen? - if (!ANIMALS.length) { return ''; } - return ANIMALS[Math.floor(Math.random() * ANIMALS.length)]; - }; - var getPseudorandomAnimal = MT.getPseudorandomAnimal = function (seed) { if (!ANIMALS.length) { return ''; } - if (typeof(seed) !== 'string') { return getRandomAnimal(); } - seed = seed.replace(/\D/g, '').slice(0, 10); // XXX possible optimization for on-wire uid + if (typeof(seed) !== 'string') { return; } + seed = seed.replace(/\D/g, '').slice(0, 10); // TODO possible optimization for on-wire uid seed = parseInt(seed); - if (!seed) { return getRandomAnimal(); } + if (!seed) { return; } return ANIMALS[seed % ANIMALS.length] || ''; }; @@ -141,7 +136,7 @@ define([ var $avatar = $('', { 'class': 'cp-avatar-default' + (animal_avatar? ' animal': ''), - // XXX prevents screenreaders from trying to describe this + // this prevents screenreaders from trying to describe this alt: '', 'aria-hidden': true, }).text(text); @@ -196,7 +191,7 @@ define([ var $img = $(mt).appendTo($container); MT.displayMediatagImage(common, $img, function (err, $image) { if (err) { return void console.error(err); } - centerImage($img, $image); // XXX add alt="" (unless the media-tag has an alt attr) + centerImage($img, $image); }); }); } diff --git a/www/common/sframe-common.js b/www/common/sframe-common.js index 3575c95b0..b7efd9f4f 100644 --- a/www/common/sframe-common.js +++ b/www/common/sframe-common.js @@ -235,9 +235,6 @@ define([ }; }; - funcs.getAuthorId = function () { // XXX - }; - var authorUid = function(existing) { if (!Array.isArray(existing)) { existing = []; } var n; @@ -263,7 +260,7 @@ define([ }); return uid || authorUid(existing); } - // XXX this should check for a matching curvePublic / uid if: + // TODO this should check for a matching curvePublic / uid if: // 1. you are logged in OR // 2. you have a token // so that users that register recognize comments from before diff --git a/www/common/toolbar.js b/www/common/toolbar.js index 5b359a323..5f1c2ece5 100644 --- a/www/common/toolbar.js +++ b/www/common/toolbar.js @@ -164,6 +164,7 @@ MessengerUI, Messages, Pages) { }); }; var showColors = false; + Messages.userlist_visitProfile = "Visit {0}'s profile"; // XXX "'s" is incorrect for names that end in "s" in English... don't care? var updateUserList = function (toolbar, config, forceOffline) { if (!config.displayed || config.displayed.indexOf('userlist') === -1) { return; } if (toolbar.isAlone) { return; } @@ -249,6 +250,7 @@ MessengerUI, Messages, Pages) { var friendRequests = Common.getFriendRequests(); // Friend requests received editUsersNames.forEach(function (data) { var name = data.name || Messages.anonymous; + var safeName = Util.fixHTML(name); var $span = $('', {'class': 'cp-avatar'}); if (data.color && showColors) { $span.css('border-color', data.color); @@ -323,7 +325,7 @@ MessengerUI, Messages, Pages) { $('