remove onReady callback

+ use strudelTheme as default
This commit is contained in:
Felix Roos 2023-12-15 11:21:48 +01:00
parent 9872a89a29
commit be1e5a7d0e

View file

@ -22,7 +22,7 @@ const initialSettings = {
isFlashEnabled: true, isFlashEnabled: true,
isTooltipEnabled: false, isTooltipEnabled: false,
isLineWrappingEnabled: false, isLineWrappingEnabled: false,
theme: 'teletext', theme: 'strudelTheme',
fontFamily: 'monospace', fontFamily: 'monospace',
fontSize: 18, fontSize: 18,
}; };
@ -47,9 +47,6 @@ class StrudelRepl extends HTMLElement {
constructor() { constructor() {
super(); super();
} }
onReady(listener) {
this.readyListener = listener;
}
attributeChangedCallback(name, oldValue, newValue) { attributeChangedCallback(name, oldValue, newValue) {
if (name === 'code') { if (name === 'code') {
this.code = newValue; this.code = newValue;
@ -88,7 +85,6 @@ class StrudelRepl extends HTMLElement {
// init settings // init settings
this.editor.updateSettings(this.settings); this.editor.updateSettings(this.settings);
this.editor.setCode(this.code); this.editor.setCode(this.code);
this.readyListener?.(this);
// settingsMap.listen((settings, key) => editor.changeSetting(key, settings[key])); // settingsMap.listen((settings, key) => editor.changeSetting(key, settings[key]));
// onEvent('strudel-toggle-play', () => this.editor.toggle()); // onEvent('strudel-toggle-play', () => this.editor.toggle());
} }