summaryrefslogtreecommitdiff
path: root/src/static
diff options
context:
space:
mode:
authorChad Weider <cweider@oofn.net>2012-05-28 18:11:59 -0700
committerChad Weider <cweider@oofn.net>2012-09-11 21:16:47 -0700
commite375b6212a97af529427614134bcab0e1ef91751 (patch)
tree5bf3f09bf22b26d6f3c43433698532f606f68376 /src/static
parentb0d71df604b182b45d83eee6872293f3d910109d (diff)
downloadetherpad-lite-e375b6212a97af529427614134bcab0e1ef91751.zip
Static functions are static.
Diffstat (limited to 'src/static')
-rw-r--r--src/static/js/pluginfw/plugins.js28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/static/js/pluginfw/plugins.js b/src/static/js/pluginfw/plugins.js
index 5925e7d2..e691e4c2 100644
--- a/src/static/js/pluginfw/plugins.js
+++ b/src/static/js/pluginfw/plugins.js
@@ -53,7 +53,7 @@ exports.formatHooks = function (hook_set_name) {
return "<dl>" + res.join("\n") + "</dl>";
};
-exports.loadFn = function (path, hookName) {
+function loadFn(path, hookName) {
var functionName
, parts = path.split(":");
@@ -95,7 +95,7 @@ exports.extractHooks = function (parts, hook_set_name) {
}
try {
- var hook_fn = exports.loadFn(hook_fn_name, hook_name);
+ var hook_fn = loadFn(hook_fn_name, hook_name);
if (!hook_fn) {
throw "Not a function";
}
@@ -161,12 +161,12 @@ exports.update = function (cb) {
async.forEach(
Object.keys(packages),
function (plugin_name, cb) {
- exports.loadPlugin(packages, plugin_name, plugins, parts, cb);
+ loadPlugin(packages, plugin_name, plugins, parts, cb);
},
function (err) {
if (err) cb(err);
exports.plugins = plugins;
- exports.parts = exports.sortParts(parts);
+ exports.parts = sortParts(parts);
exports.hooks = exports.extractHooks(exports.parts, "hooks");
exports.loaded = true;
exports.callInit(cb);
@@ -202,7 +202,10 @@ exports.getPackages = function (cb) {
});
};
-exports.loadPlugin = function (packages, plugin_name, plugins, parts, cb) {
+}
+
+
+function loadPlugin(packages, plugin_name, plugins, parts, cb) {
var plugin_path = path.resolve(packages[plugin_name].path, "ep.json");
fs.readFile(
plugin_path,
@@ -226,9 +229,9 @@ exports.loadPlugin = function (packages, plugin_name, plugins, parts, cb) {
cb();
}
);
-};
+}
-exports.partsToParentChildList = function (parts) {
+function partsToParentChildList(parts) {
var res = [];
_.chain(parts).keys().forEach(function (name) {
_.each(parts[name].post || [], function (child_name) {
@@ -242,18 +245,15 @@ exports.partsToParentChildList = function (parts) {
}
});
return res;
-};
-
+}
// Used only in Node, so no need for _
-exports.sortParts = function(parts) {
+function sortParts(parts) {
return tsort(
- exports.partsToParentChildList(parts)
+ partsToParentChildList(parts)
).filter(
function (name) { return parts[name] !== undefined; }
).map(
function (name) { return parts[name]; }
);
-};
-
-} \ No newline at end of file
+}