- Profile
- Images
Location: [unknown]
Surnames/tags: javascript bookmarklets ui
This page is a work in progress.
Contents |
What is a Bookmarklet?
Bookmarklets are small scripts that live in your bookmarks bar. They contain segments of Javascript code that can interact with the page you are currently viewing to add functionality and change the user interface.
Bookmarklets do not modify Wikitree or any sites in any permanent way. They only help change the appearance and usability of the site for the person using them.
How to install
Desktop
Mobile
List of Bookmarklets
Link Generator for Profiles
This bookmarklet looks at the current page and generates a link that can be used in profiles. It generates the link or template in formats that follow official Wikitree guidance.
- Last Updated: 6/14/2020
- Source: Github
Compiled Bookmark Code:
javascript:(function()%7Bfunction%20parse_ancestry(e)%7Blet%20t%3D%22%22%2Ci%3D%22%22%3Breturn%20e.replace(%2F(%5C%3Fbackurl%3D.*)%2F%2C%22%22)%2Ct%3De.includes(%22%2Finteractive%22)%3Fnull!%3D(i%3De.match(%2F.*interactive%5C%2F(%5B%5Cw-%5D*)%5C%2F((.*imageId%3D(%5B%5Cw-%5D*))%7C(%5B%5Cw-%5D*))%2F))%5B4%5D%3F%22%7B%7BAncestry%20Image%7C%22%2Bi%5B1%5D%2B%22%7C%22%2Bi%5B4%5D%2B%22%7D%7D%22%3A%22%7B%7BAncestry%20Image%7C%22%2Bi%5B1%5D%2B%22%7C%22%2Bi%5B2%5D%2B%22%7D%7D%22%3Ae.includes(%22imageviewer%2Fcollections%22)%3F%22%7B%7BAncestry%20Image%7C%22%2B(i%3De.match(%2F.*imageviewer%5C%2Fcollections%5C%2F(%5B%5Cw-%5D*)%5C%2Fimages%5C%2F(%5B%5Cw-%5D*)%5C%3F.*%2F))%5B1%5D%2B%22%7C%22%2Bi%5B2%5D%2B%22%7D%7D%22%3Ae.includes(%22%2Fmediaui-viewer%2F%22)%3F%22%7B%7BAncestry%20Tree%20Media%7C%22%2B(i%3De.match(%2F.*mediaui-viewer%5C%2Ftree%5C%2F(%5B%5Cw-%5D*).*%5C%2Fmedia%5C%2F(%5B%5Cw-%5D*)(%5C%3F%7C%24%7C%5Cb)%2F))%5B1%5D%2B%22%7C%22%2Bi%5B2%5D%2B%22%7D%7D%22%3Ae.includes(%22family-tree%22)%3F%22person%22%3D%3D(i%3De.match(%2F.*%5C%2Ftree%5C%2F(%5B%5Cw-%5D*)%5C%2F(media%7Cperson)%5C%2F(%5B%5Cw-%5D*)%2F))%5B2%5D%3F%22%7B%7BAncestry%20Tree%7C%22%2Bi%5B1%5D%2B%22%7C%22%2Bi%5B3%5D%2B%22%7D%7D%22%3A%22%7B%7BAncestry%20Tree%20Media%7C%22%2Bi%5B1%5D%2B%22%7C%22%2Bi%5B3%5D%2B%22%7D%7D%22%3Ae.match(%2F.*%5C%2Fpt%5C%2F.*tid%3D(%5B%5Cw-%5D*)%26.*pid%3D(%5B%5Cw-%5D*)%2F)%3F%22%7B%7BAncestry%20Tree%7C%22%2B(i%3De.match(%2F.*tid%3D(%5B%5Cw-%5D*)%26.*pid%3D(%5B%5Cw-%5D*)%2F))%5B1%5D%2B%22%7C%22%2Bi%5B2%5D%2B%22%7D%7D%22%3Ae.match(%2F.*db(id)%3F%3D(%5Cw*)%26.*h%3D(%5Cw*)(%26%7C%24%7C%5Cb)%2F)%3F%22com%22!%3D(i%3De.match(%2F.*ancestry.*%5C.(%5Ba-z%5D%7B2%2C3%7D)%5C%2F.*db(id)%3F%3D(%5Cw*)%26.*h%3D(%5Cw*)(%26%7C%24%7C%5Cb)%2F))%5B1%5D%3F%22%7B%7BAncestry%20Record%7C%22%2Bi%5B3%5D%2B%22%7C%22%2Bi%5B4%5D%2B%22%7C%22%2Bi%5B1%5D%2B%22%7D%7D%22%3A%22%7B%7BAncestry%20Record%7C%22%2Bi%5B3%5D%2B%22%7C%22%2Bi%5B4%5D%2B%22%7D%7D%22%3A%22%5B%22%2Be%2B%22%20Ancestry%20Link%5D%22%7Dfunction%20parse_wikitree(e)%7Blet%20t%3D%22%22%2Ci%3D%22%22%3Bif(e.includes(%22%2Fphoto%22))%7Blet%20e%3D%24('link%5Brel*%3D%22image_src%22%5D').attr(%22href%22)%3Bt%3D%22%5B%5B%3Aimage%3A%22%2B(e%3De.substr(e.lastIndexOf(%22%2F%22)%2B1))%2B%22%7C%22%2B%24(%22title%22).text()%2B%22%5D%5D%22%7Delse%20e.match(%2F.*wikitree%5C.com%5C%2Fwiki%5C%2F(%5Cw*-%5Cd*)(%24%7C%5Cb)%2F)%3Ft%3D%22%5B%5B%22%2B(i%3De.match(%2F.*wikitree%5C.com%5C%2Fwiki%5C%2F(%5Cw*-%5Cd*)(%24%7C%5Cb)%2F))%5B1%5D%2B%22%7C%22%2B%24('h1%20span%5Bitemprop*%3D%22name%22%5D').text()%2B%22%5D%5D%22%3Ae.match(%2F.*wikitree%5C.com%5C%2Fwiki%5C%2F(Space%3A.*)(%24%7C%5Cb)%2F)%3Ft%3D%22%5B%5BSpace%3A%22%2B(i%3D%24(%22h1%22).text())%2B%22%7C%22%2Bi%2B%22%5D%5D%22%3Ae.match(%2F.*wikitree%5C.com%5C%2Fwiki%5C%2F(Category%3A.*)(%24%7C%5Cb)%2F)%26%26(t%3D%22%5B%5B%3A%22%2B(i%3D%24(%22h1%22).text())%2B%22%7C%22%2Bi%2B%22%5D%5D%22)%3Breturn%20t%7Dfunction%20parse_findgrave(e)%7Blet%20t%3D%22%22%2Ci%3D%22%22%3Breturn%20e.includes(%22%2Fmemorial%22)%3F(i%3De.match(%2F.*memorial%5C%2F(%5Cd*)(%5C%2F%7C%24%7C%5Cb)%2F)%2Ct%3D%22Find%20A%20Grave%2C%20database%20and%20images%20(accessed%20%22%2B(new%20Date).toLocaleDateString()%2B%22)%2C%20memorial%20page%20for%20%22%2B%24(%22%23bio-name%22).text()%2B%22%2C%20%7B%7BFindAGrave%7C%22%2Bi%5B1%5D%2B%22%7D%7D.%20Maintained%20by%20Find%20A%20Grave.%22)%3At%3D%22%5B%22%2Be%2B%22%20Find%20a%20Grave%20Link%5D%22%2Ct%7Dconst%20copyToClipBoard%3De%3D%3E%7Bconst%20t%3Ddocument.createElement(%22textarea%22)%3Bt.value%3De%2Cdocument.body.appendChild(t)%2Ct.select()%2Cdocument.execCommand(%22copy%22)%2Cdocument.body.removeChild(t)%7D%3Bfunction%20host_router(e%2Ct)%7Blet%20i%3D%22%22%3Breturn%20e.includes(%22.ancestry.%22)%3Fi%3Dparse_ancestry(t)%3Ae.includes(%22.findagrave.%22)%3Fi%3Dparse_findgrave(t)%3Ae.includes(%22.wikitree.%22)%26%26(i%3Dparse_wikitree(t))%2C%22%22%3D%3Di%26%26(i%3D%22%5B%22%2Bt%2B%22%20Link%5D%22)%2Ci%7Dlet%20link%3Dhost_router(location.host%2Cwindow.location.href)%3BcopyToClipBoard(link)%2Cconsole.log(link)%7D)()
Functionality Overview:
This bookmarklet creates wikitree formatted links that can be used in profiles. It currently supports the following:
Ancestry.com
Link formats are taken from this document: Help:Links_to_Ancestry
URL structures supported:
- Records:
{{Ancestry Record|1234|5678}}
- Images:
{{Ancestry Image|1234|5678}}
- Trees
{{Ancestry Tree|1234|5678}}
- Family Tree Media
{{Ancestry Tree Media|1234|5678}}
Find-a-Grave Find-a-Grave links work slightly differently. The bookmarklet provides the whole citation rather than just the link.
For example:
- If you are visiting this page: and use the bookmarklet.
https://www.findagrave.com/memorial/104098549/james-w-wetzel
The following citation will be copied into your clipboard:Find A Grave, database and images (accessed 6/14/2020), memorial page for James W Wetzel , Find A Grave: Memorial #104098549. Maintained by Find A Grave.
Wikitree
Other
For all other urls not outlined above, the bookmark will create a link in the format:[Current_URL Link]
For example:
- If you are viewing and you click the link, your clipboard will now contain:
www.google.com
[https://www.google.com Link]
How to create a bookmarklet from Javasript
Contribution Guidelines
Additional References
- Login to edit this profile and add images.
- Private Messages: Send a private message to the Profile Manager. (Best when privacy is an issue.)
- Public Comments: Login to post. (Best for messages specifically directed to those editing this profile. Limit 20 per day.)