Some amd loading of hooks

This commit is contained in:
Egil Moeller 2015-04-12 13:33:33 +02:00
parent 77449760f6
commit 027d9e3a70
2 changed files with 35 additions and 28 deletions

View file

@ -48,8 +48,6 @@ var readCookie = require('./pad_utils').readCookie;
var randomString = require('./pad_utils').randomString; var randomString = require('./pad_utils').randomString;
var gritter = require('./gritter').gritter; var gritter = require('./gritter').gritter;
var hooks = require('ep_etherpad-lite/static/js/pluginfw/hooks');
var receivedClientVars = false; var receivedClientVars = false;
function createCookie(name, value, days, path){ /* Warning Internet Explorer doesn't use this it uses the one from pad_utils.js */ function createCookie(name, value, days, path){ /* Warning Internet Explorer doesn't use this it uses the one from pad_utils.js */
@ -947,8 +945,13 @@ var alertBar = (function()
return self; return self;
}()); }());
var hooks = undefined;
function init() { function init() {
requirejs(['ep_etherpad-lite/static/js/pluginfw/hooks'], function (h) {
hooks = h;
return pad.init(); return pad.init();
});
} }
var settings = { var settings = {

View file

@ -398,7 +398,12 @@
paths: {'underscore': baseURL + "static/plugins/underscore/underscore"}, paths: {'underscore': baseURL + "static/plugins/underscore/underscore"},
}); });
requirejs(["ep_etherpad-lite/static/js/rjquery", 'ep_etherpad-lite/static/js/pluginfw/client_plugins'], function ($, plugins) { requirejs(
[
'ep_etherpad-lite/static/js/rjquery',
'ep_etherpad-lite/static/js/pluginfw/client_plugins',
'ep_etherpad-lite/static/js/pluginfw/hooks'
], function ($, plugins, hooks) {
window.$ = $; // Expose jQuery #HACK window.$ = $; // Expose jQuery #HACK
window.jQuery = $; window.jQuery = $;
@ -407,8 +412,6 @@
document.domain = document.domain; // for comet document.domain = document.domain; // for comet
} }
var hooks = require('ep_etherpad-lite/static/js/pluginfw/hooks');
plugins.baseURL = baseURL; plugins.baseURL = baseURL;
plugins.update(function () { plugins.update(function () {
hooks.plugins = plugins; hooks.plugins = plugins;
@ -428,7 +431,8 @@
chat = require('ep_etherpad-lite/static/js/chat').chat; chat = require('ep_etherpad-lite/static/js/chat').chat;
padeditbar = require('ep_etherpad-lite/static/js/pad_editbar').padeditbar; padeditbar = require('ep_etherpad-lite/static/js/pad_editbar').padeditbar;
padimpexp = require('ep_etherpad-lite/static/js/pad_impexp').padimpexp; padimpexp = require('ep_etherpad-lite/static/js/pad_impexp').padimpexp;
}); }
);
}()); }());
</script> </script>
<% e.end_block(); %> <% e.end_block(); %>