# HG changeset patch # User www-data # Date 1464279650 -3600 # Node ID 6b6422523c886a7fabb0294e0088efb9efb09756 # Parent e7601d5ff17bce4112c3db4d52dff3cfa4f7ac19# Parent 5e1fb07919e73f1f71b70c2dea30d2a1854fa5ce Merge branch 'master' of https://github.com/BrechtDeMan/WebAudioEvaluationTool diff -r e7601d5ff17b -r 6b6422523c88 js/core.js --- a/js/core.js Thu May 26 16:20:56 2016 +0100 +++ b/js/core.js Thu May 26 17:20:50 2016 +0100 @@ -116,6 +116,16 @@ } } +var check_dependancies = function() { + // This will check for the data dependancies + if (typeof(jQuery) != "function") {return false;} + if (typeof(Specification) != "function") {return false;} + if (typeof(calculateLoudness) != "function") {return false;} + if (typeof(WAVE) != "function") {return false;} + if (typeof(validateXML) != "function") {return false;} + return true; +} + var onload = function() { // Function called once the browser has loaded all files. // This should perform any initial commands such as structure / loading documents @@ -3229,4 +3239,12 @@ }; } -onload(); \ No newline at end of file +var window_depedancy_callback; +window_depedancy_callback = window.setInterval(function(){ + if (check_dependancies()) { + window.clearInterval(window_depedancy_callback); + onload(); + } else { + document.getElementById("topLevelBody").innerHTML = "

Loading Resources

"; + } +},100); \ No newline at end of file