Menubar.View.js 872 B

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