add initial popup generation
This commit is contained in:
parent
2797986e3a
commit
77425a34c0
1 changed files with 46 additions and 8 deletions
|
@ -2,14 +2,52 @@
|
||||||
Build the interface for popup
|
Build the interface for popup
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Import modules.
|
// Import modules.
|
||||||
import texts from "./read.JS";
|
import texts from './read.JS';
|
||||||
|
import windowman from './windowman.JS';
|
||||||
|
|
||||||
|
|
||||||
|
// 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);
|
||||||
|
}
|
||||||
|
|
||||||
|
main();
|
||||||
|
|
||||||
// Call the main function.
|
|
||||||
function main() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
if (compat.restrict()) {
|
|
||||||
main();
|
|
||||||
}
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue