User:Adam1213/sandbox
From Wikipedia, the free encyclopedia
function addlilink(tabs, url, name, id, title, key){
var na = document.createElement('a'); na.href = url; na.appendChild(document.createTextNode(name)); var li = document.createElement('li'); if(id) li.id = id; li.appendChild(na); tabs.appendChild(li); if(id) { if(key && title) { ta[id] = [key, title]; } else if(key) { ta[id] = [key, ]; } else if(title) { ta[id] = [, title]; } } // re-render the title and accesskeys from existing code in wikibits.js akeytt(); return li;
}
//
function addTab(url, name, id, title, key){
var tabs = document.getElementById('p-cactions').getElementsByTagName('ul')[0]; return addlilink(tabs, url, name, id, title, key);
} //
//Please leave the following line //user:Where/usertabs
addOnloadHook(function() {
if (document.title.search("/") != -1 || document.title.search("- History -") != -1) { //no subpages or history return; } if (document.title.indexOf("User:") == 0 || document.title.indexOf("User talk:") == 0) { username_a = document.URL.match(/:.*:(.*)/); username=username_a[1]; addTab("http://en.wikipedia.org/wiki/Special:Contributions/" + username, "contrib", "ca-contrib", "contribs", ""); addTab("http://en.wikipedia.org/w/index.php?title=Special:Log&type=move&user=" + username, "page moves", "ca-pagemoves", "page moves", ""); addTab("http://en.wikipedia.org/w/index.php?title=Special:Log&type=block&user=" + username, "block log", "ca-blog", "blog", ""); addTab("http://tools.wikimedia.de/~kate/cgi-bin/count_edits?dbname=enwiki&user=" + username, "edit count", "ca-kate", "kate", ""); }
});