Bloodhound, "" "" Typeahead, .
typeahead, JavaScript, :
1 - bootstrap3-typeahead-ci.min.js
$.fn.typeahead.Constructor.prototype.normalize = function (str) {
var normalized = str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
normalized = normalized.replace(/[aãáàâ]/gi, '[aãáàâ]');
normalized = normalized.replace(/[eẽéèê]/gi, '[eẽéèê]');
normalized = normalized.replace(/[iĩíìî]/gi, '[iĩíìî]');
normalized = normalized.replace(/[oõóòô]/gi, '[oõóòô]');
normalized = normalized.replace(/[uũúùû]/gi, '[uũúùû]');
normalized = normalized.replace(/[cç]/gi, '[cç]');
normalized = new RegExp(normalized, 'gi');
return normalized;
}
$.fn.typeahead.Constructor.prototype.matcher = function (item) {
var source = this.displayText(item);
var normalized = this.normalize(this.query);
return source.match(normalized);
}
$.fn.typeahead.Constructor.prototype.highlighter = function (item) {
var source = this.displayText(item);
var normalized = this.normalize(this.query);
return source.replace(normalized, '<strong>$&</strong>');
}
2 - bootstrap3-typeahead.min.js
<script src="bootstrap3-typeahead.min.js"></script>
<script src="bootstrap3-typeahead-ci.min.js"></script>
, , , , , , typeahead, . .
PS: Stack Overflow, , !