summaryrefslogtreecommitdiff
path: root/src/static/js/pluginfw
diff options
context:
space:
mode:
authorMarcel Klehr <mklehr@gmx.net>2013-09-23 19:55:35 +0200
committerMarcel Klehr <mklehr@gmx.net>2013-09-23 19:55:35 +0200
commit6a02302fc9dfabd6108b91a43b5f8908bdbfbe81 (patch)
treef2428b59f1bd7d3c137ad67d8f5df16b0d827802 /src/static/js/pluginfw
parent7898c350f7f8a012af832bd062621a9ead6bdef1 (diff)
downloadetherpad-lite-6a02302fc9dfabd6108b91a43b5f8908bdbfbe81.zip
/admin/plugins: Fix search algorithm (use string match in lower case)
fix #1903
Diffstat (limited to 'src/static/js/pluginfw')
-rw-r--r--src/static/js/pluginfw/installer.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/static/js/pluginfw/installer.js b/src/static/js/pluginfw/installer.js
index b125a77c..e5602616 100644
--- a/src/static/js/pluginfw/installer.js
+++ b/src/static/js/pluginfw/installer.js
@@ -83,8 +83,8 @@ exports.search = function(searchTerm, maxCacheAge, cb) {
searchTerm = searchTerm.toLowerCase();
for (var pluginName in results) { // for every available plugin
if (pluginName.indexOf(plugins.prefix) != 0) continue; // TODO: Also search in keywords here!
-
- if(searchTerm && pluginName.indexOf(searchTerm) < 0 && results[pluginName].description.indexOf(searchTerm) < 0) continue;
+
+ if(searchTerm && !~pluginName.toLowerCase().indexOf(searchTerm) && !~results[pluginName].description.toLowerCase().indexOf(searchTerm)) continue;
res[pluginName] = results[pluginName];
}
cb && cb(null, res)