Merge branch 'polymer' of github.com:dataarts/dat.gui into polymer

This commit is contained in:
Doug Fritz 2014-09-08 15:01:51 -07:00
commit 979b54f572
6 changed files with 61 additions and 5 deletions

View File

@ -3,6 +3,11 @@ BUILD
- [x] single import
- [ ] browsersync
REFACTOR
- [ ] controller-* => gui-*
- [ ] gui.define* => gui.var*
PARITY
- [ ] folders

1
build/gui.shim.js Normal file
View File

@ -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);

39
elements/shim.js Normal file
View File

@ -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 );

View File

@ -6,8 +6,8 @@
<title>dat-gui kitchen sink</title>
<!-- <script src="../build/gui.js"></script> -->
<link rel="import" href="../gui.html">
<script src="../build/gui.js"></script>
<!-- <link rel="import" href="../gui.html"> -->
<meta name="viewport" content="width=device-width, user-scalable=no">

View File

@ -11,10 +11,11 @@ var paths = {
lint: [ 'gulpfile.js', 'elements/**/*.js' ],
test: [ 'build/gui.js', 'tests/*.js' ],
clean: [ 'build/*', '**/*.css' ],
docs: [ 'README.md', 'docs/*' ]
docs: [ 'README.md', 'docs/*' ],
shim: [ 'elements/shim.js' ]
};
gulp.task( 'default', [ 'docs', 'lint', 'build' ] );
gulp.task( 'default', [ 'docs', 'lint', 'shim', 'build' ] );
gulp.task( 'watch', [ 'default' ], function() {
@ -26,6 +27,7 @@ gulp.task( 'watch', [ 'default' ], function() {
gulp.watch( paths.docs, [ 'docs' ] );
gulp.watch( paths.lint, [ 'lint' ] );
gulp.watch( paths.build, [ 'build' ] );
gulp.watch( paths.shim, [ 'shim' ] );
} );
@ -76,13 +78,21 @@ gulp.task( 'jshint', function() {
} );
gulp.task( 'css', function() {
return css( 'elements/**/*.styl', 'elements' );
} );
gulp.task( 'shim', function() {
return gulp.src( paths.shim )
.pipe( $.uglify() )
.pipe( $.rename( 'gui.shim.js' ) )
.pipe( gulp.dest( 'build' ) );
} );
gulp.task( 'docs', function() {
css( 'docs/*.styl', 'docs' );

View File

@ -15,6 +15,7 @@
"gulp-replace": "^0.4.0",
"gulp-rimraf": "^0.1.0",
"gulp-stylus": "^1.3.0",
"gulp-uglify": "^1.0.1",
"gulp-vulcanize": "^1.0.0",
"gulp-watch": "^0.6.9",
"jshint-stylish": "^0.4.0",