123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- /**
- * @author mrdoob / http://mrdoob.com/
- */
- Sidebar.Script = function ( editor ) {
- var signals = editor.signals;
- var container = new UI.CollapsiblePanel();
- container.setCollapsed( editor.config.getKey( 'ui/sidebar/script/collapsed' ) );
- container.onCollapsedChange( function ( boolean ) {
- editor.config.setKey( 'ui/sidebar/script/collapsed', boolean );
- } );
- container.setDisplay( 'none' );
- container.addStatic( new UI.Text( 'Script' ).setTextTransform( 'uppercase' ) );
- container.add( new UI.Break() );
- var source = new Sidebar.Script.Editor( editor );
- container.add( source );
- signals.objectSelected.add( function ( object ) {
- if ( object !== null ) {
- container.setDisplay( 'block' );
- /*
- var scripts = editor.scripts[ object.uuid ];
- if ( scripts !== undefined ) {
- scriptSource.setValue( scripts[ 0 ] );
- } else {
- scriptSource.setValue( '' );
- }
- */
- } else {
- container.setDisplay( 'none' );
- }
- } );
- return container;
- }
|