mirror of
https://github.com/smogon/pokemon-showdown-client.git
synced 2026-09-30 23:01:05 -05:00
Teambuilder: Support searching by middle word
Previously, you could search by the first or last word in a three-word phrase, but not the middle so "High" and "Kick" but not "Jump" in "High Jump Kick". This lets you search by all three.
This commit is contained in:
@@ -89,6 +89,12 @@ function requireNoCache(pathSpec) {
|
||||
if (acronym && !(acronym in Tools.data.Aliases) || toId(Tools.data.Aliases[acronym]) !== id) {
|
||||
index.push('' + acronym + ' ' + type + ' ' + id + ' 0');
|
||||
}
|
||||
|
||||
let i2 = name.lastIndexOf(' ', i - 1);
|
||||
if (i2 < 0) i2 = name.lastIndexOf('-', i - 1);
|
||||
if (i2 >= 0) {
|
||||
index.push('' + toId(name.slice(i2)) + ' ' + type + ' ' + id + ' ' + toId(name.slice(0, i2)).length);
|
||||
}
|
||||
}
|
||||
for (const id in Tools.data.Pokedex) {
|
||||
const name = Tools.data.Pokedex[id].species;
|
||||
|
||||
Reference in New Issue
Block a user