mirror of
https://github.com/dataarts/dat.gui.git
synced 2024-12-12 04:08:27 +00:00
merge
This commit is contained in:
commit
407abe299c
@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "polymer-gui",
|
||||
"name": "dat.gui",
|
||||
"version": "0.0.0",
|
||||
"description": "Attempt at revamping dat.gui with Polymer.",
|
||||
"keywords": [
|
||||
|
@ -19,11 +19,6 @@ var e,f,g,h=b.type;if("load"===h&&!b.bubbles){var i=c;i instanceof Q.Document&&(
|
||||
<!-- src -->
|
||||
<script>(function( scope ) {
|
||||
|
||||
var ready = false;
|
||||
var readyHandlers = [];
|
||||
|
||||
var controllers = {};
|
||||
|
||||
var Gui = function( params ) {
|
||||
|
||||
if ( !ready ) {
|
||||
@ -48,6 +43,8 @@ var e,f,g,h=b.type;if("load"===h&&!b.bubbles){var i=c;i instanceof Q.Document&&(
|
||||
// Register custom controllers
|
||||
// -------------------------------
|
||||
|
||||
var controllers = {};
|
||||
|
||||
Gui.register = function( elementName, test ) {
|
||||
|
||||
controllers[ elementName ] = test;
|
||||
@ -78,6 +75,9 @@ var e,f,g,h=b.type;if("load"===h&&!b.bubbles){var i=c;i instanceof Q.Document&&(
|
||||
// Gui ready handler ... * shakes fist at polymer *
|
||||
// -------------------------------
|
||||
|
||||
var ready = false;
|
||||
var readyHandlers = [];
|
||||
|
||||
document.addEventListener( 'polymer-ready', function() {
|
||||
|
||||
ready = true;
|
||||
@ -654,6 +654,10 @@ Polymer('gui-row', {
|
||||
font: 10px 'Lucida Grande', sans-serif;
|
||||
color: #eee;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
cursor: pointer;
|
||||
text-align: center;
|
||||
padding: 6px 8px;
|
||||
@ -879,31 +883,34 @@ Polymer('controller-base', {
|
||||
this.object = object;
|
||||
this.path = path;
|
||||
|
||||
if ( this._observer ) {
|
||||
this._observer.close();
|
||||
delete this._observer;
|
||||
}
|
||||
|
||||
var _this = this;
|
||||
this.bind('value', new PathObserver(this.object, this.path));
|
||||
|
||||
this._observer = new PathObserver( this.object, this.path );
|
||||
this._observer.open( function( newValue ) {
|
||||
// if ( this._observer ) {
|
||||
// this._observer.close();
|
||||
// delete this._observer;
|
||||
// }
|
||||
|
||||
_this.value = newValue;
|
||||
// var _this = this;
|
||||
|
||||
} );
|
||||
// this._observer = new PathObserver( this.object, this.path );
|
||||
// this._observer.open( function( newValue ) {
|
||||
|
||||
this.value = this.object[ this.path ];
|
||||
// _this.value = newValue;
|
||||
|
||||
// } );
|
||||
|
||||
// this.value = this.object[ this.path ];
|
||||
|
||||
},
|
||||
|
||||
valueChanged: function() {
|
||||
|
||||
if ( this._observer ) {
|
||||
// if ( this._observer ) {
|
||||
|
||||
Path.get( this.path ).setValueFrom( this.object, this.value );
|
||||
// Path.get( this.path ).setValueFrom( this.object, this.value );
|
||||
|
||||
}
|
||||
// }
|
||||
|
||||
this.update();
|
||||
|
||||
@ -943,7 +950,7 @@ Polymer('controller-base', {
|
||||
|
||||
});</script>
|
||||
|
||||
<polymer-element name="controller-base" attributes="object path" assetpath="../elements/controller-base/"></polymer-element>
|
||||
<polymer-element name="controller-base" attributes="object path value" assetpath="../elements/controller-base/"></polymer-element>
|
||||
|
||||
<script>/*
|
||||
|
||||
|
@ -14,9 +14,8 @@
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="readme"><!-- Replaced with contents of README.md --></div>
|
||||
|
||||
<script src="../underscore/underscore.js"></script>
|
||||
<!-- Copied from README.md -->
|
||||
<div id="readme"></div>
|
||||
|
||||
<script src="docs/main.js"></script>
|
||||
<script src="docs/examples.js"></script>
|
||||
|
@ -1,10 +1,5 @@
|
||||
(function( scope ) {
|
||||
|
||||
var ready = false;
|
||||
var readyHandlers = [];
|
||||
|
||||
var controllers = {};
|
||||
|
||||
var Gui = function( params ) {
|
||||
|
||||
if ( !ready ) {
|
||||
@ -29,6 +24,8 @@
|
||||
// Register custom controllers
|
||||
// -------------------------------
|
||||
|
||||
var controllers = {};
|
||||
|
||||
Gui.register = function( elementName, test ) {
|
||||
|
||||
controllers[ elementName ] = test;
|
||||
@ -59,6 +56,9 @@
|
||||
// Gui ready handler ... * shakes fist at polymer *
|
||||
// -------------------------------
|
||||
|
||||
var ready = false;
|
||||
var readyHandlers = [];
|
||||
|
||||
document.addEventListener( 'polymer-ready', function() {
|
||||
|
||||
ready = true;
|
||||
|
@ -26,13 +26,14 @@ Polymer('controller-base', {
|
||||
this.object = object;
|
||||
this.path = path;
|
||||
|
||||
|
||||
this.bind('value', new PathObserver(this.object, this.path));
|
||||
|
||||
// if ( this._observer ) {
|
||||
// this._observer.close();
|
||||
// delete this._observer;
|
||||
// }
|
||||
|
||||
this.bind('value', new PathObserver(this.object, this.path));
|
||||
|
||||
// var _this = this;
|
||||
|
||||
// this._observer = new PathObserver( this.object, this.path );
|
||||
|
@ -24,6 +24,7 @@
|
||||
}
|
||||
|
||||
&.open-false {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -69,7 +69,6 @@ gulp.task( 'default', function() {
|
||||
gulp.watch( [ paths.js, paths.main, paths.html ], [ 'vulcanize', 'test' ] );
|
||||
gulp.watch( [ 'README.md', 'docs/*' ], [ 'docs' ] );
|
||||
|
||||
|
||||
} );
|
||||
|
||||
|
||||
|
@ -14,6 +14,7 @@
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<!-- Copied from README.md -->
|
||||
<div id="readme"><h1 id="dat-gui">dat-gui</h1>
|
||||
<p>dat-gui creates an interface that you can use to modify variables with very little code. </p>
|
||||
<h3 id="basic-usage">Basic Usage</h3>
|
||||
@ -182,9 +183,7 @@ Gui.register( 'controller-number', function( value ) {
|
||||
<pre><code class="lang-html"><script src="gui.js"></script>
|
||||
<script src="gui-three.js"></script>
|
||||
</code></pre>
|
||||
<!-- Replaced with contents of README.md --></div>
|
||||
|
||||
<script src="../underscore/underscore.js"></script>
|
||||
</div>
|
||||
|
||||
<script src="docs/main.js"></script>
|
||||
<script src="docs/examples.js"></script>
|
||||
|
@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "polymer-gui",
|
||||
"name": "dat.gui",
|
||||
"version": "0.0.0",
|
||||
"devDependencies": {
|
||||
"gulp": "^3.8.7",
|
||||
|
Loading…
Reference in New Issue
Block a user