# HG changeset patch # User www-data # Date 1462360871 -3600 # Node ID fc8d79f8d9c5af4431fe391a0bce3dc12c0a29d1 # Parent 510fe0e815fdab5f63c0e5e9c7bed371bc25b44b# Parent 59083312c5ffc741f255e287904c5d4c23021afe Merge branch 'master' of https://github.com/BrechtDeMan/WebAudioEvaluationTool diff -r 510fe0e815fd -r fc8d79f8d9c5 js/core.js --- a/js/core.js Tue May 03 15:21:03 2016 +0100 +++ b/js/core.js Wed May 04 12:21:11 2016 +0100 @@ -16,7 +16,7 @@ var testState; var currentTrackOrder = []; // Hold the current XML tracks in their (randomised) order var audioEngineContext; // The custome AudioEngine object -var projectReturn; // Hold the URL for the return +var gReturnURL; // Add a prototype to the bufferSourceNode to reference to the audioObject holding it @@ -150,9 +150,13 @@ { // Split each request into searchQueries[i] = searchQueries[i].split('='); - if (searchQueries[i][0] == "url") - { - url = decodeURI(searchQueries[i][1]); + switch(searchQueries[i][0]) { + case "url": + url = decodeURI(searchQueries[i][1]); + break; + case "returnURL": + gReturnURL = decodeURI(searchQueries[i][1]); + break; } } loadProjectSpec(url); @@ -399,6 +403,11 @@ break; } document.getElementsByTagName("head")[0].appendChild(interfaceJS); + + if (gReturnURL != undefined) { + console.log("returnURL Overide from "+specification.returnURL+" to "+gReturnURL); + specification.returnURL = gReturnURL; + } // Create the audio engine object audioEngineContext = new AudioEngine(specification); @@ -454,7 +463,9 @@ var file = response.getElementsByTagName("file")[0]; console.log("Save: OK, written "+file.getAttribute("bytes")+"B"); if (typeof specification.returnURL == "string") { - window.location = returnURL; + if (specification.returnURL.length > 0) { + window.location = specification.returnURL; + } } else { popup.popupContent.textContent = specification.exitText; }