Hooks can now be loaded as AMD

i18n
Egil Moeller 2015-04-12 11:32:59 +02:00
parent 7a1f065702
commit dade9520a4
2 changed files with 13 additions and 4 deletions

View File

@ -20,7 +20,7 @@
* limitations under the License.
*/
define(["ep_etherpad-lite/static/js/rjquery", "underscore"], function ($, _) {
define(["ep_etherpad-lite/static/js/rjquery", "underscore", 'ep_etherpad-lite/static/js/pluginfw/hooks'], function ($, _, hooks) {
var exports = {};
var browser = require('./browser').browser;
@ -43,7 +43,6 @@ var isNodeText = Ace2Common.isNodeText,
binarySearchInfinite = Ace2Common.binarySearchInfinite,
htmlPrettyEscape = Ace2Common.htmlPrettyEscape,
noop = Ace2Common.noop;
var hooks = require('ep_etherpad-lite/static/js/pluginfw/hooks');
function Ace2Inner(){

View File

@ -1,5 +1,5 @@
var async = require("async");
var _ = require("underscore");
function defineHooks(_, async, exports) {
if (exports == undefined) exports = {};
exports.bubbleExceptions = true
@ -125,3 +125,13 @@ exports.callAllStr = function(hook_name, args, sep, pre, post) {
}
return newCallhooks.join(sep || "");
}
return exports;
}
if (typeof(define) != 'undefined' && define.amd != undefined && typeof(exports) == 'undefined') {
define(["underscore", "async/lib/async"], defineHooks);
} else {
defineHooks(require("underscore"), require("async"), exports);
}