From 037478cbcd1b29b99dd4f17dd88e7d90ce63152a Mon Sep 17 00:00:00 2001 From: mluto Date: Thu, 31 Jan 2013 19:05:23 +0100 Subject: [PATCH] Made plugin search not casesensitive --- src/static/js/pluginfw/installer.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/static/js/pluginfw/installer.js b/src/static/js/pluginfw/installer.js index eb10f8af..15d87940 100644 --- a/src/static/js/pluginfw/installer.js +++ b/src/static/js/pluginfw/installer.js @@ -94,11 +94,12 @@ exports.search = function(query, cache, cb) { if (er) return cb(er); var res = {}; var i = 0; + var pattern = query.pattern.toLowerCase(); 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(pattern) != -1 || key.indexOf(plugins.prefix) == 0 - && data[key].description.indexOf(query.pattern) != -1 + && data[key].description.indexOf(pattern) != -1 ) { // If the name contains ep_ and the search string is in the name or description i++; if (i > query.offset