mirror of
https://github.com/kkapsner/CanvasBlocker
synced 2025-07-04 04:26:35 +02:00
Added centralized theme system and themed all pages
This commit is contained in:
parent
c2a817478e
commit
6301b744d2
39 changed files with 448 additions and 127 deletions
|
@ -14,6 +14,7 @@
|
|||
<script src="../lib/settingContainers.js"></script>
|
||||
<script src="../lib/settingsMigration.js"></script>
|
||||
<script src="../lib/settings.js"></script>
|
||||
<script src="../lib/theme.js"></script>
|
||||
<script src="export.js"></script>
|
||||
</body>
|
||||
</html>
|
|
@ -7,6 +7,7 @@
|
|||
const settings = require("../lib/settings");
|
||||
const logging = require("../lib/logging");
|
||||
const settingsMigration = require("../lib/settingsMigration");
|
||||
require("../lib/theme").init();
|
||||
const input = document.getElementById("settings");
|
||||
settings.onloaded(function(){
|
||||
var data = {};
|
||||
|
|
|
@ -10,8 +10,6 @@
|
|||
|
||||
.button {
|
||||
display: inline-block;
|
||||
border: none;
|
||||
background-color: white;
|
||||
border: 1px solid lightgray;
|
||||
margin: 2px;
|
||||
width: 7em;
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
<script src="../lib/settingContainers.js"></script>
|
||||
<script src="../lib/settings.js"></script>
|
||||
<script src="../lib/navigator.js"></script>
|
||||
<script src="../lib/theme.js"></script>
|
||||
<script src="navigator.js"></script>
|
||||
</body>
|
||||
</html>
|
|
@ -7,6 +7,7 @@
|
|||
const extension = require("../lib/extension");
|
||||
const settings = require("../lib/settings");
|
||||
const navigator = require("../lib/navigator");
|
||||
require("../lib/theme").init();
|
||||
|
||||
const title = document.createElement("h1");
|
||||
title.className = "title";
|
||||
|
|
|
@ -1,76 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
width="30"
|
||||
height="20"
|
||||
viewBox="0 0 7.9374998 5.2916668"
|
||||
version="1.1"
|
||||
id="svg8"
|
||||
inkscape:version="0.92.4 5da689c313, 2019-01-14"
|
||||
sodipodi:docname="notVisible-dark.svg">
|
||||
<defs
|
||||
id="defs2" />
|
||||
<sodipodi:namedview
|
||||
id="base"
|
||||
pagecolor="#000000"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="3.959798"
|
||||
inkscape:cx="-31.241245"
|
||||
inkscape:cy="54.832316"
|
||||
inkscape:document-units="mm"
|
||||
inkscape:current-layer="layer1"
|
||||
showgrid="false"
|
||||
inkscape:window-width="1600"
|
||||
inkscape:window-height="841"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="0"
|
||||
inkscape:window-maximized="1"
|
||||
units="px" />
|
||||
<metadata
|
||||
id="metadata5">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title></dc:title>
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
inkscape:label="Ebene 1"
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1"
|
||||
transform="translate(0,-291.70832)">
|
||||
<path
|
||||
style="fill:none;stroke:#ffffff;stroke-width:0.07936867;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;opacity:1"
|
||||
d="m 0.14548308,294.43593 c 2.59575882,2.03078 4.92396642,2.03973 7.67986362,-0.06 -3.6044602,-0.64366 -3.6257846,-2.34887 -7.67986362,0.06 z"
|
||||
id="path4520"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="ccc" />
|
||||
<ellipse
|
||||
style="fill:#bbbbbb;fill-opacity:1;stroke:#bbbbbb;stroke-width:0.04199925;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;opacity:1"
|
||||
id="path4522"
|
||||
cx="4.0754137"
|
||||
cy="294.64594"
|
||||
rx="0.92998338"
|
||||
ry="0.86998433" />
|
||||
<path
|
||||
style="opacity:1;fill:none;stroke:#919191;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="m 1.2695302,296.79953 5.6794774,-4.27631"
|
||||
id="path4543"
|
||||
inkscape:connector-curvature="0" />
|
||||
</g>
|
||||
</svg>
|
Before Width: | Height: | Size: 2.6 KiB |
|
@ -1,26 +0,0 @@
|
|||
body {
|
||||
background-color: rgb(74, 74, 79);
|
||||
color: rgb(249, 249, 250);
|
||||
}
|
||||
|
||||
a:link, a:visited, a:active {
|
||||
color: lightblue;
|
||||
}
|
||||
|
||||
header .bookmarkNotice {
|
||||
border: 1px dotted #E72020;
|
||||
color: #FF8E8E;
|
||||
}
|
||||
|
||||
input, textarea, select, button {
|
||||
background-color: rgb(53, 56, 54);
|
||||
color: rgb(249, 249, 250);
|
||||
border-color: rgb(53, 56, 54);
|
||||
}
|
||||
|
||||
.content .hide ~ .display, .displayHidden ~ .display {
|
||||
background-image: url(visible-dark.svg);
|
||||
}
|
||||
.content .hide:checked ~ .display, .displayHidden:checked ~ .display {
|
||||
background-image: url(notVisible-dark.svg);
|
||||
}
|
|
@ -1,19 +0,0 @@
|
|||
body {
|
||||
color: rgb(60, 62, 60);
|
||||
background-color: rgb(249, 250, 249);
|
||||
}
|
||||
|
||||
a:link, a:visited, a:active {
|
||||
color: blue;
|
||||
}
|
||||
|
||||
header .bookmarkNotice {
|
||||
border: 1px dotted #880000;
|
||||
color: #880000;
|
||||
}
|
||||
|
||||
input, textarea, select, button {
|
||||
background-color: rgb(236, 237, 236);
|
||||
color: rgb(60, 62, 60);
|
||||
border-color: rgb(236, 237, 236);
|
||||
}
|
|
@ -1,19 +0,0 @@
|
|||
body {
|
||||
background-color: rgb(255, 255, 255);
|
||||
color: rgb(12, 12, 13);
|
||||
}
|
||||
|
||||
a:link, a:visited, a:active {
|
||||
color: blue;
|
||||
}
|
||||
|
||||
header .bookmarkNotice {
|
||||
border: 1px dotted #880000;
|
||||
color: #880000;
|
||||
}
|
||||
|
||||
input, textarea, select, button {
|
||||
background-color: rgb(240, 240, 240);
|
||||
color: rgb(12, 12, 13);
|
||||
border-color: rgb(240, 240, 240);
|
||||
}
|
|
@ -174,9 +174,13 @@ textarea {
|
|||
padding: 0;
|
||||
border: none;
|
||||
background-color: transparent;
|
||||
background-image: none;
|
||||
}
|
||||
.urlValues.collapsed .collapser::after {
|
||||
content: "\25B6";
|
||||
display: inline-block;
|
||||
height: 100%;
|
||||
line-height: 0;
|
||||
}
|
||||
.urlValues.expanded .collapser::after {
|
||||
content: "\25BC";
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
<script src="../lib/settingsMigration.js"></script>
|
||||
<script src="../lib/settings.js"></script>
|
||||
<script src="../lib/search.js"></script>
|
||||
<script src="../lib/theme.js"></script>
|
||||
<script src="optionsGui.js"></script>
|
||||
<script src="settingsDisplay.js"></script>
|
||||
<script src="options.js"></script>
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
const settingStrings = require("../lib/settingStrings");
|
||||
const searchParameters = new URLSearchParams(window.location.search);
|
||||
const settingsMigration = require("../lib/settingsMigration");
|
||||
require("./theme").init("options");
|
||||
|
||||
var callbacks = {
|
||||
openNavigatorSettings: function(){
|
||||
|
@ -428,16 +429,6 @@
|
|||
document.body.appendChild(version);
|
||||
|
||||
settings.onloaded(function(){
|
||||
// load theme
|
||||
var themeLink = document.createElement("link");
|
||||
themeLink.href = `options-${settings.theme}.css`;
|
||||
themeLink.rel = "stylesheet";
|
||||
themeLink.type = "text/css";
|
||||
document.head.appendChild(themeLink);
|
||||
settings.on("theme", function(){
|
||||
themeLink.href = `options-${settings.theme}.css`;
|
||||
});
|
||||
|
||||
const reCaptchaEntry = "^https://www\\.google\\.com/recaptcha/api2/(?:b?frame|anchor).*$";
|
||||
const {url: urlContainer} = settings.getContainers();
|
||||
settings.on("protectWindow", function({newValue}){
|
||||
|
|
|
@ -108,7 +108,7 @@
|
|||
const input = document.createElement("input");
|
||||
input.type = "checkbox";
|
||||
input.checked = value;
|
||||
input.style.display = "inline";
|
||||
input.style.display = "inline-block";
|
||||
return input;
|
||||
},
|
||||
updateCallback: function(input, value){
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
<script src="../lib/settingDefinitions.js"></script>
|
||||
<script src="../lib/settingContainers.js"></script>
|
||||
<script src="../lib/settings.js"></script>
|
||||
<script src="../lib/theme.js"></script>
|
||||
<script src="sanitationRules.js"></script>
|
||||
<script src="sanitize.js"></script>
|
||||
</body>
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
|
||||
const extension = require("../lib/extension");
|
||||
const settings = require("../lib/settings");
|
||||
require("../lib/theme").init("sanitize");
|
||||
const sanitationRules = require("./sanitationRules");
|
||||
|
||||
var title = document.createElement("h1");
|
||||
|
|
|
@ -1,71 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
width="30"
|
||||
height="20"
|
||||
viewBox="0 0 7.9374998 5.2916668"
|
||||
version="1.1"
|
||||
id="svg8"
|
||||
inkscape:version="0.92.4 5da689c313, 2019-01-14"
|
||||
sodipodi:docname="visible-dark.svg">
|
||||
<defs
|
||||
id="defs2" />
|
||||
<sodipodi:namedview
|
||||
id="base"
|
||||
pagecolor="#000000"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="3.959798"
|
||||
inkscape:cx="-31.241245"
|
||||
inkscape:cy="54.832316"
|
||||
inkscape:document-units="mm"
|
||||
inkscape:current-layer="layer1"
|
||||
showgrid="false"
|
||||
inkscape:window-width="1600"
|
||||
inkscape:window-height="841"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="0"
|
||||
inkscape:window-maximized="1"
|
||||
units="px" />
|
||||
<metadata
|
||||
id="metadata5">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title></dc:title>
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
inkscape:label="Ebene 1"
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1"
|
||||
transform="translate(0,-291.70832)">
|
||||
<path
|
||||
style="fill:none;stroke:#ffffff;stroke-width:0.07936867;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="m 0.14548308,294.43593 c 2.59575882,2.03078 4.92396642,2.03973 7.67986362,-0.06 -3.6044602,-0.64366 -3.6257846,-2.34887 -7.67986362,0.06 z"
|
||||
id="path4520"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="ccc" />
|
||||
<ellipse
|
||||
style="fill:#919191;fill-opacity:1;stroke:#919191;stroke-width:0.04199925;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
id="path4522"
|
||||
cx="4.0754137"
|
||||
cy="294.64594"
|
||||
rx="0.92998338"
|
||||
ry="0.86998433" />
|
||||
</g>
|
||||
</svg>
|
Before Width: | Height: | Size: 2.3 KiB |
Loading…
Add table
Add a link
Reference in a new issue