From ca1462350709d8bbe95d4d2a3850442372d50e33 Mon Sep 17 00:00:00 2001 From: George Michael Brower Date: Tue, 9 Sep 2014 15:53:30 -0400 Subject: [PATCH 1/2] controller- = --- README.md | 14 +++++++------- TODO.md | 3 ++- build/gui.html | 14 +++++++------- build/gui.js | 14 +++++++------- docs/style.styl | 2 +- elements/Gui.js | 16 ++++++++-------- elements/controller-base/controller-base.html | 5 ----- .../controller-function.html | 19 ------------------- .../controller-function.js | 12 ------------ elements/dat-gui-base/dat-gui-base.html | 5 +++++ .../dat-gui-base.js} | 2 +- .../dat-gui-boolean.html} | 8 ++++---- .../dat-gui-boolean.js} | 4 ++-- .../dat-gui-boolean.styl} | 0 .../dat-gui-function/dat-gui-function.html | 19 +++++++++++++++++++ elements/dat-gui-function/dat-gui-function.js | 12 ++++++++++++ .../dat-gui-function.styl} | 0 .../dat-gui-number.html} | 10 +++++----- .../dat-gui-number.js} | 4 ++-- .../dat-gui-number.styl} | 0 .../dat-gui-option.html} | 8 ++++---- .../dat-gui-option.js} | 2 +- .../dat-gui-option.styl} | 0 .../dat-gui-string.html} | 10 +++++----- .../dat-gui-string.js} | 4 ++-- .../dat-gui-string.styl} | 0 .../gui-panel.html => dat-gui/dat-gui.html} | 6 +++--- .../gui-panel.js => dat-gui/dat-gui.js} | 2 +- .../gui-panel.styl => dat-gui/dat-gui.styl} | 0 .../controller-custom/controller-custom.html | 2 +- examples/index.html | 4 ++-- gui.html | 12 ++++++------ index.html | 14 +++++++------- tests/test.gui.js | 12 ++++++------ 34 files changed, 120 insertions(+), 119 deletions(-) delete mode 100644 elements/controller-base/controller-base.html delete mode 100644 elements/controller-function/controller-function.html delete mode 100644 elements/controller-function/controller-function.js create mode 100644 elements/dat-gui-base/dat-gui-base.html rename elements/{controller-base/controller-base.js => dat-gui-base/dat-gui-base.js} (97%) rename elements/{controller-boolean/controller-boolean.html => dat-gui-boolean/dat-gui-boolean.html} (59%) rename elements/{controller-boolean/controller-boolean.js => dat-gui-boolean/dat-gui-boolean.js} (67%) rename elements/{controller-boolean/controller-boolean.styl => dat-gui-boolean/dat-gui-boolean.styl} (100%) create mode 100644 elements/dat-gui-function/dat-gui-function.html create mode 100644 elements/dat-gui-function/dat-gui-function.js rename elements/{controller-function/controller-function.styl => dat-gui-function/dat-gui-function.styl} (100%) rename elements/{controller-number/controller-number.html => dat-gui-number/dat-gui-number.html} (78%) rename elements/{controller-number/controller-number.js => dat-gui-number/dat-gui-number.js} (98%) rename elements/{controller-number/controller-number.styl => dat-gui-number/dat-gui-number.styl} (100%) rename elements/{controller-option/controller-option.html => dat-gui-option/dat-gui-option.html} (54%) rename elements/{controller-option/controller-option.js => dat-gui-option/dat-gui-option.js} (96%) rename elements/{controller-option/controller-option.styl => dat-gui-option/dat-gui-option.styl} (100%) rename elements/{controller-string/controller-string.html => dat-gui-string/dat-gui-string.html} (50%) rename elements/{controller-string/controller-string.js => dat-gui-string/dat-gui-string.js} (76%) rename elements/{controller-string/controller-string.styl => dat-gui-string/dat-gui-string.styl} (100%) rename elements/{gui-panel/gui-panel.html => dat-gui/dat-gui.html} (85%) rename elements/{gui-panel/gui-panel.js => dat-gui/dat-gui.js} (97%) rename elements/{gui-panel/gui-panel.styl => dat-gui/dat-gui.styl} (100%) diff --git a/README.md b/README.md index 4d30a63..422ad7d 100644 --- a/README.md +++ b/README.md @@ -181,11 +181,11 @@ Since dat-gui is built using [Web Components]( todo ), you can also use HTML syn ```html - + - + - - - - - \ No newline at end of file +},_register:function(){c(this.extends)&&!b(this.extends)&&console.warn("%s is attempting to extend %s, an unregistered element or one that was not registered with Polymer.",this.name,this.extends),this.register(this.name,this.extends),this.registered=!0},waitingForPrototype:function(a){return h(a)?void 0:(i(a,this),this.handleNoScript(a),!0)},handleNoScript:function(a){this.hasAttribute("noscript")&&!this.noscript&&(this.noscript=!0,Polymer(a))},waitingForResources:function(){return this._needsResources},waitingForQueue:function(){return f.enqueue(this,this.registerWhenReady,this._register)},loadResources:function(){this._needsResources=!0,this.loadStyles(function(){this._needsResources=!1,this.registerWhenReady()}.bind(this))}});e.publish(e.declaration,j),g(function(){document.body.removeAttribute("unresolved"),document.dispatchEvent(new CustomEvent("polymer-ready",{bubbles:!0}))}),document.registerElement("polymer-element",{prototype:j})}(Polymer),function(){var a=document.createElement("polymer-element");a.setAttribute("name","auto-binding"),a.setAttribute("extends","template"),a.init(),Polymer("auto-binding",{createdCallback:function(){this.syntax=this.bindingDelegate=this.makeSyntax(),Polymer.whenPolymerReady(function(){this.model=this,this.setAttribute("bind",""),this.async(function(){this.marshalNodeReferences(this.parentNode),this.fire("template-bound")})}.bind(this))},makeSyntax:function(){var a=Object.create(Polymer.api.declaration.events),b=this;a.findController=function(){return b.model};var c=new PolymerExpressions,d=c.prepareBinding;return c.prepareBinding=function(b,e,f){return a.prepareEventBinding(b,e,f)||d.call(c,b,e,f)},c}})}(); + + + + + \ No newline at end of file diff --git a/build/gui.js b/build/gui.js index 0b0af98..7aee080 100755 --- a/build/gui.js +++ b/build/gui.js @@ -3,12 +3,12 @@ document.write(['', -'', +'', '', -'', -'', -'', -'', -'',].join("\n")) \ No newline at end of file +'},_register:function(){c(this.extends)&&!b(this.extends)&&console.warn("%s is attempting to extend %s, an unregistered element or one that was not registered with Polymer.",this.name,this.extends),this.register(this.name,this.extends),this.registered=!0},waitingForPrototype:function(a){return h(a)?void 0:(i(a,this),this.handleNoScript(a),!0)},handleNoScript:function(a){this.hasAttribute("noscript")&&!this.noscript&&(this.noscript=!0,Polymer(a))},waitingForResources:function(){return this._needsResources},waitingForQueue:function(){return f.enqueue(this,this.registerWhenReady,this._register)},loadResources:function(){this._needsResources=!0,this.loadStyles(function(){this._needsResources=!1,this.registerWhenReady()}.bind(this))}});e.publish(e.declaration,j),g(function(){document.body.removeAttribute("unresolved"),document.dispatchEvent(new CustomEvent("polymer-ready",{bubbles:!0}))}),document.registerElement("polymer-element",{prototype:j})}(Polymer),function(){var a=document.createElement("polymer-element");a.setAttribute("name","auto-binding"),a.setAttribute("extends","template"),a.init(),Polymer("auto-binding",{createdCallback:function(){this.syntax=this.bindingDelegate=this.makeSyntax(),Polymer.whenPolymerReady(function(){this.model=this,this.setAttribute("bind",""),this.async(function(){this.marshalNodeReferences(this.parentNode),this.fire("template-bound")})}.bind(this))},makeSyntax:function(){var a=Object.create(Polymer.api.declaration.events),b=this;a.findController=function(){return b.model};var c=new PolymerExpressions,d=c.prepareBinding;return c.prepareBinding=function(b,e,f){return a.prepareEventBinding(b,e,f)||d.call(c,b,e,f)},c}})}();', +'', +'', +'', +'', +'',].join("\n")) \ No newline at end of file diff --git a/docs/style.styl b/docs/style.styl index 2e11699..1a362b6 100644 --- a/docs/style.styl +++ b/docs/style.styl @@ -52,7 +52,7 @@ h3 #readme margin-right readme-margin -gui-panel +dat-gui position fixed width panel-width top 0px diff --git a/elements/Gui.js b/elements/Gui.js index 03f4461..e66297f 100644 --- a/elements/Gui.js +++ b/elements/Gui.js @@ -18,7 +18,7 @@ // Make domElement - this.panel = document.createElement( 'gui-panel' ); + this.panel = document.createElement( 'dat-gui' ); this.panel.autoPlace = params.autoPlace !== false; if ( this.panel.autoPlace ) { @@ -45,7 +45,7 @@ var controller; if ( args[ 0 ] instanceof Array || typeof args[ 0 ] == 'object' ) { - controller = document.createElement( 'controller-option' ); + controller = document.createElement( 'dat-gui-option' ); } else { controller = Gui.getController( value ); } @@ -204,12 +204,12 @@ dat.dom.dom = function() {}; dat.controllers = {}; - dat.controllers.Controller = constructor( 'controller-base' ); - dat.controllers.NumberController = constructor( 'controller-number' ); - dat.controllers.FunctionController = constructor( 'controller-function' ); - dat.controllers.ColorController = constructor( 'controller-color' ); - dat.controllers.BooleanController = constructor( 'controller-boolean' ); - dat.controllers.OptionController = constructor( 'controller-option' ); + dat.controllers.Controller = constructor( 'dat-gui-base' ); + dat.controllers.NumberController = constructor( 'dat-gui-number' ); + dat.controllers.FunctionController = constructor( 'dat-gui-function' ); + dat.controllers.ColorController = constructor( 'dat-gui-color' ); + dat.controllers.BooleanController = constructor( 'dat-gui-boolean' ); + dat.controllers.OptionController = constructor( 'dat-gui-option' ); dat.controllers.NumberControllerBox = dat.controllers.NumberController; dat.controllers.NumberControllerSlider = dat.controllers.NumberController; diff --git a/elements/controller-base/controller-base.html b/elements/controller-base/controller-base.html deleted file mode 100644 index ca724b6..0000000 --- a/elements/controller-base/controller-base.html +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/elements/controller-function/controller-function.html b/elements/controller-function/controller-function.html deleted file mode 100644 index 505ebbc..0000000 --- a/elements/controller-function/controller-function.html +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/elements/controller-function/controller-function.js b/elements/controller-function/controller-function.js deleted file mode 100644 index 7a01575..0000000 --- a/elements/controller-function/controller-function.js +++ /dev/null @@ -1,12 +0,0 @@ -/* globals Gui, Polymer */ - - -Gui.register( 'controller-function', function( value ) { - - return typeof value == 'function'; - -} ); - -Polymer( 'controller-function', { - -} ); diff --git a/elements/dat-gui-base/dat-gui-base.html b/elements/dat-gui-base/dat-gui-base.html new file mode 100644 index 0000000..f7e37d7 --- /dev/null +++ b/elements/dat-gui-base/dat-gui-base.html @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/elements/controller-base/controller-base.js b/elements/dat-gui-base/dat-gui-base.js similarity index 97% rename from elements/controller-base/controller-base.js rename to elements/dat-gui-base/dat-gui-base.js index 8729b68..1022fdd 100644 --- a/elements/controller-base/controller-base.js +++ b/elements/dat-gui-base/dat-gui-base.js @@ -3,7 +3,7 @@ // [ ] onFinishChange() -Polymer( 'controller-base', { +Polymer( 'dat-gui-base', { ready: function() { diff --git a/elements/controller-boolean/controller-boolean.html b/elements/dat-gui-boolean/dat-gui-boolean.html similarity index 59% rename from elements/controller-boolean/controller-boolean.html rename to elements/dat-gui-boolean/dat-gui-boolean.html index dd01e37..4b90ff3 100644 --- a/elements/controller-boolean/controller-boolean.html +++ b/elements/dat-gui-boolean/dat-gui-boolean.html @@ -1,13 +1,13 @@ - + - + - +