Files
duplicati/Duplicati/Server/webroot/theme.html
T

106 lines
2.7 KiB
HTML
Raw Normal View History

2024-10-02 22:14:37 +02:00
<!DOCTYPE html>
2015-11-30 21:44:02 +01:00
<html>
2024-10-02 22:14:37 +02:00
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<title>Select theme</title>
<style type="text/css">
2024-10-02 22:14:37 +02:00
.button {
display: inline-block;
padding: 10px;
background-color: lightblue;
color: black;
cursor: pointer;
margin-right: 10px;
2024-10-02 22:14:37 +02:00
}
2024-10-02 22:14:37 +02:00
.button.disabled {
background-color: lightgray;
color: white;
cursor: default;
2024-10-02 22:14:37 +02:00
}
</style>
2024-10-02 22:14:37 +02:00
<script type="text/javascript">
function setDefault(theme) {
var d = new Date();
2024-10-02 22:14:37 +02:00
d.setTime(d.getTime() + 90 * 24 * 60 * 60 * 1000);
document.cookie =
"default-theme=" +
theme +
"; expires=" +
d.toUTCString() +
"; path=/";
updateToCurrentTheme();
return false;
2024-10-02 22:14:37 +02:00
}
2015-11-30 21:44:02 +01:00
2024-10-02 22:14:37 +02:00
function parseCookies() {
var cookiestrings = document.cookie.split("; ");
2015-11-30 21:44:02 +01:00
var cookies = {};
2024-10-02 22:14:37 +02:00
for (var i = cookiestrings.length - 1; i >= 0; i--) {
var parts = cookiestrings[i].split("=");
cookies[parts[0]] = parts[1];
2015-11-30 21:44:02 +01:00
}
return cookies;
2024-10-02 22:14:37 +02:00
}
2015-11-30 21:44:02 +01:00
2025-02-12 10:06:05 +01:00
function updateToCurrentClient() {
2025-02-12 10:05:12 +01:00
var theme = parseCookies()["default-client"];
2015-11-30 21:44:02 +01:00
2024-10-02 22:14:37 +02:00
var themes = ["ngax", "ngclient"];
for (var k in themes) {
var el = document.getElementById(themes[k]);
el.className = "button" + (theme == themes[k] ? " disabled" : "");
}
2024-10-02 22:14:37 +02:00
}
2015-11-30 21:44:02 +01:00
2024-10-02 22:14:37 +02:00
function onLabelClick(e) {
document.forms[0]["theme"].value = e;
}
2015-11-30 21:44:02 +01:00
2024-10-02 22:14:37 +02:00
function setView(theme) {
window.location = theme;
2024-10-02 22:14:37 +02:00
}
2015-11-30 21:44:02 +01:00
2024-10-02 22:14:37 +02:00
// Lazy hack for DOM timing issues...
2025-02-12 10:06:05 +01:00
window.setTimeout(updateToCurrentClient, 1000);
</script>
2015-11-30 21:44:02 +01:00
2024-10-02 22:14:37 +02:00
<script type="text/javascript" src="oem/root/theme/oem.js"></script>
<link rel="stylesheet" type="text/css" href="oem/root/theme/oem.css" />
2024-10-02 22:14:37 +02:00
</head>
2024-10-02 22:14:37 +02:00
<body>
<h2>Duplicati theme</h2>
<ul>
2024-10-02 22:14:37 +02:00
<li class="theme-item">
<h3 class="title">NgAx - The responsive theme</h3>
<div class="buttons">
<div class="button" id="ngax" onclick="setDefault('ngax')">
Use as default
</div>
<div class="button" onclick="setView('ngax')">View now</div>
</div>
</li>
<li class="theme-item">
<h3 class="title">NgClient - Modern Angular theme</h3>
<div class="buttons">
<div class="button" id="ngclient" onclick="setDefault('ngclient')">
Use as default
</div>
<div class="button" onclick="setView('ngclient')">View now</div>
</div>
</li>
</ul>
2024-10-02 22:14:37 +02:00
<script type="text/javascript">
2025-02-12 10:06:05 +01:00
updateToCurrentClient();
2024-10-02 22:14:37 +02:00
</script>
</body>
2015-11-30 21:44:02 +01:00
</html>