define([ '/customize/messages.js', '/bower_components/jquery/dist/jquery.min.js' ], function (Messages) { var $ = window.jQuery; var Bar = { constants: {}, }; /** Id of the div containing the user list. */ var USER_LIST_CLS = Bar.constants.userlist = 'cryptpad-user-list'; /** Id of the div containing the lag info. */ var LAG_ELEM_CLS = Bar.constants.lag = 'cryptpad-lag'; /** The toolbar class which contains the user list, debug link and lag. */ var TOOLBAR_CLS = Bar.constants.toolbar = 'cryptpad-toolbar'; var TOP_CLS = Bar.constants.top = 'cryptpad-toolbar-top'; var LEFTSIDE_CLS = Bar.constants.leftside = 'cryptpad-toolbar-leftside'; var RIGHTSIDE_CLS = Bar.constants.rightside = 'cryptpad-toolbar-rightside'; var SPINNER_CLS = Bar.constants.spinner = 'cryptpad-spinner'; var STATE_CLS = Bar.constants.state = 'cryptpad-state'; var USERNAME_CLS = Bar.constants.username = 'cryptpad-toolbar-username'; var READONLY_CLS = Bar.constants.readonly = 'cryptpad-readonly'; var USERBUTTONS_CONTAINER_CLS = Bar.constants.userButtonsContainer = "cryptpad-userbuttons-container"; var USERLIST_CLS = Bar.constants.userlist = "cryptpad-dropdown-users"; var EDITSHARE_CLS = Bar.constants.editShare = "cryptpad-dropdown-editShare"; var VIEWSHARE_CLS = Bar.constants.viewShare = "cryptpad-dropdown-viewShare"; var DROPDOWN_CONTAINER_CLS = Bar.constants.dropdownContainer = "cryptpad-dropdown-container"; var DROPDOWN_CLS = Bar.constants.dropdown = "cryptpad-dropdown"; var TITLE_CLS = Bar.constants.title = "cryptpad-title"; var USER_CLS = Bar.constants.userAdmin = "cryptpad-user"; /** Key in the localStore which indicates realtime activity should be disallowed. */ // TODO remove? will never be used in cryptpad var LOCALSTORAGE_DISALLOW = Bar.constants.localstorageDisallow = 'cryptpad-disallow'; var SPINNER_DISAPPEAR_TIME = 3000; var SPINNER = [ '-', '\\', '|', '/' ]; var uid = function () { return 'cryptpad-uid-' + String(Math.random()).substring(2); }; var $style; var firstConnection = true; var styleToolbar = function ($container, href) { href = href || '/customize/toolbar.css'; $.ajax({ url: href, dataType: 'text', success: function (data) { $container.append($('