Mercurial > hg > webaudioevaluationtool
changeset 761:af6cfa619c24
Browser GET support. In the project URL, you can select the test page to load by using http://server.com/index.html?url=server/path/to/project.xml
author | Nicholas Jillings <nicholas.jillings@eecs.qmul.ac.uk> |
---|---|
date | Thu, 17 Dec 2015 16:48:08 +0000 |
parents | 946f8b4762ad |
children | 01c026742e1e |
files | index.html |
diffstat | 1 files changed, 18 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/index.html Thu Dec 17 16:38:52 2015 +0000 +++ b/index.html Thu Dec 17 16:48:08 2015 +0000 @@ -23,14 +23,26 @@ window.onbeforeunload = function() { return "Please only leave this page once you have completed the tests. Are you sure you have completed all testing?"; }; - </script> - <!-- Uncomment the following script for automatic loading of projects --> - <script> - //url = '/pseudo.xml'; //Project XML document location - url = 'example_eval/project.xml'; + + var url = 'example_eval/project.xml'; + // SEARCH QUERY: By using the GET Request option ?url=loca/path/to/project.xml in the URL bar, you can load a project quickly + 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 = searchQueries[i][1]; + } + } + } loadProjectSpec(url); </script> - </head> <body>