|
|
@ -7,10 +7,8 @@ define([
|
|
|
|
'/common/common-ui-elements.js',
|
|
|
|
'/common/common-ui-elements.js',
|
|
|
|
'/common/notifications.js',
|
|
|
|
'/common/notifications.js',
|
|
|
|
'/common/hyperscript.js',
|
|
|
|
'/common/hyperscript.js',
|
|
|
|
'/common/clipboard.js',
|
|
|
|
|
|
|
|
'/customize/messages.js',
|
|
|
|
'/customize/messages.js',
|
|
|
|
], function ($, ApiConfig, Util, Hash, UI, UIElements, Notifications, h,
|
|
|
|
], function ($, ApiConfig, Util, Hash, UI, UIElements, Notifications, h, Messages) {
|
|
|
|
Clipboard, Messages) {
|
|
|
|
|
|
|
|
var Mailbox = {};
|
|
|
|
var Mailbox = {};
|
|
|
|
|
|
|
|
|
|
|
|
Mailbox.create = function (Common) {
|
|
|
|
Mailbox.create = function (Common) {
|
|
|
@ -65,17 +63,9 @@ define([
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (data.type === 'broadcast') {
|
|
|
|
if (data.type === 'broadcast') {
|
|
|
|
var urlArgs = Util.find(ApiConfig, ['requireConf', 'urlArgs']) || '';
|
|
|
|
var urlArgs = Util.find(ApiConfig, ['requireConf', 'urlArgs']) || '';
|
|
|
|
var adminCls = Common.isAdmin() ? '.admin' : '';
|
|
|
|
avatar = h('span.cp-broadcast', h('img', {
|
|
|
|
avatar = h('span.cp-broadcast'+adminCls, h('img', {
|
|
|
|
|
|
|
|
src: '/customize/CryptPad_logo.svg?' + urlArgs,
|
|
|
|
src: '/customize/CryptPad_logo.svg?' + urlArgs,
|
|
|
|
title: adminCls ? 'Copy UID' : '' // XXX
|
|
|
|
|
|
|
|
}));
|
|
|
|
}));
|
|
|
|
if (adminCls) {
|
|
|
|
|
|
|
|
$(avatar).click(function () {
|
|
|
|
|
|
|
|
var success = Clipboard.copy(Util.find(data, ['content', 'msg', 'uid']));
|
|
|
|
|
|
|
|
if (success) { UI.log(Messages.shareSuccess); }
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else if (userData && typeof(userData) === "object" && userData.profile) {
|
|
|
|
} else if (userData && typeof(userData) === "object" && userData.profile) {
|
|
|
|
avatar = h('span.cp-avatar');
|
|
|
|
avatar = h('span.cp-avatar');
|
|
|
|
Common.displayAvatar($(avatar), userData.avatar, userData.displayName || userData.name);
|
|
|
|
Common.displayAvatar($(avatar), userData.avatar, userData.displayName || userData.name);
|
|
|
|