User:Bookofjude/monobook.js
Appearance
Code that you insert on this page could contain malicious content capable of compromising your account. If you import a script from another page with "importScript", "mw.loader.load", "iusc", or "lusc", take note that this causes you to dynamically load a remote script, which could be changed by others. Editors are responsible for all edits and actions they perform, including by scripts. User scripts are not centrally supported and may malfunction or become inoperable due to software changes. A guide to help you find broken scripts is available. If you are unsure whether code you are adding to this page is safe, you can ask at the appropriate village pump. This code will be executed when previewing this page. |
![]() | The accompanying .css page for this skin is at User:Bookofjude/monobook.css. |
/* <pre><nowiki> */
/**** Add generic tab ****/
function addlilink(tabs, url, name, id){
var na = document.createElement('a');
na.href = url;
na.appendChild(document.createTextNode(name));
var li = document.createElement('li');
li.id = id;
li.appendChild(na);
tabs.appendChild(li);
return li;
}
/**** Add tab as menu ****/
function addlimenu(tabs, name, id)
{
var na = document.createElement('a');
na.href = '#';
var mn = document.createElement('ul');
na.appendChild(document.createTextNode(name));
var li = document.createElement('li');
li.id = id;
li.className = 'tabmenu';
li.appendChild(na);
li.appendChild(mn);
tabs.appendChild(li);
return li;
}
function addTab(url, name, id, title, key){
var tabs = document.getElementById('p-cactions').getElementsByTagName('ul')[0];
addlilink(tabs, url, name, id, title, key);
}
function morelinks()
{
var tabs = document.getElementById('p-cactions').getElementsByTagName('ul')[0];
addlimenu(tabs, 'User functions', 'userf');
var userf = document.getElementById('userf').getElementsByTagName('ul')[0];
var editlk = document.getElementById('ca-edit').getElementsByTagName('a')[0].href;
editlk = editlk.substring(editlk.indexOf('title=') + 6, editlk.lastIndexOf('&action=edit'));
editlk = editlk.substring(editlk.indexOf(':') + 1);
var slloc = editlk.indexOf('/');
if(slloc > 0) editlk = editlk.substring(0, slloc);
// format: addlilink(userf, url, name);
// add "block" tab
addlilink(userf, '/wiki/Special:Blockip/' + editlk, 'block user');
// previous: addTab('/wiki/Special:Blockip/' + editlk, 'block', 'ca-block', '');
// add "blocklog" tab
addlilink(userf, '/wiki/Special:Log/block?page=User:' + editlk, 'block log', '');
// addTab('/wiki/Special:Log/block?page=User:' + editlk, 'log', 'ca-blocklog');
// add "unblock" tab
addlilink(userf, '/w/index.php?title=Special:Ipblocklist&action=unblock&ip=' + editlk, 'unblock user', '');
// addTab('/w/index.php?title=Special:Ipblocklist&action=unblock&ip=' + editlk, 'un');
// add "contributions" tab
addlilink(userf, '/wiki/Special:Contributions/' + editlk, 'contributions', '');
// addTab('/wiki/Special:Contributions/' + editlk, 'con');
// add "edit count" tab
addlilink(userf, 'http://tools.wikimedia.de/~interiot/cgi-bin/count_edits?user=' + editlk + '&dbname=enwiki_p', 'interiot's tool', '');
// addTab('http://tools.wikimedia.de/~interiot/cgi-bin/count_edits?user=' + editlk + '&dbname=enwiki_p', 'count');
// add "whois" tab
addlilink(userf, 'http://www.samspade.org/t/lookat?a=' + editlk, 'whois user', '');
// addTab('http://www.samspade.org/t/lookat?a=' + editlk, 'who');
// add "proxycheck" tab
addlilink(userf, 'http://quyme.com/proxycheck.php?ip=' + editlk, 'open proxy check', '');
// addTab('http://quyme.com/proxycheck.php?ip=' + editlk, 'proxy');
}
addOnloadHook(myLoadFuncs);
/**** Load custom functions ****/
function myLoadFuncs()
{
morelinks();
}
/* </nowiki></pre> */