Sidebar.Settings.js 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /**
  2. * @author mrdoob / http://mrdoob.com/
  3. */
  4. Sidebar.Settings = function ( editor ) {
  5. var config = editor.config;
  6. var signals = editor.signals;
  7. var strings = editor.strings;
  8. var container = new UI.Panel();
  9. container.setBorderTop( '0' );
  10. container.setPaddingTop( '20px' );
  11. container.setPaddingBottom( '20px' );
  12. // language
  13. var options = {
  14. en: 'English',
  15. zh: '中文'
  16. };
  17. var languageRow = new UI.Row();
  18. var language = new UI.Select().setWidth( '150px' );
  19. language.setOptions( options );
  20. if ( config.getKey( 'language' ) !== undefined ) {
  21. language.setValue( config.getKey( 'language' ) );
  22. }
  23. language.onChange( function () {
  24. var value = this.getValue();
  25. editor.config.setKey( 'language', value );
  26. } );
  27. languageRow.add( new UI.Text( strings.getKey( 'sidebar/settings/language' ) ).setWidth( '90px' ) );
  28. languageRow.add( language );
  29. container.add( languageRow );
  30. container.add( new Sidebar.Settings.Shortcuts( editor ) );
  31. container.add( new Sidebar.Settings.Viewport( editor ) );
  32. return container;
  33. };