1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- import { UIPanel, UIRow, UISelect, UISpan, UIText } from './libs/ui.js';
- import { SidebarSettingsShortcuts } from './Sidebar.Settings.Shortcuts.js';
- import { SidebarSettingsHistory } from './Sidebar.Settings.History.js';
- function SidebarSettings( editor ) {
- const config = editor.config;
- const strings = editor.strings;
- const container = new UISpan();
- const settings = new UIPanel();
- settings.setBorderTop( '0' );
- settings.setPaddingTop( '20px' );
- container.add( settings );
- // language
- const options = {
- en: 'English',
- fr: 'Français',
- zh: '中文',
- ja: '日本語',
- };
- const languageRow = new UIRow();
- const language = new UISelect().setWidth( '150px' );
- language.setOptions( options );
- if ( config.getKey( 'language' ) !== undefined ) {
- language.setValue( config.getKey( 'language' ) );
- }
- language.onChange( function () {
- const value = this.getValue();
- editor.config.setKey( 'language', value );
- } );
- languageRow.add( new UIText( strings.getKey( 'sidebar/settings/language' ) ).setClass( 'Label' ) );
- languageRow.add( language );
- settings.add( languageRow );
- //
- container.add( new SidebarSettingsShortcuts( editor ) );
- container.add( new SidebarSettingsHistory( editor ) );
- return container;
- }
- export { SidebarSettings };
|