changeset 2411:c31f73252af5

Merge branch 'master' into Dev_main
author Nicholas Jillings <nicholas.jillings@mail.bcu.ac.uk>
date Fri, 27 May 2016 08:52:28 +0100
parents 2f6a1f510ade (current diff) 5e1fb07919e7 (diff)
children 18f88a726ccd
files js/core.js
diffstat 1 files changed, 19 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/js/core.js	Thu May 26 16:07:00 2016 +0100
+++ b/js/core.js	Fri May 27 08:52:28 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