Fix whitespace

This commit is contained in:
Matt Baer 2018-12-03 12:18:04 -05:00
parent 3b4d14f194
commit 5fc41687be
1 changed files with 11 additions and 10 deletions

View File

@ -22,12 +22,13 @@
// Given a array of URIs, load them in order
function loadLanguages(uris, callback) {
uris.forEach(function(uri) {
var sc=document.createElement('script');
sc.src=uri; sc.async=false; // critical?
if( uris.indexOf(uri) == uris.length-1) {
sc.onload = callback;
}
document.head.appendChild(sc);
var sc = document.createElement('script');
sc.src = uri;
sc.async = false; // critical?
if (uris.indexOf(uri) == uris.length-1) {
sc.onload = callback;
}
document.head.appendChild(sc);
});
}
@ -44,10 +45,10 @@
// Check what we need to load
for (i=0; i < lb.length; i++) {
lang = lb[i].className.replace('language-','');
lurl = hlbaseUri + "languages/" + lang + ".min.js";
if (!(langs.includes(lang) || jss.includes(lurl))) {
jss.push(lurl);
}
lurl = hlbaseUri + "languages/" + lang + ".min.js";
if (!(langs.includes(lang) || jss.includes(lurl))) {
jss.push(lurl);
}
}
// Load files in order, higlight on last load
loadLanguages(jss, () => {highlight(lb)});