Use text()/textContent when we don't need HTML (#3464)

This commit is contained in:
yubiuser
2025-05-18 17:18:51 +02:00
committed by GitHub
3 changed files with 5 additions and 5 deletions

View File

@@ -112,7 +112,7 @@ const htmlLegendPlugin = {
textLink.style.padding = 0;
textLink.style.textDecoration = item.hidden ? "line-through" : "";
textLink.className = "legend-label-text";
textLink.append(item.text);
textLink.textContent = item.text;
li.append(boxSpan, textLink);
ul.append(li);

View File

@@ -44,7 +44,7 @@ function piholeChanged(blocking, timer = null) {
const enaT = $("#enableTimer");
if (timer !== null && Number.parseFloat(timer) > 0) {
enaT.html(Date.now() + Number.parseFloat(timer) * 1000);
enaT.text(Date.now() + Number.parseFloat(timer) * 1000);
setTimeout(countDown, 100);
}
@@ -591,7 +591,7 @@ function updateVersionInfo() {
$(() => {
if (!globalThis._isLoginPage) updateInfo();
const enaT = $("#enableTimer");
const target = new Date(Number.parseInt(enaT.html(), 10));
const target = new Date(Number.parseInt(enaT.text(), 10));
const seconds = Math.round((target.getTime() - Date.now()) / 1000);
if (seconds > 0) {
setTimeout(countDown, 100);

View File

@@ -131,11 +131,11 @@ $(() => {
// Insert "Never" into Last Query field when we have
// never seen a query from this device
if (data.lastQuery === 0) {
$("td:eq(4)", row).html("Never");
$("td:eq(4)", row).text("Never");
}
// Set number of queries to localized string (add thousand separators)
$("td:eq(5)", row).html(data.numQueries.toLocaleString());
$("td:eq(5)", row).text(data.numQueries.toLocaleString());
const ips = [];
const iptitles = [];