JS: A working v0.9.0

This commit is contained in:
Eryn Wells 2024-08-07 08:05:59 -10:00
parent f614b8db20
commit a1b8bc4630
5 changed files with 261 additions and 216 deletions

32
assets/js/setHandler.js Normal file
View file

@ -0,0 +1,32 @@
class SetEvent extends Event {
#option;
#newValue;
constructor(option, newValue) {
super("setOption")
this.#option = option;
this.#newValue = newValue;
}
get option() {
return this.#option;
}
get newValue() {
return this.#newValue;
}
}
export class SetOptionHandler {
get name() {
return "set";
}
execute(command, commandBar) {
for (const param of command.parameters) {
const setEvent = new SetEvent(param.name.valueOf(), param.value.valueOf());
commandBar.dispatchEvent(setEvent);
}
return true;
}
}