define([ 'jquery', '/api/config', '/common/cryptpad-common.js', '/common/common-util.js', '/common/media-tag.js', '/common/tippy.min.js', '/customize/application_config.js', 'css!/common/tippy.css', ], function ($, Config, Cryptpad, Util, MediaTag, Tippy, AppConfig) { var UI = {}; var Messages = Cryptpad.Messages; /** * Requirements from cryptpad-common.js * getFileSize * - hrefToHexChannelId * displayAvatar * - getFirstEmojiOrCharacter * - parsePadUrl * - getSecrets * - base64ToHex * - getBlobPathFromHex * - bytesToMegabytes * createUserAdminMenu * - fixHTML * - createDropdown */ UI.updateTags = function (common, href) { var sframeChan = common.getSframeChannel(); sframeChan.query('Q_TAGS_GET', href || null, function (err, res) { if (err || res.error) { if (res.error === 'NO_ENTRY') { Cryptpad.alert(Messages.tags_noentry); } return void console.error(err || res.error); } Cryptpad.dialog.tagPrompt(res.data, function (tags) { if (!Array.isArray(tags)) { return; } sframeChan.event('EV_TAGS_SET', { tags: tags, href: href, }); }); }); }; UI.createButton = function (common, type, rightside, data, callback) { var AppConfig = common.getAppConfig(); var button; var size = "17px"; var sframeChan = common.getSframeChannel(); switch (type) { case 'export': button = $('