window.onload = resolve;\r
});\r
\r
+ // Get a resolve function for the script loading promises\r
script_promise = new Promise(function (resolve) {\r
script_promise_resolve = resolve;\r
});\r
+\r
+ // Chain each script loading promise\r
script_promise = script_promise.then(function () {\r
var idx;\r
for (idx = 0; idx < scripts.length; idx++) {\r
}\r
});\r
\r
+ // Debugging will get a list of debugging scripts from settings.json (below)\r
if (!getQueryVariable('debug')) {\r
scripts.push(['assets/libs/lodash.min.js?t=<%build_time%>']);\r
scripts.push([\r
});\r
});\r
\r
- Promise.all([onload_promise, settings_promise]).then(function(){return script_promise}).then(function startApp() {\r
+ // prawnsalad: Why is the below script_promise in its own .then()?\r
+ // M2Ys4U: prawnsalad: either of the first two promises can resolve the\r
+ // third one, but the third one has a then() on it already, so the\r
+ // then() on the all() makes it wait for the then() on the script promise\r
+ // to resolve.\r
+ //\r
+ // Promises - simple.\r
+ Promise.all([onload_promise, settings_promise])\r
+ .then(function(){return script_promise})\r
+ .then(function startApp() {\r
// Kiwi IRC version this is built from\r
kiwi.build_version = '<%build_version%>';\r
\r