Update jQuery to v3.6.1. (#2392)

This commit is contained in:
DL6ER
2022-10-28 13:01:34 -04:00
committed by GitHub
12 changed files with 55 additions and 49 deletions

View File

@@ -393,7 +393,7 @@ $("#querytime").on("apply.daterangepicker", function (ev, picker) {
updateQueriesOverTime();
});
$("#queryOverTimeChart").click(function (evt) {
$("#queryOverTimeChart").on("click", function (evt) {
var activePoints = timeLineChart.getElementsAtEventForMode(
evt,
"nearest",

View File

@@ -464,12 +464,12 @@ $("#querytime").on("apply.daterangepicker", function (ev, picker) {
refreshTableData();
});
$("input[id^=type]").change(function () {
$("input[id^=type]").on("change", function () {
if (datepickerManuallySelected) {
reloadBox.show();
}
});
$(".bt-reload").click(function () {
$(".bt-reload").on("click", function () {
refreshTableData();
});

View File

@@ -150,7 +150,7 @@ function initCheckboxRadioStyle() {
var iCheckStyle = $("#iCheckStyle");
if (iCheckStyle !== null) {
iCheckStyle.val(chkboxStyle);
iCheckStyle.change(function () {
iCheckStyle.on("change", function () {
var themename = $(this).val();
localStorage.setItem("theme_icheck", themename);
applyCheckboxRadioStyle(themename);
@@ -197,7 +197,7 @@ function initCPUtemp() {
var tempunitSelector = $("#tempunit-selector");
if (tempunitSelector !== null) {
tempunitSelector.val(tempunit);
tempunitSelector.change(function () {
tempunitSelector.on("change", function () {
tempunit = $(this).val();
setCPUtemp(tempunit);
});
@@ -256,7 +256,7 @@ $("#pihole-disable-custom").on("click", function (e) {
});
// Handle Ctrl + Enter button on Login page
$(document).keypress(function (e) {
$(document).on("keypress", function (e) {
if ((e.keyCode === 10 || e.keyCode === 13) && e.ctrlKey && $("#loginpw").is(":focus")) {
$("#loginform").attr("action", "settings.php");
$("#loginform").submit();

View File

@@ -69,7 +69,7 @@ function showSuggestDomains(value) {
// Purposefully omit 'btn' class to save space on padding
return $('<button type="button" class="btn-link btn-block text-right">')
.append($("<i>").text(hostname))
.click(function () {
.on("click", function () {
hideSuggestDomains();
newDomainEl.val(hostname);
});

View File

@@ -1071,7 +1071,7 @@ $(function () {
updateTopClientsChart();
}
$("#queryOverTimeChart").click(function (evt) {
$("#queryOverTimeChart").on("click", function (evt) {
var activePoints = timeLineChart.getElementsAtEventForMode(
evt,
"nearest",
@@ -1093,7 +1093,7 @@ $(function () {
return false;
});
$("#clientsChart").click(function (evt) {
$("#clientsChart").on("click", function (evt) {
var activePoints = clientsChart.getElementsAtEventForMode(
evt,
"nearest",

View File

@@ -178,7 +178,7 @@ $(function () {
}
$("td:eq(3)", row).html(names.join("<br>"));
$("td:eq(3)", row).hover(function () {
$("td:eq(3)", row).on("hover", function () {
this.title = allnames.join("\n");
});
}
@@ -201,7 +201,7 @@ $(function () {
}
$("td:eq(0)", row).html(ips.join("<br>"));
$("td:eq(0)", row).hover(function () {
$("td:eq(0)", row).on("hover", function () {
this.title = data.ip.join("\n");
});

View File

@@ -240,17 +240,18 @@ $(function () {
$("td:eq(6)", row).html(buttontext);
if (DomainlistLink) {
$("td:eq(4)", row).hover(
function () {
$("td:eq(4)", row).on(
"hover",
(function () {
this.title = "Click to show matching blacklist/whitelist domain";
this.style.color = "#72afd2";
},
function () {
this.style.color = "";
}
})
);
$("td:eq(4)", row).off(); // Release any possible previous onClick event handlers
$("td:eq(4)", row).click(function () {
$("td:eq(4)", row).on("click", function () {
var newTab = window.open("groups-domains.php?domainid=" + data[9], "_blank");
if (newTab) {
newTab.focus();
@@ -366,80 +367,85 @@ $(function () {
// Query type IPv4 / IPv6
api
.$("td:eq(1)")
.click(function (event) {
.on("click", function (event) {
addColumnFilter(event, 1, this.textContent);
})
.hover(
function () {
.on(
"hover",
(function () {
$(this).addClass("pointer").attr("title", tooltipText(1, this.textContent));
},
function () {
$(this).removeClass("pointer");
}
})
);
// Domain
api
.$("td:eq(2)")
.click(function (event) {
.on("click", function (event) {
addColumnFilter(event, 2, this.textContent.split("\n")[0]);
})
.hover(
function () {
.on(
"hover",
(function () {
$(this).addClass("pointer").attr("title", tooltipText(2, this.textContent));
},
function () {
$(this).removeClass("pointer");
}
})
);
// Client
api
.$("td:eq(3)")
.click(function (event) {
.on("click", function (event) {
addColumnFilter(event, 3, this.textContent);
})
.hover(
function () {
.on(
"hover",
(function () {
$(this).addClass("pointer").attr("title", tooltipText(3, this.textContent));
},
function () {
$(this).removeClass("pointer");
}
})
);
// Status
api
.$("td:eq(4)")
.click(function (event) {
.on("click", function (event) {
var id = this.children.id.value;
var text = this.textContent;
addColumnFilter(event, 4, id + "#" + text);
})
.hover(
function () {
.on(
"hover",
(function () {
$(this).addClass("pointer").attr("title", tooltipText(4, this.textContent));
},
function () {
$(this).removeClass("pointer");
}
})
);
// Reply type
api
.$("td:eq(5)")
.click(function (event) {
.on("click", function (event) {
var id = this.children.id.value;
var text = this.textContent.split(" ")[0];
addColumnFilter(event, 5, id + "#" + text);
})
.hover(
function () {
.on(
"hover",
(function () {
$(this).addClass("pointer").attr("title", tooltipText(5, this.textContent));
},
function () {
$(this).removeClass("pointer");
}
})
);
// Disable autocorrect in the search box
@@ -465,7 +471,7 @@ $(function () {
}
});
$("#resetButton").click(function () {
$("#resetButton").on("click", function () {
tableApi.search("");
resetColumnsFilters();
});

View File

@@ -87,7 +87,7 @@ function eventsource() {
}
// Handle enter key
$("#domain").keypress(function (e) {
$("#domain").on("keypress", function (e) {
if (e.which === 13) {
// Enter was pressed, and the input has focus
exact = "";

View File

@@ -59,7 +59,7 @@ $(function () {
});
// display selected import file on button's adjacent textfield
$("#zip_file").change(function () {
$("#zip_file").on("change", function () {
var fileName = $(this)[0].files.length === 1 ? $(this)[0].files[0].name : "";
$("#zip_filename").val(fileName);
});
@@ -194,7 +194,7 @@ $("#apiTokenModal").on("show.bs.modal", function () {
$('iframe[name="apiToken_iframe"]').contents().find("table").css(qrCodeStyle);
});
$("#DHCPchk").click(function () {
$("#DHCPchk").on("click", function () {
$("input.DHCPgroup").prop("disabled", !this.checked);
$("#dhcpnotice").prop("hidden", !this.checked).addClass("lookatme");
});
@@ -347,7 +347,7 @@ $(function () {
// En-/disable conditional forwarding input fields based
// on the checkbox state
$('input[name="rev_server"]').click(function () {
$('input[name="rev_server"]').on("click", function () {
$('input[name="rev_server_cidr"]').prop("disabled", !this.checked);
$('input[name="rev_server_target"]').prop("disabled", !this.checked);
$('input[name="rev_server_domain"]').prop("disabled", !this.checked);
@@ -377,7 +377,7 @@ $(function () {
}
}
bargraphs.click(function () {
bargraphs.on("click", function () {
localStorage.setItem("barchart_chkbox", bargraphs.prop("checked"));
});
});
@@ -397,7 +397,7 @@ $(function () {
}
}
colorfulQueryLog.click(function () {
colorfulQueryLog.on("click", function () {
localStorage.setItem("colorfulQueryLog_chkbox", colorfulQueryLog.prop("checked"));
});
});
@@ -463,7 +463,7 @@ $(function () {
}
}
nonfatalwarnigns.click(function () {
nonfatalwarnigns.on("click", function () {
localStorage.setItem("hideNonfatalDnsmasqWarnings_chkbox", nonfatalwarnigns.prop("checked"));
// Call check messages to make new setting effective
checkMessages();

View File

@@ -39,11 +39,11 @@ $(function () {
reloadData();
});
$("#chk1").click(function () {
$("#chk1").on("click", function () {
$("#chk2").prop("checked", this.checked);
scrolling = this.checked;
});
$("#chk2").click(function () {
$("#chk2").on("click", function () {
$("#chk1").prop("checked", this.checked);
scrolling = this.checked;
});

View File

@@ -39,11 +39,11 @@ $(function () {
reloadData();
});
$("#chk1").click(function () {
$("#chk1").on("click", function () {
$("#chk2").prop("checked", this.checked);
scrolling = this.checked;
});
$("#chk2").click(function () {
$("#chk2").on("click", function () {
$("#chk1").prop("checked", this.checked);
scrolling = this.checked;
});

File diff suppressed because one or more lines are too long