Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Relationship and surname from table_filters to surname_table #578

Draft
wants to merge 8 commits into
base: development
Choose a base branch
from
5 changes: 5 additions & 0 deletions src/core/pageType.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ export let isSpecialDNATests = false;
export let isDNADescendants = false;
// Special: WatchedList page
export let isSpecialWatchedList = false;
// Special: WatchedList page for free space pages
export let isSpecialWatchedListSpaces = false;
// Special: TrustedList page
export let isSpecialTrustedList = false;
// MergeEdit
Expand Down Expand Up @@ -357,6 +359,9 @@ if (domain.match("apps.wikitree.com")) {
uri.match(/\/index.php\?title=Special(:|%3A|%3a)WatchedList.*/g)
) {
isSpecialWatchedList = true;
if (uri.match(/do_s=1/g)) {
isSpecialWatchedListSpaces = true;
}
} else if (
uri.match(/\/Special(:|%3A|%3a)SearchPerson/g) ||
uri.match(/\/index.php\?title=Special(:|%3A|%3a)SearchPerson.*/g)
Expand Down
18 changes: 17 additions & 1 deletion src/features/remove_from_watchlist/remove_from_watchlist.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@ shouldInitializeFeature("removeFromWatchlist").then((result) => {
const profileRows = document.getElementsByTagName("tr");

for (let i = 1 /* skip table with sorting links */; i < profileRows.length; i++) {
const editLink = profileRows[i].getElementsByTagName("a")[3];
let editLink = findEditLink(profileRows, i);
if (editLink == null) {
console.warn("editLink missing");
continue;
}
var urlParams = new URLSearchParams(editLink.href);
if (urlParams.has("u")) {
//parent of edit link is td
Expand Down Expand Up @@ -103,6 +107,18 @@ shouldInitializeFeature("removeFromWatchlist").then((result) => {
});
nextButton.appendChild(orphanButton);
}

function findEditLink(profileRows, i) {
const aTags = profileRows[i].getElementsByTagName("a");
let editLink = null;
for (let j = 0; j < aTags.length; j++) {
if (aTags[j].href != null && aTags[j].href.includes("EditPerson")) {
editLink = aTags[j];
break;
}
}
return editLink;
}
});

async function DoOrphan() {
Expand Down
Loading
Loading