diff --git a/TODO.md b/TODO.md index 747eea7..768a73f 100644 --- a/TODO.md +++ b/TODO.md @@ -3,6 +3,11 @@ BUILD - [x] single import - [ ] browsersync +REFACTOR + +- [ ] controller-* => gui-* +- [ ] gui.define* => gui.var* + PARITY - [ ] folders diff --git a/build/gui.shim.js b/build/gui.shim.js new file mode 100644 index 0000000..95a09d2 --- /dev/null +++ b/build/gui.shim.js @@ -0,0 +1 @@ +!function(n){"use strict";var t=function(){this.defined={}};t.ready=function(n){n()},t.prototype.define=function(n,t){return this.defined[n]=t,e},t.prototype.add=function(){return e};var i=function(){return this},e={on:i};n.Gui=t}(this); \ No newline at end of file diff --git a/elements/shim.js b/elements/shim.js new file mode 100644 index 0000000..d03f2bd --- /dev/null +++ b/elements/shim.js @@ -0,0 +1,39 @@ +// Use gui.shim.js in production when you want to use dat.gui to recall values without any of the interface. +( function( scope ) { + + 'use strict'; + + var Gui = function() { + + this.defined = {}; + + }; + + Gui.ready = function( fnc ) { + + fnc(); + + }; + + Gui.prototype.define = function( name, value ) { + + this.defined[ name ] = value; + return controllerShim; + + }; + + Gui.prototype.add = function( object, path ) { + + return controllerShim; + + }; + + var identity = function() { return this; }; + + var controllerShim = { + on: identity + }; + + scope.Gui = Gui; + +} )( this ); \ No newline at end of file diff --git a/examples/index.html b/examples/index.html index 78f10e3..bf634d3 100644 --- a/examples/index.html +++ b/examples/index.html @@ -6,8 +6,8 @@