From 31824d8127ca0befdf8086eee4f979a52ee7f4b3 Mon Sep 17 00:00:00 2001 From: Isaac Khor Date: Mon, 12 Mar 2018 22:10:01 +0800 Subject: [PATCH] Remove link_hinting.coffee --- src/link_hinting.coffee | 47 ----------------------------------------- 1 file changed, 47 deletions(-) delete mode 100644 src/link_hinting.coffee diff --git a/src/link_hinting.coffee b/src/link_hinting.coffee deleted file mode 100644 index 224f9651..00000000 --- a/src/link_hinting.coffee +++ /dev/null @@ -1,47 +0,0 @@ -# Inspired by QuantumVim: https://github.com/shinglyu/QuantumVim - -BACKGROUND_COLOUR = "yellow" - -highlight_links = () -> - links = document.querySelectorAll('a') # Just handles links, not buttons/inputs etc. - code = 0 - for link in links - link_highlight(link, code) - code +=1 - - console.log(LINK_CODES) - return code - -LINK_CODES = {} - -link_highlight = (elem, code) -> - elem._background = elem.style.backgroundColor - elem._position = elem.style.position - # Why are these being saved? - elem.style.backgroundColor = BACKGROUND_COLOUR - elem.style.position="relative" - codehint = generate_codehint(code) - elem.appendChild(codehint) - LINK_CODES[String(code)] = { - element: elem - codehint - } - -generate_codehint = (code) -> - codehint = document.createElement('span') - codehint.textContent = "" + code - codehint.style.border = "solid 1 px black" - codehint.style.backgroundColor="white" - codehint.style.font="12px/14px bold sans-serif" - codehint.style.color="darkred" - codehint.style.position="absolute" - codehint.style.top="0" - codehint.style.left="0" - codehint.style.padding="0.1em" - codehint - -linkMessageHandler = (message) -> - switch(message.command) - when "hint" then highlight_links() - -browser.runtime.onMessage.addListener(linkMessageHandler)