User:Peteparker/beta.js

// function editLinks{ if (pageTitle.indexOf("User talk:")==-1){ var content = document.getElementById('bodyContent'); var editLinks = content.getElementsByTagName("h2"); changeLinks(editLinks);

editLinks = content.getElementsByTagName("h3"); changeLinks(editLinks); } }

function changeLinks(editLinks){ var pageTitle = ""+wgPageName; for (var i = 0; i < editLinks.length; i++){ var editLink = editLinks[i].childNodes.item(1).childNodes.item(1); if (editLink != null){ var oldLink = editLink.href; var newLink = oldLink.replace("/Appearances_Synopsis", ""); newLink = newLink.replace("Marvel_Database:Comic_Template/Header", pageTitle); newLink = newLink.replace("Marvel_Database:Comic_Template", pageTitle); newLink = newLink.replace("Marvel_Database:Character_Template/Header", pageTitle); newLink = newLink.replace("Marvel_Database:Character_Template", pageTitle); newLink = newLink.replace("&section=T-10", ""); newLink = newLink.replace("&section=T-11", ""); newLink = newLink.replace("&section=T-12", ""); newLink = newLink.replace("&section=T-13", ""); newLink = newLink.replace("&section=T-14", ""); newLink = newLink.replace("&section=T-15", ""); newLink = newLink.replace("&section=T-16", ""); newLink = newLink.replace("&section=T-17", ""); newLink = newLink.replace("&section=T-1", ""); newLink = newLink.replace("&section=T-2", ""); newLink = newLink.replace("&section=T-3", ""); newLink = newLink.replace("&section=T-4", ""); newLink = newLink.replace("&section=T-5", ""); newLink = newLink.replace("&section=T-6", ""); newLink = newLink.replace("&section=T-7", ""); newLink = newLink.replace("&section=T-8", ""); newLink = newLink.replace("&section=T-9", ""); newLink = newLink.replace("_&_", "_%26_"); editLink.href = newLink; editLink.title = pageTitle.replace(/_/g, " "); editLink.title = editLink.title.replace("Comics:", "Edit: "); editLink.title = editLink.title.replace(" Vol 1 ", " #"); //editLink.innerHTML = "Done!"; }	} } //