Menubar.View.js 899 B

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