mirror of
https://github.com/pi-hole/web.git
synced 2025-12-20 10:48:26 +00:00
Use text()/textContent when we don't need HTML (#3464)
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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 = [];
|
||||
|
||||
Reference in New Issue
Block a user