define([ '/customize/messages.js', '/customize/DecorateToolbar.js', '/common/cryptpad-common.js', '/bower_components/lil-uri/uri.min.js', '/customize/email.js', '/bower_components/jquery/dist/jquery.min.js', ], function (Messages, DecorateToolbar, Cryptpad, LilUri, Email) { var $ = window.$; var email = Email.makeScrambler(1); // slip past the spammers, then unscramble mailto links $('a[href^="mailto:"]').each(function () { $(this).attr('href', function (i, href) { return href.replace(/:(.*$)/, function (a, address) { return ':' + email.decrypt(address); }); }); }); DecorateToolbar.main($('#bottom-bar')); Cryptpad.styleAlerts(); var $table = $('table.scroll'); var $tbody = $table.find('tbody'); var $tryit = $('#tryit'); var now = new Date(); var hasRecent = false; var forgetPad = Cryptpad.forgetPad; var padTypes = { '/pad/': 'Pad', '/code/': 'Code', '/poll/': 'Poll', }; var truncateTitle = function (title, len) { if (typeof(title) === 'string' && title.length > len) { return title.slice(0, len) + '…'; } return title; }; var fixHTML = function (html) { return html.replace(/', { id: id }); var $remove = $('