diff options
author | John McLear <john@mclear.co.uk> | 2014-11-04 17:06:47 +0000 |
---|---|---|
committer | John McLear <john@mclear.co.uk> | 2014-11-04 17:06:47 +0000 |
commit | c7061e47db8aa7828461fc3344e69a6b4dc6d319 (patch) | |
tree | 568c3403a383d33d1c363820711fe9e9867118c3 | |
parent | b61d8d99d17833d9fb45d21e9fb213ae59acd9f1 (diff) | |
download | etherpad-lite-c7061e47db8aa7828461fc3344e69a6b4dc6d319.zip |
use request and a remote ep plugin only endpoint
-rw-r--r-- | src/static/js/pluginfw/installer.js | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/static/js/pluginfw/installer.js b/src/static/js/pluginfw/installer.js index 9f7ac939..7480e152 100644 --- a/src/static/js/pluginfw/installer.js +++ b/src/static/js/pluginfw/installer.js @@ -1,6 +1,7 @@ var plugins = require("ep_etherpad-lite/static/js/pluginfw/plugins"); var hooks = require("ep_etherpad-lite/static/js/pluginfw/hooks"); var npm = require("npm"); +var request = require("request"); var npmIsLoaded = false; var withNpm = function (npmfn) { @@ -60,17 +61,16 @@ exports.availablePlugins = null; var cacheTimestamp = 0; exports.getAvailablePlugins = function(maxCacheAge, cb) { - withNpm(function (er) { + request("http://etherpad.org/plugins.json", function(er, response, plugins){ if (er) return cb && cb(er); if(exports.availablePlugins && maxCacheAge && Math.round(+new Date/1000)-cacheTimestamp <= maxCacheAge) { return cb && cb(null, exports.availablePlugins) } - npm.commands.search(['ep_'], /*silent?*/true, function(er, results) { - if(er) return cb && cb(er); - exports.availablePlugins = results; + console.log("plugins", plugins); + plugins = JSON.parse(plugins); + exports.availablePlugins = plugins; cacheTimestamp = Math.round(+new Date/1000); - cb && cb(null, results) - }) + cb && cb(null, plugins) }); }; |