Created
November 22, 2011 04:50
-
-
Save fuba/1384920 to your computer and use it in GitHub Desktop.
dotjs script: replace Jimmy Wales to relevant image using jpg.to (en.wikipedia.org)
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 replaceJimmy () { | |
var wikiname = $("#firstHeading").text().replace(/\s+/g, '-'); | |
var divs = $("#centralNotice > div"); | |
if (divs.length) { | |
divs[0].style.backgroundImage = 'url("http://'+wikiname+'.jpg.to")'; | |
$("#cn-bold-blue-text").each(function(){ | |
this.innerHTML = this.innerHTML.replace(/Jimmy Wales/, wikiname); | |
}); | |
} | |
else { | |
window.setTimeout(replaceJimmy, 100); | |
} | |
} | |
window.addEventListener('load', replaceJimmy, false); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment