diff --git a/www/code/main.js b/www/code/main.js index 715133c18..0b9cda087 100644 --- a/www/code/main.js +++ b/www/code/main.js @@ -19,7 +19,9 @@ define([ ], function (Config, /*RTCode,*/ Messages, Crypto, Realtime, TextPatcher, Toolbar, JSONSortify, JsonOT, Cryptpad, Modes, Themes, Visible, Notify) { var $ = window.jQuery; var saveAs = window.saveAs; - var module = window.APP = {}; + var module = window.APP = { + Cryptpad: Cryptpad, + }; var ifrw = module.ifrw = $('#pad-iframe')[0].contentWindow; var stringify = function (obj) { return JSONSortify(obj); @@ -184,16 +186,17 @@ define([ }; var onInit = config.onInit = function (info) { + //Cryptpad.warn("Initializing realtime session..."); var $bar = $('#pad-iframe')[0].contentWindow.$('#cme_toolbox'); toolbarList = info.userList; var config = { userData: userList, - changeNameID: 'cryptpad-changeName', + changeNameID: Toolbar.constants.changeName, }; - toolbar = info.realtime.toolbar = Toolbar.create($bar, info.myID, info.realtime, info.getLag, info.userList, config); - createChangeName('cryptpad-changeName', $bar); + toolbar = module.toolbar = Toolbar.create($bar, info.myID, info.realtime, info.getLag, info.userList, config); + createChangeName(Toolbar.constants.changeName, $bar); - var $rightside = $bar.find('.rtwysiwyg-toolbar-rightside'); + var $rightside = $bar.find('.' + Toolbar.constants.rightside); /* add an export button */ var $export = $('