Skip to content

Instantly share code, notes, and snippets.

@jakebox
Last active April 3, 2022 00:57
Show Gist options
  • Save jakebox/e7a7f976d647e0c27cd1f875c0e9e0b3 to your computer and use it in GitHub Desktop.
Save jakebox/e7a7f976d647e0c27cd1f875c0e9e0b3 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name Ancestry Add Relative Shortcut
// @namespace jakebox.scripts
// @match *://*.ancestry.com/*
// @grant none
// @version 1.0
// @author Jake B, www.github.com/jakebox
// @description 12/25/2020, 4:46:35 PM
// ==/UserScript==
// This script provides two new shortcuts for Ancestry.com, a keychord to open the add relative window
// and a keychord to add a child. These keychords can really help make adding in a large number of people.
// The author suggests binding the keychords to a mouse with buttons for extra speed.
// To use, click on the person icon in the tree view and use one of the bindings.
// Add Child (relative but with an extra step basically)
(function(){
document.addEventListener('keydown', function(c) {
// pressed Shift-Control-Alt-c
if (c.keyCode == 67 && c.shiftKey && c.ctrlKey && c.altKey && !c.metaKey) {
document.getElementById('hoverCardToolsButton').click();
setTimeout(function() {
// document.getElementById("hoverAddRelativeLink").click() -- OBSOLETE APR 2021
document.getElementsByClassName('link icon iconPlus')[0].click();
}, 50);
setTimeout(function() {
document.getElementById("ChildAddLnk").click()
}, 450);
}
}, false);
})();
// Add Relative
(function(){
document.addEventListener('keydown', function(r) {
// pressed Shift-Control-Alt-r
if (r.keyCode == 82 && r.shiftKey && r.ctrlKey && r.altKey && !r.metaKey) {
document.getElementById('hoverCardToolsButton').click();
setTimeout(function() {
// document.getElementById("hoverAddRelativeLink").click() -- OBSOLETE APR 2021
document.getElementsByClassName('link icon iconPlus')[0].click();
}, 50);
}
}, false);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment