diff --git a/controller.js b/controller.js index 92d60f3..b59598f 100644 --- a/controller.js +++ b/controller.js @@ -1,4 +1,4 @@ -var Controller = function(object, propertyName) { +var Controller = function() { this.setName = function(n) { this.propertyNameElement.innerHTML = n; @@ -24,7 +24,6 @@ var NumberController = function() { Controller.apply(this, arguments); - var _this = this; this.isClicked = false; @@ -86,7 +85,25 @@ NumberController.prototype.constructor = NumberController; var StringController = function() { this.type = "string"; Controller.apply(this, arguments); - + // TODO }; StringController.prototype = new Controller(); StringController.prototype.constructor = StringController; + + +var BooleanController = function() { + this.type = "boolean"; + Controller.apply(this, arguments); + // TODO +}; +BooleanController.prototype = new Controller(); +BooleanController.prototype.constructor = BooleanController; + + +var FunctionController = function() { + this.type = "function"; + Controller.apply(this, arguments); + // TODO +}; +FunctionController.prototype = new Controller(); +FunctionController.prototype.constructor = FunctionController; diff --git a/demo.css b/demo.css index e47cedd..d46643a 100644 --- a/demo.css +++ b/demo.css @@ -1,4 +1,37 @@ - pre { -display: none; -} \ No newline at end of file +padding: 10px; +border: 1px solid #ccc; +max-width: 500px; +} + +/* Pretty printing styles. Used with prettify.js. */ + +/* SPAN elements with the classes below are added by prettyprint. */ +.str { color: #080; } +.kwd { color: #008; } +.com { color: #800; } +.typ { color: #606; } +.lit { color: #066; } +.pun, .opn, .clo { color: #660; } +.pln { color: #000; } +.tag { color: #008; } +.atn { color: #606; } +.atv { color: #080; } +.dec { color: #606; } + +/* Specify class=linenums on a pre to get line numbering */ +ol.linenums { margin-top: 0; margin-bottom: 0 } /* IE indents via margin-left */ +li.L0, +li.L1, +li.L2, +li.L3, +li.L5, +li.L6, +li.L7, +li.L8 { list-style-type: none } +/* Alternate shading for lines */ +li.L1, +li.L3, +li.L5, +li.L7, +li.L9 { background: #eee } diff --git a/demo.html b/demo.html index 682b793..4cc49bc 100644 --- a/demo.html +++ b/demo.html @@ -2,9 +2,49 @@
+ - + + ++var controllableObject = { numberProperty: 20, constrainedNum: 0, @@ -18,13 +58,13 @@ window.onload = function() { GUI.start(); - GUI.show(); // collapsed by default // Creates a number box GUI.add(controllableObject, "numberProperty"); // Creates a slider (min, max) - GUI.add(controllableObject, "constrainedNum", -100, 100).setName("customName"); + GUI.add(controllableObject, "constrainedNum", -100, 100) + .setName("customName"); // Creates a text field GUI.add(controllableObject, "textProperty"); @@ -35,14 +75,7 @@ window.onload = function() { // Creates a button GUI.add(controllableObject, "functionProperty"); -} - - - -- +};