open pop-ups with settings

This commit is contained in:
buzz-lightsnack-2007 2024-04-23 17:46:57 +08:00
parent 5ea9077f74
commit 81c5c6f825

28
scripts/GUI/window.js Normal file
View file

@ -0,0 +1,28 @@
/* different from windowman.js, just creates window management. */
export default class Window {
#features;
constructor(url, name, options) {
this.url = url;
this.name = name;
if ((typeof options).includes(`obj`)) {
this.options = options;
this.#features = ``;
let FEATURES = Object.keys(options);
for (let i = 0; i < FEATURES.length; i++) {
this.#features = this.#features.concat(`${FEATURES[i]}=${options[FEATURES[i]]}`).concat((i == Object.keys(options).length - 1) ? `` : `,`);
}
}
this.options = options;
this.show();
}
show() {
this.window = window.open(this.url, this.name, this.options);
};
};