define([ '/common/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 button to change my username. */ var USERNAME_BUTTON_GROUP = Bar.constants.changeName = 'cryptpad-changeName'; /** 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 LEFTSIDE_CLS = Bar.constants.leftside = 'cryptpad-toolbar-leftside'; var RIGHTSIDE_CLS = Bar.constants.rightside = 'cryptpad-toolbar-rightside'; var BACK_CLS = Bar.constants.back = 'cryptpad-back'; var SPINNER_CLS = Bar.constants.spinner = 'cryptpad-spinner'; /** 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 styleToolbar = function ($container, href) { href = href || '/customize/toolbar.css'; $.ajax({ url: href, dataType: 'text', success: function (data) { $container.append($('