User:Anerisys/vector.js

var contribution_day = 0; var contribution_count = 0;

if (	mw.config.get("wgNamespaceNumber") == -1 // checks "Special" name space	&& mw.config.get("wgCanonicalSpecialPageName") == "Contributions" // checks if it is a contributions page	&& document.getElementsByClassName("mw-contributions-list") // contributions list not empty	&& ( ! document.getElementsByClassName("mw-changeslist-links")[1].getElementsByTagName("span")[2] ) // not already added ) {

var mw_contributions_list = document.getElementsByClassName("mw-contributions-list");

for ( contribution_day = 0; contribution_day < mw_contributions_list.length; contribution_day++ ) {

for ( contribution_count = 0; contribution_count < mw_contributions_list[contribution_day].getElementsByTagName("li").length; contribution_count++ ) {

var contribution = mw_contributions_list[contribution_day].getElementsByTagName("li")[contribution_count]; if (contribution.querySelector(".mw-changeslist-links") ) { edit_page_URL = mw.util.getUrl( contribution.querySelector(".mw-contributions-title").innerHTML, { "action": "edit" } ); contribution.querySelector(".mw-changeslist-links").appendChild(document.createElement("span")); contribution.querySelector(".mw-changeslist-links").lastElementChild.classList.add("mw-changeslist-edit"); contribution.querySelector(".mw-changeslist-links").lastElementChild.innerHTML=" edit"; }		}	}	console.log("contribution_day","contribution_count"); }

/* User contributions edit shortcut */