summaryrefslogtreecommitdiff
path: root/html
diff options
context:
space:
mode:
authorWojtek Kosior <koszko@koszko.org>2021-12-22 16:39:34 +0100
committerWojtek Kosior <koszko@koszko.org>2021-12-22 16:39:34 +0100
commitb590eaa2f64ead3384eadc6fe58f6358aa1a0478 (patch)
tree8f1e9403c1a75246c2a9a0afc4ab30706ea7afbe /html
parentb7378a9994724750198e0d165c575be8538334fb (diff)
downloadbrowser-extension-b590eaa2f64ead3384eadc6fe58f6358aa1a0478.tar.gz
browser-extension-b590eaa2f64ead3384eadc6fe58f6358aa1a0478.zip
reworked build system; added missing license notices
Diffstat (limited to 'html')
-rw-r--r--html/DOM_helpers.js15
-rw-r--r--html/MOZILLA_scrollbar_fix.css48
-rw-r--r--html/back_button.css28
-rw-r--r--html/base.css29
-rw-r--r--html/default_blocking_policy.html32
-rw-r--r--html/default_blocking_policy.js17
-rw-r--r--html/display_panel.html (renamed from html/display-panel.html)42
-rw-r--r--html/display_panel.js (renamed from html/display-panel.js)68
-rw-r--r--html/import_frame.html31
-rw-r--r--html/import_frame.js21
-rw-r--r--html/mozilla_scrollbar_fix.css67
-rw-r--r--html/options.html38
-rw-r--r--html/options_main.js24
-rw-r--r--html/reset.css3
-rw-r--r--html/table.css29
15 files changed, 322 insertions, 170 deletions
diff --git a/html/DOM_helpers.js b/html/DOM_helpers.js
index aaf5621..443e4eb 100644
--- a/html/DOM_helpers.js
+++ b/html/DOM_helpers.js
@@ -41,10 +41,7 @@
* proprietary program, I am not going to enforce this in court.
*/
-function by_id(id)
-{
- return document.getElementById(id);
-}
+#EXPORT id => document.getElementById(id) AS by_id
const known_templates = new Map();
@@ -63,6 +60,7 @@ function get_template(template_id)
known_templates.set(template_id, template);
return template;
}
+#EXPORT get_template
function clone_template(template_id)
{
@@ -86,11 +84,4 @@ function clone_template(template_id)
return result_object;
}
-
-/*
- * EXPORTS_START
- * EXPORT by_id
- * EXPORT get_template
- * EXPORT clone_template
- * EXPORTS_END
- */
+#EXPORT clone_template
diff --git a/html/MOZILLA_scrollbar_fix.css b/html/MOZILLA_scrollbar_fix.css
deleted file mode 100644
index cdbd5c6..0000000
--- a/html/MOZILLA_scrollbar_fix.css
+++ /dev/null
@@ -1,48 +0,0 @@
-/**
- * This file is part of Haketilo.
- *
- * Function: Hacky fix for vertical scrollbar width being included in child's
- * width.
- *
- * Copyright (C) 2021 Wojtek Kosior
- * Redistribution terms are gathered in the `copyright' file.
- */
-
-/*
- * Under Mozilla browsers to avoid vertical scrollbar forcing horizontal
- * scrollbar to appear in an element we add the `firefox_scrollbars_hacky_fix'
- * class to an element for which width has to be reserved.
- *
- * This is a bit hacky and relies on some assumed width of Firefox scrollbar, I
- * know. And must be excluded from Chromium builds.
- *
- * I came up with this hack when working on popup. Before that I had the
- * scrollbar issue with tables in the options page and gave up there and made
- * the scrollbal always visible. Now we could try applying this "fix" there,
- * too!
- */
-
-.firefox_scrollbars_hacky_fix {
- font-size: 0;
-}
-
-.firefox_scrollbars_hacky_fix>div {
- display: inline-block;
- width: -moz-available;
-}
-
-.firefox_scrollbars_hacky_fix>*>* {
- font-size: initial;
-}
-
-.firefox_scrollbars_hacky_fix::after {
- content: "";
- display: inline-block;
- visibility: hidden;
- font-size: initial;
- width: 14px;
-}
-
-.firefox_scrollbars_hacky_fix.has_inline_content::after {
- width: calc(14px - 0.3em);
-}
diff --git a/html/back_button.css b/html/back_button.css
index b83e834..94b18cf 100644
--- a/html/back_button.css
+++ b/html/back_button.css
@@ -1,10 +1,30 @@
-/**
+/*
+ * SPDX-License-Identifier: GPL-3.0-or-later OR CC-BY-SA-4.0
+ *
+ * Style for a "back" button with a CSS arrow image
+ *
* This file is part of Haketilo.
*
- * Function: Style for a "back" button with a CSS arrow image.
+ * Copyright (C) 2021 Wojtek Kosior <koszko@koszko.org>
+ *
+ * File is dual-licensed. You can choose either GPLv3+, CC BY-SA or both.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
*
- * Copyright (C) 2021 Wojtek Kosior
- * Redistribution terms are gathered in the `copyright' file.
+ * I, Wojtek Kosior, thereby promise not to sue for violation of this file's
+ * licenses. Although I request that you do not make use this code in a
+ * proprietary program, I am not going to enforce this in court.
*/
.back_button {
diff --git a/html/base.css b/html/base.css
index 517a5c1..47fc66b 100644
--- a/html/base.css
+++ b/html/base.css
@@ -1,11 +1,30 @@
-/**
+/*
+ * SPDX-License-Identifier: GPL-3.0-or-later OR CC-BY-SA-4.0
+ *
+ * Base styling common for all Haketilo internal HTML pages
+ *
* This file is part of Haketilo.
*
- * Function: Base styles.
+ * Copyright (C) 2021 Wojtek Kosior <koszko@koszko.org>
+ *
+ * File is dual-licensed. You can choose either GPLv3+, CC BY-SA or both.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
*
- * Copyright (C) 2021 Wojtek Kosior
- * Copyright (C) 2021 Nicholas Johnson
- * Redistribution terms are gathered in the `copyright' file.
+ * I, Wojtek Kosior, thereby promise not to sue for violation of this file's
+ * licenses. Although I request that you do not make use this code in a
+ * proprietary program, I am not going to enforce this in court.
*/
body {
diff --git a/html/default_blocking_policy.html b/html/default_blocking_policy.html
index 50c19ca..547f756 100644
--- a/html/default_blocking_policy.html
+++ b/html/default_blocking_policy.html
@@ -1,10 +1,37 @@
<!--
- Copyright (C) 2021 Wojtek Kosior
- Redistribution terms are gathered in the `copyright' file.
+ SPDX-License-Identifier: GPL-3.0-or-later OR CC-BY-SA-4.0
+ Catch-all script-blocking policy setting dialog
+
+ This file is part of Haketilo.
+
+ Copyright (C) 2021 Wojtek Kosior <koszko@koszko.org>
+
+ File is dual-licensed. You can choose either GPLv3+, CC BY-SA or both.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>.
+
+ I, Wojtek Kosior, thereby promise not to sue for violation of this file's
+ licenses. Although I request that you do not make use this code in a
+ proprietary program, I am not going to enforce this in court.
+ -->
+
+<!--
This is not a standalone page. This file is meant to be imported into other
HTML code.
-->
+
<style>
#blocking_policy_div {
line-height: 2em;
@@ -16,3 +43,4 @@
their own scripts.
<button id="toggle_policy_but">Toggle policy</button>
</span>
+#LOADJS html/default_blocking_policy.js
diff --git a/html/default_blocking_policy.js b/html/default_blocking_policy.js
index 8178386..47435eb 100644
--- a/html/default_blocking_policy.js
+++ b/html/default_blocking_policy.js
@@ -41,13 +41,10 @@
* proprietary program, I am not going to enforce this in court.
*/
-/*
- * IMPORTS_START
- * IMPORT by_id
- * IMPORT light_storage
- * IMPORT observables
- * IMPORTS_END
- */
+#IMPORT common/storage_light.js AS light_storage
+#IMPORT common/observables.js
+
+#FROM html/DOM_helpers.js IMPORT by_id
/*
* Used with `default_blocking_policy.html' to allow user to choose whether to
@@ -75,8 +72,4 @@ async function init_default_policy_dialog()
blocking_policy_span.classList.remove("hide");
}
-/*
- * EXPORTS_START
- * EXPORT init_default_policy_dialog
- * EXPORTS_END
- */
+init_default_policy_dialog();
diff --git a/html/display-panel.html b/html/display_panel.html
index ee9e767..5ee20f1 100644
--- a/html/display-panel.html
+++ b/html/display_panel.html
@@ -1,21 +1,48 @@
<!doctype html>
<!--
+ SPDX-License-Identifier: GPL-3.0-or-later OR CC-BY-SA-4.0
+
+ Extension's popup page
+
This file is part of Haketilo.
- Function: Extension's popup page.
+ Copyright (C) 2021 Wojtek Kosior <koszko@koszko.org>
+
+ File is dual-licensed. You can choose either GPLv3+, CC BY-SA or both.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>.
- Copyright (C) 2021 Wojtek Kosior
- Redistribution terms are gathered in the `copyright' file.
+ I, Wojtek Kosior, thereby promise not to sue for violation of this file's
+ licenses. Although I request that you do not make use this code in a
+ proprietary program, I am not going to enforce this in court.
-->
<html>
<head>
<meta charset="utf-8"/>
<title>Haketilo - page settings</title>
+#COPY_FILE html/reset.css
<link type="text/css" rel="stylesheet" href="reset.css" />
+#COPY_FILE html/base.css
<link type="text/css" rel="stylesheet" href="base.css" />
+#COPY_FILE html/back_button.css
<link type="text/css" rel="stylesheet" href="back_button.css" />
+#COPY_FILE html/table.css
<link type="text/css" rel="stylesheet" href="table.css" />
- <link type="text/css" rel="stylesheet" href="MOZILLA_scrollbar_fix.css" />
+#IF MOZILLA
+#COPY_FILE html/mozilla_scrollbar_fix.css
+ <link type="text/css" rel="stylesheet" href="mozilla_scrollbar_fix.css" />
+#ENDIF
<style>
body {
width: max-content;
@@ -228,7 +255,7 @@
<div id="install_view">
<div class="top has_bottom_line"><h2> Site modifiers install </h2></div>
<div class="padding_inline">
- <IMPORT html/import_frame.html />
+#INCLUDE html/import_frame.html
</div>
</div>
@@ -258,7 +285,7 @@
</div>
<div class="padding_inline padding_top has_upper_thin_line firefox_scrollbars_hacky_fix has_inline_content">
<span class="nowrap">
- <IMPORT html/default_blocking_policy.html />
+#INCLUDE html/default_blocking_policy.html
</span>
</div>
</div>
@@ -342,6 +369,7 @@
<div class="has_upper_line"></div>
- <label for="show_main_view_radio" class="back_button"><div></div></label>_POPUPSCRIPTS_
+ <label for="show_main_view_radio" class="back_button"><div></div></label>
+#LOADJS html/display_panel.js
</body>
</html>
diff --git a/html/display-panel.js b/html/display_panel.js
index d48d254..9d880ca 100644
--- a/html/display-panel.js
+++ b/html/display_panel.js
@@ -41,38 +41,32 @@
* proprietary program, I am not going to enforce this in court.
*/
+#IMPORT common/connection_types.js AS CONNECTION_TYPE
+
+#FROM common/browser.js IMPORT browser
/*
- * IMPORTS_START
- * IMPORT browser
- * IMPORT is_chrome
- * IMPORT is_mozilla
- *** Using remote storage here seems inefficient, we only resort to that
- *** temporarily, before all storage access gets reworked.
- * IMPORT get_remote_storage
- * IMPORT get_import_frame
- * IMPORT init_default_policy_dialog
- * IMPORT query_all
- * IMPORT CONNECTION_TYPE
- * IMPORT is_privileged_url
- * IMPORT TYPE_PREFIX
- * IMPORT nice_name
- * IMPORT open_in_settings
- * IMPORT each_url_pattern
- * IMPORT by_id
- * IMPORT clone_template
- * IMPORTS_END
+ * Using remote storage here seems inefficient, we only resort to that
+ * temporarily, before all storage access gets reworked.
*/
+#FROM common/storage_client.js IMPORT get_remote_storage
+#FROM html/import_frame.js IMPORT get_import_frame
+#FROM common/settings_query.js IMPORT query_all
+#FROM common/misc.js IMPORT is_privileged_url, nice_name, \
+ open_in_settings
+#FROM common/stored_types.js IMPORT TYPE_PREFIX
+#FROM common/patterns.js IMPORT each_url_pattern
+#FROM html/DOM_helpers.js IMPORT by_id, clone_template
let storage;
let tab_url;
+#IF MOZILLA
/* Force popup <html>'s reflow on stupid Firefox. */
-if (is_mozilla) {
- const reflow_forcer =
- () => document.documentElement.style.width = "-moz-fit-content";
- for (const radio of document.querySelectorAll('[name="current_view"]'))
- radio.addEventListener("change", reflow_forcer);
-}
+const reflow_forcer =
+ () => document.documentElement.style.width = "-moz-fit-content";
+for (const radio of document.querySelectorAll('[name="current_view"]'))
+ radio.addEventListener("change", reflow_forcer);
+#ENDIF
const show_queried_view_radio = by_id("show_queried_view_radio");
@@ -80,11 +74,12 @@ const tab_query = {currentWindow: true, active: true};
async function get_current_tab()
{
- /* Fix for fact that Chrome does not use promises here */
- const promise = is_chrome ?
- new Promise((resolve, reject) =>
- browser.tabs.query(tab_query, tab => resolve(tab))) :
- browser.tabs.query(tab_query);
+#IF CHROMIUM
+ const callback = (cb) => browser.tabs.query(tab_query, tab => cb(tab));
+ const promise = new Promise(callback);
+#ELIF MOZILLA
+ const promise = browser.tabs.query(tab_query);
+#ENDIF
try {
return (await promise)[0];
@@ -194,8 +189,9 @@ function try_to_connect(tab_id)
query_pattern_but.addEventListener("click", start_querying_repos);
- if (is_mozilla)
- setTimeout(() => monitor_connecting(tab_id), 1000);
+#IF MOZILLA
+ setTimeout(() => monitor_connecting(tab_id), 1000);
+#ENDIF
}
function start_querying_repos()
@@ -214,8 +210,10 @@ function handle_disconnect(tab_id, button_cb)
query_pattern_but.removeEventListener("click", button_cb);
content_script_port = null;
- if (is_chrome && !browser.runtime.lastError)
+#IF CHROMIUM
+ if (!browser.runtime.lastError)
return;
+#ENDIF
/* return if error was not during connection initialization */
if (connected_chbx.checked)
@@ -268,7 +266,7 @@ function handle_activity_report(message)
blocked_span.textContent = settings.allow ? "no" : "yes";
if (settings.pattern) {
- pattern_span.textContent = pattern;
+ pattern_span.textContent = settings.pattern;
const settings_opener =
() => open_in_settings(TYPE_PREFIX.PAGE, settings.pattern);
view_pattern_but.classList.remove("hide");
@@ -579,8 +577,6 @@ by_id("settings_but")
async function main()
{
- init_default_policy_dialog();
-
storage = await get_remote_storage();
import_frame = await get_import_frame();
import_frame.onclose = () => show_queried_view_radio.checked = true;
diff --git a/html/import_frame.html b/html/import_frame.html
index 754b289..5b1f875 100644
--- a/html/import_frame.html
+++ b/html/import_frame.html
@@ -1,10 +1,37 @@
<!--
- Copyright (C) 2021 Wojtek Kosior
- Redistribution terms are gathered in the `copyright' file.
+ SPDX-License-Identifier: GPL-3.0-or-later OR CC-BY-SA-4.0
+ Scripts import dialog
+
+ This file is part of Haketilo.
+
+ Copyright (C) 2021 Wojtek Kosior <koszko@koszko.org>
+
+ File is dual-licensed. You can choose either GPLv3+, CC BY-SA or both.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>.
+
+ I, Wojtek Kosior, thereby promise not to sue for violation of this file's
+ licenses. Although I request that you do not make use this code in a
+ proprietary program, I am not going to enforce this in court.
+ -->
+
+<!--
This is not a standalone page. This file is meant to be imported into other
HTML code.
-->
+
<style>
.padding_right {
padding-right: 0.3em;
diff --git a/html/import_frame.js b/html/import_frame.js
index 3d91557..f23f4ea 100644
--- a/html/import_frame.js
+++ b/html/import_frame.js
@@ -41,15 +41,10 @@
* proprietary program, I am not going to enforce this in court.
*/
-/*
- * IMPORTS_START
- * IMPORT get_remote_storage
- * IMPORT by_id
- * IMPORT clone_template
- * IMPORT nice_name
- * IMPORT make_once
- * IMPORTS_END
- */
+#FROM common/storage_client.js IMPORT get_remote_storage
+#FROM html/DOM_helpers.js IMPORT by_id, clone_template
+#FROM common/misc.js IMPORT nice_name
+#FROM common/once.js IMPORT make_once
let storage;
@@ -187,10 +182,4 @@ async function init()
return exports;
}
-const get_import_frame = make_once(init);
-
-/*
- * EXPORTS_START
- * EXPORT get_import_frame
- * EXPORTS_END
- */
+#EXPORT make_once(init) AS get_import_frame
diff --git a/html/mozilla_scrollbar_fix.css b/html/mozilla_scrollbar_fix.css
new file mode 100644
index 0000000..bf74305
--- /dev/null
+++ b/html/mozilla_scrollbar_fix.css
@@ -0,0 +1,67 @@
+/*
+ * SPDX-License-Identifier: GPL-3.0-or-later OR CC-BY-SA-4.0
+ *
+ * Hacky fix for vertical scrollbar width being included in child's width
+ *
+ * This file is part of Haketilo.
+ *
+ * Copyright (C) 2021 Wojtek Kosior <koszko@koszko.org>
+ *
+ * File is dual-licensed. You can choose either GPLv3+, CC BY-SA or both.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ * I, Wojtek Kosior, thereby promise not to sue for violation of this file's
+ * licenses. Although I request that you do not make use this code in a
+ * proprietary program, I am not going to enforce this in court.
+ */
+
+/*
+ * Under Mozilla browsers to avoid vertical scrollbar forcing horizontal
+ * scrollbar to appear in an element we add the `firefox_scrollbars_hacky_fix'
+ * class to an element for which width has to be reserved.
+ *
+ * This is a bit hacky and relies on some assumed width of Firefox scrollbar, I
+ * know. And must be excluded from Chromium builds.
+ *
+ * I came up with this hack when working on popup. Before that I had the
+ * scrollbar issue with tables in the options page and gave up there and made
+ * the scrollbal always visible. Now we could try applying this "fix" there,
+ * too!
+ */
+
+.firefox_scrollbars_hacky_fix {
+ font-size: 0;
+}
+
+.firefox_scrollbars_hacky_fix>div {
+ display: inline-block;
+ width: -moz-available;
+}
+
+.firefox_scrollbars_hacky_fix>*>* {
+ font-size: initial;
+}
+
+.firefox_scrollbars_hacky_fix::after {
+ content: "";
+ display: inline-block;
+ visibility: hidden;
+ font-size: initial;
+ width: 14px;
+}
+
+.firefox_scrollbars_hacky_fix.has_inline_content::after {
+ width: calc(14px - 0.3em);
+}
diff --git a/html/options.html b/html/options.html
index 2e8317c..14b7d44 100644
--- a/html/options.html
+++ b/html/options.html
@@ -1,18 +1,41 @@
-<!doctype html>
+<!DOCTYPE html>
<!--
+ SPDX-License-Identifier: GPL-3.0-or-later OR CC-BY-SA-4.0
+
+ Extension's settings page
+
This file is part of Haketilo.
- Function: Extension's settings page.
+ Copyright (C) 2021 Wojtek Kosior <koszko@koszko.org>
+
+ File is dual-licensed. You can choose either GPLv3+, CC BY-SA or both.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>.
- Copyright (C) 2021 Wojtek Kosior
- Redistribution terms are gathered in the `copyright' file.
+ I, Wojtek Kosior, thereby promise not to sue for violation of this file's
+ licenses. Although I request that you do not make use this code in a
+ proprietary program, I am not going to enforce this in court.
-->
<html>
<head>
<meta charset="utf-8"/>
<title>Haketilo options</title>
+#COPY_FILE html/reset.css
<link type="text/css" rel="stylesheet" href="reset.css" />
+#COPY_FILE html/base.css
<link type="text/css" rel="stylesheet" href="base.css" />
+#COPY_FILE html/table.css
<link type="text/css" rel="stylesheet" href="table.css" />
<style>
body {
@@ -272,7 +295,7 @@
</div>
<button id="add_page_but" type="button"> Add page </button>
<br/>
- <IMPORT html/default_blocking_policy.html />
+#INCLUDE html/default_blocking_policy.html
</div>
<div id="bags" class="tab">
<div class="table_wrapper tight_table has_bottom_line has_upper_line">
@@ -383,13 +406,14 @@
<div id="import_window" class="hide popup" position="absolute">
<div class="popup_frame">
<h2> Settings import </h2>
- <IMPORT html/import_frame.html />
+#INCLUDE html/import_frame.html
</div>
</div>
<a id="file_downloader" class="hide"></a>
<form id="file_opener_form" style="visibility: hidden;">
<input type="file" id="file_opener"></input>
- </form>_OPTIONSSCRIPTS_
+ </form>
+#LOADJS html/options_main.js
</body>
</html>
diff --git a/html/options_main.js b/html/options_main.js
index 3620ad8..f362c6b 100644
--- a/html/options_main.js
+++ b/html/options_main.js
@@ -41,21 +41,13 @@
* proprietary program, I am not going to enforce this in court.
*/
-/*
- * IMPORTS_START
- * IMPORT get_remote_storage
- * IMPORT TYPE_PREFIX
- * IMPORT TYPE_NAME
- * IMPORT list_prefixes
- * IMPORT nice_name
- * IMPORT parse_json_with_schema
- * IMPORT get_template
- * IMPORT by_id
- * IMPORT matchers
- * IMPORT get_import_frame
- * IMPORT init_default_policy_dialog
- * IMPORTS_END
- */
+#FROM common/storage_client.js IMPORT get_remote_storage
+#FROM common/stored_types.js IMPORT TYPE_PREFIX, TYPE_NAME, \
+ list_prefixes
+#FROM common/misc.js IMPORT nice_name, matchers
+#FROM common/sanitize_JSON.js IMPORT parse_json_with_schema
+#FROM html/DOM_helpers.js IMPORT get_template, by_id
+#FROM html/import_frame.js IMPORT get_import_frame
var storage;
@@ -710,8 +702,6 @@ function jump_to_item(url_with_item)
async function main()
{
- init_default_policy_dialog();
-
storage = await get_remote_storage();
for (let prefix of list_prefixes) {
diff --git a/html/reset.css b/html/reset.css
index dab51cd..ed11813 100644
--- a/html/reset.css
+++ b/html/reset.css
@@ -1,7 +1,6 @@
/* http://meyerweb.com/eric/tools/css/reset/
v2.0 | 20110126
- Copyright 2008,2011 Eric A. Meyer
- Redistribution terms are gathered in the `copyright' file.
+ License: none (public domain)
*/
html, body, div, span, applet, object, iframe,
diff --git a/html/table.css b/html/table.css
index 36f88bb..1803e02 100644
--- a/html/table.css
+++ b/html/table.css
@@ -1,3 +1,32 @@
+/*
+ * SPDX-License-Identifier: GPL-3.0-or-later OR CC-BY-SA-4.0
+ *
+ * Table styling used in some Haketilo internal HTML pages
+ *
+ * This file is part of Haketilo.
+ *
+ * Copyright (C) 2021 Wojtek Kosior <koszko@koszko.org>
+ *
+ * File is dual-licensed. You can choose either GPLv3+, CC BY-SA or both.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ * I, Wojtek Kosior, thereby promise not to sue for violation of this file's
+ * licenses. Although I request that you do not make use this code in a
+ * proprietary program, I am not going to enforce this in court.
+ */
+
.table_wrapper {
display: block;
background-color: #f0f0f0;