2
0

Menubar.Status.js 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /**
  2. * @author mrdoob / http://mrdoob.com/
  3. */
  4. import * as THREE from '../../build/three.module.js';
  5. import { UIPanel, UIText } from './libs/ui.js';
  6. import { UIBoolean } from './libs/ui.three.js';
  7. var MenubarStatus = function ( editor ) {
  8. var strings = editor.strings;
  9. var container = new UIPanel();
  10. container.setClass( 'menu right' );
  11. var autosave = new UIBoolean( editor.config.getKey( 'autosave' ), strings.getKey( 'menubar/status/autosave' ) );
  12. autosave.text.setColor( '#888' );
  13. autosave.onChange( function () {
  14. var value = this.getValue();
  15. editor.config.setKey( 'autosave', value );
  16. if ( value === true ) {
  17. editor.signals.sceneGraphChanged.dispatch();
  18. }
  19. } );
  20. container.add( autosave );
  21. editor.signals.savingStarted.add( function () {
  22. autosave.text.setTextDecoration( 'underline' );
  23. } );
  24. editor.signals.savingFinished.add( function () {
  25. autosave.text.setTextDecoration( 'none' );
  26. } );
  27. var version = new UIText( 'r' + THREE.REVISION );
  28. version.setClass( 'title' );
  29. version.setOpacity( 0.5 );
  30. container.add( version );
  31. return container;
  32. };
  33. export { MenubarStatus };