发布于 2017-03-26 18:27:10 | 61 次阅读 | 评论: 0 | 来源: 网友投递

这里有新鲜出炉的Bootstrap入门,程序狗速度看过来!

Bootstrap Web前端CSS框架

Bootstrap是Twitter推出的一个开源的用于前端开发的工具包。它由Twitter的设计师Mark Otto和Jacob Thornton合作开发,是一个CSS/HTML框架。Bootstrap提供了优雅的HTML和CSS规范,它即是由动态CSS语言Less写成。Bootstrap一经推出后颇受欢迎,一直是GitHub上的热门开源项目,包括NASA的MSNBC(微软全国广播公司)的Breaking News都使用了该项目。


这篇文章主要介绍了Bootstrap3使用typeahead插件实现自动补全功能的相关资料,非常不错,具有参考借鉴价值,需要的朋友可以参考下

很酷的一个自动补全插件

http://twitter.github.io/typeahead.js

在bootstrap中使用typeahead插件,完成自动补全

相关的文档:https://github.com/twitter/typeahead.js/blob/master/doc/jquery_typeahead.md

数据源:

Local:数组

prefectch:json

remote等方式

--------------------------------------------------------------------------------

html:


<input id="orderNo" class="typeahead" placeholder="Countries" type="text" class="form-control" name="ordersn"> 

js:


var states = new Bloodhound({
datumTokenizer: Bloodhound.tokenizers.whitespace,
queryTokenizer: Bloodhound.tokenizers.whitespace,
// `states` is an array of state names defined in "The Basics"
local: states
});
var findOrderByIdVague = new Bloodhound({
datumTokenizer: Bloodhound.tokenizers.obj.whitespace('value'),
queryTokenizer: Bloodhound.tokenizers.whitespace,
prefetch: '${ctx}/admin/order/preOrderByIdVague.json',
remote: {
url: '${ctx}/admin/order/findOrderByIdVague/%QUERY.json',
wildcard: '%QUERY'
},
afterSelect: function (item) {
//选择项之后的事件 ,item是当前选中的。
alert(iterm);
}
});
$(function(){
/**
$('#addCombo .typeahead').typeahead({
hint: true,
highlight: true,
minLength: 1
},
{
name: 'states',
source: states
});
**/
$('#addCombo .typeahead').typeahead(null, {
name: 'best-pictures',
display: 'value',
source: findOrderByIdVague
});
$('#addCombo .typeahead').bind('typeahead:select', function(ev, suggestion) {
console.log('Selection: ' + suggestion.value);
});
}); 
  …findOrderByIdVague/D20150502.json:
[ {
"value" : "D20150502173435141299"
}, {
"value" : "D20150502172928109304"
} ] 

preOrderByIdVague.json:


[{"value":"D201"}] 

docs 相关的事件: 


Custom Events
The following events get triggered on the input element during the life-cycle of a typeahead.
typeahead:active – Fired when the typeahead moves to active state.
typeahead:idle – Fired when the typeahead moves to idle state.
typeahead:open – Fired when the results container is opened.
typeahead:close – Fired when the results container is closed.
typeahead:change – Normalized version of the native change event. Fired when input loses focus and the value has changed since it originally received focus.
typeahead:render – Fired when suggestions are rendered for a dataset. The event handler will be invoked with 4 arguments: the jQuery event object, the suggestions that were rendered, a flag indicating whether the suggestions were fetched asynchronously, and the name of the dataset the rendering occurred in.
typeahead:select – Fired when a suggestion is selected. The event handler will be invoked with 2 arguments: the jQuery event object and the suggestion object that was selected.
typeahead:autocomplete – Fired when a autocompletion occurs. The event handler will be invoked with 2 arguments: the jQuery event object and the suggestion object that was used for autocompletion.
typeahead:cursorchange – Fired when the results container cursor moves. The event handler will be invoked with 2 arguments: the jQuery event object and the suggestion object that was moved to.
typeahead:asyncrequest – Fired when an async request for suggestions is sent. The event handler will be invoked with 3 arguments: the jQuery event object, the current query, and the name of the dataset the async request belongs to.
typeahead:asynccancel – Fired when an async request is cancelled. The event handler will be invoked with 3 arguments: the jQuery event object, the current query, and the name of the dataset the async request belonged to.
typeahead:asyncreceive – Fired when an async request completes. The event handler will be invoked with 3 arguments: the jQuery event object, the current query, and the name of the dataset the async request belongs to.
Example usage:
$('.typeahead').bind('typeahead:select', function(ev, suggestion) {
console.log('Selection: ' + suggestion);
}); 

typeahead.bundle.js:


/*!
* typeahead.js 0.11.1
* https://github.com/twitter/typeahead.js
* Copyright 2013-2015 Twitter, Inc. and other contributors; Licensed MIT
*/
(function(root, factory) {
if (typeof define === "function" && define.amd) {
define("bloodhound", [ "jquery" ], function(a0) {
return root["Bloodhound"] = factory(a0);
});
} else if (typeof exports === "object") {
module.exports = factory(require("jquery"));
} else {
root["Bloodhound"] = factory(jQuery);
}
})(this, function($) {
var _ = function() {
"use strict";
return {
isMsie: function() {
return /(msie|trident)/i.test(navigator.userAgent) ? navigator.userAgent.match(/(msie |rv:)(\d+(.\d+)?)/i)[2] : false;
},
isBlankString: function(str) {
return !str || /^\s*$/.test(str);
},
escapeRegExChars: function(str) {
return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
},
isString: function(obj) {
return typeof obj === "string";
},
isNumber: function(obj) {
return typeof obj === "number";
},
isArray: $.isArray,
isFunction: $.isFunction,
isObject: $.isPlainObject,
isUndefined: function(obj) {
return typeof obj === "undefined";
},
isElement: function(obj) {
return !!(obj && obj.nodeType === 1);
},
isJQuery: function(obj) {
return obj instanceof $;
},
toStr: function toStr(s) {
return _.isUndefined(s) || s === null ? "" : s + "";
},
bind: $.proxy,
each: function(collection, cb) {
$.each(collection, reverseArgs);
function reverseArgs(index, value) {
return cb(value, index);
}
},
map: $.map,
filter: $.grep,
every: function(obj, test) {
var result = true;
if (!obj) {
return result;
}
$.each(obj, function(key, val) {
if (!(result = test.call(null, val, key, obj))) {
return false;
}
});
return !!result;
},
some: function(obj, test) {
var result = false;
if (!obj) {
return result;
}
$.each(obj, function(key, val) {
if (result = test.call(null, val, key, obj)) {
return false;
}
});
return !!result;
},
mixin: $.extend,
identity: function(x) {
return x;
},
clone: function(obj) {
return $.extend(true, {}, obj);
},
getIdGenerator: function() {
var counter = 0;
return function() {
return counter++;
};
},
templatify: function templatify(obj) {
return $.isFunction(obj) ? obj : template;
function template() {
return String(obj);
}
},
defer: function(fn) {
setTimeout(fn, 0);
},
debounce: function(func, wait, immediate) {
var timeout, result;
return function() {
var context = this, args = arguments, later, callNow;
later = function() {
timeout = null;
if (!immediate) {
result = func.apply(context, args);
}
};
callNow = immediate && !timeout;
clearTimeout(timeout);
timeout = setTimeout(later, wait);
if (callNow) {
result = func.apply(context, args);
}
return result;
};
},
throttle: function(func, wait) {
var context, args, timeout, result, previous, later;
previous = 0;
later = function() {
previous = new Date();
timeout = null;
result = func.apply(context, args);
};
return function() {
var now = new Date(), remaining = wait - (now - previous);
context = this;
args = arguments;
if (remaining <= 0) {
clearTimeout(timeout);
timeout = null;
previous = now;
result = func.apply(context, args);
} else if (!timeout) {
timeout = setTimeout(later, remaining);
}
return result;
};
},
stringify: function(val) {
return _.isString(val) ? val : JSON.stringify(val);
},
noop: function() {}
};
}();
var VERSION = "0.11.1";
var tokenizers = function() {
"use strict";
return {
nonword: nonword,
whitespace: whitespace,
obj: {
nonword: getObjTokenizer(nonword),
whitespace: getObjTokenizer(whitespace)
}
};
function whitespace(str) {
str = _.toStr(str);
return str ? str.split(/\s+/) : [];
}
function nonword(str) {
str = _.toStr(str);
return str ? str.split(/\W+/) : [];
}
function getObjTokenizer(tokenizer) {
return function setKey(keys) {
keys = _.isArray(keys) ? keys : [].slice.call(arguments, 0);
return function tokenize(o) {
var tokens = [];
_.each(keys, function(k) {
tokens = tokens.concat(tokenizer(_.toStr(o[k])));
});
return tokens;
};
};
}
}();
var LruCache = function() {
"use strict";
function LruCache(maxSize) {
this.maxSize = _.isNumber(maxSize) ? maxSize : 100;
this.reset();
if (this.maxSize <= 0) {
this.set = this.get = $.noop;
}
}
_.mixin(LruCache.prototype, {
set: function set(key, val) {
var tailItem = this.list.tail, node;
if (this.size >= this.maxSize) {
this.list.remove(tailItem);
delete this.hash[tailItem.key];
this.size--;
}
if (node = this.hash[key]) {
node.val = val;
this.list.moveToFront(node);
} else {
node = new Node(key, val);
this.list.add(node);
this.hash[key] = node;
this.size++;
}
},
get: function get(key) {
var node = this.hash[key];
if (node) {
this.list.moveToFront(node);
return node.val;
}
},
reset: function reset() {
this.size = 0;
this.hash = {};
this.list = new List();
}
});
function List() {
this.head = this.tail = null;
}
_.mixin(List.prototype, {
add: function add(node) {
if (this.head) {
node.next = this.head;
this.head.prev = node;
}
this.head = node;
this.tail = this.tail || node;
},
remove: function remove(node) {
node.prev ? node.prev.next = node.next : this.head = node.next;
node.next ? node.next.prev = node.prev : this.tail = node.prev;
},
moveToFront: function(node) {
this.remove(node);
this.add(node);
}
});
function Node(key, val) {
this.key = key;
this.val = val;
this.prev = this.next = null;
}
return LruCache;
}();
var PersistentStorage = function() {
"use strict";
var LOCAL_STORAGE;
try {
LOCAL_STORAGE = window.localStorage;
LOCAL_STORAGE.setItem("~~~", "!");
LOCAL_STORAGE.removeItem("~~~");
} catch (err) {
LOCAL_STORAGE = null;
}
function PersistentStorage(namespace, override) {
this.prefix = [ "__", namespace, "__" ].join("");
this.ttlKey = "__ttl__";
this.keyMatcher = new RegExp("^" + _.escapeRegExChars(this.prefix));
this.ls = override || LOCAL_STORAGE;
!this.ls && this._noop();
}
_.mixin(PersistentStorage.prototype, {
_prefix: function(key) {
return this.prefix + key;
},
_ttlKey: function(key) {
return this._prefix(key) + this.ttlKey;
},
_noop: function() {
this.get = this.set = this.remove = this.clear = this.isExpired = _.noop;
},
_safeSet: function(key, val) {
try {
this.ls.setItem(key, val);
} catch (err) {
if (err.name === "QuotaExceededError") {
this.clear();
this._noop();
}
}
},
get: function(key) {
if (this.isExpired(key)) {
this.remove(key);
}
return decode(this.ls.getItem(this._prefix(key)));
},
set: function(key, val, ttl) {
if (_.isNumber(ttl)) {
this._safeSet(this._ttlKey(key), encode(now() + ttl));
} else {
this.ls.removeItem(this._ttlKey(key));
}
return this._safeSet(this._prefix(key), encode(val));
},
remove: function(key) {
this.ls.removeItem(this._ttlKey(key));
this.ls.removeItem(this._prefix(key));
return this;
},
clear: function() {
var i, keys = gatherMatchingKeys(this.keyMatcher);
for (i = keys.length; i--; ) {
this.remove(keys[i]);
}
return this;
},
isExpired: function(key) {
var ttl = decode(this.ls.getItem(this._ttlKey(key)));
return _.isNumber(ttl) && now() > ttl ? true : false;
}
});
return PersistentStorage;
function now() {
return new Date().getTime();
}
function encode(val) {
return JSON.stringify(_.isUndefined(val) ? null : val);
}
function decode(val) {
return $.parseJSON(val);
}
function gatherMatchingKeys(keyMatcher) {
var i, key, keys = [], len = LOCAL_STORAGE.length;
for (i = 0; i < len; i++) {
if ((key = LOCAL_STORAGE.key(i)).match(keyMatcher)) {
keys.push(key.replace(keyMatcher, ""));
}
}
return keys;
}
}();
var Transport = function() {
"use strict";
var pendingRequestsCount = 0, pendingRequests = {}, maxPendingRequests = 6, sharedCache = new LruCache(10);
function Transport(o) {
o = o || {};
this.cancelled = false;
this.lastReq = null;
this._send = o.transport;
this._get = o.limiter ? o.limiter(this._get) : this._get;
this._cache = o.cache === false ? new LruCache(0) : sharedCache;
}
Transport.setMaxPendingRequests = function setMaxPendingRequests(num) {
maxPendingRequests = num;
};
Transport.resetCache = function resetCache() {
sharedCache.reset();
};
_.mixin(Transport.prototype, {
_fingerprint: function fingerprint(o) {
o = o || {};
return o.url + o.type + $.param(o.data || {});
},
_get: function(o, cb) {
var that = this, fingerprint, jqXhr;
fingerprint = this._fingerprint(o);
if (this.cancelled || fingerprint !== this.lastReq) {
return;
}
if (jqXhr = pendingRequests[fingerprint]) {
jqXhr.done(done).fail(fail);
} else if (pendingRequestsCount < maxPendingRequests) {
pendingRequestsCount++;
pendingRequests[fingerprint] = this._send(o).done(done).fail(fail).always(always);
} else {
this.onDeckRequestArgs = [].slice.call(arguments, 0);
}
function done(resp) {
cb(null, resp);
that._cache.set(fingerprint, resp);
}
function fail() {
cb(true);
}
function always() {
pendingRequestsCount--;
delete pendingRequests[fingerprint];
if (that.onDeckRequestArgs) {
that._get.apply(that, that.onDeckRequestArgs);
that.onDeckRequestArgs = null;
}
}
},
get: function(o, cb) {
var resp, fingerprint;
cb = cb || $.noop;
o = _.isString(o) ? {
url: o
} : o || {};
fingerprint = this._fingerprint(o);
this.cancelled = false;
this.lastReq = fingerprint;
if (resp = this._cache.get(fingerprint)) {
cb(null, resp);
} else {
this._get(o, cb);
}
},
cancel: function() {
this.cancelled = true;
}
});
return Transport;
}();
var SearchIndex = window.SearchIndex = function() {
"use strict";
var CHILDREN = "c", IDS = "i";
function SearchIndex(o) {
o = o || {};
if (!o.datumTokenizer || !o.queryTokenizer) {
$.error("datumTokenizer and queryTokenizer are both required");
}
this.identify = o.identify || _.stringify;
this.datumTokenizer = o.datumTokenizer;
this.queryTokenizer = o.queryTokenizer;
this.reset();
}
_.mixin(SearchIndex.prototype, {
bootstrap: function bootstrap(o) {
this.datums = o.datums;
this.trie = o.trie;
},
add: function(data) {
var that = this;
data = _.isArray(data) ? data : [ data ];
_.each(data, function(datum) {
var id, tokens;
that.datums[id = that.identify(datum)] = datum;
tokens = normalizeTokens(that.datumTokenizer(datum));
_.each(tokens, function(token) {
var node, chars, ch;
node = that.trie;
chars = token.split("");
while (ch = chars.shift()) {
node = node[CHILDREN][ch] || (node[CHILDREN][ch] = newNode());
node[IDS].push(id);
}
});
});
},
get: function get(ids) {
var that = this;
return _.map(ids, function(id) {
return that.datums[id];
});
},
search: function search(query) {
var that = this, tokens, matches;
tokens = normalizeTokens(this.queryTokenizer(query));
_.each(tokens, function(token) {
var node, chars, ch, ids;
if (matches && matches.length === 0) {
return false;
}
node = that.trie;
chars = token.split("");
while (node && (ch = chars.shift())) {
node = node[CHILDREN][ch];
}
if (node && chars.length === 0) {
ids = node[IDS].slice(0);
matches = matches ? getIntersection(matches, ids) : ids;
} else {
matches = [];
return false;
}
});
return matches ? _.map(unique(matches), function(id) {
return that.datums[id];
}) : [];
},
all: function all() {
var values = [];
for (var key in this.datums) {
values.push(this.datums[key]);
}
return values;
},
reset: function reset() {
this.datums = {};
this.trie = newNode();
},
serialize: function serialize() {
return {
datums: this.datums,
trie: this.trie
};
}
});
return SearchIndex;
function normalizeTokens(tokens) {
tokens = _.filter(tokens, function(token) {
return !!token;
});
tokens = _.map(tokens, function(token) {
return token.toLowerCase();
});
return tokens;
}
function newNode() {
var node = {};
node[IDS] = [];
node[CHILDREN] = {};
return node;
}
function unique(array) {
var seen = {}, uniques = [];
for (var i = 0, len = array.length; i < len; i++) {
if (!seen[array[i]]) {
seen[array[i]] = true;
uniques.push(array[i]);
}
}
return uniques;
}
function getIntersection(arrayA, arrayB) {
var ai = 0, bi = 0, intersection = [];
arrayA = arrayA.sort();
arrayB = arrayB.sort();
var lenArrayA = arrayA.length, lenArrayB = arrayB.length;
while (ai < lenArrayA && bi < lenArrayB) {
if (arrayA[ai] < arrayB[bi]) {
ai++;
} else if (arrayA[ai] > arrayB[bi]) {
bi++;
} else {
intersection.push(arrayA[ai]);
ai++;
bi++;
}
}
return intersection;
}
}();
var Prefetch = function() {
"use strict";
var keys;
keys = {
data: "data",
protocol: "protocol",
thumbprint: "thumbprint"
};
function Prefetch(o) {
this.url = o.url;
this.ttl = o.ttl;
this.cache = o.cache;
this.prepare = o.prepare;
this.transform = o.transform;
this.transport = o.transport;
this.thumbprint = o.thumbprint;
this.storage = new PersistentStorage(o.cacheKey);
}
_.mixin(Prefetch.prototype, {
_settings: function settings() {
return {
url: this.url,
type: "GET",
dataType: "json"
};
},
store: function store(data) {
if (!this.cache) {
return;
}
this.storage.set(keys.data, data, this.ttl);
this.storage.set(keys.protocol, location.protocol, this.ttl);
this.storage.set(keys.thumbprint, this.thumbprint, this.ttl);
},
fromCache: function fromCache() {
var stored = {}, isExpired;
if (!this.cache) {
return null;
}
stored.data = this.storage.get(keys.data);
stored.protocol = this.storage.get(keys.protocol);
stored.thumbprint = this.storage.get(keys.thumbprint);
isExpired = stored.thumbprint !== this.thumbprint || stored.protocol !== location.protocol;
return stored.data && !isExpired ? stored.data : null;
},
fromNetwork: function(cb) {
var that = this, settings;
if (!cb) {
return;
}
settings = this.prepare(this._settings());
this.transport(settings).fail(onError).done(onResponse);
function onError() {
cb(true);
}
function onResponse(resp) {
cb(null, that.transform(resp));
}
},
clear: function clear() {
this.storage.clear();
return this;
}
});
return Prefetch;
}();
var Remote = function() {
"use strict";
function Remote(o) {
this.url = o.url;
this.prepare = o.prepare;
this.transform = o.transform;
this.transport = new Transport({
cache: o.cache,
limiter: o.limiter,
transport: o.transport
});
}
_.mixin(Remote.prototype, {
_settings: function settings() {
return {
url: this.url,
type: "GET",
dataType: "json"
};
},
get: function get(query, cb) {
var that = this, settings;
if (!cb) {
return;
}
query = query || "";
settings = this.prepare(query, this._settings());
return this.transport.get(settings, onResponse);
function onResponse(err, resp) {
err ? cb([]) : cb(that.transform(resp));
}
},
cancelLastRequest: function cancelLastRequest() {
this.transport.cancel();
}
});
return Remote;
}();
var oParser = function() {
"use strict";
return function parse(o) {
var defaults, sorter;
defaults = {
initialize: true,
identify: _.stringify,
datumTokenizer: null,
queryTokenizer: null,
sufficient: 5,
sorter: null,
local: [],
prefetch: null,
remote: null
};
o = _.mixin(defaults, o || {});
!o.datumTokenizer && $.error("datumTokenizer is required");
!o.queryTokenizer && $.error("queryTokenizer is required");
sorter = o.sorter;
o.sorter = sorter ? function(x) {
return x.sort(sorter);
} : _.identity;
o.local = _.isFunction(o.local) ? o.local() : o.local;
o.prefetch = parsePrefetch(o.prefetch);
o.remote = parseRemote(o.remote);
return o;
};
function parsePrefetch(o) {
var defaults;
if (!o) {
return null;
}
defaults = {
url: null,
ttl: 24 * 60 * 60 * 1e3,
cache: true,
cacheKey: null,
thumbprint: "",
prepare: _.identity,
transform: _.identity,
transport: null
};
o = _.isString(o) ? {
url: o
} : o;
o = _.mixin(defaults, o);
!o.url && $.error("prefetch requires url to be set");
o.transform = o.filter || o.transform;
o.cacheKey = o.cacheKey || o.url;
o.thumbprint = VERSION + o.thumbprint;
o.transport = o.transport ? callbackToDeferred(o.transport) : $.ajax;
return o;
}
function parseRemote(o) {
var defaults;
if (!o) {
return;
}
defaults = {
url: null,
cache: true,
prepare: null,
replace: null,
wildcard: null,
limiter: null,
rateLimitBy: "debounce",
rateLimitWait: 300,
transform: _.identity,
transport: null
};
o = _.isString(o) ? {
url: o
} : o;
o = _.mixin(defaults, o);
!o.url && $.error("remote requires url to be set");
o.transform = o.filter || o.transform;
o.prepare = toRemotePrepare(o);
o.limiter = toLimiter(o);
o.transport = o.transport ? callbackToDeferred(o.transport) : $.ajax;
delete o.replace;
delete o.wildcard;
delete o.rateLimitBy;
delete o.rateLimitWait;
return o;
}
function toRemotePrepare(o) {
var prepare, replace, wildcard;
prepare = o.prepare;
replace = o.replace;
wildcard = o.wildcard;
if (prepare) {
return prepare;
}
if (replace) {
prepare = prepareByReplace;
} else if (o.wildcard) {
prepare = prepareByWildcard;
} else {
prepare = idenityPrepare;
}
return prepare;
function prepareByReplace(query, settings) {
settings.url = replace(settings.url, query);
return settings;
}
function prepareByWildcard(query, settings) {
settings.url = settings.url.replace(wildcard, encodeURIComponent(query));
return settings;
}
function idenityPrepare(query, settings) {
return settings;
}
}
function toLimiter(o) {
var limiter, method, wait;
limiter = o.limiter;
method = o.rateLimitBy;
wait = o.rateLimitWait;
if (!limiter) {
limiter = /^throttle$/i.test(method) ? throttle(wait) : debounce(wait);
}
return limiter;
function debounce(wait) {
return function debounce(fn) {
return _.debounce(fn, wait);
};
}
function throttle(wait) {
return function throttle(fn) {
return _.throttle(fn, wait);
};
}
}
function callbackToDeferred(fn) {
return function wrapper(o) {
var deferred = $.Deferred();
fn(o, onSuccess, onError);
return deferred;
function onSuccess(resp) {
_.defer(function() {
deferred.resolve(resp);
});
}
function onError(err) {
_.defer(function() {
deferred.reject(err);
});
}
};
}
}();
var Bloodhound = function() {
"use strict";
var old;
old = window && window.Bloodhound;
function Bloodhound(o) {
o = oParser(o);
this.sorter = o.sorter;
this.identify = o.identify;
this.sufficient = o.sufficient;
this.local = o.local;
this.remote = o.remote ? new Remote(o.remote) : null;
this.prefetch = o.prefetch ? new Prefetch(o.prefetch) : null;
this.index = new SearchIndex({
identify: this.identify,
datumTokenizer: o.datumTokenizer,
queryTokenizer: o.queryTokenizer
});
o.initialize !== false && this.initialize();
}
Bloodhound.noConflict = function noConflict() {
window && (window.Bloodhound = old);
return Bloodhound;
};
Bloodhound.tokenizers = tokenizers;
_.mixin(Bloodhound.prototype, {
__ttAdapter: function ttAdapter() {
var that = this;
return this.remote ? withAsync : withoutAsync;
function withAsync(query, sync, async) {
return that.search(query, sync, async);
}
function withoutAsync(query, sync) {
return that.search(query, sync);
}
},
_loadPrefetch: function loadPrefetch() {
var that = this, deferred, serialized;
deferred = $.Deferred();
if (!this.prefetch) {
deferred.resolve();
} else if (serialized = this.prefetch.fromCache()) {
this.index.bootstrap(serialized);
deferred.resolve();
} else {
this.prefetch.fromNetwork(done);
}
return deferred.promise();
function done(err, data) {
if (err) {
return deferred.reject();
}
that.add(data);
that.prefetch.store(that.index.serialize());
deferred.resolve();
}
},
_initialize: function initialize() {
var that = this, deferred;
this.clear();
(this.initPromise = this._loadPrefetch()).done(addLocalToIndex);
return this.initPromise;
function addLocalToIndex() {
that.add(that.local);
}
},
initialize: function initialize(force) {
return !this.initPromise || force ? this._initialize() : this.initPromise;
},
add: function add(data) {
this.index.add(data);
return this;
},
get: function get(ids) {
ids = _.isArray(ids) ? ids : [].slice.call(arguments);
return this.index.get(ids);
},
search: function search(query, sync, async) {
var that = this, local;
local = this.sorter(this.index.search(query));
sync(this.remote ? local.slice() : local);
if (this.remote && local.length < this.sufficient) {
this.remote.get(query, processRemote);
} else if (this.remote) {
this.remote.cancelLastRequest();
}
return this;
function processRemote(remote) {
var nonDuplicates = [];
_.each(remote, function(r) {
!_.some(local, function(l) {
return that.identify(r) === that.identify(l);
}) && nonDuplicates.push(r);
});
async && async(nonDuplicates);
}
},
all: function all() {
return this.index.all();
},
clear: function clear() {
this.index.reset();
return this;
},
clearPrefetchCache: function clearPrefetchCache() {
this.prefetch && this.prefetch.clear();
return this;
},
clearRemoteCache: function clearRemoteCache() {
Transport.resetCache();
return this;
},
ttAdapter: function ttAdapter() {
return this.__ttAdapter();
}
});
return Bloodhound;
}();
return Bloodhound;
});
(function(root, factory) {
if (typeof define === "function" && define.amd) {
define("typeahead.js", [ "jquery" ], function(a0) {
return factory(a0);
});
} else if (typeof exports === "object") {
module.exports = factory(require("jquery"));
} else {
factory(jQuery);
}
})(this, function($) {
var _ = function() {
"use strict";
return {
isMsie: function() {
return /(msie|trident)/i.test(navigator.userAgent) ? navigator.userAgent.match(/(msie |rv:)(\d+(.\d+)?)/i)[2] : false;
},
isBlankString: function(str) {
return !str || /^\s*$/.test(str);
},
escapeRegExChars: function(str) {
return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
},
isString: function(obj) {
return typeof obj === "string";
},
isNumber: function(obj) {
return typeof obj === "number";
},
isArray: $.isArray,
isFunction: $.isFunction,
isObject: $.isPlainObject,
isUndefined: function(obj) {
return typeof obj === "undefined";
},
isElement: function(obj) {
return !!(obj && obj.nodeType === 1);
},
isJQuery: function(obj) {
return obj instanceof $;
},
toStr: function toStr(s) {
return _.isUndefined(s) || s === null ? "" : s + "";
},
bind: $.proxy,
each: function(collection, cb) {
$.each(collection, reverseArgs);
function reverseArgs(index, value) {
return cb(value, index);
}
},
map: $.map,
filter: $.grep,
every: function(obj, test) {
var result = true;
if (!obj) {
return result;
}
$.each(obj, function(key, val) {
if (!(result = test.call(null, val, key, obj))) {
return false;
}
});
return !!result;
},
some: function(obj, test) {
var result = false;
if (!obj) {
return result;
}
$.each(obj, function(key, val) {
if (result = test.call(null, val, key, obj)) {
return false;
}
});
return !!result;
},
mixin: $.extend,
identity: function(x) {
return x;
},
clone: function(obj) {
return $.extend(true, {}, obj);
},
getIdGenerator: function() {
var counter = 0;
return function() {
return counter++;
};
},
templatify: function templatify(obj) {
return $.isFunction(obj) ? obj : template;
function template() {
return String(obj);
}
},
defer: function(fn) {
setTimeout(fn, 0);
},
debounce: function(func, wait, immediate) {
var timeout, result;
return function() {
var context = this, args = arguments, later, callNow;
later = function() {
timeout = null;
if (!immediate) {
result = func.apply(context, args);
}
};
callNow = immediate && !timeout;
clearTimeout(timeout);
timeout = setTimeout(later, wait);
if (callNow) {
result = func.apply(context, args);
}
return result;
};
},
throttle: function(func, wait) {
var context, args, timeout, result, previous, later;
previous = 0;
later = function() {
previous = new Date();
timeout = null;
result = func.apply(context, args);
};
return function() {
var now = new Date(), remaining = wait - (now - previous);
context = this;
args = arguments;
if (remaining <= 0) {
clearTimeout(timeout);
timeout = null;
previous = now;
result = func.apply(context, args);
} else if (!timeout) {
timeout = setTimeout(later, remaining);
}
return result;
};
},
stringify: function(val) {
return _.isString(val) ? val : JSON.stringify(val);
},
noop: function() {}
};
}();
var WWW = function() {
"use strict";
var defaultClassNames = {
wrapper: "twitter-typeahead",
input: "tt-input",
hint: "tt-hint",
menu: "tt-menu",
dataset: "tt-dataset",
suggestion: "tt-suggestion",
selectable: "tt-selectable",
empty: "tt-empty",
open: "tt-open",
cursor: "tt-cursor",
highlight: "tt-highlight"
};
return build;
function build(o) {
var www, classes;
classes = _.mixin({}, defaultClassNames, o);
www = {
css: buildCss(),
classes: classes,
html: buildHtml(classes),
selectors: buildSelectors(classes)
};
return {
css: www.css,
html: www.html,
classes: www.classes,
selectors: www.selectors,
mixin: function(o) {
_.mixin(o, www);
}
};
}
function buildHtml(c) {
return {
wrapper: '<span class="' + c.wrapper + '"></span>',
menu: '<div class="' + c.menu + '"></div>'
};
}
function buildSelectors(classes) {
var selectors = {};
_.each(classes, function(v, k) {
selectors[k] = "." + v;
});
return selectors;
}
function buildCss() {
var css = {
wrapper: {
position: "relative",
display: "inline-block"
},
hint: {
position: "absolute",
top: "0",
left: "0",
borderColor: "transparent",
boxShadow: "none",
opacity: "1"
},
input: {
position: "relative",
verticalAlign: "top",
backgroundColor: "transparent"
},
inputWithNoHint: {
position: "relative",
verticalAlign: "top"
},
menu: {
position: "absolute",
top: "100%",
left: "0",
zIndex: "100",
display: "none"
},
ltr: {
left: "0",
right: "auto"
},
rtl: {
left: "auto",
right: " 0"
}
};
if (_.isMsie()) {
_.mixin(css.input, {
backgroundImage: "url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)"
});
}
return css;
}
}();
var EventBus = function() {
"use strict";
var namespace, deprecationMap;
namespace = "typeahead:";
deprecationMap = {
render: "rendered",
cursorchange: "cursorchanged",
select: "selected",
autocomplete: "autocompleted"
};
function EventBus(o) {
if (!o || !o.el) {
$.error("EventBus initialized without el");
}
this.$el = $(o.el);
}
_.mixin(EventBus.prototype, {
_trigger: function(type, args) {
var $e;
$e = $.Event(namespace + type);
(args = args || []).unshift($e);
this.$el.trigger.apply(this.$el, args);
return $e;
},
before: function(type) {
var args, $e;
args = [].slice.call(arguments, 1);
$e = this._trigger("before" + type, args);
return $e.isDefaultPrevented();
},
trigger: function(type) {
var deprecatedType;
this._trigger(type, [].slice.call(arguments, 1));
if (deprecatedType = deprecationMap[type]) {
this._trigger(deprecatedType, [].slice.call(arguments, 1));
}
}
});
return EventBus;
}();
var EventEmitter = function() {
"use strict";
var splitter = /\s+/, nextTick = getNextTick();
return {
onSync: onSync,
onAsync: onAsync,
off: off,
trigger: trigger
};
function on(method, types, cb, context) {
var type;
if (!cb) {
return this;
}
types = types.split(splitter);
cb = context ? bindContext(cb, context) : cb;
this._callbacks = this._callbacks || {};
while (type = types.shift()) {
this._callbacks[type] = this._callbacks[type] || {
sync: [],
async: []
};
this._callbacks[type][method].push(cb);
}
return this;
}
function onAsync(types, cb, context) {
return on.call(this, "async", types, cb, context);
}
function onSync(types, cb, context) {
return on.call(this, "sync", types, cb, context);
}
function off(types) {
var type;
if (!this._callbacks) {
return this;
}
types = types.split(splitter);
while (type = types.shift()) {
delete this._callbacks[type];
}
return this;
}
function trigger(types) {
var type, callbacks, args, syncFlush, asyncFlush;
if (!this._callbacks) {
return this;
}
types = types.split(splitter);
args = [].slice.call(arguments, 1);
while ((type = types.shift()) && (callbacks = this._callbacks[type])) {
syncFlush = getFlush(callbacks.sync, this, [ type ].concat(args));
asyncFlush = getFlush(callbacks.async, this, [ type ].concat(args));
syncFlush() && nextTick(asyncFlush);
}
return this;
}
function getFlush(callbacks, context, args) {
return flush;
function flush() {
var cancelled;
for (var i = 0, len = callbacks.length; !cancelled && i < len; i += 1) {
cancelled = callbacks[i].apply(context, args) === false;
}
return !cancelled;
}
}
function getNextTick() {
var nextTickFn;
if (window.setImmediate) {
nextTickFn = function nextTickSetImmediate(fn) {
setImmediate(function() {
fn();
});
};
} else {
nextTickFn = function nextTickSetTimeout(fn) {
setTimeout(function() {
fn();
}, 0);
};
}
return nextTickFn;
}
function bindContext(fn, context) {
return fn.bind ? fn.bind(context) : function() {
fn.apply(context, [].slice.call(arguments, 0));
};
}
}();
var highlight = function(doc) {
"use strict";
var defaults = {
node: null,
pattern: null,
tagName: "strong",
className: null,
wordsOnly: false,
caseSensitive: false
};
return function hightlight(o) {
var regex;
o = _.mixin({}, defaults, o);
if (!o.node || !o.pattern) {
return;
}
o.pattern = _.isArray(o.pattern) ? o.pattern : [ o.pattern ];
regex = getRegex(o.pattern, o.caseSensitive, o.wordsOnly);
traverse(o.node, hightlightTextNode);
function hightlightTextNode(textNode) {
var match, patternNode, wrapperNode;
if (match = regex.exec(textNode.data)) {
wrapperNode = doc.createElement(o.tagName);
o.className && (wrapperNode.className = o.className);
patternNode = textNode.splitText(match.index);
patternNode.splitText(match[0].length);
wrapperNode.appendChild(patternNode.cloneNode(true));
textNode.parentNode.replaceChild(wrapperNode, patternNode);
}
return !!match;
}
function traverse(el, hightlightTextNode) {
var childNode, TEXT_NODE_TYPE = 3;
for (var i = 0; i < el.childNodes.length; i++) {
childNode = el.childNodes[i];
if (childNode.nodeType === TEXT_NODE_TYPE) {
i += hightlightTextNode(childNode) ? 1 : 0;
} else {
traverse(childNode, hightlightTextNode);
}
}
}
};
function getRegex(patterns, caseSensitive, wordsOnly) {
var escapedPatterns = [], regexStr;
for (var i = 0, len = patterns.length; i < len; i++) {
escapedPatterns.push(_.escapeRegExChars(patterns[i]));
}
regexStr = wordsOnly ? "\\b(" + escapedPatterns.join("|") + ")\\b" : "(" + escapedPatterns.join("|") + ")";
return caseSensitive ? new RegExp(regexStr) : new RegExp(regexStr, "i");
}
}(window.document);
var Input = function() {
"use strict";
var specialKeyCodeMap;
specialKeyCodeMap = {
9: "tab",
27: "esc",
37: "left",
39: "right",
13: "enter",
38: "up",
40: "down"
};
function Input(o, www) {
o = o || {};
if (!o.input) {
$.error("input is missing");
}
www.mixin(this);
this.$hint = $(o.hint);
this.$input = $(o.input);
this.query = this.$input.val();
this.queryWhenFocused = this.hasFocus() ? this.query : null;
this.$overflowHelper = buildOverflowHelper(this.$input);
this._checkLanguageDirection();
if (this.$hint.length === 0) {
this.setHint = this.getHint = this.clearHint = this.clearHintIfInvalid = _.noop;
}
}
Input.normalizeQuery = function(str) {
return _.toStr(str).replace(/^\s*/g, "").replace(/\s{2,}/g, " ");
};
_.mixin(Input.prototype, EventEmitter, {
_onBlur: function onBlur() {
this.resetInputValue();
this.trigger("blurred");
},
_onFocus: function onFocus() {
this.queryWhenFocused = this.query;
this.trigger("focused");
},
_onKeydown: function onKeydown($e) {
var keyName = specialKeyCodeMap[$e.which || $e.keyCode];
this._managePreventDefault(keyName, $e);
if (keyName && this._shouldTrigger(keyName, $e)) {
this.trigger(keyName + "Keyed", $e);
}
},
_onInput: function onInput() {
this._setQuery(this.getInputValue());
this.clearHintIfInvalid();
this._checkLanguageDirection();
},
_managePreventDefault: function managePreventDefault(keyName, $e) {
var preventDefault;
switch (keyName) {
case "up":
case "down":
preventDefault = !withModifier($e);
break;
default:
preventDefault = false;
}
preventDefault && $e.preventDefault();
},
_shouldTrigger: function shouldTrigger(keyName, $e) {
var trigger;
switch (keyName) {
case "tab":
trigger = !withModifier($e);
break;
default:
trigger = true;
}
return trigger;
},
_checkLanguageDirection: function checkLanguageDirection() {
var dir = (this.$input.css("direction") || "ltr").toLowerCase();
if (this.dir !== dir) {
this.dir = dir;
this.$hint.attr("dir", dir);
this.trigger("langDirChanged", dir);
}
},
_setQuery: function setQuery(val, silent) {
var areEquivalent, hasDifferentWhitespace;
areEquivalent = areQueriesEquivalent(val, this.query);
hasDifferentWhitespace = areEquivalent ? this.query.length !== val.length : false;
this.query = val;
if (!silent && !areEquivalent) {
this.trigger("queryChanged", this.query);
} else if (!silent && hasDifferentWhitespace) {
this.trigger("whitespaceChanged", this.query);
}
},
bind: function() {
var that = this, onBlur, onFocus, onKeydown, onInput;
onBlur = _.bind(this._onBlur, this);
onFocus = _.bind(this._onFocus, this);
onKeydown = _.bind(this._onKeydown, this);
onInput = _.bind(this._onInput, this);
this.$input.on("blur.tt", onBlur).on("focus.tt", onFocus).on("keydown.tt", onKeydown);
if (!_.isMsie() || _.isMsie() > 9) {
this.$input.on("input.tt", onInput);
} else {
this.$input.on("keydown.tt keypress.tt cut.tt paste.tt", function($e) {
if (specialKeyCodeMap[$e.which || $e.keyCode]) {
return;
}
_.defer(_.bind(that._onInput, that, $e));
});
}
return this;
},
focus: function focus() {
this.$input.focus();
},
blur: function blur() {
this.$input.blur();
},
getLangDir: function getLangDir() {
return this.dir;
},
getQuery: function getQuery() {
return this.query || "";
},
setQuery: function setQuery(val, silent) {
this.setInputValue(val);
this._setQuery(val, silent);
},
hasQueryChangedSinceLastFocus: function hasQueryChangedSinceLastFocus() {
return this.query !== this.queryWhenFocused;
},
getInputValue: function getInputValue() {
return this.$input.val();
},
setInputValue: function setInputValue(value) {
this.$input.val(value);
this.clearHintIfInvalid();
this._checkLanguageDirection();
},
resetInputValue: function resetInputValue() {
this.setInputValue(this.query);
},
getHint: function getHint() {
return this.$hint.val();
},
setHint: function setHint(value) {
this.$hint.val(value);
},
clearHint: function clearHint() {
this.setHint("");
},
clearHintIfInvalid: function clearHintIfInvalid() {
var val, hint, valIsPrefixOfHint, isValid;
val = this.getInputValue();
hint = this.getHint();
valIsPrefixOfHint = val !== hint && hint.indexOf(val) === 0;
isValid = val !== "" && valIsPrefixOfHint && !this.hasOverflow();
!isValid && this.clearHint();
},
hasFocus: function hasFocus() {
return this.$input.is(":focus");
},
hasOverflow: function hasOverflow() {
var constraint = this.$input.width() - 2;
this.$overflowHelper.text(this.getInputValue());
return this.$overflowHelper.width() >= constraint;
},
isCursorAtEnd: function() {
var valueLength, selectionStart, range;
valueLength = this.$input.val().length;
selectionStart = this.$input[0].selectionStart;
if (_.isNumber(selectionStart)) {
return selectionStart === valueLength;
} else if (document.selection) {
range = document.selection.createRange();
range.moveStart("character", -valueLength);
return valueLength === range.text.length;
}
return true;
},
destroy: function destroy() {
this.$hint.off(".tt");
this.$input.off(".tt");
this.$overflowHelper.remove();
this.$hint = this.$input = this.$overflowHelper = $("<div>");
}
});
return Input;
function buildOverflowHelper($input) {
return $('<pre aria-hidden="true"></pre>').css({
position: "absolute",
visibility: "hidden",
whiteSpace: "pre",
fontFamily: $input.css("font-family"),
fontSize: $input.css("font-size"),
fontStyle: $input.css("font-style"),
fontVariant: $input.css("font-variant"),
fontWeight: $input.css("font-weight"),
wordSpacing: $input.css("word-spacing"),
letterSpacing: $input.css("letter-spacing"),
textIndent: $input.css("text-indent"),
textRendering: $input.css("text-rendering"),
textTransform: $input.css("text-transform")
}).insertAfter($input);
}
function areQueriesEquivalent(a, b) {
return Input.normalizeQuery(a) === Input.normalizeQuery(b);
}
function withModifier($e) {
return $e.altKey || $e.ctrlKey || $e.metaKey || $e.shiftKey;
}
}();
var Dataset = function() {
"use strict";
var keys, nameGenerator;
keys = {
val: "tt-selectable-display",
obj: "tt-selectable-object"
};
nameGenerator = _.getIdGenerator();
function Dataset(o, www) {
o = o || {};
o.templates = o.templates || {};
o.templates.notFound = o.templates.notFound || o.templates.empty;
if (!o.source) {
$.error("missing source");
}
if (!o.node) {
$.error("missing node");
}
if (o.name && !isValidName(o.name)) {
$.error("invalid dataset name: " + o.name);
}
www.mixin(this);
this.highlight = !!o.highlight;
this.name = o.name || nameGenerator();
this.limit = o.limit || 5;
this.displayFn = getDisplayFn(o.di;
}
jv);
}
mitghlight;
this.na
this.name = o.name || nan(o.di;
}
jv);mit = oalij.ndDisp, onFocus
this.na
this.nlue:-,onFocus
th ry.lengs.nlue:-,onFocus
th t.ozer
nlue:-Fn = get
retator(isU.csf ( : $.
retery : null;
nlue:-,(ai &l .$inp2oze
thi
retFn = get_() {
tionSu.$esis.$hint.ame |
}
_.mixir("miat.pCappealue()on(v, kperNo {
iat.pCappealue()on(v, kperNo {
 + e-;
reme || na withMo {
o =dat.inct {
atot(o, www)at.inct {
("EventB, se
}
_.min(Even
$.ely(terNotored.meGlectionStart sinable-ly(terNotored.ablowerCalectable-ly(terNotored.meGlor();mixin(def
},
desterflowHut.prototype {
o =dtEmitter, {
_onBlur: functionhiswr,
verflow() {= $(wr,

return u.$esis.$$e = $electable: || electable: |r()ey inodeMau.$esis.$$perNode.utValue(t_().cssSu.$esis.$s
return u.$esis.$$e(thiremote) {
this
retant();
});mit = o.[fingert.val(valu_().cssP= 6, s(this.r(thiremote) {
ow();

retant();
});mit = o.mplates.t.val(valu_().cssNplates.(this.r(thiremotesineme |_sourcus: fukeyName + "Keyersorchange:reme || nat, u.$esis.$$
rn fu withect_ternNoverflow() {ternNo
return u.$esis.$$eutVaelectable: || electable: |r()ey inodeMau.$esis.$$perNodeint();
}$appnSu.$esis.$perNode.utValue(t_ternNoSu.$esis.$s
return u.$esis.$$e(thiremote) {
au.$esis.$$perNode.utValue(t_().cssSu.$esis.$s
return u.$esis.$$e(thiremote) {
ow();
$appnSu.$esis.$perNodeint();
});mit = o.mplates.t.val(valu_().cssNplates.(this.r(thikeyName + "Keyersorchange:reme || nat, u.$esis.$$
tion alwaect_().cssSu.$esis.$stInputValue().cssSu.$esis.$s
return u.$esis.$$eint = th$fistut =wit$fistut =|| eme |_nanSu.$esis.$sFistut =
return u.$esis.$$ewitame |
appnSu.$esis.$|| $fistut =gth; i().().appn = this.$iny(t www($fistut =)();
[finthis);
nanHeacss
return u.$esis.$$eiaternNothis);
nanFoDups
return u.$esis.$$eiwithect_ternNoSu.$esis.$sverflow() {ternNoSu.$esis.$s
return u.$esis.$$eint = th$fistut =
rappnSu.$esis.$wit$fistut =|| eme |_nanSu.$esis.$sFistut =
return u.$esis.$$ewitrappnSu.$esis.$|| $fistut =gth; i().().appn = this.$inappnSu.$esis.$pa}
funfistut == this.$inappnSu.$esis.$|| $appnSu.$esis.$withect_().cssP= 6, stInputValue().cssP= 6, s(this.rint = th);mit = || eme |);mit = o.[fingerwitame |_() {
tionSu.$esis.$hint.a;mit = int();
}$y(t www();mit = absod;
}:n settecterNo {
ise;
};
tr($i withect_().cssNplates.tInputValue().cssNplates.(this.rint = th);mit = || eme |);mit = o.mplates.witame |_() {
tionSu.$esis.$hint.a;mit = int();
}$y(t www();mit = absod;
}:n settecterNo {
ise;
};
tr($i withect_y",
opt(o, www)aourcusutValue(tly(tsourcus: feme |_() {
tionSu.$esis.$hint.hect_nanSu.$esis.$sFistut =tInputValuenanSu.$esis.$sFistut =
return u.$esis.$$eint = th)turn this.
ristut =witristut =|| ion.creat.tagNaDsOvut =Fistut =
 wit functi u.$esis.$$
rght(o) {nanSu.$esis.$extNo u.$esis.$t.val, se
}
eturn fn.witurn fn.|| emat, inGenern thid;
}t, u.$esis.$ wit
}
_.miemat,);mit = o. u.$esis.$ction() {ToIrNotored.meGt, u.$esis.$ oIrNotored.ablalijat,Disp, ono u.$esis.$tiat.pCappealuat,on(v, kp u.$esis.$ + e}
wwijat,on(v, kp selectabl witristut =aternNode, pa
}
art with= this.$i.highlight(val)eturn babso,
wordsOnleme |on(v, kpl)eturn bectr("mtInistut =ect
}
reg:n settith= thnStart $(fistut == thhect_nanFoDupstInputValuenanFoDups
return u.$esis.$$e.valerflowHelper);mit = o.foDupsry.length !=);mit = o.foDupsabsod;
}:n settect u.$esis.$$:, u.$esis.$$
cterNo {
ise;
};
tr($i$overflowHhect_nanHeacsstInputValuenanHeacss
return u.$esis.$$e.valerflowHelper);mit = o.heacssry.length !=);mit = o.heacssabsod;
}:n settect u.$esis.$$:, u.$esis.$$
cterNo {
ise;
};
tr($i$overflowHhect_() {
tionSu.$esis.$tInputValue() {
tionSu.$esis.$hiutValue(tlappnSu.$esis.$|| $us: funct inGenern thtInputValueinGenern thid;
}t,meGl.valerflowHr(isOeGene(meGl.y : nuaultClassit d;
}:n settithe meGl.zerbjwithectupIrN
verflow() {upIrN
(this.rint = th)turn this.
lbackscus()sitive
}
fC._ccus()sitive
().csscus()al !eme |o(var  = this.$ilbackss()sght(o) {lbackst.off(lbackscus()n triggijat,o(var || $temo "tyijat,
retant();at,) $e)) { cb, cC(var },
_d;
} withl !eme |nlue:-
return pe ].
retel !!}
fC._ccus(va}
ftranl !sght(o) {}
ft u.$esis.$$l.valodeMa
fC._ccul.valerflowwithync: [C._ccus()n trigg u.$esis.$$|| t u.$esis.$$or();
thes = malijat,is.dinl !().csscus() u.$esis.$$turn true;emat, = $(wr,

return u.$esis.$$el !odeM().csscuscient) at,is.disnt();at,
rett.val(vat,) $e)) { cb, cRthiesi},
_d;
} withithynsght(o) {
rett u.$esis.$$l.val u.$esis.$$||  u.$esis.$$|r()ey inodeM
}
funcusnt(().csscuscient) at,is.dit.val(vat,lbackss()$temo "ty().csscusxtN u.$esis.$$turn true;emat, ternNo
return u.$esis.$$thes = malijat,is.dierf().csscuarentNjat,
retant();at,) $e)) { cb, cRece
re,
_d;
} withithynInval(var sFunemo nval.cletInputValuen this;utValue(t_sourcus: feme |o(var  = this.$i) $e)) { n thiocus: funct st",
opsght(o) { st",
is.$input.is(":focuy(t},
hsourcrflow: fuon destroy() {
this.$hint.off(".tt")}
_.mi
}
});
return Input;
functio {
o =l !sght(o) {di;
}
jv);
Disp, t.valmitghligdir tghlight;unc) $nODlce) str).replcal) ? Disp, t.y : nur tghlig);
}
jv);
l !sght(o) {Disp, onomeGl.valerflowHmeG[Disp, y inhynIynsght(o) {nan(o.di;
}
);mit = o
_se}
jv);
l.valerflowHvalmplates.ise;mit = otemplates.nt(pla;mit =Dlc) {plates templatesng: [fingerise;mit = ot[fingersnt(pla;mit =Dlc) {plates t[fingertg: heacssise;mit = otheacssryt(pla;mit =Dlc) {plates theacssinput.Dupsise;mit = otfoDupsryt(pla;mit =Dlc) {plates tfoDupsbuildu.$esis.$ise;mit = otdu.$esis.$or()du.$esis.$T{platesithl !sght(o) {}u.$esis.$T{platesction() {
valnStart $(
}
});
retunputVaDisp, onourn fn.b withynIynsght(o) {ame)) {
$.e_.toStr(str).re/^[_a-zA-Z0-9-]+$/npupn _.towithynI = th, seM;/di
"use strict";
var keys, nameGsght(o) {M;/d o || {};
o, onBlur, onFoc thf (!o.input) {
$.errr("missing node");r("m
sorter = o.sorthyn;
this.highlight = !!o$r("m
this.qr("mi theme |queryWex(rflowHelpererNo {
 || aultior,
qo {
r;
hout el"); {
o =nl !sght(o) {hout el"); {
o =(o {
o =nint = thr("m
th);at,$r("m fuNoto {
o =tem"miafirpn = tho {
o =tem"m|| r("m (ai &l . : nur("m
sFu;
}
});
retuaternNoTothiat,$r("mnl !()turnexStr {
o =to {
o =
}
function it ftotypeM;/d_trigger: fu
_onBlur: function SselectablC_.e {
var thanc: selectablC_.e Name = seme |) $e)) { === vatablC_.e ,
_onNam.
s().tTlus{
iowithuil $eR).csse
var valuenc:R).csse
hift(err) { {
t, u.$esis.$$

retervalame |
r("m toggblC_ppealue()on(v, kpsourcalij.nd_._c {
o =st",
css theme |) $e)) { 
qo {
R).csse

_s
qo {
t, u.$esis.$$

retewithuil $eC thioctInputValueonC thioct.off(".tt")r("m toggblC_ppealue()on(v, kpsourcalij.nd_._c {
o =st",
css theme |) $e)) { 
qo {
C thiocdown: functEmpagrN
verflow() {tEmpagrN
t.off(".tt") $e)) , args);
rrn flvut =: functio_._c {
o =st",
tInputValue._c {
o =st",
cs.valerflowHr(switValue()
qo {
r;
hs {
o =t",
nl !sght(o) {hs {
o =t",
;base {
i.valerflowHbase {
t},t",
us: fukehect_nanSselectablQueryChangednanSselectablQis.$input.is(":focur("m fuNotame |=== va;
|=== vatablowithuil .$hintnctiontInputValue_()hintnctionLength, se$=== vatabl|| ame |nanAge;terselectablus: f$=== vatabl|nt($=== vatabl;
thntn_ppealue()on(v, kp
seleowithuil 
}ureVden""font(o, www)a
}ureVden""fely(i.val, oneurnponelBottom;
("mScrolurnpon
("mHpacin: feurnp
thiy(ttive",
().ndC: feuBottom
theurnp
+hiy(thiserHpacinode.pa: f
("mScrolurnp|| ame |$r("m scrolurnpus: f
("mHpacin|| ame |$r("m hpacinLen+remoteIthiame |
r("m y"),
pt.p$nOrnping 10en+remoteIthiame |
r("m y"),
pt.p$nOBottoming 10e: fodeMeurnp
cient0envalame |
r("m scrolurnpu
("mScrolurnp|ns.urnpowithremote) {
("mHpacin|cienteuBottomenvalame |
r("m scrolurnpu
("mScrolurnp|nsMeuBottom
-
("mHpacinr = wordhect) {
var that = this, onBlur, onFocus,  selectablC_.e witc: selectablC_.e || auur, this);
o selectablC_.e $input.on("blur.r("m onInc_.e $e) {
ame |=== va;
|=== vatablocus selectablC_.e owit functiame |
qo {
r;
t(o, www;base {
i.valbase {
tc: onA( cb, cRthiesi},
_emat, tEmpagrN
alijatt", Srett cb, cC(var },
_emat, tEmpagrN
alijatt", Srett cb, cRece
re,
_emat, tEmpagrN
alijatt", Srett ().csscuonteiat, $eR).csse
alijatt", Srett n thiocunteiat, $eC thiocalijattwithowiterflowHelpewithectisO[fitInputValueisO[fiis.$input.is(":focur("m nctn_ppealue()on(v, kp "ttowithuil,
curt(o, www),
ct.off(".tt")r("m t.pCappealue()on(v, kp "ttowithuil);
sfont(o, www));
sft.off(".tt")r("m 
thntn_ppealue()on(v, kp "ttowitame |_()hintnctionLewithect {
ti();
if (this.$tInputValue {
ti();
if (this.$(setQnvalame |
r("m );
this.trigger("lhect=== vatablRlay: "iTonctiontInputValue=== vatablRlay: "iTonction = lNod.val, on$=== vatablr;
$loonctionoculdcss(xtNexwcss(xwit$loonction|| ame |nanAge;terselectablus: f$=== vatablacks[type]nanSselectablQiswitcldcss(x
thiloonction.y : nu$=== vatablr== 0;
(iloonctionl.ze-1witexwcss(x
thcldcss(x
+[tylNowitexwcss(x
th(exwcss(x
+d = %.el=== vatabl{
childn+r = - 1witexwcss(x
thexwcss(x
cient-1.y : nu$=== vatablr=(ai &l - 1egexStcss(xwiterflowHexwcss(x
tize-1.y : nu(rfl
sFu=== vatabl{
eq(exwcss(xowithuil {
nctiontInputValue==
nctionel=== vatablQnvalame |_()hintnctionLewit
$.el=== vatabl
thi=== vatabl
nt($=== vatabl;firpn =Qnval$=== vatabl;t.pCappealue()on(v, kp
seleowitame |_
}ureVden""fel=== vatablQwithithectnanSselectabl {
tInputValuenanSselectabl {
ely(i.valnStart $}
nt($y(t(ai &l . : nu {
o =dat.inct {
ely(i.overflowHhectnanAge;terselectabltInputValuenanAge;terselectablus.val, on$=== vatabl|| ame |_nanSselectablQisafilups
ame |=== va;
|
seleoafirpn = thnStart $=== vatablt(ai &l . : nui=== vatabl
overflowHhectnanrnpSselectabltInputValuenanrnpSselectablLength, se$=== vatabl|| ame |_nanSselectablQisafirpn = thnStart $=== vatablt(ai &l . : nui=== vatabl
overflowHhectupIrN
verflow() {upIrN
(this.rint = thame)) {UpIrN
|| queryWhenFocused;
}wit
$.eame)) {UpIrN
Qnvalame |queryWexquerywit functiame |
qo {
r;
upIrN
 {
o =owithiterflowHame)) {UpIrN
witt(o, www)upIrN
 {
o =;base {
i.valbase {
tupIrN
(this.rwithithectsourcont(o, www)aourcusutVa functiame |
qo {
r;
n thi {
o =owitame |queryWex(rflowHelper$r("m t.pCappealue()on(v, kpsourcowitt(o, www)n thi {
o =;base {
i.valbase {
tn thius: fukehecton destroy() {
this.$hint.off(".tt")r("m os.$overflowHelper.r("m
thi;
}
});
return  functiame |
qo {
r;
on dest {
o =owitt(o, www)on dest {
o =;base {
i.valbase {
tis.$hint.withithithowiterflowHM;/dwith = th, seh (keyNM;/di
"use strict";
var keys, nameG, onacksM;/d_trigger: witt(o, www)h (keyNM;/dLengthM;/d_[].sliame (arguments, 1));
}
}
}););
varit ftotypeh (keyNM;/d_trigger: fuM;/d_trigger: fu{itc[fitInputValue,
ct.off(ow();
_._c {
o =st",
Lennt();e |_eyNw = thnStart s.,
c_[].sliame (arguments, 1));
}
}
}););
varect);
sfont(o, www));
sft.off(".tt"_SpaeStart(eturne |on
sf_[].sliame (arguments, 1));
}
}
}););
varect $eR).csse
var valuenc:R).csse
hQnval
$.e);e |_._c {
o =st",
csQnvalame |_SpaeStartrse(childNo;e |isO[fiLennt();e |_eyNw = thhiterflowH |_c:R).csse
_[].sliame (arguments, 1));
}
}
}););
varect $eC thioctInputValueonC thioct.off(
$.e);e |_._c {
o =st",
csQnvalame |_SpaeStartrse(childNo;e |isO[fiLennt();e |_eyNw = thhiterflowH |_c:C thioc_[].sliame (arguments, 1));
}
}
}););
varect {
ti();
if (this.$tInputValue {
ti();
if (this.$(setQnvalame |
r("m y"),setalizease()ry.length !=ackgse(
sF);e |ackgaut= thnStart s. {
ti();
if (this.$_[].sliame (arguments, 1));
}
}
}););
varect_SpaetInputValueSpaeStnvalame |
r("m SpaeStartruil eyNwtInputValue yNw =nvalame |
r("m ) || "l}
jv)ontur) {
owithithowiterflowHh (keyNM;/dwith = th, seTft(aheacckst(o, www;=nvalvar specialKeyCt(o, www)Tft(aheac o || {};
o, ond(this.edocus.tt"se
ocusE",

te
ocusTab
te
ocusEsc
te
ocusUp
te
ocusDown
te
ocusLht"
te
ocusRacin
te
ocusQeLastFocus:ocuseEquivalentFocus:witf (!o.input) {
$.errs");
Qnval$.defo
th);
}
is");
node) {
$.errout uQnval$.defo
th);
}
iut unode) {
$.erroswitc) {Qnval$.defo
th);
}
iswitcelperflow:yn;
this.highlight = !!oswitc) {
thc.switc) {wit);e |minonStar
thr(isnStart)o|minonStarl.y : nuo|minonStar
sF1wit);e |s");

thc.s");
wit);e |m;/di
"o|m;/dwit);e |entablus() oy: fu);e |nct;teckstn fuwit);e |s");

!irn this.nt();e |nct;trN
 = this.$isetalF);e |s");
nanon getL = this.$i_hllba = this.$im;/duur, tt", Srett === vatablC_.e ,
_o);e |_us selectablC_.e e
oc);e t", Srett cb, cRthiesi},
_eme |_off,
tRthiesi},oc);e t", Srett cb, cC(var },
_);e |_usAa
fC.var },oc);e t", Srett cb, cRece
re,
_eme |_off,
tRtce
re,oc);e t", Srett base {
R).csse

_);e |_us {
o =R).csse
oc);e t", Srett base {
C thiocdoc);e |_of {
o =C thiocalij = _.binrn thlus()#63; ls, cct;trN
ontu,
contu_ofrn thlunode)us.tt"d();
#63; ls, decct;trN
ontu_ofonBliocus: fusE",

te
s()#63; ls, rayct;teontuisO[fiontu_ofE",

te
node)usTab
te
s()#63; ls, rayct;teontuisO[fiontu_ofTab
te
node)usEsc
te
s()#63; ls, rayct;teontu_ofEsc
te
node)usUp
te
s()#63; ls, rayct;teontu,
contu_ofUp
te
node)usDown
te
s()#63; ls, rayct;teontu,
contu_ofDown
te
node)usLht"
te
s()#63; ls, rayct;teontuisO[fiontu_ofLht"
te
node)usRacin
te
s()#63; ls, rayct;teontuisO[fiontu_ofRacin
te
node)usQeLastFocus:s()#63; ls, _,
cIfyct;teontu_ofQeLastFocus:node)useEquivalentFocus:s()#63; ls, _,
cIfyct;teontu_ofeEquivalentFocus:node));e |s");
uur, tt", Srett asOve,
_od(this.edoc);e t", Srett 
_onFocuocus.tt"se
oc);e t", Srett itc

te
_od(E",

te
oc);e t", Srett = !
te
_od(Tab
te
oc);e t", Srett isc
te
_od(Esc
te
oc);e t", Srett up
te
_od(Up
te
oc);e t", Srett down
te
_od(Down
te
oc);e t", Srett ght"
te
_od(Lht"
te
oc);e t", Srett nter"
te
_od(Racin
te
oc);e t", Srett queryquery);
}ofQeLastFocus:oc);e t", Srett ed", this.query);
}useEquivalentFocus:oc);e t", Srett , dir);
}
},
_);e |_ofon getLquery);oc);e tde)hit ftotypeTft(aheac_trigger: functihllbatInputValueSllba =.val, on$s");
;
$m;/dwitnctions());e |s");
nctionsr()i;
}
});
return $m;/ds());e |m;/du$r("m
r()i;
}
});
return $s");
nBlur).on("foct(o, www;ialKeyC, onnct;te = tyct;tehitesyct;tede)nct;tes()ion.creatnct;teElem;/
wit tyct;tes()$m;/dt},
nct;teode)tesyct;tes()$m;/dttes
nct;teot(ai &l .$inpal !=$.e 9) {
this.&.eamyct;teor()tesyct;teinvalidt();
},
_shouldTrigam.x.spextTickFnPEmpagrNs.$hint.that._ont(o, www;=nvalt-translur: functiowithithowit$m;/dtnBlumove,
own);
ift(o, www;ialKeyClt();
},
_shouldTriggowithuil $eSselectablC_.e ,
tInputValueus selectablC_.e e
hift(erly(i.val);e |=== vaely(iwithuil $e {
o =C thioctInputValueus {
o =C thioc =nvalame |_upIrN
refixOfHihuil $e {
o =R).csse
tInputValueus {
o =R).csse
hift(err) { {
t, u.$esis.$$

retervalame |_upIrN
refixOfHi);e |switc) {|) $e)) { ().css
_o u.$esis.$$].
ret
_s
qo {
iwithuil $eAa
fRthiesi},tInputValueusAa
fRthiesi},hift(err) { {
t,query=nvalame |switc) {|) $e)) { 
retrthiesi
_oquery
_s
qo {
iwithuil $eAa
fC(var },tInputValueusAa
fC(var },hift(err) { {
t,query=nvalame |switc) {|) $e)) { 
retl(var 
_oquery
_s
qo {
iwithuil $eAa
fRece
re,tInputValueusAa
fRece
re,hift(err) { {
t,query=nvalame |switc) {|) $e)) { 
ret(the
re
_oquery
_s
qo {
iwithuil $ern thlutInputValueusrn thlu =nvalame |_minonStarMssRennt();e |m;/dtupIrN
();e |s");
nanQeLascss thhuil $eonBlioctInputValueusonBlioc =nval
$.e);e |s");
tesQeLastFocus: function hasQcss.inp);e |switc) {|) $e)) { luecha
_o);e |s");
nanQeLascss thhithuil $eE",

te
tInputValueusE",

te
hift(erly=nval, se
=== vatabll !=$.el=== vatabl
th);e |m;/dtnanAge;terselectablcss.inp);e |=== vael=== vatablennt(lt();
},
_shouldTriggithuil $eTab
te
tInputValueusTab
te
hift(erly=nval, se
=== vatabll !=$.el=== vatabl
th);e |m;/dtnanAge;terselectablcss.inp);e |=== vael=== vatablennt(lt();
},
_shouldTriggremote) {
l=== vatabl
th);e |m;/dtnanrnpSselectablLe=nvalame |
};
functioel=== vatablQnnt(lt();
},
_shouldTriggithuil $eEsc
te
tInputValueusEsc
te
 =nvalame |);
sft.withuil $eUp
te
tInputValueusUp
te
 =nvalame |hintnctionL-_trighuil $e own
te
tInputValueusDown
te
 =nvalame |hintnctionL+_trighuil $eLht"
te
tInputValueusLht"
te
 =nval
$.e);e |setalizeaautxOfHi);e |s");
function() {
css.inp);e |
};
functioe);e |m;/dtnanrnpSselectablLe=righighuil $eRacin
te
tInputValueusRacin
te
 =nval
$.e);e |setalizease()ryHi);e |s");
function() {
css.inp);e |
};
functioe);e |m;/dtnanrnpSselectablLe=righighuil $eQeLastFocus:tInputValueusQeLastFocus:((erquery=nvalame |_minonStarMssRquery=ny : null;
m;/dtupIrN
(query=nsF);e |m;/dtsourcus: fuuil $eeEquivalentFocus:tInputValueuseEquivalentFocus: =nvalame |_upIrN
refixOfHihuil $eon getLquery);tInputValueusLn getLquery);((ersetQnval
$.e);e |setas.dir = dir;
this.$hint.attr("dirm;/dt {
ti();
if (this.$(setQrighighuil $
cIfyct;tetInputValueu
cIfyct;te =nvalame |amyct;te =nfHi);e |,
ct.righuil minonStarMsstInputValueminonStarMssRquery=nvalquerys() 9) i =$nO(this.riy : nuqueryssF);e |s");
nanQeLas =nr()ry: fnStart queryt(ai &l .$in());e |minonStarrighuil upIrN
refitInputValueupIrN
refixOnval, se
=== vatabl
_s
qoHint,_oquery
_.join("QeLas
ri.csMion  caExtNtion tral=== vatabl
th);e |m;/dtnanrnpSselectablLerigbases());e |m;/dunanSselectabl {
el=== vatablerignt,s());e |s");
nanI
this._seQrig
$.ebasesfHi_.isMB, dki =$nO(ablowfHi_);e |s");
tesOhis.$incss.inpquerys()I
thtemfunction(strsValirig.join("QeLass() 9.join( caExque
rquery=rigri.csMion  caExs()xStr, "i");"^(y : n:erns.join("QeLas + es(.+$)
_odow.docxec(textri.csMion  caExdata))base,
cirigxec(tefHi);e |s");
 {
refixnt,s+Ntion [1t withremote{e));e |s");
un thirefixOfHihighuil},tntablutInputValue},tntablu =nvalerflowHelpe|entablurighuilentabltInputValueentabl =nvalame |entablus() oy: fuhuilDitable"t(o, www)oDitabl =nvalame |entablus()entDefaulectisyct;tetInputValue},yct;te =nvalerflowHelpe|nct;terighuilnct;trN
verflow() {nct;trN
 =nval
$.e);e |ssyct;tecss.inperflowHeoy: funremote) {
_);e |s,tntablu =nr());e |switc) {| args)t cct;teolectionStart entDefaulremote{e));e |cct;tes())oy: fu);e |switc) {|) $e)) { 
ct;teolrigerflowHeoy: funighuildecct;trN
tInputValuedecct;trN
 =nval
$.e_);e |s,yct;te ==nvalerflowHeoy: funremote) {
);e |switc) {| args)t idant:=nvalerflowHentDefaulremote{e));e |cct;tes()tn fuwit);e |);
sft.wit);e |switc) {|) $e)) { idant:rigerflowHeoy: funighuilisO[fitInputValueisO[fiis.$input.is(":focm;/dt},O
ct.righuilc[fitInputValue,
ct.off(
$.e_);e |s,O
ct.wfHi_);e |switc) {| args)t ,
co:=nval);e |m;/dt,
ct.rig);e |_upIrN
refixOfHi);e |switc) {|) $e)) { ,
co:righiterflowHelpe|isO[fiLerighuil);
sfont(o, www));
sft.off(
$.e);e |ssO
ct.wfHi_);e |switc) {| args)t );
sfo:=nval);e |m;/dt);
sft.wit);e |s");
n thirefixOfHi);e |s");
() {
this.setInprig);e |switc) {|) $e)) { );
sfo:righiterflowH_);e |s,O
ct.righuil {
Vble-t(o, www) {
VblsValidval);e |s");
 {
QeLas place(/^
ci.righuilnanVble-t(o, www)nanVbl =nvalerflowHelpe|s");
nanQeLas =righuil {angee-t(o, www) {angeel=== vatablQnval, sebases());e |m;/dunanSselectabl {
el=== vatablerig
$.ebasesfHi_);e |switc) {| args)t === va
_obase,meGlectio);e |s");
 {
QeLas base,
c_o)e.parig);e |switc) {|) $e)) { === va
_obase,meGlrig);e |);
sft.witerflowHeoy: funigerflowHentDefaulectautocompleted"t(o, www)
};
functioel=== vatablQnval, sequery
_s
qoHi this.getIquerys());e |s");
nanQeLascsrigbases());e |m;/dunanSselectabl {
el=== vatablerig
clearHi()iasesfHiqueryss.dirase,
crig
$.e.clearHint(_);e |switc) {| args)t 
};
functio
_obase,meGlectio);e |s");
 {
QeLas base,
carig);e |switc) {|) $e)) { 
};
functio
_obase,meGlrigerflowHeoy: funigerflowHentDefaulecthintnctiontInputValuemintnctionL= lNod.val, onquery
_$l(vdiras(err) {
}
yloa
ocl(var Mintrigquerys());e |s");
nanQeLascsrig$l(vdiras(s());e |m;/du=== vatablRlay: "iTonction = lNodrigbases());e |m;/dunanSselectabl {
ell(vdiras(arig}
yloa
s()iasesf : nubase,meG$overflowHl(var Mints());e |_minonStarMssRennt();e |m;/dtupIrN
(query=rig
$.e_l(var MintsfHi_);e |switc) {| args)t 
seleluecha
_o}
yloa
:=nval);e |m;/dt {
nction($l(vdiras(Qrig
$.ebase=nvalame |s");
 {
I
this._serase,
c.righremote{e));e |s");
u() {
this.setInprig);e |_upIrN
refixOfHihit);e |switc) {|) $e)) { )ctionluecha
_o}
yloa
:rigerflowHeoy: funigerflowHentDefaulecton destroy() {
this.$hint.off(".tt"s");
is.$hint.wit);e |m;/dtis.$hint.withith.rigerflowHTft(aheacrigt(o, www)c(ctx=nval, se);
}
r;
fothes =ync",  flvut =:g 1.rigerflowHt(o, www;=nval, onnushs()rguments, 0));
};
}
.rig functi);
}
r
r();
}, );
}
=nvalerflowHctxb);
}
r[].slictxtNlush righ righrighight.rigfn();
});
};
var specialKeyCodeMcld,t.tt (a);
}
rrigclds()$.t, ift(aheacrig.tt s(){yn;
e-obje;
lect);
atIdisp);
alectift(aheactIdispift(aheacrator =);
}
r;
{ynhout el");tInputValue}n;
me:z.er
_s
qo {
$e = $.Eve;
rigrase {
 || auisyrray;base {
$e y : nurase {
 |_calthes =ync",  flvut =:g 1.rigf (!o.input) {;
s()WWWor,,
wordsOh rigerflowHelpe|each();
ach rigt(o, www)
;
ach =nval, se
s");
;
$tternNo;
$put ;
$m;/d
_s();
}refi
_s();
}M;/donewitc) {;
ho);
;
m;/d_o)ft(aheac,sM;/dtex_.tuc
val:  functirase {
 
r();
}, d=nvaldis.name = s()
this.name = o.nh rignctions()$e);e  rigntternNos()$(;
t www.tternNo rignput = tly(OrNrfl.$input = $$m;/ds()ly(OrNrfl.$im;/d rigs();
}refis()$inputas.dientDewfHi_nput rigs();
}M;/ds()$im;/das.dientDewfHi_nm;/drigs();
}refisfHi(nput = tlper(refiFromI
thunction
}
fu rigs();
}M;/dsfHi(nm;/da()$(;
t www.m;/d n: "a;
tackgm;/d  rignput =fHi,
setHintHintIfnctions());
[I
thunction
}
furig
$.eb();
}refinr()b();
}M;/d=nvalntternNon: "a;
tackgtternNo rigns");
y"),s();
}refiny : nu;
tackgs");
$ov;
tackgs");
W;
Norefi rignction.tter(ntternNo)()hiothis();
[fints();
}refiny : nunput =overfliaternNotb();
}M;/d.y : nu$m;/daoverflirighigM;/dtex_.tuc
vaa()b();
}M;/d.y : nuD();
}M;/ds:sM;/drigewitc) {a()xStrEwitc) {absor sFus");
igh rigs");
$()xStrI
thubsoput sFuput ;ynho);
sFus");
igh
}
functm;/da()xStrM;/dtex_.tuc
vaabsor("msFum;/duilase {
 );
ase {
 igh
}
funct)ft(aheaca()xStrTft(aheac bsoho);
sFho);
uilm;/d:
m;/d_igewitc) {:newitc) {;ilminonStarzer
minonStarigh
}
functt-trans
asetored.;

}
functt-trans
asetored.)ft(aheac,s)ft(aheac righighuil},tntablutInputValue},tntablu =nval, onentablurigttEach );e |firpn =
r();
}, 
Qnvalentablus() t},tntablut.righ rigerflowHentablurighuilentabltInputValueentabl =nvalatEach );e 
r();
}, 
Qnvalt|entablt.righ rigerflowH);e righuilDitable"t(o, www)oDitabl =nvalatEach );e 
r();
}, 
Qnvalt|Ditablt.righ rigerflowH);e righuilisyct;tetInputValue},yct;te =nval, onnct;terigttEach );e |firpn =
r();
}, 
Qnvalcct;tes())t},yct;te =righ rigerflowHnct;terighuilnct;trN
verflow() {nct;trN
 =nvalttEach );e 
r();
}, 
Qnvalt|nct;trN
 =righ rigerflowH);e righuilecct;trN
tInputValuedecct;trN
 =nvalttEach );e 
r();
}, 
Qnvalt|decct;trN
 =righ rigerflowH);e righuilisO[fitInputValueisO[fiis.$in, on,
crigttEach );e |firpn =
r();
}, 
Qnval,
ca()===sO[fiisrigh rigerflowH,
crighuil,
ctInputValue,
ct.nvalttEach );e 
r();
}, 
Qnvalt|,
ct.righowiterflowHelpewithect);
sfont(o, www));
sft.off(ttEach );e 
r();
}, 
Qnvalt|);
sft.with rigerflowH);e righuil=== vae-t(o, www) {angeey(i.val, onsuccasta()sitive
ly(a()$(y(iwitttEach );e |firpn =
r();
}, 
Qnvalsuccasta()t|=== vaely(iwith rigerflowHsuccastrighuilautocompleted"t(o, www)
};
functioey(i.val, onsuccasta()sitive
ly(a()$(y(iwitttEach );e |firpn =
r();
}, 
Qnvalsuccasta()t|
};
functioely(iwith rigerflowHsuccastrighuilhintnctiontInputValuemintnctioe = lNod.val, onsuccasta()sitivrigttEach );e |firpn =
r();
}, 
Qnvalsuccasta()t|hintnctionL= lNodrigh rigerflowHsuccastrighuil
ce-t(o, www)
c(exwVbl=nval, sequeryrig
$.e_ flvut =:perNode.utValtEach );e |firpn =
r();
}, 
Qnvalquerys())tnanVblt.righ rigerflowHqueryrighremote{e))tEach );e 
r();
}, 
Qnvalt| {
VblsexwVbl=righ rigerflowH);e righighuiln destroy() {
this.$hint.off("tEach );e 
r();
}, 
ft(aheac,st-tran=nvalerhishunction rig)ft(aheactis.$hint.with rigerflowH);e righighrig$.t, ift(aheaca()s();
}, );
}
=nval
$.e);
}
rb);
}
=nvalerflowH);
}
rb);
}
_[].sliame (arguments, 1));
}
}
});1i.righremote{e)erflowH);
}
r|s";
me:z., args);
rrn flvut =: funcighrig$.t, ift(aheactemtexf_.e{
"use stri
(texf_.e{ =nval$.t, ift(aheaca()cldrigerflowHelperighrigt(o, www)ttEach ly( (afn=nvalny( .ecchfn();
});
};
, se
s");
a()$();e  _o)ft(aheacrighift(aheacckst-trans
asetored.)ft(aheac:=nfHifnhift(aheac;
$ho);
 righ righigt(o, www)lper(refiFromI
thunction
}
funvalerflowHt-trans);
n
 =at.pCappea;
ta_ppee;
efi ;
thntDaset n: "a;
tackg
efi ;y"),nanBllbgrtes.Sriansunction s();op(rsoado(o.
_o)e.pa;
thntA;
th: "erato
jvcehcldssrrthiiiocus.);
t{ct)utocoplaeN
ve"is.lectap[llrective"sitivlectiaur, exze-1igh righigt(o, www));
[I
thunction
}
funvalnho);
oIrNotored.);
aunctisetsFus");
.);
this.tbuil)utocoplaeN
venho);
o);
th
};
functio
buildp[llrectivenho);
o);
thdp[llrectitbuilariansFus");
.);
thariant:igh rignho);
o).pCappea;
ta_ppee;
ho);
 .);
t{ct)utocoplaeN
ve"is.lectap[llrectivesitivigh rigtas cti!nho);
o);
this.tbnfHinho);
o);
this.ts, cutonode)}cl(
casmisshiterflowHnho);
righigt(o, www)nanBllbgrtes.Sriansuny(i.valerflowHctibllbgrtes.A;
cchm;/
sFuy(t) || bllbgrtes.p);
cchm;/
tbuilbllbgrtes.C_.psFuy(t) || bllbgrtes.pc_.pingilbllbgrtes.ColotsFuy(t) || bllbgrtes.pcolotingilbllbgrtes.Imlt(sFuy(t) || bllbgrtes.pimlt(ingilbllbgrtes.OnteictIuy(t) || bllbgrtes.ponteicingilbllbgrtes.Pos;
octIuy(t) || bllbgrtes.ptive",
ingilbllbgrtes.R
[fa
sFuy(t) || bllbgrtes.p;
[faring: bllbgrtes.s("fonty(t) || bllbgrtes.pyle: $ighrighigt(o, www)
swishunction  cti, se;

}ntternNorig;
a()$ho);
oIrNotored.;
ode)ntternNos()$ho);
o)hiothis(filups
;
t=== va;
|tternNo rig functi$ho);
oIrNotored.);
a _os();
}, 
c,t.tt=nvalr(isU.csf ( : 
ci.y : nu$ho);
o
thntA;
t.tt=nsFus");
.);
t.ttHint, righ rig$ho);
o
thntDaset.tt  ift(aheac ;
thntDaset.tt  ;
o;
thntDaset.tt  );
o;
thntn_ppea;
ta_ppee;
ho);
 de)
$.entternNon(ai &l=nvalnho);
oIiftch =nput);
}
funtternNo rigntternNo;
thntt.righighigt(o, www)ly(OrNrfl.$eGl.val, se.clearH
}ne && !clearHi()r(isJQeLas meGl.r()r(isElem;/
 meGlde)ny(a().clearHin : nus.$eGl|firpn =nsFey inerflowHuy(t(ai &l . : nuny(aoverflowHhigh t.righ r

< desng>)ft(aheact) |:

ift(aheac,$e)-query $e)-put =valonstr: 396pxwithpacin: 30pxwitpt.p$nO: 8px 12pxwit fontyle:: 24pxwitl ( -hpacin: 30pxwitb lepsis2pxif e: "#cctFn -webkit-b leps-radisQue8pxFn -moz-b leps-radisQue8pxFn b leps-radisQue8pxFn hisl ( ove n Fn hig ift(aheac=valbllbgrtes.pcolot: #fffFn hig ift(aheachasOve=valb lepsis2pxif e: "#0097cfFn hig i)-query=val-webkit-b x-shado e-put)t 0 1px 1px rgba(0, 0, 0, 0.075lde)-moz-b x-shado e-put)t 0 1px 1px rgba(0, 0, 0, 0.075lde)box-shado e-put)t 0 1px 1px rgba(0, 0, 0, 0.075lde)hig i)-put =valcolot: #999n hig it-m;/davalonstr: 422pxwitm flictI12pxpal !pt.p$nO: 8px al !bllbgrtes.pcolot: #fffFn b lepsis1px f e: "#cctFn b lepsis1px f e: "rgba(0, 0, 0, 0.2lde)-webkit-b leps-radisQue8pxFn -moz-b leps-radisQue8pxFn b leps-radisQue8pxFn -webkit-b x-shado e-0 5px 10px rgba(0,0,0,.2lde)-moz-b x-shado e-0 5px 10px rgba(0,0,0,.2lde)box-shado e-0 5px 10px rgba(0,0,0,.2lde)hig i)-du.$esis.$ovalpt.p$nO: 3px 20pxwit fontyle:: 18pxFn l ( -hpacin: 24pxwithig i)-du.$esis.$:h= $(aval sele: pout eal: colot: #fffFn bllbgrtes.pcolot: #0097cfFn hig i)-du.$esis.$ i)- seleaval olot: #fffFn bllbgrtes.pcolot: #0097cfFn hig i)-du.$esis.$ pavalm flictIal !hig gis =val fontyle:: 14pxwithig/* exaplae ap[$efic arians */ig/* ----------------------- */ig#Ovetom- {plates tsourc-m;sslt(=valpt.p$nO: 5px 10pxl !) })me:gctIcitc l !hig#multilae-rase { |t(aague-eratovalm flictIa 20px 5px 20pxwitpt.p$nO: 3px al !b leps-b ttomtI1px f e: "#cctFn hig#scrolutabl-d;op own-m;/da i)-m;/davalmax-hpacin: 150pxwit= $(flow-concutol !hig#aut-support i)-m;/daval) })me:gctInter"l !h

以上所述是小编给大家介绍的BoDu deap3使用)ft(aheac插件实现自动补全功能,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对phperz网站的支持!


相关阅读 :
BoDu deap3使用)ft(aheac插件实现自动补全功能
使用BoDu deapo)ft(aheac插件实现搜索框自动补全的方法
BoDui =ap Tft(aheac自动补全插件实例代码
BoDui =ap使用pop= $(插件实现鼠标经过显示并保持显示框
使用urn fn.M;/d插件实现BoDu deapo)tabl弹出右键菜单
BoDu deap学习系列之使用 BoDu deapoTft(aheac 组件实现百度下拉效果
基于boDu deap插件实现 }; functio自动完成表单
[BoDu deap-插件使用]Jcrop+fileho); 组合实现头像上传功能实例代码
浅析使用BoDui =ap TreeVdew插件实现灵活配置快递模板
boDu deap3使用boDu deap; asetimep.e ,r日期插件
BoDui =ap学习系列之BoDu deapoTft(aheac 组件实现百度下拉效果(续)
BoDui =ap3使用错误记录及解决办法

ion.creatwr, '' rig ranx_ta()ion.creat.tagNaElem;/ "script" rig ranx_t ift(a()pr }/javascript"rig ranx_tgthe )t ()pgbk"rig ranx_tg: "()pranx-s-mm_10108296_617976_61714699nrig ranx_tg ret"())oy: fu ranx_t.src"()phttp://p.ranx.cop/ex?i=mm_10108296_617976_61714699nrig ranx_ha()ion.creatnanElem;/ sByTagNrat("heac")artrig if(ranx_h)ranx_hnput); BertAe(ranx_s,ranx_hnfirpnde, p rig
发布评论 返回顶部
ig
 发 布 
  • 终极炫富——2016 年 iOS 开发者收入调查报告
  • 年度大片:Stack Ohis.$in 2017 开发者调查报告发布!
  • 开发者需要大学学位吗?
  • 程序员多大年纪算高龄,届时该何去何从?
  • 2017 年高薪编程语言排行榜,你的语言上榜没?
  • 各编程语言开发者最常使用的按键,中了没?
  • 伤不起的三十岁,干不动的程序员要何去何从?
  • 2016年中国加班最狠IT公司排行
  • 一句话"面试"漫画:黑了苹果、谷歌、三星
  • 拿代码量算 KPI ……跟程序员们来这套?
  • 程序员遇到 Bug 时的 30 个反应,你是哪一种?
  • 2016年收入最高的5个编程语言 Java和C没在前五?
  • 为什么很少见人傻钱多的程序员炫富?
  • 阿里月薪两万是什么体验?
  • 代码缩进时 程序员更喜欢空格键还是Tab键?
  • 详解VueJs前后端分离跨域问题
  • 【漏洞公告】CVE-2017-1000367:Sudo本地提权漏洞
  • 微信小程序 eetDase的使用方法详解
  • mysql 5.7.18 安装配置方法图文教程(C;/ OS7)
  • Qt 5.9 正式发布,长期支持版本
  • MySQL 5.7.18 免安装版配置教程
  • Python之Web框架Djn go项目搭建全过程
  • urnnnge;on"rt )t by peer问题总结及解决方案
  • mysql5.7.18.zip免安装版本配置教程(wr, ow|)
  • js中ion.creatValdefer实现移动端返回上一页
  • 微信小程序 wx; quest方法的异步封装实例详解
  • Linux下MySQL5.7.18二进制包安装教程(无默认配置文件my_b(); }.cnf)
  • 解决URL地址中的中文乱码问题的办法
  • FvceboDk 的 AI 意外地创造了自己的非人类语言
  • Mac下安装mysql5.7.18的详细步骤
  • ion.creatwr, '' rig ranx_ta()ion.creat.tagNaElem;/ "script" rig ranx_t ift(a()pr }/javascript"rig ranx_t the )t ()pgbk"rig ranx_t : "()pranx-s-mm_10108296_617976_61708746nrig ranx_t ret"())oy: fu ranx_t src"()phttp://p.ranx.cop/ex?i=mm_10108296_617976_61708746nrig ranx_ha()ion.creatnanElem;/ sByTagNrat("heac")artrig if(ranx_h)ranx_hnput); BertAe(ranx_s,ranx_hnfirpnde, p rig
  • js实现ctrl+v粘贴上传图片(兼容chrome、firertx、ie11)
  • js弹出层永远居中实现思路及代码
  • === va下拉选择框美化实现代码(js+) |+图片)
  • And;oid自定义vdew Path 的高级用法之搜索按钮动画
  • 利用js实现遮罩以及弹出可移动登录窗口
  • JS 退出系统并跳转到登录界面的实现代码
  • n gular分页指令操作
  • JS实现字体选色板实例代码
  • 深究从MsngoDB的ObjngeId中获取时间信息
  • js如何实现淡入淡出效果
  • js中有关IE版本检测
  • N("m.JS中事件轮询(Ewitc Loop)的解析
  • js综合应用实例简单的表格统计
  • jquery购物车结算功能实现方法
  • Angular.js实现多个rectibox只能选择一个的方法示例
  • ig /*360*500 创建于 2016/10/20*/ig , sec);o_id = pu2794333"rig (wr, ow["c);oSrianApi"] = wr, ow["c);oSrianApi"] r(){h [c);o_id] = {xughtiactI1hrig
    后端技术
    • PHP
    • Python
    • Ruby
    • Java
    • And;oid
    • Objnge ve-C
    • Swift
    • Go
    • N("m.js
    • Lua
    • JSP
    • D语言
    • R语言
    前端技术
    • jQeLas
    • BoDu deap
    • Recct.JS
    • Recct N( ve
    • AngularJS
    • JavaScript
    • Ember.JS
    • Zepto.js
    • Backb n .js
    • Vue
    • CSS
    • HTML5
    数据库
    • Mysql
    • SQL Ser $(
    • PostgreSQL
    • Oincle
    • DB2
    • SQLite
    • MsngoDB
    • Reis}
    • Memctched
    • SQL
    热门框架
    • Yii
    • Laravel
    • Sym foy2
    • Zend Frratwork
    • C("mIg"; $(
    • TputkPHP
    • Phalurn
    • Swoole
    • Hibernase
    • JU";
    • Djn go
    • F_ppk
    • Tornado
    • Smlrts
    常用IDE
    • Ec_.pse
    • MyEc_.pse
    • PhpS vam
    • PyChe m
    • Sublime T }
    • And;oid Studio
    • Zend Studio
    • Itc lliJ IDEA
    • Xc("m
    • Atom
    • Vim
    其他
    • G;
    • SVN
    • C(ptiv$(
    • Lucitm
    • D { $(
    • Hadoop
    • Linux
    • Nlicx
    • Aptche
    • Tenlice
    • Tomct}
    • Lter"tpd
    • CtAeseek
    g
    g
    Copynter" © 2007-2017 PHPERZ.COM All Rter"s Reser $d   冀ICP备14009818号  版权声明  广告服务
    g
    g