Remove unused/dead old code

- "quiet" option and related functions (used by blocking page);
- "adlist" option (used by blocking page).

Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
This commit is contained in:
RD WebDesign
2023-01-13 14:38:12 -03:00
parent 393302efbc
commit 9c62cc5225
2 changed files with 3 additions and 30 deletions

View File

@@ -8,35 +8,16 @@
var exact = "";
var showAll = "";
function quietfilter(ta, data) {
var lines = data.split("\n");
for (var i = 0; i < lines.length; i++) {
if (lines[i].indexOf("results") !== -1 && lines[i].indexOf("0 results") === -1) {
var shortstring = lines[i].replace("::: /etc/pihole/", "");
// Remove "(x results)"
shortstring = shortstring.replace(/\(.*/, "");
ta.append(shortstring + "\n");
}
}
}
function eventsource() {
var ta = $("#output");
// process with the current visible domain input field
var domain = $("input[id^='domain']:visible").val().trim().toLowerCase();
var q = $("#quiet");
var unlimited = $("#show-all").is(":checked");
if (domain.length === 0) {
return;
}
var quiet = false;
if (q.val() === "yes") {
quiet = true;
exact = "&exact";
}
if (unlimited === true) {
showAll = "&showall";
}
@@ -52,11 +33,7 @@ function eventsource() {
}).done(function (data) {
ta.show();
ta.empty();
if (!quiet) {
ta.append(data);
} else {
quietfilter(ta, data);
}
ta.append(data);
});
return;
}
@@ -70,11 +47,7 @@ function eventsource() {
source.addEventListener(
"message",
function (e) {
if (!quiet) {
ta.append(e.data);
} else {
quietfilter(ta, e.data);
}
ta.append(e.data);
},
false
);