Menubar.Status.js 884 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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 autosave = new UI.THREE.Boolean( editor.config.getKey( 'autosave' ), 'autosave' );
  8. autosave.text.setColor( '#888' );
  9. autosave.onChange( function () {
  10. var value = this.getValue();
  11. editor.config.setKey( 'autosave', value );
  12. if ( value === true ) {
  13. editor.signals.sceneGraphChanged.dispatch();
  14. }
  15. } );
  16. container.add( autosave );
  17. editor.signals.savingStarted.add( function () {
  18. autosave.text.setTextDecoration( 'underline' );
  19. } );
  20. editor.signals.savingFinished.add( function () {
  21. autosave.text.setTextDecoration( 'none' );
  22. } );
  23. var version = new UI.Text( 'r' + THREE.REVISION );
  24. version.setClass( 'title' );
  25. version.setOpacity( 0.5 );
  26. container.add( version );
  27. return container;
  28. };