Mercurial > hg > webaudioevaluationtool
comparison js/loader.js @ 2538:464c6c6692d6
Beautified entire project.
author | Nicholas Jillings <nicholas.jillings@mail.bcu.ac.uk> |
---|---|
date | Mon, 14 Nov 2016 14:17:03 +0000 |
parents | 2ddc68898dff |
children | 15104a43089d |
comparison
equal
deleted
inserted
replaced
2536:527020a63203 | 2538:464c6c6692d6 |
---|---|
1 // Script to load the relevant JS files if the system supports it | 1 // Script to load the relevant JS files if the system supports it |
2 | 2 |
3 window.onload = function() { | 3 window.onload = function () { |
4 // First check if the Web Audio API is supported | 4 // First check if the Web Audio API is supported |
5 if (window.AudioContext == undefined && window.webkitAudioContext == undefined) { | 5 if (window.AudioContext == undefined && window.webkitAudioContext == undefined) { |
6 // Display unsuported error message | 6 // Display unsuported error message |
7 var body = document.getElementsByTagName("body")[0]; | 7 var body = document.getElementsByTagName("body")[0]; |
8 body.innerHTML = "<h1>Sorry! Your browser is not supported :(</h1><p>Your browser does not support the HTML5 Web Audio API. Please use one of the following supported browsers instead.<p>"; | 8 body.innerHTML = "<h1>Sorry! Your browser is not supported :(</h1><p>Your browser does not support the HTML5 Web Audio API. Please use one of the following supported browsers instead.<p>"; |
14 table.innerHTML += "<tr><td>Edge</td><td>12 or newer</td></tr>"; | 14 table.innerHTML += "<tr><td>Edge</td><td>12 or newer</td></tr>"; |
15 body.appendChild(table); | 15 body.appendChild(table); |
16 } else { | 16 } else { |
17 var head = document.getElementsByTagName("head")[0]; | 17 var head = document.getElementsByTagName("head")[0]; |
18 var src_list = ['js/specification.js', 'js/core.js', 'js/loudness.js', 'js/xmllint.js', 'js/WAVE.js']; | 18 var src_list = ['js/specification.js', 'js/core.js', 'js/loudness.js', 'js/xmllint.js', 'js/WAVE.js']; |
19 for (var i=0; i<src_list.length; i++) { | 19 for (var i = 0; i < src_list.length; i++) { |
20 var src = src_list[i]; | 20 var src = src_list[i]; |
21 var script = document.createElement("script"); | 21 var script = document.createElement("script"); |
22 script.type = "text/javascript"; | 22 script.type = "text/javascript"; |
23 script.async = false; | 23 script.async = false; |
24 script.defer = true; | 24 script.defer = true; |