Add scrolling options for status messages

This commit is contained in:
Timo Wagner committed 2025-10-26 11:43:14 +01:00
1 parent 6f3a182328
commit f5c6924ffc
11 files changed
+94 -9

No files matched your search

+2
View File
@@ -53,6 +53,8 @@
"preview": "Vorschau",
"program": "Programm",
"statusMessage": "Statusmeldung",
"statusMessageScrolling": "Scrollen Aktivieren",
"statusMessageScrollingDuration": "Scroll Dauer (s)",
"askChangeBundle": "Paket wirklich ändern?"
},
"editBundleSlides": {
+2
View File
@@ -53,6 +53,8 @@
"preview": "Preview",
"program": "Program",
"statusMessage": "Status Message",
"statusMessageScrolling": "Enable Scrolling",
"statusMessageScrollingDuration": "Scroll Duration (s)",
"askChangeBundle": "Really change bundle?"
},
"editBundleSlides": {
+2
View File
@@ -53,6 +53,8 @@
"preview": "Esikatselu",
"program": "Ohjelma",
"statusMessage": "Tilaviesti",
"statusMessageScrolling": "Ota vieritys käyttöön",
"statusMessageScrollingDuration": "Vierityksen kesto (s)",
"askChangeBundle": "Vaihda diapaketti?"
},
"editBundleSlides": {
+4 -2
View File
@@ -306,8 +306,10 @@ export default class admin {
}
});
socket.on("admin.setStatusMessage", function (message) {
self.getView().serverOptions.statusMessage = message;
socket.on("admin.setStatusMessage", function (data) {
self.getView().serverOptions.statusMessage = data.msg;
self.getView().serverOptions.statusMessageScrolling = data.scrolling;
self.getView().serverOptions.statusMessageScrollingDuration = data.scrollingDuration;
self.getView().updateUI();
});
+2
View File
@@ -48,6 +48,8 @@ export default class display {
transition: "fade",
displayTime: true,
statusMessage: "",
statusMessageScrolling: false,
statusMessageScrollingDuration: "15s"
};
/** @property {Array} timeoutId - holds setTimeout id's for mainLoop */
+4 -1
View File
@@ -235,7 +235,10 @@ function editSlide(name, type) {
}
function setStatusMessage() {
emit("admin.setStatusMessage", $('#statusMessageAdmin').val().replace("\n", "<br>"));
const msgText = $('#statusMessageAdmin').val().replace("\n", "<br>");
const msgScrolling = $('#statusMessageScrolling')[0].checked
const msgScrollingDuration = $('#statusMessageScrollingDuration').val()
emit("admin.setStatusMessage", { msg: msgText, scrolling: msgScrolling, scrollingDuration: msgScrollingDuration});
}
function clearStatusMessage() {
+10 -2
View File
@@ -224,8 +224,16 @@ function checkBlackout() {
function updateStatusMessage() {
if (serverOptions.statusMessage !== "") {
$('#statusMessageOuter').fadeIn();
$('#statusMessage').html(serverOptions.statusMessage);
//only update on a real change
let msg = serverOptions.statusMessage;
if (serverOptions.statusMessageScrolling) {
const dur = serverOptions.statusMessageScrollingDuration || 15
msg = '<div id="statusMessageScrolling" style="animation-duration: ' + dur + 's">' + msg + '</div>'
}
if ($('#statusMessage').html() !== msg) {
$('#statusMessageOuter').fadeIn();
$('#statusMessage').html(msg);
}
} else {
$('#statusMessageOuter').fadeOut();
$('#statusMessage').text("");
+10 -2
View File
@@ -183,8 +183,16 @@ function checkBlackout() {
function updateStatusMessage() {
if (serverOptions.statusMessage !== "") {
$('#statusMessageOuter').fadeIn();
$('#statusMessage').html(serverOptions.statusMessage);
//only update on a real change
let msg = serverOptions.statusMessage;
if (serverOptions.statusMessageScrolling) {
const dur = serverOptions.statusMessageScrollingDuration || 15
msg = '<div id="statusMessageScrolling" style="animation-duration: ' + dur + 's">' + msg + '</div>'
}
if ($('#statusMessage').html() !== msg) {
$('#statusMessageOuter').fadeIn();
$('#statusMessage').html(msg);
}
} else {
$('#statusMessageOuter').fadeOut();
$('#statusMessage').text("");
+10 -2
View File
@@ -212,8 +212,16 @@ function checkBlackout() {
function updateStatusMessage() {
if (serverOptions.statusMessage !== "") {
$('#statusMessageOuter').fadeIn();
$('#statusMessage').html(serverOptions.statusMessage);
//only update on a real change
let msg = serverOptions.statusMessage;
if (serverOptions.statusMessageScrolling) {
const dur = serverOptions.statusMessageScrollingDuration || 15
msg = '<div id="statusMessageScrolling" style="animation-duration: ' + dur + 's">' + msg + '</div>'
}
if ($('#statusMessage').html() !== msg) {
$('#statusMessageOuter').fadeIn();
$('#statusMessage').html(msg);
}
} else {
$('#statusMessageOuter').fadeOut();
$('#statusMessage').text("");
+21
View File
@@ -226,6 +226,27 @@ canvas {
overflow-block: clip;
}
#statusMessage {
overflow: hidden;
width: 100%;
}
#statusMessageScrolling {
white-space: nowrap;
will-change: transform;
animation: marquee 15s linear infinite;
}
/* Animation keyframes for the scroll */
@keyframes marquee {
0% {
transform: translateX(100%);
}
100% {
transform: translateX(-100%);
}
}
#time {
position: absolute;
z-index: 12;
+27
View File
@@ -115,6 +115,33 @@
<button class="ui small green button" onclick="setStatusMessage();">{{ t("actions.set") }}</button>
<button class="ui small red button" onclick="clearStatusMessage();">{{ t("actions.clear") }}</button>
</div>
<div class="ui form">
<div class="inline fields" style="gap: 1rem;">
<!-- Toggle checkbox for scrolling -->
<div class="field">
<div class="ui mini toggle checkbox">
<input type="checkbox" name="statusMessageScrolling" id="statusMessageScrolling">
<label for="statusMessageScrolling" style="color: var(--label-color) !important;">
{{ t("admin.dashboard.statusMessageScrolling") }}
</label>
</div>
</div>
<!-- Number inpu for scroll duration -->
<div class="field">
<label for="statusMessageScrollingDuration"
style="color: var(--label-color) !important; line-height:3em; font-weight:normal; font-size:14px ">
{{ t("admin.dashboard.statusMessageScrollingDuration") }}
</label>
<div class="ui mini input">
<input type="number"
id="statusMessageScrollingDuration"
name="statusMessageScrollingDuration"
min="1" max="99" value="15">
</div>
</div>
</div>
</div>
</div>
</div>
</div>