Differential D11431 Diff 27474 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 181 Lines • ▼ Show 20 Lines | addResult : function(obj) { | ||||
// dedupe things properly. Whatever the case, just ignore it. | // dedupe things properly. Whatever the case, just ignore it. | ||||
return; | return; | ||||
} | } | ||||
if (__DEV__) { | if (__DEV__) { | ||||
for (var k in {name : 1, id : 1, display : 1, uri : 1}) { | for (var k in {name : 1, id : 1, display : 1, uri : 1}) { | ||||
if (!(k in obj)) { | if (!(k in obj)) { | ||||
throw new Error( | throw new Error( | ||||
"JX.TypeaheadSource.addResult(): " + | 'JX.TypeaheadSource.addResult(): result must have ' + | ||||
"result must have properties 'name', 'id', 'uri' and 'display'."); | 'properties \'name\', \'id\', \'uri\' and \'display\'.'); | ||||
} | } | ||||
} | } | ||||
} | } | ||||
this._raw[obj.id] = obj; | this._raw[obj.id] = obj; | ||||
var t = this.tokenize(obj.tokenizable || obj.name); | var t = this.tokenize(obj.tokenizable || obj.name); | ||||
for (var jj = 0; jj < t.length; ++jj) { | for (var jj = 0; jj < t.length; ++jj) { | ||||
if (!this._lookup.hasOwnProperty(t[jj])) { | if (!this._lookup.hasOwnProperty(t[jj])) { | ||||
▲ Show 20 Lines • Show All 172 Lines • Show Last 20 Lines |