JS: A working v0.9.0
This commit is contained in:
parent
f614b8db20
commit
a1b8bc4630
5 changed files with 261 additions and 216 deletions
32
assets/js/setHandler.js
Normal file
32
assets/js/setHandler.js
Normal 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;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue