Polymer( 'controller-number', {
+Take for example this (simplified) source for dat-gui's <dat-gui-number>
:
+Polymer( 'dat-gui-number', {
// Define element ...
} );
-Gui.register( 'controller-number', function( value ) {
+Gui.register( 'dat-gui-number', function( value ) {
return typeof value == 'number';
} );
-Gui.register
takes an element name and a test function. The test function tells dat-gui to add a <controller-number>
to the panel when the user adds a variable whose type is 'number'
.
+Gui.register
takes an element name and a test function. The test function tells dat-gui to add a <dat-gui-number>
to the panel when the user adds a variable whose type is 'number'
.
A test function determines if a controller is appropriate for a given value. This example registers <vector-controller>
for values that have properties x
, y
and z
.
Gui.register( 'vector-controller', function( value ) {
diff --git a/tests/test.gui.js b/tests/test.gui.js
index 7a13ae0..c320f64 100644
--- a/tests/test.gui.js
+++ b/tests/test.gui.js
@@ -30,13 +30,13 @@ describe( 'Gui', function() {
it( 'picks the right controller for the job', function() {
- expectController( 'controller-number', 1234 );
- expectController( 'controller-string', 'string value' );
- expectController( 'controller-function', function(){} );
- expectController( 'controller-boolean', true );
+ expectController( 'dat-gui-number', 1234 );
+ expectController( 'dat-gui-string', 'string value' );
+ expectController( 'dat-gui-function', function(){} );
+ expectController( 'dat-gui-boolean', true );
- expectController( 'controller-option', 'hey', [ 'hey', 'hi', 'ho' ] );
- expectController( 'controller-option', 'a', { a: 'a', b: 'b', c: 'c' } );
+ expectController( 'dat-gui-option', 'hey', [ 'hey', 'hi', 'ho' ] );
+ expectController( 'dat-gui-option', 'a', { a: 'a', b: 'b', c: 'c' } );
// expectController( 'controller-color', '#00ff00' );
// expectController( 'controller-color', '#aba' );