Skip to content

samcolby/bigdavebookmarklet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 

Repository files navigation

bigdavebookmarklet

Bookmarklet for bigdave44.com

Use https://mrcoles.com/bookmarklet/ to create bookmarklet code

The generated code can be copied from below. Create a new bookmark and paste this in

javascript:(function()%7Bconst%20clues%20%3D%20%5B%221a%20%22%2C%222a%20%22%2C%223a%20%22%2C%224a%20%22%2C%225a%20%22%2C%226a%20%22%2C%227a%20%22%2C%228a%20%22%2C%229a%20%22%2C%2210a%22%2C%2211a%22%2C%2212a%22%2C%2213a%22%2C%2214a%22%2C%2215a%22%2C%2216a%22%2C%2217a%22%2C%2218a%22%2C%2219a%22%2C%2220a%22%2C%2221a%22%2C%2222a%22%2C%2223a%22%2C%2224a%22%2C%2225a%22%2C%2226a%22%2C%2227a%22%2C%2228a%22%2C%2229a%22%2C%2230a%22%2C%2231a%22%2C%2232a%22%2C%2233a%22%2C%2234a%22%2C%2235a%22%2C%2236a%22%2C%2237a%22%2C%2238a%22%2C%2239a%22%2C%221d%20%22%2C%222d%20%22%2C%223d%20%22%2C%224d%20%22%2C%225d%20%22%2C%226d%20%22%2C%227d%20%22%2C%228d%20%22%2C%229d%20%22%2C%2210d%22%2C%2211d%22%2C%2212d%22%2C%2213d%22%2C%2214d%22%2C%2215d%22%2C%2216d%22%2C%2217d%22%2C%2218d%22%2C%2219d%22%2C%2220d%22%2C%2221d%22%2C%2222d%22%2C%2223d%22%2C%2224d%22%2C%2225d%22%2C%2226d%22%2C%2227d%22%2C%2228d%22%2C%2229d%22%2C%2230d%22%2C%2231d%22%2C%2232d%22%2C%2233d%22%2C%2234d%22%2C%2235d%22%2C%2236d%22%2C%2237d%22%2C%2238d%22%2C%2239d%22%5D%3Bconst%20arrAnchorIds%20%3D%20clues.map(%20(clue)%20%3D%3E%20'jsanchor-'%20%2B%20clue.trim()%20)%3Bconst%20arrReplaceRegexs%20%3D%20clues.map(%20(clue)%20%3D%3E%20new%20RegExp(%20'%5C%5Cb'%20%2B%20clue.trim()%2C%20%22gi%22%20)%20)%3Bconst%20createAnchors%20%3D%20()%20%3D%3E%20%7Bconst%20getClueNo%20%3D%20(text)%20%3D%3E%20text.substring(0%2C3).replace(%2F%5Cs%2Fg%2C%20%22%20%22)%3Bconst%20insertAnchor%20%3D%20(tag%2C%20clueNo)%20%3D%3E%20%7Bconst%20anchor%20%3D%20document.createElement(%22a%22)%3Bconst%20anchorName%20%3D%20arrAnchorIds%5Bclues.indexOf(clueNo)%5D%3Banchor.name%20%3D%20anchorName%3Banchor.id%20%3D%20anchorName%3Btag.insertBefore(%20anchor%2C%20tag.firstChild%20)%3B%7D%3Bconst%20insertAnchorsToClues%20%3D%20(tag%2C%20i)%20%3D%3E%20%7Bconst%20html%20%3D%20tag.innerText.trim()%3Bconst%20clueNo%20%3D%20getClueNo(%20html%20)%3Bif%20(%20clueNo%20%26%26%20clues.includes(%20clueNo%20)%20)%20%7BinsertAnchor(tag%2C%20clueNo)%3B%7D%7D%3Bconst%20entries%20%3D%20document.getElementsByClassName(%22entry-content%22)%3Bconst%20pTags%20%3D%20entries%5B0%5D.getElementsByTagName(%22p%22)%3BArray.from(pTags).map(insertAnchorsToClues)%3B%7D%3Bconst%20createLinks%20%3D%20()%20%3D%3E%20%7Bconst%20anchorExists%20%3D%20(idx)%20%3D%3E%20document.getElementById(%20arrAnchorIds%5Bidx%5D%20)%3Bconst%20replaceCommentedCluesWithLinks%20%3D%20(tag%2C%20i)%20%3D%3E%20%7Blet%20html%20%3D%20tag.innerHTML%3Bfor%20(%20i%20%3D%200%3B%20i%20%3C%20clues.length%3B%20i%2B%2B%20)%20%7Bif%20(%20anchorExists(i)%20)%20%7Bhtml%20%3D%20html.replace(%20arrReplaceRegexs%5Bi%5D%2C%20'%20%3Ca%20href%3D%22%23'%20%2B%20arrAnchorIds%5Bi%5D%20%2B%20'%22%20title%3D%22Goto%20to%20clue%20definition%22%3E'%20%2B%20clues%5Bi%5D.trim()%20%2B%20'%3C%2Fa%3E')%3B%7D%7Dtag.innerHTML%20%3D%20html%3B%7D%3Bconst%20comments%20%3D%20document.querySelectorAll(%22.comment-text%2C%20.comment-content%22)%3BArray.from(comments).map(replaceCommentedCluesWithLinks)%3B%7D%3BcreateAnchors()%3BcreateLinks()%7D)()

About

Bookmarklet for bigdave44.com

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published