Last active
August 29, 2015 13:56
-
-
Save KushalP/9306626 to your computer and use it in GitHub Desktop.
Bookmarklet that replaces uses of IL0...IL9 with random colours of the rainbow.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Paste the below into your address bar where the "Impact Level" acronym is used. | |
javascript:function replaceILUse(){function randomRainbowColour(){return ["Red","Orange","Yellow","Green","Blue","Indigo","Violet"].sort(function(){return 0.5-Math.random()})[0]}function rainbowMatcher(match,p1,offset,string){return randomRainbowColour()}var original=document.body.innerHTML;document.body.innerHTML=original.replace(/IL[0-9]/ig,rainbowMatcher)}replaceILUse(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function replaceILUse() { | |
function randomRainbowColour() { | |
return ["Red", "Orange", "Yellow", "Green", "Blue", "Indigo", "Violet"]. | |
sort(function() { return 0.5 - Math.random(); })[0]; | |
} | |
function rainbowMatcher(match, p1, offset, string) { | |
return randomRainbowColour(); | |
} | |
var original = document.body.innerHTML; | |
document.body.innerHTML = original.replace(/IL[0-9]/ig, rainbowMatcher); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment