move files to locations describing their function

This commit is contained in:
buzz-lightsnack-2007 2024-03-28 08:51:04 +08:00
parent 8a590a9bad
commit 89b22bccba
6 changed files with 148 additions and 261 deletions

View file

@ -0,0 +1,61 @@
/* Settings.js
Build the interface for the settings
*/
// Import modules.
import { windowman } from "../windowman.js";
let secretariat = await import(chrome.runtime.getURL("scripts/secretariat.js"));
// Import configuration file.
// const config = chrome.runtime.getURL('gui/layouts/settings.json');
let pref_pane = 0;
function start() {
windowman.prepare();
}
/* Generate the appropriate strings. */
function say() {
windowman.fill();
}
/*
Arrange the interface.
*/
function arrange() {
async function click() {
let last_opened = (
await Promise.all([secretariat.read([`view`, window.location.href], 1)])
)[0];
if (!last_opened) {
last_opened = "settings";
}
document.querySelector(`[role="tab"][for="${last_opened}"]`).click();
}
// click!
// document.querySelector(`menu button[role="tab"][aria-controls="${last_opened}"]`).click();
click();
}
/*
Define the mapping of each button.
*/
function events() {
windowman.events();
}
function main() {
let tab = start();
say();
events();
arrange();
/*arrange();
events();*/
}
main();