Menubar.Status.js 905 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /**
  2. * @author mrdoob / http://mrdoob.com/
  3. */
  4. Menubar.Status = function ( editor ) {
  5. var container = new UI.Panel();
  6. container.setClass( 'menu right' );
  7. var checkbox = new UI.Checkbox( editor.config.getKey( 'autosave' ) );
  8. checkbox.onChange( function () {
  9. var value = this.getValue();
  10. editor.config.setKey( 'autosave', value );
  11. if ( value === true ) {
  12. editor.signals.sceneGraphChanged.dispatch();
  13. }
  14. } );
  15. container.add( checkbox );
  16. var text = new UI.Text( 'autosave' );
  17. text.setClass( 'title' );
  18. container.add( text );
  19. editor.signals.savingStarted.add( function () {
  20. text.setTextDecoration( 'underline' );
  21. } );
  22. editor.signals.savingFinished.add( function () {
  23. text.setTextDecoration( 'none' );
  24. } );
  25. var version = new UI.Text( 'r' + THREE.REVISION );
  26. version.setClass( 'title' );
  27. version.setOpacity( 0.5 );
  28. container.add( version );
  29. return container;
  30. };