MediaWiki:Monobook.js
Jump to navigation
Jump to search
Note: After saving, changes may not occur immediately. Click here to learn how to bypass your browser's cache.
- Mozilla / Firefox / Safari: hold down Shift while clicking Reload, or press Ctrl-Shift-R (Cmd-Shift-R on Apple Mac);
- Internet Explorer: hold Ctrl while clicking Refresh, or press Ctrl-F5;
- Konqueror: simply click the Reload button, or press F5;
- Opera users may need to completely clear their cache in Tools→Preferences.
This is JavaScript for the "MonoBook" skin. You can propose changes on the discussion page or at the proposals reading room. Errors made here can disrupt Wikibooks. You can test changes in your personal JavaScript first. Due to caching, changes can take up to 31 days before propagating to all users. |
/*
See also: [[MediaWiki:Common.js]]
<pre>
*/
/* Functions for adding links to the personal links section and the toolbox*/
function AddPersonalLink(link, text, tag, ibefore)
{
var li = document.createElement( 'li' );
li.id = tag;
var a = document.createElement( 'a' );
a.appendChild( document.createTextNode( text ) );
a.href = link;
li.appendChild( a );
if ( ! ibefore ) // append to end (right) of list
{
document.getElementById( 'pt-logout' ).parentNode.appendChild( li );
}
else
{
var before = document.getElementById( ibefore );
before.appendChild( li, before );
}
}
function AddToolboxLink(text, href, onclick, linkid) {
var tb = document.getElementById('p-tb').getElementsByTagName('ul')[0];
var link = document.createElement('a');
link.onclick = onclick;
link.href = href;
link.appendChild(document.createTextNode(text));
var li = document.createElement('li');
li.id = linkid;
li.appendChild(link);
tb.insertBefore(li, tb.firstChild);
return;
}
/*
</pre>
*/