()
| 34 | } |
| 35 | |
| 36 | function onJSONLoaded () { |
| 37 | data = JSON.parse(this.responseText); |
| 38 | var scriptsToLoad = ['lunr.js']; |
| 39 | if (data.config && data.config.lang && data.config.lang.length) { |
| 40 | lang = data.config.lang; |
| 41 | } |
| 42 | if (lang.length > 1 || lang[0] !== "en") { |
| 43 | scriptsToLoad.push('lunr.stemmer.support.js'); |
| 44 | if (lang.length > 1) { |
| 45 | scriptsToLoad.push('lunr.multi.js'); |
| 46 | } |
| 47 | for (var i=0; i < lang.length; i++) { |
| 48 | if (lang[i] != 'en') { |
| 49 | scriptsToLoad.push(['lunr', lang[i], 'js'].join('.')); |
| 50 | } |
| 51 | } |
| 52 | } |
| 53 | loadScripts(scriptsToLoad, onScriptsLoaded); |
| 54 | } |
| 55 | |
| 56 | function onScriptsLoaded () { |
| 57 | console.log('All search scripts loaded, building Lunr index...'); |
nothing calls this directly
no test coverage detected