Mercurial > hg > webaudioevaluationtool
changeset 1052:b7fd0296c6ab
merge
author | Nicholas Jillings <nicholas.jillings@eecs.qmul.ac.uk> |
---|---|
date | Wed, 01 Jul 2015 11:11:54 +0100 |
parents | 7aa8862850ef (diff) cabeed51943a (current diff) |
children | 329dfa208333 |
files | README.txt ape.js core.js example_eval/project.xml index.html pythonServer.py saves/read.txt scripts/comment_parser.py scripts/score_parser.py scripts/timeline_view.py |
diffstat | 2 files changed, 32 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/core.js Wed Jul 01 11:09:17 2015 +0100 +++ b/core.js Wed Jul 01 11:11:54 2015 +0100 @@ -637,6 +637,29 @@ } } +function errorSessionDump(msg){ + // Create the partial interface XML save + // Include error node with message on why the dump occured + var xmlDoc = interfaceXMLSave(); + var err = document.createElement('error'); + err.textContent = msg; + xmlDoc.appendChild(err); + var parent = document.createElement("div"); + parent.appendChild(xmlDoc); + var file = [parent.innerHTML]; + var bb = new Blob(file,{type : 'application/xml'}); + var dnlk = window.URL.createObjectURL(bb); + var a = document.createElement("a"); + a.hidden = ''; + a.href = dnlk; + a.download = "save.xml"; + a.textContent = "Save File"; + + popup.showPopup(); + popup.popupContent.innerHTML = "ERROR : "+msg; + popup.popupContent.appendChild(a); +} + // Only other global function which must be defined in the interface class. Determines how to create the XML document. function interfaceXMLSave(){ // Create the XML string to be exported with results @@ -888,6 +911,12 @@ if (audioObj.state == 0 || audioObj.buffer == undefined) { // Genuine error console.log('FATAL - Error loading buffer on '+audioObj.id); + if (request.status == 404) + { + console.log('FATAL - Fragment '+audioObj.id+' 404 error'); + console.log('URL: '+audioObj.url); + errorSessionDump('Fragment '+audioObj.id+' 404 error'); + } } }); }; @@ -1975,5 +2004,4 @@ } return true; }; -} - +} \ No newline at end of file
--- a/index.html Wed Jul 01 11:09:17 2015 +0100 +++ b/index.html Wed Jul 01 11:11:54 2015 +0100 @@ -25,7 +25,8 @@ </script> <!-- Uncomment the following script for automatic loading of projects --> <script> - url = '/pseudo.xml'; //Project XML document location + //url = '/pseudo.xml'; //Project XML document location + url = 'example_eval/project.xml'; loadProjectSpec(url); </script>