Skip to content

Commit

Permalink
Hygiene
Browse files Browse the repository at this point in the history
  • Loading branch information
cwdesautels committed May 20, 2011
1 parent b92ede1 commit 12138cb
Show file tree
Hide file tree
Showing 3 changed files with 104 additions and 104 deletions.
42 changes: 21 additions & 21 deletions index.html
Expand Up @@ -2,37 +2,37 @@
<html>
<head>
<title>Sundae</title>
<script type="text/javascript" src="sundae.js" ></script>
<script type='text/javascript' src='sundae.js' ></script>
</head>
<body>
<h1>Sundae Ref Test Runner</h1>
<h3>Settings</h3>
<div id="setup">
<div id='setup'>
<table><tr>
<td>Run Tests:</td>
<td>
<select id="type">
<option value="all" selected="selected">All</option>
<select id='type'>
<option value='all' selected='selected'>All</option>
</select>
</td>
</tr><tr>
<td>Tolerance:</td>
<td><input type="text" size="2" id="epsilon" value="5"/>%</td>
<td><input type='text' size='2' id='epsilon' value='5'/>%</td>
</tr><tr>
<td>Blur Radius:</td>
<td><input type="text" size="2" id="sigma" value="2"/>px</td>
<td><input type='text' size='2' id='sigma' value='2'/>px</td>
</tr></table>
</div>
<script type="text/javascript">
<script type='text/javascript'>
var d = document;
var b = d.createElement("input");
b.setAttribute("type", "Button");
b.setAttribute("value", "Begin Tests");
b.setAttribute("onClick", "beginTester();");
d.getElementById("setup").appendChild(b);
getJSON("tests.json", function (data) {
var b = d.createElement('input');
b.setAttribute('type', 'Button');
b.setAttribute('value', 'Begin Tests');
b.setAttribute('onClick', 'beginTester();');
d.getElementById('setup').appendChild(b);
getJSON('tests.json', function (data) {
var found = false;
var t = d.getElementById("type"); ;
var t = d.getElementById('type'); ;
for (var i = 0; data.testSuite && i < data.testSuite.length; i++) {
for (var j = 0; data.testSuite[i].test && j < data.testSuite[i].test.length; j++) {
if (data.testSuite[i].test[j].tag) {
Expand All @@ -41,7 +41,7 @@ <h3>Settings</h3>
found = true;
}
if (!found) {
var opt = d.createElement("option");
var opt = d.createElement('option');
opt.text = opt.value = data.testSuite[i].test[j].tag;
t.options.add(opt);
}
Expand All @@ -52,24 +52,24 @@ <h3>Settings</h3>
});
function beginTester() {
//Optional Global Setters
sundae.setBlurRadius(d.getElementById("sigma").value);
sundae.setTolerance(d.getElementById("epsilon").value);
sundae.setTestTag(d.getElementById("type").value);
sundae.setBlurRadius(d.getElementById('sigma').value);
sundae.setTolerance(d.getElementById('epsilon').value);
sundae.setTestTag(d.getElementById('type').value);
//Start tester
sundae.init();
b.disabled = true;
}
//Duplicate of private function within library
function getJSON(src, callback){
var r = new XMLHttpRequest();
r.open("GET", src, true);
r.overrideMimeType("application/json");
r.open('GET', src, true);
r.overrideMimeType('application/json');
r.onload = function(){
try{
callback(JSON.parse(r.responseText));
}
catch(e){
callback(eval("(" + r.responseText + ")"));
callback(eval('(' + r.responseText + ')'));
}
};
r.send(null);
Expand Down
4 changes: 2 additions & 2 deletions slave.js
Expand Up @@ -32,7 +32,7 @@ onmessage = function (event) {
pix.b = blur(pix.b, pix.height, pix.width);
}
comparePixels(pix);
postMessage({"id":pix.cId, "data":pix.c});
postMessage({'id':pix.cId, 'data':pix.c});
function buildKernel() {
var ss = pix.sig * pix.sig;
var factor = 2 * Math.PI * ss;
Expand Down Expand Up @@ -86,7 +86,7 @@ onmessage = function (event) {
function comparePixels(pix) {
var failed = false;
var len = pix.b.length;
if(pix.knownFail != "true"){
if(pix.knownFail != 'true'){
if (pix.a.length === len) {
var j;
for (j = 0; j < len; j += 4) {
Expand Down

0 comments on commit 12138cb

Please sign in to comment.