drop some theme settings

This commit is contained in:
quenousimporte 2023-11-15 21:24:38 +01:00
parent 1cb23c7108
commit ffabf2453f
2 changed files with 6 additions and 18 deletions

16
main.js
View File

@ -1,7 +1,5 @@
var defaultsettings = var defaultsettings =
{ {
bgcolor: "white",
fontfamily: "system-ui",
fontsize: "16px", fontsize: "16px",
fontcolor: "rgb(55, 53, 47)", fontcolor: "rgb(55, 53, 47)",
lineheight: "24px", lineheight: "24px",
@ -18,7 +16,6 @@ var defaultsettings =
sync: false, sync: false,
tagsinlists: true, tagsinlists: true,
tagfilter: "", tagfilter: "",
darkcode: true,
uselinkpopup: true uselinkpopup: true
}; };
@ -674,7 +671,7 @@ function shownotelinks()
{ {
color: color:
{ {
background: settings.bgcolor, background: "white",
border: settings.fontcolor, border: settings.fontcolor,
}, },
font: font:
@ -1317,8 +1314,6 @@ function loadstorage()
function applystyle() function applystyle()
{ {
document.body.style.background = settings.bgcolor;
document.body.style.fontFamily = settings.fontfamily;
document.body.style.fontSize = settings.fontsize; document.body.style.fontSize = settings.fontsize;
document.body.style.lineHeight = settings.lineheight; document.body.style.lineHeight = settings.lineheight;
document.body.style.color = settings.fontcolor; document.body.style.color = settings.fontcolor;
@ -2162,20 +2157,14 @@ function rawline2html(line, index, options)
{ {
options.code = true; options.code = true;
options.language = line.substring(3); options.language = line.substring(3);
if (settings.darkcode)
{
line = "<div class='color-code'>" + line.replace(new RegExp("(" + options.language + ")"), "<span style='text-shadow: " + shadow + ";color:" + settings.accentcolor + ";'>$1</span>") + "</div>"; line = "<div class='color-code'>" + line.replace(new RegExp("(" + options.language + ")"), "<span style='text-shadow: " + shadow + ";color:" + settings.accentcolor + ";'>$1</span>") + "</div>";
} }
}
else if (line == "```" && options.code) else if (line == "```" && options.code)
{ {
options.code = false; options.code = false;
options.language = ""; options.language = "";
if (settings.darkcode)
{
line = "<div class='color-code'>" + line + "</div>"; line = "<div class='color-code'>" + line + "</div>";
} }
}
else if (options.code) else if (options.code)
{ {
var comment = false; var comment = false;
@ -2184,10 +2173,7 @@ function rawline2html(line, index, options)
line = "<span style='color:grey'>" + line + "</span>"; line = "<span style='color:grey'>" + line + "</span>";
comment = true; comment = true;
} }
if (settings.darkcode)
{
line = "<div class='color-code'>" + (line || emptyline) + "</div>"; line = "<div class='color-code'>" + (line || emptyline) + "</div>";
}
if (!comment && languagekeywords[options.language]) if (!comment && languagekeywords[options.language])
{ {
var keywords = languagekeywords[options.language]; var keywords = languagekeywords[options.language];

View File

@ -3,6 +3,8 @@
body { body {
margin-left: 7%; margin-left: 7%;
margin-right: 7%; margin-right: 7%;
background: white;
font-family: system-ui;
} }
a { a {