From db52ff488e98543c821b42488d01bb8c05333158 Mon Sep 17 00:00:00 2001 From: Jonathan Hodgson Date: Thu, 4 Oct 2018 16:49:00 +0100 Subject: [PATCH] Add bitbucket dotjs script --- config/dotjs/bitbucket.org.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 config/dotjs/bitbucket.org.js diff --git a/config/dotjs/bitbucket.org.js b/config/dotjs/bitbucket.org.js new file mode 100644 index 00000000..382bb409 --- /dev/null +++ b/config/dotjs/bitbucket.org.js @@ -0,0 +1,23 @@ +((() => { + const domLoaded = function domLoaded(){ + document.removeEventListener("readystatechange",domLoaded); + document.querySelectorAll("li").forEach(li => { + console.log(li); + if( li.innerHTML.indexOf( '[' ) !== -1 ){ + li.innerHTML = li.innerHTML.replace(/\[ \]/g, '☐'); + li.innerHTML = li.innerHTML.replace(/\[x\]/g, '☒'); + } + } ); + } + + console.log("I get here"); + if(document.readyState == "loading"){ + + //If the dom hasn't loaded, wait until it is + document.addEventListener("readystatechange",domLoaded); + return; + } else { + //If it has, run the domLoaded function + domLoaded(); + } +}))();