Hooks can now be loaded as AMD
parent
7a1f065702
commit
dade9520a4
|
@ -20,7 +20,7 @@
|
||||||
* limitations under the License.
|
* 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 exports = {};
|
||||||
|
|
||||||
var browser = require('./browser').browser;
|
var browser = require('./browser').browser;
|
||||||
|
@ -43,7 +43,6 @@ var isNodeText = Ace2Common.isNodeText,
|
||||||
binarySearchInfinite = Ace2Common.binarySearchInfinite,
|
binarySearchInfinite = Ace2Common.binarySearchInfinite,
|
||||||
htmlPrettyEscape = Ace2Common.htmlPrettyEscape,
|
htmlPrettyEscape = Ace2Common.htmlPrettyEscape,
|
||||||
noop = Ace2Common.noop;
|
noop = Ace2Common.noop;
|
||||||
var hooks = require('ep_etherpad-lite/static/js/pluginfw/hooks');
|
|
||||||
|
|
||||||
function Ace2Inner(){
|
function Ace2Inner(){
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
var async = require("async");
|
function defineHooks(_, async, exports) {
|
||||||
var _ = require("underscore");
|
if (exports == undefined) exports = {};
|
||||||
|
|
||||||
exports.bubbleExceptions = true
|
exports.bubbleExceptions = true
|
||||||
|
|
||||||
|
@ -125,3 +125,13 @@ exports.callAllStr = function(hook_name, args, sep, pre, post) {
|
||||||
}
|
}
|
||||||
return newCallhooks.join(sep || "");
|
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);
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue