Compare commits

...
2 Commits
3 changed files with 17 additions and 5 deletions
+1 -1
View File
@@ -1 +1 @@
0.0.21
0.0.23
+14 -2
View File
@@ -507,9 +507,21 @@ static char *sovereign_page_head(const char *title) {
/* Build the theme-toggle button + closing </body></html>.
* Returns a newly-allocated string (g_free). */
static char *sovereign_page_foot(void) {
/* The theme toggle immediately flips the CSS class on <html> for an
* instant visual response, then fires an async XHR to save the setting
* in the background. No page reload, no UI blocking. */
return g_strdup_printf(
"<a class='theme-toggle' href='sovereign://settings/set?feature=theme_dark'>"
"%s</a>\n"
"<a class='theme-toggle' href='#' onclick='"
"var h=document.documentElement;"
"var isDark=h.classList.contains(\"dark\");"
"if(isDark){h.classList.remove(\"dark\");}"
"else{h.classList.add(\"dark\");}"
"this.textContent=isDark?\"Night Mode\":\"Day Mode\";"
"var x=new XMLHttpRequest();"
"x.open(\"GET\",\"sovereign://settings/set?feature=theme_dark\",true);"
"x.send();"
"return false;"
"'>%s</a>\n"
"</body></html>\n",
settings_get()->theme_dark ? "Day Mode" : "Night Mode");
}
+2 -2
View File
@@ -11,9 +11,9 @@
#ifndef SOVEREIGN_BROWSER_VERSION_H
#define SOVEREIGN_BROWSER_VERSION_H
#define SB_VERSION "v0.0.21"
#define SB_VERSION "v0.0.23"
#define SB_VERSION_MAJOR 0
#define SB_VERSION_MINOR 0
#define SB_VERSION_PATCH 21
#define SB_VERSION_PATCH 23
#endif /* SOVEREIGN_BROWSER_VERSION_H */