TODO item 11.

This commit is contained in:
Martin Potier 2015-09-14 15:06:08 +02:00
parent 3438b15e9f
commit ba774bd16e
2 changed files with 3 additions and 2 deletions

View file

@ -19,7 +19,8 @@ Todo (sorted by priority)
------------------------- -------------------------
1. ~~Make the search case-insensitive (as well as accents insensitive)~~ 1. ~~Make the search case-insensitive (as well as accents insensitive)~~
11. BUG: trim spaces from search expression 11. ~~BUG: trim spaces from search expression~~
12. BUG: fix search for codes also
2. Create a nice html page (may take several steps) 2. Create a nice html page (may take several steps)
3. Make it chrome compatible (some trouble with the first ajax call) 3. Make it chrome compatible (some trouble with the first ajax call)
4. Make the search mis-spelling safe (like Google does) 4. Make the search mis-spelling safe (like Google does)

View file

@ -211,7 +211,7 @@ function main() {
//console.log(words.data); //console.log(words.data);
$( "#question" ).keyup(function () { $( "#question" ).keyup(function () {
var str = removeDiacritics($( "#question" ).val()); var str = removeDiacritics($( "#question" ).val());
var ans = words.find({'Word': { '$contains': str}}); var ans = words.find({'Word': { '$contains': str.trim()}});
//console.log("Words found: ",ans); //console.log("Words found: ",ans);
//console.log(displayMany(ans)); //console.log(displayMany(ans));
$( "#answer" ).empty().append(displayMany(ans)); $( "#answer" ).empty().append(displayMany(ans));