87,842
社区成员




AbstractChosen.prototype.winnow_results = function() {
var a, b, c, d, e, f, g, h, i, j, k, l;
for (this.no_results_clear(), d = 0, f = this.get_search_text(), a = f.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), i = new RegExp(a, "i"), c = this.get_search_regex(a), l = this.results_data, j = 0, k = l.length; k > j; j++) b = l[j],
b.search_match = !1,
e = null,
this.include_option_in_results(b) && (b.group && (b.group_match = !1, b.active_options = 0), null != b.group_array_index && this.results_data[b.group_array_index] && (e = this.results_data[b.group_array_index], 0 === e.active_options && e.search_match && (d += 1), e.active_options += 1), b.search_text = b.group ? b.label: b.html, (!b.group || this.group_search) && (b.search_match = this.search_string_match(b.search_text, c) || this.search_string_match(b.value, c), b.search_match && !b.group && (d += 1), b.search_match ? (f.length && (g = this.search_string_match(b.value, c) ? (this.search_string_match(b.search_text, c)?b.search_text.search(i):0) : b.search_text.search(i), h = b.search_text.substr(0, g + f.length) + "</em>" + b.search_text.substr(g + f.length), b.search_text = h.substr(0, g) + "<em>" + h.substr(g)), null != e && (e.group_match = !0)) : null != b.group_array_index && this.results_data[b.group_array_index].search_match && (b.search_match = !0)));
return this.result_clear_highlight(),
1 > d && f.length ? (this.update_results_content(""), this.no_results(f)) : (this.update_results_content(this.results_option_build()), this.winnow_results_set_highlight())
}
AbstractChosen.prototype.winnow_results = function() {
var a, b, c, d, e, f, g, h, i, j, k, l;
for (this.no_results_clear(), d = 0, f = this.get_search_text(), a = f.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), i = new RegExp(a, "i"), c = this.get_search_regex(a), l = this.results_data, j = 0, k = l.length; k > j; j++) b = l[j],
b.search_match = !1,
e = null,
this.include_option_in_results(b) && (b.group && (b.group_match = !1, b.active_options = 0), null != b.group_array_index && this.results_data[b.group_array_index] && (e = this.results_data[b.group_array_index], 0 === e.active_options && e.search_match && (d += 1), e.active_options += 1), b.search_text = b.group ? b.label: b.html, (!b.group || this.group_search) && (b.search_match = this.search_string_match(b.search_text, c) || this.search_string_match(b.value, c), b.search_match && !b.group && (d += 1), b.search_match ? (f.length && (g = this.search_string_match(b.value, c) ? 0 : b.search_text.search(i), h = b.search_text.substr(0, g + f.length) + "</em>" + b.search_text.substr(g + f.length), b.search_text = h.substr(0, g) + "<em>" + h.substr(g)), null != e && (e.group_match = !0)) : null != b.group_array_index && this.results_data[b.group_array_index].search_match && (b.search_match = !0)));
return this.result_clear_highlight(),
1 > d && f.length ? (this.update_results_content(""), this.no_results(f)) : (this.update_results_content(this.results_option_build()), this.winnow_results_set_highlight())
}