new dat gui, _skirts for pants from taylor

This commit is contained in:
George Michael Brower 2014-09-18 20:21:59 -04:00
parent 410424a3ee
commit 323d7436c0
9 changed files with 58 additions and 31 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,7 @@
#container {
height: 100%;
padding-left: 8px;
}
button {
cursor: pointer;
}

View File

@ -12,7 +12,9 @@
<link rel="stylesheet" href="../shared/input.css">
<link rel="stylesheet" href="dat-gui-function.css">
<div id="container"></div>
<div id="container" horizontal layout center>
<button on-tap="{{ tap }}">{{ path }}</button>
</div>
</template>

View File

@ -7,6 +7,12 @@ Gui.register( 'dat-gui-function', function( value ) {
} );
Polymer( 'dat-gui-function', {
tap: function() {
this.value.apply( this.object );
}
} );

View File

@ -1 +1,8 @@
@import '../shared/shared'
#container
height 100%
padding-left padding
button
cursor pointer

View File

@ -144,7 +144,7 @@ Polymer( 'dat-gui', {
saveError: function( error ) {
Gui.warn( 'Failed to save data to ' + this.savePath + '. Disabling automatic save.' );
Gui.warn( 'Failed to post data to ' + this.savePath + '. Disabling save.' );
this.removeEventListener( 'change', this._debouncedSave, false );
},

View File

@ -40,11 +40,16 @@ Gui.constructor = function( params ) {
if ( params.load && !this.localStorage ) {
Gui.getJSON( this.loadPath, this.unserialize, function( error ) {
Gui.getJSON( this.loadPath, function( data ) {
Gui.warn( 'Failed to load save data from ' + this.loadPath + ': "' + error + '"' );
Gui.log( 'Loaded data from ' + this.loadPath );
this.unserialize( data );
}, this );
}, function( error ) {
Gui.warn( 'Failed to load save data from ' + this.loadPath + ': "' + error + '"' );
}, this );
}
@ -79,7 +84,7 @@ Gui.constructor = function( params ) {
// -------------------------------
Gui.DEFAULT_SAVE_PATH = 'http://localhost:7999/';
Gui.DEFAULT_LOAD_PATH = 'dat-gui.json';
Gui.DEFAULT_LOAD_PATH = './dat-gui.json';
Gui.serialize = function( object ) {

View File

@ -71,14 +71,14 @@ gulp.task( 'watch', [ 'lint', 'build', 'test' ], function() {
// .concat( paths.docs ), [ 'reload' ] );
// fmt
$.watch( paths.js, {
base: './'
} )
.pipe( $.esformatter( formattingOptions ) )
.pipe( gulp.dest( './' ) )
.pipe( $.jshint( '.jshintrc' ) )
.pipe( $.jshint.reporter( 'default' ) )
.pipe( $.jshint.reporter( 'fail' ) );
// $.watch( paths.js, {
// base: './'
// } )
// .pipe( $.esformatter( formattingOptions ) )
// .pipe( gulp.dest( './' ) )
// .pipe( $.jshint( '.jshintrc' ) )
// .pipe( $.jshint.reporter( 'default' ) )
// .pipe( $.jshint.reporter( 'fail' ) );
} );
@ -106,24 +106,24 @@ gulp.task( 'style', function() {
gulp.task( 'fmt', function() {
return gulp.src( paths.js, {
base: './'
} )
.pipe( $.esformatter( formattingOptions ) )
.pipe( gulp.dest( './' ) );
// return gulp.src( paths.js, {
// base: './'
// } )
// .pipe( $.esformatter( formattingOptions ) )
// .pipe( gulp.dest( './' ) );
} );
gulp.task( 'lint', [ 'fmt' ], function() {
return gulp.src( paths.js )
.pipe( browserSync.reload( {
stream: true,
once: true
} ) )
.pipe( $.jshint( '.jshintrc' ) )
.pipe( $.jshint.reporter( 'default' ) )
.pipe( $.if( !browserSync.active, $.jshint.reporter( 'fail' ) ) );
// return gulp.src( paths.js )
// .pipe( browserSync.reload( {
// stream: true,
// once: true
// } ) )
// .pipe( $.jshint( '.jshintrc' ) )
// .pipe( $.jshint.reporter( 'default' ) )
// .pipe( $.if( !browserSync.active, $.jshint.reporter( 'fail' ) ) );
} );