Changeset View
Changeset View
Standalone View
Standalone View
webroot/rsrc/js/core/Prefab.js
| Show First 20 Lines • Show All 52 Lines • ▼ Show 20 Lines | buildTokenizer : function(config) { | ||||
| } catch (ex) { | } catch (ex) { | ||||
| // If the root element does not exist, just return without building | // If the root element does not exist, just return without building | ||||
| // anything. This happens in some cases -- like Conpherence -- where we | // anything. This happens in some cases -- like Conpherence -- where we | ||||
| // may load a tokenizer but not put it in the document. | // may load a tokenizer but not put it in the document. | ||||
| return; | return; | ||||
| } | } | ||||
| var datasource; | var datasource; | ||||
| if (config.ondemand) { | |||||
| // Default to an ondemand source if no alternate configuration is | |||||
| // provided. | |||||
| var ondemand = true; | |||||
| if ('ondemand' in config) { | |||||
| ondemand = config.ondemand; | |||||
| } | |||||
| if (ondemand) { | |||||
| datasource = new JX.TypeaheadOnDemandSource(config.src); | datasource = new JX.TypeaheadOnDemandSource(config.src); | ||||
| } else { | } else { | ||||
| datasource = new JX.TypeaheadPreloadedSource(config.src); | datasource = new JX.TypeaheadPreloadedSource(config.src); | ||||
| } | } | ||||
| // Sort results so that the viewing user always comes up first; after | // Sort results so that the viewing user always comes up first; after | ||||
| // that, prefer unixname matches to realname matches. | // that, prefer unixname matches to realname matches. | ||||
| ▲ Show 20 Lines • Show All 156 Lines • Show Last 20 Lines | |||||