mirror of
https://github.com/webxoss/webxoss-client.git
synced 2025-02-24 06:03:01 +01:00
fix searching with translation
This commit is contained in:
parent
6d358bdb59
commit
6326ef9a50
1 changed files with 4 additions and 5 deletions
|
@ -1,9 +1,5 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
function Searcher () {
|
function Searcher () {
|
||||||
this.infos = [];
|
|
||||||
for (var pid in CardInfo) {
|
|
||||||
this.infos.push(CardInfo[pid]);
|
|
||||||
}
|
|
||||||
this.rules = [
|
this.rules = [
|
||||||
ColorRule,
|
ColorRule,
|
||||||
CrossRule,
|
CrossRule,
|
||||||
|
@ -30,7 +26,10 @@ Searcher.prototype.search = function (str) {
|
||||||
var filters = this.rules.map(function (rule) {
|
var filters = this.rules.map(function (rule) {
|
||||||
return rule.parse(words);
|
return rule.parse(words);
|
||||||
},this);
|
},this);
|
||||||
|
var infos = Object.keys(CardInfo).map(function (pid) {
|
||||||
|
return CardInfo[pid];
|
||||||
|
});
|
||||||
return filters.reduce(function (results,filter) {
|
return filters.reduce(function (results,filter) {
|
||||||
return results.filter(filter);
|
return results.filter(filter);
|
||||||
},this.infos);
|
},infos);
|
||||||
};
|
};
|
Loading…
Reference in a new issue