mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-28 11:26:16 -04:00
Cleanup
This commit is contained in:
parent
b86aa5d858
commit
9729af63e8
2 changed files with 3 additions and 8 deletions
|
@ -19,17 +19,13 @@ exports.hooks = {};
|
||||||
exports.ensure = function (cb) {
|
exports.ensure = function (cb) {
|
||||||
if (!exports.loaded)
|
if (!exports.loaded)
|
||||||
exports.getPackages(function (er, packages) {
|
exports.getPackages(function (er, packages) {
|
||||||
pkg = Object.keys(packages).map(function (name) {
|
requirejs.config({
|
||||||
|
packages: Object.keys(packages).map(function (name) {
|
||||||
return {
|
return {
|
||||||
name: name,
|
name: name,
|
||||||
location: packages[name].realPath
|
location: packages[name].realPath
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
;
|
|
||||||
|
|
||||||
console.log(["AAAAAAAAA", pkg]);
|
|
||||||
requirejs.config({
|
|
||||||
packages: pkg
|
|
||||||
});
|
});
|
||||||
|
|
||||||
exports.update(cb);
|
exports.update(cb);
|
||||||
|
|
|
@ -23,8 +23,6 @@ function loadFn(path, hookName, cb) {
|
||||||
functionName = parts[1];
|
functionName = parts[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(["loadName", path, functionName]);
|
|
||||||
|
|
||||||
var handleFunction = function (fn) {
|
var handleFunction = function (fn) {
|
||||||
functionName = functionName ? functionName : hookName;
|
functionName = functionName ? functionName : hookName;
|
||||||
|
|
||||||
|
@ -38,6 +36,7 @@ function loadFn(path, hookName, cb) {
|
||||||
/* We're apparently in NodeJS, so try to load using the built-in require first */
|
/* We're apparently in NodeJS, so try to load using the built-in require first */
|
||||||
try {
|
try {
|
||||||
handleFunction(require(path));
|
handleFunction(require(path));
|
||||||
|
console.warn("Module uses old CommonJS format: " + path);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
requirejs([path], handleFunction);
|
requirejs([path], handleFunction);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue