This commit is contained in:
2025-09-20 12:22:20 -07:00
parent 0d62d99c80
commit 26d604534a
6 changed files with 90 additions and 17 deletions

View File

@ -2,6 +2,11 @@ body {
background-color: #191717;
}
form {
color: white;
font-size: large;
}
#deviceReady div {
top: 0;
left: 0;

View File

@ -21,7 +21,7 @@
<script src="scripts/jquery-1.9.1.min.js"></script>
<script src="scripts/bootstrap.min.js"></script>
<script src="scripts/jquery.bgswitcher.js"></script>
<script type="text/javascript" src="scripts/index.js?nocache=2025-08-10-15-12"></script>
<script type="text/javascript" src="scripts/index.js?nocache=2025-09-20-09-42"></script>
</body>
</html>

View File

@ -18,11 +18,8 @@
var _DeviceReadyDiv = typeof document == 'undefined' ? undefined : $('#deviceReady div');
var _TimeElement = typeof document == 'undefined' ? undefined : document.createElement('time');
function loadData() {
const currentDate = new Date();
const dd = currentDate.getDate().toString().padStart(2, '0');
const mm = (new Date().getMonth() + 1).toString().padStart(2, '0');
const url = _UniformResourceLocator + '/slideshow/' + _DataDirectory + '/' + mm + '-' + dd + '.json?nocache=2025-08-10-15-12';
function loadData(mm, dd) {
const url = _UniformResourceLocator + '/slideshow/' + _DataDirectory + '/' + mm + '-' + dd + '.json?nocache=2025-09-20-09-42';
console.log(url);
fetch(url, { nocache: new Date().getTime() })
.then((res) => res.text())
@ -47,7 +44,9 @@
if (currentHours === 0) {
const currentMinutes = currentDate.getMinutes();
if (currentMinutes === 0) {
loadData();
const dd = currentDate.getDate().toString().padStart(2, '0');
const mm = (new Date().getMonth() + 1).toString().padStart(2, '0');
loadData(mm, dd);
}
}
}
@ -177,7 +176,9 @@
_hasLast = typeof window == 'undefined' ? false : window.location.href.indexOf('last') > 0;
_hasList = typeof window == 'undefined' ? false : window.location.href.indexOf('list') > 0;
_hasTime = typeof window == 'undefined' ? false : window.location.href.indexOf('time') > 0;
const url = uniformResourceLocator + '/slideshow/index.json?nocache=2025-08-10-15-12';
const fixedDateSegments = typeof window == 'undefined' ? [] : window.location.href.split('fixed-date=');
const imageIntervalSegments = typeof window == 'undefined' ? [] : window.location.href.split('image-interval=');
const url = uniformResourceLocator + '/slideshow/index.json?nocache=2025-09-20-09-42';
console.log(url);
fetch(url, { nocache: new Date().getTime() })
.then((res) => res.text())
@ -197,10 +198,25 @@
if (_hasLast) {
loadLog();
}
loadData();
if (fixedDateSegments.length === 2) {
const fixedDateSegmentsB = fixedDateSegments[1].split('&')[0].split('-');
loadData(fixedDateSegmentsB[0], fixedDateSegmentsB[1]);
}
else {
const currentDate = new Date();
const dd = currentDate.getDate().toString().padStart(2, '0');
const mm = (new Date().getMonth() + 1).toString().padStart(2, '0');
loadData(mm, dd);
}
if (!_hasList && _DeviceReadyDiv != undefined) {
setInterval(onTickJSON, data.JsonInterval);
setInterval(onTickImage, data.ImageInterval);
if (imageIntervalSegments.length === 1) {
setInterval(onTickImage, data.ImageInterval);
}
else {
const imageInterval = imageIntervalSegments[1].split('&')[0];
setInterval(onTickImage, imageInterval);
}
}
if (_hasList && _hasLast) {
_TickLoadList = setInterval(onTickLoadList, 500);
@ -225,7 +241,7 @@
}
function loadLog() {
const url = _UniformResourceLocator + '/log-nginx/access.log?nocache=2025-08-10-15-12';
const url = _UniformResourceLocator + '/log-nginx/access.log?nocache=2025-09-20-09-42';
fetch(url, { nocache: new Date().getTime() })
.then((res) => res.text())
.then((text) => {