Menubar.Help.js 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /**
  2. * @author mrdoob / http://mrdoob.com/
  3. */
  4. import { UIPanel, UIRow } from './libs/ui.js';
  5. var MenubarHelp = function ( editor ) {
  6. var strings = editor.strings;
  7. var container = new UIPanel();
  8. container.setClass( 'menu' );
  9. var title = new UIPanel();
  10. title.setClass( 'title' );
  11. title.setTextContent( strings.getKey( 'menubar/help' ) );
  12. container.add( title );
  13. var options = new UIPanel();
  14. options.setClass( 'options' );
  15. container.add( options );
  16. // Source code
  17. var option = new UIRow();
  18. option.setClass( 'option' );
  19. option.setTextContent( strings.getKey( 'menubar/help/source_code' ) );
  20. option.onClick( function () {
  21. window.open( 'https://github.com/mrdoob/three.js/tree/master/editor', '_blank' );
  22. } );
  23. options.add( option );
  24. // About
  25. var option = new UIRow();
  26. option.setClass( 'option' );
  27. option.setTextContent( strings.getKey( 'menubar/help/about' ) );
  28. option.onClick( function () {
  29. window.open( 'http://threejs.org', '_blank' );
  30. } );
  31. options.add( option );
  32. return container;
  33. };
  34. export { MenubarHelp };