Jump to content

User:Wugapodes/Add tools links.js

From Wikipedia, the free encyclopedia
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
//Sidebar links
var makeLink = function(title, target, tooltip) {
	var link = document.createElement("a");
	link.setAttribute("href","/wiki/".concat(target))
	link.setAttribute("title",tooltip)
	link.innerHTML = title
	
	var tID = "t-".concat(title);
	var listItem = document.createElement("li");
	listItem.setAttribute("id",tID)
	
	listItem.appendChild(link)
	return(listItem)
}

var addToolsLink = function(title, target, tooltip) {
	var tools = document.getElementById("p-tb").getElementsByTagName("ul")[0]
	var link = makeLink(title, target, tooltip)
	tools.appendChild(link)
}

addToolsLink('WugBot','User:WugBot','My bot.');
addToolsLink('JavaScript','User:Wugapodes/common.js','My common.js page.');
addToolsLink('Capricorn','User:Wugapodes/Capricorn','Redirect script doc page.');
addToolsLink('Pending changes', 'Special:PendingChanges', 'Queue of revisions awaiting review.');
addToolsLink('Page curation', 'Special:NewPagesFeed', 'New page curation feed.');