Menubar.View.js 921 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /**
  2. * @author mrdoob / http://mrdoob.com/
  3. */
  4. Menubar.View = function ( editor ) {
  5. var container = new UI.Panel();
  6. container.setClass( 'menu' );
  7. var title = new UI.Panel();
  8. title.setClass( 'title' );
  9. title.setTextContent( 'View' );
  10. container.add( title );
  11. var options = new UI.Panel();
  12. options.setClass( 'options' );
  13. container.add( options );
  14. // Light theme
  15. var option = new UI.Panel();
  16. option.setClass( 'option' );
  17. option.setTextContent( 'Light theme' );
  18. option.onClick( function () {
  19. editor.setTheme( 'css/light.css' );
  20. editor.config.setKey( 'theme', 'css/light.css' );
  21. } );
  22. options.add( option );
  23. // Dark theme
  24. var option = new UI.Panel();
  25. option.setClass( 'option' );
  26. option.setTextContent( 'Dark theme' );
  27. option.onClick( function () {
  28. editor.setTheme( 'css/dark.css' );
  29. editor.config.setKey( 'theme', 'css/dark.css' );
  30. } );
  31. options.add( option );
  32. return container;
  33. };