- search: function(term, callback) { $.getJSON(baseurl + '/hashtag/' + '?f=&t=' + term).done(function(data) { callback($.map(data, function(entry) { return entry.text.indexOf(term) === 0 ? entry : null; })); }); },
+ search: function(term, callback) {
+ $.getJSON(baseurl + '/hashtag/' + '?f=&t=' + term)
+ .done(function(data) {
+ callback($.map(data, function(entry) {
+ // .toLowerCase() enables case-insensitive search
+ return entry.text.toLowerCase().indexOf(term.toLowerCase()) === 0 ? entry : null;
+ }));
+ });
+ },