jslinting complete

This commit is contained in:
Danny Yoo 2011-09-17 22:31:56 -04:00
parent 45204fcb3f
commit ae415aa09b

View File

@ -498,11 +498,6 @@ var rawJsworld = {};
var removeAllChildren = function(n) {
while (n.firstChild) {
n.removeChild(n.firstChild);
}
};
// Preorder traversal. // Preorder traversal.
@ -1331,8 +1326,10 @@ var rawJsworld = {};
stopPropagation(e); stopPropagation(e);
}); });
return node; return node;
} };
var text_input, checkbox_input;
// input: string CPS(world -> world) // input: string CPS(world -> world)
function input(aType, updateF, attribs) { function input(aType, updateF, attribs) {
@ -1356,7 +1353,7 @@ var rawJsworld = {};
var text_input = function(type, updateF, attribs) { text_input = function(type, updateF, attribs) {
var n = document.createElement('input'); var n = document.createElement('input');
n.type = type; n.type = type;
@ -1365,7 +1362,7 @@ var rawJsworld = {};
if (! n.parentNode) { return; } if (! n.parentNode) { return; }
setTimeout( setTimeout(
function() { function() {
if (lastVal != n.value) { if (lastVal !== n.value) {
lastVal = n.value; lastVal = n.value;
change_world(function (w, k) { change_world(function (w, k) {
updateF(w, n.value, k); updateF(w, n.value, k);
@ -1373,7 +1370,7 @@ var rawJsworld = {};
} }
}, },
0); 0);
} };
attachEvent(n, "keydown", onEvent); attachEvent(n, "keydown", onEvent);
eventDetachers.push(function() { eventDetachers.push(function() {
@ -1388,7 +1385,7 @@ var rawJsworld = {};
}; };
var checkbox_input = function(type, updateF, attribs) { checkbox_input = function(type, updateF, attribs) {
var n = document.createElement('input'); var n = document.createElement('input');
n.type = type; n.type = type;
var onCheck = function(w, e, k) { var onCheck = function(w, e, k) {
@ -1396,7 +1393,7 @@ var rawJsworld = {};
}; };
// This established the widget->world direction // This established the widget->world direction
add_ev_after(n, 'change', onCheck); add_ev_after(n, 'change', onCheck);
attachEvent(n, 'click', function(e) { attachEvent(n, 'click', function(e) {
stopPropagation(e); stopPropagation(e);
}); });
@ -1405,15 +1402,14 @@ var rawJsworld = {};
}; };
var button_input = function(type, updateF, attribs) { // var button_input = function(type, updateF, attribs) {
var n = document.createElement('button'); // var n = document.createElement('button');
add_ev(n, 'click', function(w, e, k) { updateF(w, n.value, k); }); // add_ev(n, 'click', function(w, e, k) { updateF(w, n.value, k); });
return addFocusTracking(copy_attribs(n, attribs)); // return addFocusTracking(copy_attribs(n, attribs));
}; // };
function text(s, attribs) { function text(s, attribs) {
var result = document.createElement("div"); var result = document.createElement("div");
@ -1423,9 +1419,11 @@ var rawJsworld = {};
} }
Jsworld.text = text; Jsworld.text = text;
var option;
function select(attribs, opts, f){ function select(attribs, opts, f){
var n = document.createElement('select'); var n = document.createElement('select'), i;
for(var i = 0; i < opts.length; i++) { for(i = 0; i < opts.length; i++) {
n.add(option({value: opts[i]}), null); n.add(option({value: opts[i]}), null);
} }
n.jsworldOpaque = true; n.jsworldOpaque = true;
@ -1435,12 +1433,12 @@ var rawJsworld = {};
} }
Jsworld.select = select; Jsworld.select = select;
function option(attribs){ option = function(attribs){
var node = document.createElement("option"); var node = document.createElement("option");
node.text = attribs.value; node.text = attribs.value;
node.value = attribs.value; node.value = attribs.value;
return node; return node;
} };
@ -1455,7 +1453,7 @@ var rawJsworld = {};
Jsworld.h1 = h1; Jsworld.h1 = h1;
function canvas(attribs){ function canvas(attribs){
return addFocusTracking(copy_attribs(document.createElement('canvas'), attribs)); return addFocusTracking(copy_attribs(document.createElement('canvas'), attribs));
} }
Jsworld.canvas = canvas; Jsworld.canvas = canvas;
@ -1517,4 +1515,4 @@ var rawJsworld = {};
}; };
})(); }());