JS: Move JavaScript to commandbar subdirectory

This commit is contained in:
Eryn Wells 2024-08-07 08:11:45 -10:00
parent ccd2a25920
commit 563693fb79
5 changed files with 0 additions and 0 deletions

View file

@ -1,32 +0,0 @@
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;
}
}