WIP comments and non-functional changes

pull/1/head
ansuz 3 years ago
parent c630abb3c5
commit c4fcc9f732

@ -157,8 +157,10 @@ define([
var icons = Object.keys(users).map(function (key, i) {
var data = users[key];
var name = data.displayName || data.name || Messages.anonymous;
var avatar = h('span.cp-usergrid-avatar.cp-avatar');
common.displayAvatar($(avatar), data.avatar, name);
var avatar = h('span.cp-usergrid-avatar.cp-avatar', {
'aria-hidden': true, // XXX aria
});
common.displayAvatar($(avatar), data.avatar, name); // XXX
var removeBtn, el;
if (config.remove) {
removeBtn = h('span.fa.fa-times');
@ -1989,11 +1991,11 @@ define([
var $displayName = $userAdmin.find('.'+displayNameCls);
var $avatar = $userAdmin.find('> button .cp-dropdown-button-title');
var $avatar = $userAdmin.find('> button .cp-dropdown-button-title'); // XXX alt="User menu"
var loadingAvatar;
var to;
var oldUrl = '';
var oldUid = undefined;
var oldUid;
var updateButton = function () {
var myData = metadataMgr.getUserData();
var privateData = metadataMgr.getPrivateData();
@ -2024,6 +2026,8 @@ define([
$userAdmin.find('> button').removeClass('cp-avatar');
if ($img) { $userAdmin.find('> button').addClass('cp-avatar'); }
loadingAvatar = false;
// XXX alt="User menu"
}, uid);
return;
}
@ -2306,7 +2310,7 @@ define([
var teams = Object.keys(privateData.teams).map(function (id) {
var data = privateData.teams[id];
var avatar = h('span.cp-creation-team-avatar.cp-avatar');
common.displayAvatar($(avatar), data.avatar, data.name);
common.displayAvatar($(avatar), data.avatar, data.name); // XXX
return h('div.cp-creation-team', {
'data-id': id,
title: data.name,

@ -132,7 +132,12 @@ define([
text = getPrettyInitials(name);
}
var $avatar = $('<span>', {'class': 'cp-avatar-default' + (animal? ' animal': '')}).text(text);
var $avatar = $('<span>', {
'class': 'cp-avatar-default' + (animal? ' animal': ''),
// XXX prevents screenreaders from trying to describe this
alt: '',
'aria-hidden': true,
}).text(text);
$container.append($avatar);
if (uid && animal) {
animal_avatars[uid] = animal_avatar;
@ -184,7 +189,7 @@ define([
var $img = $(mt).appendTo($container);
MT.displayMediatagImage(common, $img, function (err, $image) {
if (err) { return void console.error(err); }
centerImage($img, $image);
centerImage($img, $image); // XXX add alt="" (unless the media-tag has an alt attr)
});
});
}

@ -73,6 +73,7 @@ var factory = function () {
* @param {object} cfg Object {Plugins, allowed, download, pdf} containing infos about plugins
* @param {function} cb Callback function: (err, pluginElement) => {}
*/
// XXX add alt attributes if present in metadata
text: function (metadata, url, content, cfg, cb) {
var plainText = document.createElement('div');
plainText.className = "plain-text-reader";

@ -356,12 +356,13 @@ MessengerUI, Messages, Pages) {
});
}
if (data.profile) {
// XXX title to visit their profile "Visit {0}'s profile"
// Messages.contacts_info3 "Double-click their icon to view their profile",
$span.addClass('cp-userlist-clickable');
$span.click(function () {
Common.openURL(origin+'/profile/#' + data.profile);
});
}
console.error("AVATAR", $span, data.uid);
Common.displayAvatar($span, data.avatar, name, function () {
$span.append($rightCol);
}, data.uid);

@ -59,7 +59,7 @@ define([
verbose = function () {}; // comment out to enable verbose logging
var onRedraw = Util.mkEvent();
var onCursorUpdate = Util.mkEvent();
var remoteCursors = {};
var remoteCursors = {}; // XXX
var setValueAndCursor = function (input, val, _cursor) {
if (!input) { return; }
@ -95,7 +95,7 @@ define([
var getAvatar = function (cursor, noClear) {
// Tippy
var html = MT.getCursorAvatar(cursor);
var html = MT.getCursorAvatar(cursor); // XXX
var l = Util.getFirstCharacter(cursor.name || Messages.anonymous);
@ -103,10 +103,10 @@ define([
if (cursor.color) {
text = 'color:'+getTextColor(cursor.color)+';';
}
var avatar = h('span.cp-cursor.cp-tippy-html', {
var avatar = h('span.cp-cursor.cp-tippy-html', { // XXX
style: "background-color: " + (cursor.color || 'red') + ";"+text,
'data-cptippy-html': true,
title: html
title: html, // XXX "{0} is editing"
}, l);
if (!noClear) {
cursor.clear = function () {
@ -852,7 +852,7 @@ define([
getAvatar: getAvatar,
openLink: openLink,
getTags: getExistingTags,
cursors: remoteCursors,
cursors: remoteCursors, // XXX
boards: boards,
_boards: Util.clone(boards),
});
@ -1101,7 +1101,7 @@ define([
$container.find('.kanban-edit-item').remove();
});
var getCursor = function () {
var getCursor = function () { // XXX
if (!kanban || !kanban.inEditMode) { return; }
try {
var id = kanban.inEditMode;
@ -1204,7 +1204,7 @@ define([
var remoteContent = newContent.content;
if (Sortify(currentContent) !== Sortify(remoteContent)) {
var cursor = getCursor();
var cursor = getCursor(); // XXX
verbose("Content is different.. Applying content");
kanban.options.boards = remoteContent;
updateBoards(framework, kanban, remoteContent);
@ -1261,11 +1261,11 @@ define([
});
var myCursor = {};
onCursorUpdate.reg(function (data) {
onCursorUpdate.reg(function (data) { // XXX
myCursor = data;
framework.updateCursor();
});
framework.onCursorUpdate(function (data) {
framework.onCursorUpdate(function (data) { // XXX
if (!data) { return; }
if (data.reset) {
Object.keys(remoteCursors).forEach(function (id) {
@ -1293,7 +1293,7 @@ define([
if (!cursor.item && !cursor.board) { return; }
// Add new cursor
var avatar = getAvatar(cursor);
var avatar = getAvatar(cursor); // XXX
var $item = $('.kanban-item[data-eid="'+cursor.item+'"]');
var $board = $('.kanban-board[data-id="'+cursor.board+'"]');
if ($item.length) {

@ -349,7 +349,7 @@ define([
$('<img>', {
src: '/customize/images/avatar.png',
title: Messages.profile_avatar,
alt: 'Avatar'
alt: 'Avatar' // XXX translate this "Default profile picture"
}).appendTo($span);
return;
}
@ -391,7 +391,7 @@ define([
}, function () {
sframeChan.query("Q_PROFILE_AVATAR_ADD", data.url, function (err, err2) {
if (err || err2) { return void UI.log(err || err2); }
displayAvatar(data.url);
displayAvatar(data.url); // XXX add "Profile picture"
});
});
};

@ -511,7 +511,7 @@ define([
framework.updateCursor();
}, 500); // 500ms to make sure it is sent after chainpad sync
};
framework.onCursorUpdate(CodeMirror.setRemoteCursor);
framework.onCursorUpdate(CodeMirror.setRemoteCursor); // XXX
framework.setCursorGetter(CodeMirror.getCursor);
editor.on('cursorActivity', updateCursor);

Loading…
Cancel
Save