add initial popup generation

This commit is contained in:
buzz-lightsnack-2007 2024-03-24 18:40:24 +08:00
parent 2797986e3a
commit 77425a34c0

View file

@ -3,13 +3,51 @@
*/ */
// Import modules. // Import modules.
import texts from "./read.JS"; import texts from './read.JS';
import windowman from './windowman.JS';
// Call the main function.
function main() {
} // Import modules.
let secretariat = await import(chrome.runtime.getURL("scripts/secretariat.js"));
let pref_pane = 0;
function start() {
windowman.prepare();
return(new windowman(`body`, null, null, {'Close': true}));
}
/* Add the UI design. */
function design(element) {
// Set the event of the window.
function controls() {
document.getElementById(element[`titlebar`][`controls`][`Close`][`ID`]).onclick = function(){element.terminate(false)};
}
// TODO work on the content; perhaps, it must read from JSON of valid prefs
controls();
}
/* Populate the strings on the page. */
function say(element) {
element.update(element[`titlebar`][`title`], texts.localized(`GUI_title_preferences`));
};
function main() {
let tab = start();
design(tab);
say(tab);
}
if (compat.restrict()) {
main(); main();
}