From b75ec4530cf74eb523f75208751bc40bc689e061 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20K=C3=B6nig?= Date: Thu, 1 Sep 2022 09:03:15 +0200 Subject: [PATCH 1/2] Add interpretation for Pi-hole message type ADLIST MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Christian König --- scripts/pi-hole/js/groups-adlists.js | 25 +++++++++++++++++++++++++ scripts/pi-hole/js/messages.js | 13 +++++++++++++ 2 files changed, 38 insertions(+) diff --git a/scripts/pi-hole/js/groups-adlists.js b/scripts/pi-hole/js/groups-adlists.js index 452c6aedf..e8e9cb2c5 100644 --- a/scripts/pi-hole/js/groups-adlists.js +++ b/scripts/pi-hole/js/groups-adlists.js @@ -10,6 +10,7 @@ var table; var groups = []; var token = $("#token").text(); +var GETDict = {}; function getGroups() { $.post( @@ -24,6 +25,13 @@ function getGroups() { } $(function () { + window.location.search + .substr(1) + .split("&") + .forEach(function (item) { + GETDict[item.split("=")[0]] = item.split("=")[1]; + }); + $("#btnAdd").on("click", addAdlist); utils.setBsSelectDefaults(); @@ -289,6 +297,11 @@ function initTable() { var applyBtn = "#btn_apply_" + data.id; + // Highlight row (if url parameter "adlistid=" is used) + if ("adlistid" in GETDict && data.id === parseInt(GETDict.adlistid, 10)) { + $(row).find("td").addClass("highlight"); + } + var button = '