Menubar.Help.js 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. Menubar.Help = function ( editor ) {
  2. var container = new UI.Panel();
  3. container.setClass( 'menu' );
  4. container.onMouseOver( function () { options.setDisplay( 'block' ) } );
  5. container.onMouseOut( function () { options.setDisplay( 'none' ) } );
  6. container.onClick( function () { options.setDisplay( 'block' ) } );
  7. var title = new UI.Panel();
  8. title.setTextContent( 'Help' ).setColor( '#666' );
  9. title.setMargin( '0px' );
  10. title.setPadding( '8px' );
  11. container.add( title );
  12. //
  13. var options = new UI.Panel();
  14. options.setClass( 'options' );
  15. options.setDisplay( 'none' );
  16. container.add( options );
  17. // source code
  18. var option = new UI.Panel();
  19. option.setClass( 'option' );
  20. option.setTextContent( 'Source code' );
  21. option.onClick( function () { window.open( 'https://github.com/mrdoob/three.js/tree/master/editor', '_blank' ) } );
  22. options.add( option );
  23. // about
  24. var option = new UI.Panel();
  25. option.setClass( 'option' );
  26. option.setTextContent( 'About' );
  27. option.onClick( function () { window.open( 'http://threejs.org', '_blank' ) } );
  28. options.add( option );
  29. //
  30. return container;
  31. }