Mercurial > hg > webaudioevaluationtool
comparison js/core.js @ 2667:2f2aaef246af
Tighten of code around submission for Safari 8. #190
author | Nicholas Jillings <nicholas.jillings@mail.bcu.ac.uk> |
---|---|
date | Mon, 20 Mar 2017 16:21:44 +0000 |
parents | ad57c5c755d4 |
children | a513533565cf 4125da39666e |
comparison
equal
deleted
inserted
replaced
2665:ad57c5c755d4 | 2667:2f2aaef246af |
---|---|
428 console.log("WARNING - Could not update at this time"); | 428 console.log("WARNING - Could not update at this time"); |
429 createProjectSave("local"); | 429 createProjectSave("local"); |
430 } else { | 430 } else { |
431 var parser = new DOMParser(); | 431 var parser = new DOMParser(); |
432 var xmlDoc = parser.parseFromString(xmlhttp.responseText, "application/xml"); | 432 var xmlDoc = parser.parseFromString(xmlhttp.responseText, "application/xml"); |
433 var response = xmlDoc.firstElementChild; | 433 var response = xmlDoc.getElementsByTagName('response')[0]; |
434 if (response.nodeName == "response" && response.getAttribute("state") == "OK") { | 434 if (response.getAttribute("state") == "OK") { |
435 window.onbeforeunload = undefined; | 435 window.onbeforeunload = undefined; |
436 var file = response.getElementsByTagName("file")[0]; | 436 var file = response.getElementsByTagName("file")[0]; |
437 console.log("Save: OK, written " + file.getAttribute("bytes") + "B"); | 437 console.log("Intermediate save: OK, written " + file.getAttribute("bytes") + "B"); |
438 if (typeof specification.returnURL == "string" && specification.returnURL.length > 0) { | 438 if (typeof specification.returnURL == "string" && specification.returnURL.length > 0) { |
439 window.location = specification.returnURL; | 439 window.location = specification.returnURL; |
440 } else { | 440 } else { |
441 popup.popupContent.textContent = specification.exitText; | 441 popup.popupContent.textContent = specification.exitText; |
442 } | 442 } |