Jump to content

User:Codl/vector.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.
$(function(){
	
	const menu_ul = document.querySelector("#p-interaction .vector-menu-content ul");
	
	function add_contribute_link(href, text) {
		var li = document.createElement('li');
		var link = document.createElement('a');
		var span = document.createElement('span');
		
		link.href = href;
		li.classList.add("mw-list-item");
		
		span.appendChild(document.createTextNode(text));
		link.appendChild(span);
		li.appendChild(link);
		menu_ul.appendChild(li);
	}
	
	add_contribute_link('/wiki/Wikipedia:Task_Center', 'WP:Tasks');
	add_contribute_link('/wiki/Wikipedia:Community_portal/Opentask', 'WP:Open tasks');
	add_contribute_link('/wiki/Wikipedia:Backlog', 'WP:Backlog');
});