upload image

JS BookMarklet convert GRO Birth to WT ready detail and source

Privacy Level: Open (White)
Date: [unknown] [unknown]
Location: [unknown]
Surnames/tags: developers wt_apps
Profile manager: Veni Joyner private message [send private message]
This page has been accessed 79 times.

JS BookMarklet convert GRO Birth to WT ready detail and source

This Javascript bookmarklet is to be manually added to a browser (currently tested on firefox only) bookmark. When on the GRO website (UK General Registry Office) with an active birth result, click this bookmark to activate the radio buttons (this has to be done with every new birth result's page). There is no obvious change to the page but when a radio button is clicked a textbox appears with data from the birth clicked formated into a wikitree biography ready format with an adequate source included - just copy and paste into the person's wt profile.

javascript:{function toProperCase(str){return str.replace(/\w\S*/g, function(txt){return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();});} var GRO_Gender=['the','the','her','his']; var quarter={M:'Jan and Mar',J:'Apr and Jun',S:'Jul and Sep',D:'Oct and Dec'}; function DisplayInlineMenu(resultid) { var x=document.getElementById(resultid); x.innerHTML=''; var tableCell=x.parentNode; var tableRow=tableCell.parentNode; var nameCellContents=tableRow.previousElementSibling.innerHTML; var FoundNames_Array=new Array(); var GROBirthNames_regex=/[.\n]*?\<strong\>(.*?),\<\/strong\>\ [\n\s\<i(?=\>)\>]*([\w -]*).*[\n\s]*?\s*(.*?)\ (.*?)\ [\n\s]*.+[\n\s]+.+[\n\s]+\<strong\>[\n\s]+(\<i\>)*([\w -]*)/m ; FoundNames_Array = GROBirthNames_regex.exec(nameCellContents); var FoundDetails_Array=new Array(); var GROBirthDetail_regex= /(\d\d\d\d)\n\s*\ ([MJSD])\&.*\n\s*in (.*)\n\s*.*?Volume\ (.*)\n\s*.*?Page\ (.*)/m ; var GROBirthDetailNew_regex= /Q(\d).(\d\d\d\d)\n\s*in (.*)\n\s*.*[\n\s]*.*?Volume\ (.*)\n\s*.*?Page\ (.*)/m ; FoundDetails_Array= GROBirthDetail_regex.exec(tableCell.innerHTML); if(FoundDetails_Array==null){FoundDetails_Array= GROBirthDetailNew_regex.exec(tableCell.innerHTML);} x.innerHTML='<textarea name="inbox" onblur="GROBirth_outboxReset(); return false;" rows="10" cols=96% style="max-width: 100%;">The birth of [['+(FoundNames_Array!=null?toProperCase(FoundNames_Array[2])+(FoundNames_Array[3]!=''?' '+toProperCase(FoundNames_Array[3]):'')+(FoundNames_Array[4]!=''?' '+toProperCase(FoundNames_Array[4]):'')+' '+ FoundNames_Array[1]+']] was registered with ':nameCellContents)+(window.document.SearchIndexes.Gender.selectedIndex>0?GRO_Gender[window.document.SearchIndexes.Gender.selectedIndex]:'')+" mother's maiden name listed as "+FoundNames_Array[6]+', between '+(FoundDetails_Array!=null?quarter[FoundDetails_Array[2]]+' '+FoundDetails_Array[1]+' in the GRO registration district of '+toProperCase(FoundDetails_Array[3])+', United Kingdom.<ref>GROBirth: General Register Office - Births; Index of England and Wales Birth Registrations; [http://www.nationalarchives.gov.uk/information-management/re-using-public-sector-information/uk-government-licensing-framework/crown-copyright/ Crown Copyright]; online repository search https://www.gro.gov.uk/gro/content/certificates/indexes_search.asp ; Volume '+FoundDetails_Array[4]+', Page '+FoundDetails_Array[5]+'</ref>\n\n':tableCell.innerHTML)+'</textarea>'; if(x.style.display === "none"){x.style.display = "block"; } else if(x.style.display == ""){x.style.display = "block"; } else{x.style.display = "none";} }}

  • 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.)


Leave a message for others who see this profile.
There are no comments yet.
Login to post a comment.