# HG changeset patch # User www-data # Date 1461946866 -3600 # Node ID 472412fab35416ea40f71f1615ac22d5a1fc9ca8 # Parent fa52c9ea2486deeadb9d4a07a3f3970c738ebbb9# Parent ae69e61a6b761d236e6cd19a0778382f41395b3c Merge branch 'master' of https://github.com/BrechtDeMan/WebAudioEvaluationTool diff -r fa52c9ea2486 -r 472412fab354 index.html --- a/index.html Fri Apr 29 16:20:56 2016 +0100 +++ b/index.html Fri Apr 29 17:21:06 2016 +0100 @@ -22,28 +22,6 @@ - diff -r fa52c9ea2486 -r 472412fab354 js/core.js --- a/js/core.js Fri Apr 29 16:20:56 2016 +0100 +++ b/js/core.js Fri Apr 29 17:21:06 2016 +0100 @@ -140,6 +140,26 @@ storage = new Storage(); // Define window callbacks for interface window.onresize = function(event){interfaceContext.resizeWindow(event);}; + + if (window.location.search.length != 0) + { + var search = window.location.search.split('?')[1]; + // Now split the requests into pairs + var searchQueries = search.split('&'); + for (var i in searchQueries) + { + // Split each request into + searchQueries[i] = searchQueries[i].split('='); + if (searchQueries[i][0] == "url") + { + url = decodeURI(searchQueries[i][1]); + } + } + loadProjectSpec(url); + window.onbeforeunload = function() { + return "Please only leave this page once you have completed the tests. Are you sure you have completed all testing?"; + }; + } }; function loadProjectSpec(url) { diff -r fa52c9ea2486 -r 472412fab354 php/save.php --- a/php/save.php Fri Apr 29 16:20:56 2016 +0100 +++ b/php/save.php Fri Apr 29 17:21:06 2016 +0100 @@ -5,6 +5,11 @@ $postText = file_get_contents('php://input'); $file_key = $_GET['key']; $filename = "../saves/save-".$file_key.".xml"; + $doc = new DOMDocument; + $doc->preserveWhiteSpace = false; + $doc->formatOutput = true; + $doc->loadXML($postText); + $postText = $doc->saveXML(); $fileHandle = fopen($filename, 'w'); if ($fileHandle == FALSE) { diff -r fa52c9ea2486 -r 472412fab354 test.html --- a/test.html Fri Apr 29 16:20:56 2016 +0100 +++ b/test.html Fri Apr 29 17:21:06 2016 +0100 @@ -22,28 +22,6 @@ -