Installer workflow is done - Docker container is working fine
This commit is contained in:
@@ -1,57 +0,0 @@
|
||||
(() => {
|
||||
"use strict";
|
||||
|
||||
const closeButton = document.getElementById("closeLogin");
|
||||
const birthdayBanner = document.getElementById("birthdayBanner");
|
||||
const birthdayUrl = document.body.dataset.birthdayUrl;
|
||||
|
||||
closeButton?.addEventListener("click", () => window.close());
|
||||
|
||||
if (!birthdayBanner || !birthdayUrl) {
|
||||
return;
|
||||
}
|
||||
|
||||
const showBirthdayAnnouncements = (responseText) => {
|
||||
const fragment = document.createDocumentFragment();
|
||||
|
||||
responseText.split("!R0W!").filter(Boolean).forEach((row) => {
|
||||
const [message, imageName] = row.split("!C0L!");
|
||||
if (!message || !imageName || !/^[a-zA-Z0-9_-]+$/.test(imageName)) {
|
||||
return;
|
||||
}
|
||||
|
||||
const item = document.createElement("div");
|
||||
item.className = "matrix-login__birthday-item";
|
||||
|
||||
const text = document.createElement("span");
|
||||
text.textContent = `${message}!`;
|
||||
|
||||
const image = document.createElement("img");
|
||||
image.src = `${document.body.dataset.contextPath || ""}/images/dob/${imageName}.jpg`;
|
||||
image.alt = "Birthday announcement";
|
||||
|
||||
item.append(text, image);
|
||||
fragment.append(item);
|
||||
});
|
||||
|
||||
if (fragment.childNodes.length > 0) {
|
||||
birthdayBanner.replaceChildren(fragment);
|
||||
birthdayBanner.hidden = false;
|
||||
}
|
||||
};
|
||||
|
||||
fetch(birthdayUrl, {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/x-www-form-urlencoded;charset=ISO-8859-1" },
|
||||
body: new URLSearchParams({ val0: "1", val1: "5" })
|
||||
})
|
||||
.then((response) => response.ok ? response.text() : Promise.reject(new Error("Request failed")))
|
||||
.then((responseText) => {
|
||||
if (!responseText.includes("Error")) {
|
||||
showBirthdayAnnouncements(responseText);
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
// Birthday announcements are optional and must not block authentication.
|
||||
});
|
||||
})();
|
||||
Reference in New Issue
Block a user