include uid in cursor data for animal avatars

pull/1/head
ansuz 3 years ago
parent 7bb3bc167c
commit 68efd54917

@ -388,7 +388,9 @@ define([
var andThen2 = function (editor, CodeMirror, framework, isPresentMode) {
var common = framework._.sfCommon;
var privateData = common.getMetadataMgr().getPrivateData();
var metadataMgr = common.getMetadataMgr();
var privateData = metadataMgr.getPrivateData();
CodeMirror.uid = metadataMgr.getUserData().uid;
var previewPane = mkPreviewPane(editor, CodeMirror, framework, isPresentMode);
var markdownTb = mkMarkdownTb(editor, framework);

@ -43,9 +43,15 @@ define([
});
};
var animal_avatars = {};
MT.getCursorAvatar = function (cursor) {
var uid = cursor.uid;
var html = '<span class="cp-cursor-avatar">';
if (cursor.avatar && avatars[cursor.avatar]) {
html += (cursor.avatar && avatars[cursor.avatar]) || '';
} else if (animal_avatars[uid]) {
html += animal_avatars[uid] + ' ';
}
html += Util.fixHTML(cursor.name) + '</span>';
return html;
};
@ -109,7 +115,6 @@ define([
return text;
};
var animal_avatars = {};
MT.displayAvatar = function (common, $container, href, name, _cb, uid) {
var cb = Util.once(Util.mkAsync(_cb || function () {}));
var displayDefault = function () {

@ -509,6 +509,7 @@ define([
var cursor = {};
cursor.selectionStart = cursorToPos(editor.getCursor('from'), doc);
cursor.selectionEnd = cursorToPos(editor.getCursor('to'), doc);
cursor.uid = exp.uid; // FIXME this is inefficient for the network but it's unlikely to trigger errors
return cursor;
};

@ -459,7 +459,9 @@ define([
var andThen2 = function (editor, CodeMirror, framework, isPresentMode) {
var common = framework._.sfCommon;
var privateData = common.getMetadataMgr().getPrivateData();
var metadataMgr = common.getMetadataMgr();
var privateData = metadataMgr.getPrivateData();
CodeMirror.uid = metadataMgr.getUserData().uid;
var $contentContainer = $('#cp-app-slide-editor');
var $modal = $('#cp-app-slide-modal');

Loading…
Cancel
Save