Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: 81f56a6961
Fetching contributors…

Cannot retrieve contributors at this time

94 lines (76 sloc) 2.588 kB
<!DOCTYPE html>
<html>
<head>
<title>JSIL Test Runner</title>
<style>
body, button, input {
font-family: Calibri, Tahoma, Verdana, sans-serif;
font-size: 14pt;
}
label {
font-weight: bold;
display: inline-block;
width: 10em;
}
input[type="text"] {
width: 20em;
}
button {
width: 10em;
}
</style>
</head>
<body onload="onLoad()">
<script src="Libraries/JSIL.Core.js" type="text/javascript"></script>
<script src="Libraries/JSIL.Bootstrap.js" type="text/javascript"></script>
<script src="Libraries/JSIL.IO.js" type="text/javascript"></script>
<script src="Libraries/JSIL.XML.js" type="text/javascript"></script>
<label for="scriptname">Test Script To Run:</label> <input type="text" name="scriptname" id="scriptname" value="Tests/SimpleTestCases/If.js"></input><br>
<button id="runscript" name="runscript">Run</button>
<hr>
<div id="loadedscripts"></div>
<script type="text/javascript">
var _started = Date.now();
function print (text) {
console.log(text);
}
function timeout (t) {
// no-op
}
function elapsed (t) {
return Date.now() - _started;
}
function runScript () {
var scriptname = document.getElementById("scriptname").value;
window.location.hash = "#" + scriptname;
var onError = function () {
alert("Failed to load script.");
};
var elt = document.createElement("script");
elt.type = "text/javascript";
elt.addEventListener("error", onError, true);
elt.async = true;
var container = document.getElementById("loadedscripts");
container.innerHTML = "";
container.appendChild(elt);
elt.src = scriptname;
}
var lastHash = null;
function checkHash () {
var currentHash = null;
if ((typeof (window.location.hash) === "string") && (window.location.hash.length > 1)) {
currentHash = window.location.hash.substr(1);
}
if (currentHash !== lastHash) {
lastHash = currentHash;
document.getElementById("scriptname").value = currentHash;
}
}
function onLoad () {
checkHash();
setInterval(checkHash, 100);
document.getElementById("runscript").addEventListener("click", runScript, true);
}
</script>
</body>
</html>
Jump to Line
Something went wrong with that request. Please try again.