Mercurial > hg > webaudioevaluationtool
comparison core.js @ 1628:244ca9c8546d
If projectReturn is specified as a url it will return to that server. Currently only tested using the localHost server on port 8000, as per the python2.py server included
author | Nicholas Jillings <nickjillings@users.noreply.github.com> |
---|---|
date | Tue, 26 May 2015 18:47:59 +0100 |
parents | 9319c38cc278 |
children | d6303bdef165 |
comparison
equal
deleted
inserted
replaced
1627:174421083d50 | 1628:244ca9c8546d |
---|---|
268 function createProjectSave(destURL) { | 268 function createProjectSave(destURL) { |
269 // Save the data from interface into XML and send to destURL | 269 // Save the data from interface into XML and send to destURL |
270 // If destURL is null then download XML in client | 270 // If destURL is null then download XML in client |
271 // Now time to render file locally | 271 // Now time to render file locally |
272 var xmlDoc = interfaceXMLSave(); | 272 var xmlDoc = interfaceXMLSave(); |
273 var parent = document.createElement("div"); | |
274 parent.appendChild(xmlDoc); | |
275 var file = [parent.innerHTML]; | |
273 if (destURL == "null" || destURL == undefined) { | 276 if (destURL == "null" || destURL == undefined) { |
274 var parent = document.createElement("div"); | |
275 parent.appendChild(xmlDoc); | |
276 var file = [parent.innerHTML]; | |
277 var bb = new Blob(file,{type : 'application/xml'}); | 277 var bb = new Blob(file,{type : 'application/xml'}); |
278 var dnlk = window.URL.createObjectURL(bb); | 278 var dnlk = window.URL.createObjectURL(bb); |
279 var a = document.createElement("a"); | 279 var a = document.createElement("a"); |
280 a.hidden = ''; | 280 a.hidden = ''; |
281 a.href = dnlk; | 281 a.href = dnlk; |
285 var submitDiv = document.getElementById('download-point'); | 285 var submitDiv = document.getElementById('download-point'); |
286 submitDiv.appendChild(a); | 286 submitDiv.appendChild(a); |
287 popup.showPopup(); | 287 popup.showPopup(); |
288 popup.popupContent.innerHTML = null; | 288 popup.popupContent.innerHTML = null; |
289 popup.popupContent.appendChild(submitDiv) | 289 popup.popupContent.appendChild(submitDiv) |
290 } else { | |
291 var xmlhttp = new XMLHttpRequest; | |
292 xmlhttp.open("POST",destURL,true); | |
293 xmlhttp.setRequestHeader('Content-Type', 'text/xml'); | |
294 xmlhttp.send(file); | |
290 } | 295 } |
291 return submitDiv; | 296 return submitDiv; |
292 } | 297 } |
293 | 298 |
294 function AudioEngine() { | 299 function AudioEngine() { |