define([ 'jquery', '/api/config', '/common/cryptpad-common.js', '/common/common-util.js', '/common/common-language.js', '/common/common-interface.js', '/common/media-tag.js', '/common/tippy.min.js', '/customize/application_config.js', 'css!/common/tippy.css', ], function ($, Config, Cryptpad, Util, UI, Language, MediaTag, Tippy, AppConfig) { var UIElements = {}; var Messages = Cryptpad.Messages; /** * Requirements from cryptpad-common.js * getFileSize * - hrefToHexChannelId * displayAvatar * - getFirstEmojiOrCharacter * - parsePadUrl * - getSecrets * - base64ToHex * - getBlobPathFromHex * - bytesToMegabytes */ UIElements.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') { UI.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, }); }); }); }; UIElements.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 = $('