summaryrefslogtreecommitdiff
path: root/src/static/js/pluginfw
diff options
context:
space:
mode:
authorEgil Moeller <egil.moller@freecode.no>2012-04-17 22:18:43 +0200
committerEgil Moeller <egil.moller@freecode.no>2012-04-17 22:40:53 +0200
commit7ab7ee9f5ee1caedbf1ca5ac10934a269ecde8f6 (patch)
tree1a819a7905f625c6249f429b99a4c4e14763938c /src/static/js/pluginfw
parent6f774bc6a567211a8a7157458c249d89a145c3ab (diff)
downloadetherpad-lite-7ab7ee9f5ee1caedbf1ca5ac10934a269ecde8f6.zip
Plugin admin fixes
Diffstat (limited to 'src/static/js/pluginfw')
-rw-r--r--src/static/js/pluginfw/installer.js15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/static/js/pluginfw/installer.js b/src/static/js/pluginfw/installer.js
index 127a95aa..09bde920 100644
--- a/src/static/js/pluginfw/installer.js
+++ b/src/static/js/pluginfw/installer.js
@@ -55,7 +55,7 @@ exports.install = function(plugin_name, cb) {
);
};
-exports.search = function(pattern, cb) {
+exports.search = function(query, cb) {
withNpm(
function (cb) {
registry.get(
@@ -63,11 +63,18 @@ exports.search = function(pattern, cb) {
function (er, data) {
if (er) return cb(er);
var res = {};
+ var i = 0;
for (key in data) {
- if (key.indexOf(plugins.prefix) == 0 && key.indexOf(pattern) != -1)
- res[key] = data[key];
+ if (/* && key.indexOf(plugins.prefix) == 0 */
+ key.indexOf(query.pattern) != -1) {
+ i++;
+ if (i > query.offset
+ && i <= query.offset + query.limit) {
+ res[key] = data[key];
+ }
+ }
}
- cb(null, {results:res});
+ cb(null, {results:res, query: query, total:i});
}
);
},