Jump to content

User:Wugapodes/Add tools links.js

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Wugapodes (talk | contribs) at 23:59, 19 July 2019 (Undid revision 907030928 by Wugapodes (talk)). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
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.
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)
}