themeing
This commit is contained in:
@@ -1,5 +1,21 @@
|
||||
toggleDarkMode = function() {
|
||||
var oldValue = $("html").attr("data-bs-theme");
|
||||
var newValue = oldValue == "dark" ? "light" : "dark";
|
||||
var updateUrl = /*[[@{/updateTheme}]]*/ 'updateTheme';
|
||||
updateUrl = updateUrl + "/" + newValue;
|
||||
$("html").attr("data-bs-theme", newValue);
|
||||
$.ajax({
|
||||
url: updateUrl,
|
||||
type: "POST",
|
||||
contentType: "application/json",
|
||||
dataType: 'json'
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* only because th:data-bs-theme="${theme}" does not work
|
||||
*/
|
||||
$(document).ready(function(){
|
||||
var theme = /*[[${theme}]]*/ 'dark';
|
||||
$("html").attr("data-bs-theme", theme);
|
||||
});
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns:th="http://www.thymeleaf.org" layout:decorate="~{template}" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" xmlns:sec="http://www.thymeleaf.org/extras/spring-security">
|
||||
<head>
|
||||
<title>Camp Organizer 2</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||
</head>
|
||||
<body>
|
||||
<th:block layout:fragment="content">
|
||||
<div class="borderdist">
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.thymeleaf.org/extras/spring-security" data-bs-theme="dark">
|
||||
<html xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.thymeleaf.org/extras/spring-security">
|
||||
<head>
|
||||
<title>Camp Organizer 2</title>
|
||||
<title>Bible Class Organizer</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<link th:rel="stylesheet" type="text/css" media="all" th:href="@{/webjars/bootstrap/5.3.1/css/bootstrap.min.css}" />
|
||||
|
||||
Reference in New Issue
Block a user