mirror of
https://github.com/pi-hole/web.git
synced 2025-12-24 12:48:29 +00:00
Merge branch 'development' into new/web_prefix
Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
@@ -63,29 +63,23 @@ function showSuggestDomains(value) {
|
||||
var newDomainEl = $("#new_domain");
|
||||
var suggestDomainEl = $("#suggest_domains");
|
||||
|
||||
try {
|
||||
// URL is not supported in all browsers, but we are in a try-block so we can ignore it
|
||||
// eslint-disable-next-line compat/compat
|
||||
var parts = new URL(value).hostname.split(".");
|
||||
var table = $("<table>");
|
||||
var parts = new URL(value).hostname.split(".");
|
||||
var table = $("<table>");
|
||||
|
||||
for (var i = 0; i < parts.length - 1; ++i) {
|
||||
var hostname = parts.slice(i).join(".");
|
||||
for (var i = 0; i < parts.length - 1; ++i) {
|
||||
var hostname = parts.slice(i).join(".");
|
||||
|
||||
table.append(
|
||||
$("<tr>")
|
||||
.append($('<td class="text-nowrap text-right">').text(i === 0 ? "Did you mean" : "or"))
|
||||
.append($("<td>").append(createButton(hostname)))
|
||||
);
|
||||
}
|
||||
|
||||
suggestDomainEl.slideUp("fast", function () {
|
||||
suggestDomainEl.html(table);
|
||||
suggestDomainEl.slideDown("fast");
|
||||
});
|
||||
} catch {
|
||||
hideSuggestDomains();
|
||||
table.append(
|
||||
$("<tr>")
|
||||
.append($('<td class="text-nowrap text-right">').text(i === 0 ? "Did you mean" : "or"))
|
||||
.append($("<td>").append(createButton(hostname)))
|
||||
);
|
||||
}
|
||||
|
||||
suggestDomainEl.slideUp("fast", function () {
|
||||
suggestDomainEl.html(table);
|
||||
suggestDomainEl.slideDown("fast");
|
||||
});
|
||||
}
|
||||
|
||||
function hideSuggestDomains() {
|
||||
|
||||
Reference in New Issue
Block a user