Menubar.View.js 679 B

1234567891011121314151617181920212223242526272829303132333435
  1. Menubar.View = function ( editor ) {
  2. var menuConfig,
  3. optionsPanel;
  4. function onLightThemeOptionClick () {
  5. editor.setTheme( 'css/light.css' );
  6. editor.config.setKey( 'theme', 'css/light.css' );
  7. }
  8. function onDarkThemeOptionClick () {
  9. editor.setTheme( 'css/dark.css' );
  10. editor.config.setKey( 'theme', 'css/dark.css' );
  11. }
  12. // configure menu contents
  13. with(UI.MenubarHelper) {
  14. menuConfig = [
  15. createOption( 'Light theme', onLightThemeOptionClick ),
  16. createOption( 'Dark theme', onDarkThemeOptionClick )
  17. ];
  18. }
  19. optionsPanel = UI.MenubarHelper.createOptionsPanel( menuConfig );
  20. return UI.MenubarHelper.createMenuContainer( 'Help', optionsPanel );
  21. }