Skip to content

Commit b27b129

Browse files
committed
Update common.js
1 parent e1221e9 commit b27b129

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/core/common.js

+15
Original file line numberDiff line numberDiff line change
@@ -1485,12 +1485,27 @@ export async function addEmailToTrustedList(email) {
14851485
$("input[type='submit'][value='Add this Person']").trigger("click");
14861486
}
14871487

1488+
// Remove email from Trusted List
1489+
export async function removeEmailFromTrustedList(email) {
1490+
const theLink = $("a:contains('" + email + "')");
1491+
const checkbox = theLink.closest("tr").find("input[type='checkbox']");
1492+
checkbox.prop("checked", true);
1493+
$("input[type='submit'][value='Remove Selected People']").trigger("click");
1494+
}
1495+
14881496
if (window.location.href.includes("TrustedList") && window.location.href.includes("AddEmail")) {
14891497
// Get email from the URL
14901498
const email = new URLSearchParams(window.location.search).get("AddEmail");
14911499
if (email) {
14921500
addEmailToTrustedList(email);
14931501
}
14941502
}
1503+
if (window.location.href.includes("TrustedList") && window.location.href.includes("RemoveEmail")) {
1504+
// Get email from the URL
1505+
const email = new URLSearchParams(window.location.search).get("RemoveEmail");
1506+
if (email) {
1507+
removeEmailFromTrustedList(email);
1508+
}
1509+
}
14951510

14961511
////////// End of Notables Project things

0 commit comments

Comments
 (0)