User:Dragon695/addlilink.js

User:Dragon695/addlilink.js - The addlilink and tab/toolbox helper functions based on WP:WPUS/Scripts/Add_LI_link.

Taken from User:Quarl/addlilink.js.

//

function getTabActions { return (document.getElementById('p-cactions').getElementsByTagName('ul')[0]); }

function getToolbox { return (document.getElementById('p-tb').getElementsByTagName('ul')[0]); }

function getNavigationBox { return (document.getElementById('p-navigation').getElementsByTagName('ul')[0]); }

function addTab(url, name, id, title, key) { addlilink(getTabActions, url, name, id, title, key); }

function addToolboxLink(url, name, id, title, key) { addlilink(getToolbox, url, name, id, title, key); }

function addNavigationLink(url, name, id, title, key) { addlilink(getNavigationBox, url, name, id, title, key); }

function addlilinkX(tabs, entry, id, title, key){ var li = document.createElement('li'); if (id) { li.id = id; }	if (typeof(entry) == 'string') { li.innerHTML = entry; } else { li.appendChild(entry); }	tabs.appendChild(li); if (id && (key || title) && window.ta) { ta[id] = [(key || ), (title || )]; }	//	// Re-render the title and accesskeys from existing code in wikibits.js. //	akeytt;

return (li); }

function addlilink(tabs, url, name, id, title, key) { var na = document.createElement('a'); na.href = url; na.appendChild(document.createTextNode(name));

return (addlilinkX(tabs, na, id, title, key)); }

//