diff options
author | Marcel Klehr <mklehr@gmx.net> | 2012-12-03 04:14:15 -0800 |
---|---|---|
committer | Marcel Klehr <mklehr@gmx.net> | 2012-12-03 04:14:15 -0800 |
commit | 17fb60e483933bfa81fbff53c72f032c4114634a (patch) | |
tree | 8c9484c2068b36bc7f73262bb9c541fcb0c2bf28 | |
parent | 433421cc912f6881748b16faf4a7b920bf84d771 (diff) | |
parent | b5c263dd37829afc63c0e1ea572954094c4be062 (diff) | |
download | etherpad-lite-17fb60e483933bfa81fbff53c72f032c4114634a.zip |
Merge pull request #1248 from ether/improved-search
Improve plugin search
uses modules descriptions too now, bit more cpu heavy, but that's okay
-rw-r--r-- | src/static/js/pluginfw/installer.js | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/static/js/pluginfw/installer.js b/src/static/js/pluginfw/installer.js index d668e549..e491f077 100644 --- a/src/static/js/pluginfw/installer.js +++ b/src/static/js/pluginfw/installer.js @@ -91,9 +91,12 @@ exports.search = function(query, cache, cb) { if (er) return cb(er); var res = {}; var i = 0; - for (key in data) { + for (key in data) { // for every plugin in the data from npm if ( key.indexOf(plugins.prefix) == 0 - && key.indexOf(query.pattern) != -1) { + && key.indexOf(query.pattern) != -1 + || key.indexOf(plugins.prefix) == 0 + && data[key].description.indexOf(query.pattern) != -1 + ) { // If the name contains ep_ and the search string is in the name or description i++; if (i > query.offset && i <= query.offset + query.limit) { |