fixed class referencing
This commit is contained in:
parent
6a1ea8eb7d
commit
543fe2f913
9 changed files with 383 additions and 377 deletions
|
@ -1,15 +1,25 @@
|
|||
/* Settings.js
|
||||
Build the interface for the settings
|
||||
Build the interface for the settings
|
||||
*/
|
||||
|
||||
// Import modules.
|
||||
import { windowman } from "../windowman.js";
|
||||
let secretariat = await import(chrome.runtime.getURL("scripts/secretariat.js"));
|
||||
//import { windowman } from "../windowman.js";
|
||||
|
||||
async function build() {
|
||||
let secretariat = (
|
||||
await import(chrome.runtime.getURL("scripts/secretariat.js"))
|
||||
).secretariat;
|
||||
let windowman = (
|
||||
await import(chrome.runtime.getURL("gui/scripts/windowman.js"))
|
||||
).windowman;
|
||||
|
||||
let window = new windowman();
|
||||
}
|
||||
|
||||
/*
|
||||
Arrange the interface.
|
||||
*/
|
||||
function arrange() {
|
||||
Arrange the interface.
|
||||
*/
|
||||
/*function arrange() {
|
||||
async function openLast() {
|
||||
let last_opened = (
|
||||
await Promise.all([secretariat.read([`view`, window.location.href], 1)])
|
||||
|
@ -26,17 +36,24 @@ function arrange() {
|
|||
openLast();
|
||||
}
|
||||
|
||||
/*
|
||||
Define the mapping of each button.
|
||||
*/
|
||||
function events() {
|
||||
windowman.events();
|
||||
|
||||
function main() {
|
||||
windowman.fill();
|
||||
events();
|
||||
arrange();
|
||||
}*/
|
||||
|
||||
/*
|
||||
Define the mapping of each button.
|
||||
*/
|
||||
function events() {
|
||||
if (document.querySelector(`[data-action="filters,update"]`)) {
|
||||
document
|
||||
.querySelector(`[data-action="filters,update"]`)
|
||||
.addEventListener(`click`, async () => {
|
||||
let filters = await import(chrome.runtime.getURL(`scripts/filters.js`));
|
||||
let filters = (
|
||||
await import(chrome.runtime.getURL(`scripts/filters.js`))
|
||||
).default;
|
||||
filters.update();
|
||||
});
|
||||
}
|
||||
|
@ -44,19 +61,22 @@ function events() {
|
|||
document
|
||||
.querySelector(`[data-action="storage,clear"]`)
|
||||
.addEventListener(`click`, async () => {
|
||||
let storage = await import(
|
||||
chrome.runtime.getURL(`scripts/secretariat.js`)
|
||||
);
|
||||
let storage = (
|
||||
await import(chrome.runtime.getURL(`scripts/secretariat.js`))
|
||||
)["secretariat"];
|
||||
storage.forget(`sites`);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function main() {
|
||||
windowman.prepare();
|
||||
windowman.fill();
|
||||
//main();
|
||||
function load() {
|
||||
document.addEventListener("DOMContentLoaded", function () {
|
||||
M.AutoInit();
|
||||
});
|
||||
|
||||
build();
|
||||
events();
|
||||
arrange();
|
||||
}
|
||||
|
||||
main();
|
||||
load();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue