Mercurial > hg > webaudioevaluationtool
changeset 2402:6b6422523c88
Merge branch 'master' of https://github.com/BrechtDeMan/WebAudioEvaluationTool
author | www-data <www-data@sucuk.dcs.qmul.ac.uk> |
---|---|
date | Thu, 26 May 2016 17:20:50 +0100 |
parents | e7601d5ff17b (current diff) 5e1fb07919e7 (diff) |
children | f0b0b4f6487d |
files | |
diffstat | 1 files changed, 19 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- 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 = "<h1>Loading Resources</h1>"; + } +},100); \ No newline at end of file