User:Rigel Kent/common.js

/* Fix doubled titles from Dofus's news feed *********************************** * * Description: Dofus's news feed uses invalid RSS syntax which causes Wikia's * RSS plugin to show a "doubled titledoubled title". Chops the title in half. */ function fixRSSTitles { var newsElement = document.getElementById("newnews"); var elementsToFix = newsElement.getElementsByTagName("b"); elementsToFix[0].innerHTML = elementsToFix[0].innerHTML.substring(0, elementsToFix[0].innerHTML.length / 2);

newsElement = document.getElementById("oldnews"); elementsToFix = newsElement.getElementsByTagName("a"); for(var i = 0; i < elementsToFix.length, i++) {   elementsToFix[i].innerHTML = elementsToFix[i].innerHTML.substring(0, elementsToFix[0].innerHTML.length / 2); } } addOnloadHook( fixRSSTitles );