Differential D16094 Diff 38724 webroot/rsrc/externals/javelin/lib/control/typeahead/source/TypeaheadSource.js
Changeset View
Changeset View
Standalone View
Standalone View
webroot/rsrc/externals/javelin/lib/control/typeahead/source/TypeaheadSource.js
Show First 20 Lines • Show All 351 Lines • ▼ Show 20 Lines | members : { | ||||
normalize : function(str) { | normalize : function(str) { | ||||
return this.getNormalizer()(str); | return this.getNormalizer()(str); | ||||
}, | }, | ||||
tokenize : function(str) { | tokenize : function(str) { | ||||
str = this.normalize(str); | str = this.normalize(str); | ||||
if (!str.length) { | if (!str.length) { | ||||
return []; | return []; | ||||
} | } | ||||
return str.split(/\s/g); | return str.split(/\s+/g); | ||||
}, | }, | ||||
_defaultTransformer : function(object) { | _defaultTransformer : function(object) { | ||||
return { | return { | ||||
name : object[0], | name : object[0], | ||||
display : object[0], | display : object[0], | ||||
uri : object[1], | uri : object[1], | ||||
id : object[2] | id : object[2] | ||||
}; | }; | ||||
} | } | ||||
} | } | ||||
}); | }); |