From cecb5aa88c611cceb36a16d801a4c1fdf7e7c340 Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Sat, 23 May 2020 17:04:11 +0300 Subject: [PATCH] Use `$(fn)` This is the recommended way in jQuery 3.x. Signed-off-by: XhmikosR --- scripts/pi-hole/js/auditlog.js | 2 +- scripts/pi-hole/js/customdns.js | 2 +- scripts/pi-hole/js/db_graph.js | 2 +- scripts/pi-hole/js/db_queries.js | 2 +- scripts/pi-hole/js/footer.js | 2 +- scripts/pi-hole/js/groups-adlists.js | 2 +- scripts/pi-hole/js/groups-clients.js | 2 +- scripts/pi-hole/js/groups-domains.js | 2 +- scripts/pi-hole/js/groups.js | 2 +- scripts/pi-hole/js/index.js | 2 +- scripts/pi-hole/js/messages.js | 2 +- scripts/pi-hole/js/network.js | 2 +- scripts/pi-hole/js/queries.js | 2 +- scripts/pi-hole/js/queryads.js | 2 +- scripts/pi-hole/js/settings.js | 6 +++--- 15 files changed, 17 insertions(+), 17 deletions(-) diff --git a/scripts/pi-hole/js/auditlog.js b/scripts/pi-hole/js/auditlog.js index 7f80312a3..1212eb736 100644 --- a/scripts/pi-hole/js/auditlog.js +++ b/scripts/pi-hole/js/auditlog.js @@ -127,7 +127,7 @@ function auditUrl(url) { add(url, "audit"); } -$(document).ready(function () { +$(function () { // Pull in data via AJAX updateTopLists(); diff --git a/scripts/pi-hole/js/customdns.js b/scripts/pi-hole/js/customdns.js index 8c2a4d22e..116ea602d 100644 --- a/scripts/pi-hole/js/customdns.js +++ b/scripts/pi-hole/js/customdns.js @@ -37,7 +37,7 @@ function showAlert(type, message) { alertElement.delay(8000).fadeOut(2000); } -$(document).ready(function () { +$(function () { $("#btnAdd").on("click", addCustomDNS); table = $("#customDNSTable").DataTable({ diff --git a/scripts/pi-hole/js/db_graph.js b/scripts/pi-hole/js/db_graph.js index 124fc6f77..6c2dbbe87 100644 --- a/scripts/pi-hole/js/db_graph.js +++ b/scripts/pi-hole/js/db_graph.js @@ -146,7 +146,7 @@ function updateQueriesOverTime() { ); } -$(document).ready(function () { +$(function () { var ctx = document.getElementById("queryOverTimeChart").getContext("2d"); var blockedColor = "#999"; var permittedColor = "#00a65a"; diff --git a/scripts/pi-hole/js/db_queries.js b/scripts/pi-hole/js/db_queries.js index 0b29da023..12a92273d 100644 --- a/scripts/pi-hole/js/db_queries.js +++ b/scripts/pi-hole/js/db_queries.js @@ -233,7 +233,7 @@ function refreshTableData() { tableApi.ajax.url(APIstring).load(reloadCallback); } -$(document).ready(function () { +$(function () { var APIstring; if (instantquery) { diff --git a/scripts/pi-hole/js/footer.js b/scripts/pi-hole/js/footer.js index 3b706117e..63ba23de4 100644 --- a/scripts/pi-hole/js/footer.js +++ b/scripts/pi-hole/js/footer.js @@ -125,7 +125,7 @@ function testCookies() { return ret; } -$(document).ready(function () { +$(function () { var enaT = $("#enableTimer"); var target = new Date(parseInt(enaT.html())); var seconds = Math.round((target.getTime() - new Date().getTime()) / 1000); diff --git a/scripts/pi-hole/js/groups-adlists.js b/scripts/pi-hole/js/groups-adlists.js index 2c5bcbdac..4bcdde818 100644 --- a/scripts/pi-hole/js/groups-adlists.js +++ b/scripts/pi-hole/js/groups-adlists.js @@ -23,7 +23,7 @@ function getGroups() { ); } -$(document).ready(function () { +$(function () { $("#btnAdd").on("click", addAdlist); utils.setBsSelectDefaults(); diff --git a/scripts/pi-hole/js/groups-clients.js b/scripts/pi-hole/js/groups-clients.js index fbb6da709..609606ce4 100644 --- a/scripts/pi-hole/js/groups-clients.js +++ b/scripts/pi-hole/js/groups-clients.js @@ -57,7 +57,7 @@ function getGroups() { ); } -$(document).ready(function () { +$(function () { $("#btnAdd").on("click", addClient); reloadClientSuggestions(); diff --git a/scripts/pi-hole/js/groups-domains.js b/scripts/pi-hole/js/groups-domains.js index e707f6614..5a0ad2023 100644 --- a/scripts/pi-hole/js/groups-domains.js +++ b/scripts/pi-hole/js/groups-domains.js @@ -25,7 +25,7 @@ function getGroups() { ); } -$(document).ready(function () { +$(function () { window.location.search .substr(1) .split("&") diff --git a/scripts/pi-hole/js/groups.js b/scripts/pi-hole/js/groups.js index 9a0d9d76f..f7d16d533 100644 --- a/scripts/pi-hole/js/groups.js +++ b/scripts/pi-hole/js/groups.js @@ -10,7 +10,7 @@ var table; var token = $("#token").text(); -$(document).ready(function () { +$(function () { $("#btnAdd").on("click", addGroup); table = $("#groupsTable").DataTable({ diff --git a/scripts/pi-hole/js/index.js b/scripts/pi-hole/js/index.js index e778c3380..7ffdaeafc 100644 --- a/scripts/pi-hole/js/index.js +++ b/scripts/pi-hole/js/index.js @@ -775,7 +775,7 @@ function updateSummaryData(runOnce) { }); } -$(document).ready(function () { +$(function () { // Pull in data via AJAX updateSummaryData(); diff --git a/scripts/pi-hole/js/messages.js b/scripts/pi-hole/js/messages.js index e1bc20b39..3d27f36fa 100644 --- a/scripts/pi-hole/js/messages.js +++ b/scripts/pi-hole/js/messages.js @@ -62,7 +62,7 @@ function renderMessage(data, type, row) { } } -$(document).ready(function () { +$(function () { $("#messagesTable").DataTable({ ajax: { url: "api_db.php?messages", diff --git a/scripts/pi-hole/js/network.js b/scripts/pi-hole/js/network.js index 4ea3c20fc..88b94db34 100644 --- a/scripts/pi-hole/js/network.js +++ b/scripts/pi-hole/js/network.js @@ -63,7 +63,7 @@ function parseColor(input) { } } -$(document).ready(function () { +$(function () { tableApi = $("#network-entries").DataTable({ rowCallback: function (row, data) { var color, diff --git a/scripts/pi-hole/js/queries.js b/scripts/pi-hole/js/queries.js index 7877d2912..0348504ed 100644 --- a/scripts/pi-hole/js/queries.js +++ b/scripts/pi-hole/js/queries.js @@ -107,7 +107,7 @@ function autofilter() { return $("#autofilter").prop("checked"); } -$(document).ready(function () { +$(function () { // Do we want to filter queries? var GETDict = {}; window.location.search diff --git a/scripts/pi-hole/js/queryads.js b/scripts/pi-hole/js/queryads.js index 6fb340c72..676531772 100644 --- a/scripts/pi-hole/js/queryads.js +++ b/scripts/pi-hole/js/queryads.js @@ -121,6 +121,6 @@ $(window).on("resize", function () { .addClass("input-group-btn"); } }); -$(document).ready(function () { +$(function () { $(window).trigger("resize"); }); diff --git a/scripts/pi-hole/js/settings.js b/scripts/pi-hole/js/settings.js index f6f106920..375980072 100644 --- a/scripts/pi-hole/js/settings.js +++ b/scripts/pi-hole/js/settings.js @@ -167,7 +167,7 @@ function loadCacheInfo() { } var leasetable, staticleasetable; -$(document).ready(function () { +$(function () { if (document.getElementById("DHCPLeasesTable")) { leasetable = $("#DHCPLeasesTable").DataTable({ dom: "<'row'<'col-sm-12'tr>><'row'<'col-sm-6'i><'col-sm-6'f>>", @@ -225,7 +225,7 @@ $(function () { }); // DHCP leases tooltips -$(document).ready(function () { +$(function () { $('[data-toggle="tooltip"]').tooltip({ html: true, container: "body" }); }); @@ -241,7 +241,7 @@ $(".nav-tabs a").on("shown.bs.tab", function (e) { }); // Auto dismissal for info notifications -$(document).ready(function () { +$(function () { var alInfo = $("#alInfo"); if (alInfo.length > 0) { alInfo.delay(3000).fadeOut(2000, function () {