comparison core.js @ 1293:c753706731f2

Fixed null/period saves on test completion. specification projectReturn is currently deprecated pending new usage.
author Nicholas Jillings <nickjillings@users.noreply.github.com>
date Thu, 10 Mar 2016 11:49:08 +0000
parents 6b2ae5d87a64
children 6dac24365cfe
comparison
equal deleted inserted replaced
1292:a6cfd378891c 1293:c753706731f2
332 popup.showPopup(); 332 popup.showPopup();
333 popup.popupContent.innerHTML = "</span>Please save the file below to give to your test supervisor</span><br>"; 333 popup.popupContent.innerHTML = "</span>Please save the file below to give to your test supervisor</span><br>";
334 popup.popupContent.appendChild(a); 334 popup.popupContent.appendChild(a);
335 } else { 335 } else {
336 var xmlhttp = new XMLHttpRequest; 336 var xmlhttp = new XMLHttpRequest;
337 xmlhttp.open("POST",destURL,true); 337 xmlhttp.open("POST","\save.php?key="+storage.SessionKey.key,true);
338 xmlhttp.setRequestHeader('Content-Type', 'text/xml'); 338 xmlhttp.setRequestHeader('Content-Type', 'text/xml');
339 xmlhttp.onerror = function(){ 339 xmlhttp.onerror = function(){
340 console.log('Error saving file to server! Presenting download locally'); 340 console.log('Error saving file to server! Presenting download locally');
341 createProjectSave(null); 341 createProjectSave("local");
342 }; 342 };
343 xmlhttp.onload = function() { 343 xmlhttp.onload = function() {
344 console.log(xmlhttp); 344 console.log(xmlhttp);
345 if (this.status >= 300) { 345 if (this.status >= 300) {
346 console.log("WARNING - Could not update at this time"); 346 console.log("WARNING - Could not update at this time");
347 createProjectSave("local");
347 } else { 348 } else {
348 var parser = new DOMParser(); 349 var parser = new DOMParser();
349 var xmlDoc = parser.parseFromString(xmlhttp.responseText, "application/xml"); 350 var xmlDoc = parser.parseFromString(xmlhttp.responseText, "application/xml");
350 var response = xmlDoc.getElementsByTagName('response')[0]; 351 var response = xmlDoc.getElementsByTagName('response')[0];
351 if (response.getAttribute("state") == "OK") { 352 if (response.getAttribute("state") == "OK") {