User:Mets501/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:Mets501/monobook.css. |
//<pre>
if (navigator.appName != "Microsoft Internet Explorer")
{
importScript('User:AzaToth/morebits.js');
importScript('Wikipedia:WikiProject User scripts/Scripts/Add LI menu');
importStylesheet('Wikipedia:WikiProject User scripts/Scripts/Add LI menu/css');
importScript('User:AzaToth/twinklewarn.js');
importScript('User:Voice_of_All/Addtabs/monobook.js');
// [[User:Lupin/popups.js]]
document.write('<script type="text/javascript" src="'
+ 'http://en.wikipedia.org/w/index.php?title=User:Lupin/popups.js'
+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
popupFixDabs=true;
// Add a "Kate" link to your monobook "personal menu" list at the very
// top of the page.
//
// Indicate where you would like "Kate" to appear:
// pt-userpage, pt-mytalk, pt-preferences,
// pt-watchlist, pt-mycontris, pt-logout
//
gsKateInsertBefore = 'pt-mycontris'; // leave blank to append after "logout"
//
function KateLink() {
var user = document.getElementById( 'pt-userpage' ).firstChild.firstChild.data;
var li = document.createElement( 'li' );
li.id = 'pt-kate';
var a = document.createElement( 'a' );
a.appendChild( document.createTextNode( "MetsBot's contributions" ) ); // eh, the css makes the text lowercase
a.href = 'http://en.wikipedia.org/wiki/Special:Contributions/MetsBot';
li.appendChild( a );
if ( ! gsKateInsertBefore ) // append to end (right) of list
{ document.getElementById( 'pt-logout' ).parentNode.appendChild( li );
}
else
{ var before = document.getElementById( gsKateInsertBefore );
before.appendChild( li, before );
}
}
if ( window.addEventListener ) window.addEventListener( 'load', KateLink, false );
else if ( window.attachEvent ) window.attachEvent ( 'onload', KateLink );
function tnaddlilink(url, name)
{
var na = document.createElement('a');
na.setAttribute('href', url);
var txt = document.createTextNode(name);
na.appendChild(txt);
var li = document.createElement('li');
li.appendChild(na);
return li;
}
// My own edit top
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)
};
var fulltitle = document.title.split(" - Wikipedia, the free encyclopedia");
var articletitle = fulltitle[0];
if (document.title.indexOf("Editing ") == -1) {
addOnloadHook(
function() {
addTab("http://en.wikipedia.org/w/index.php?title="+articletitle+"&action=edit§ion=0", "edit top", "ca-edittop", "Edit top", "");
addTab("http://tinyurl.com/3afcmg", "In", "ca-imin", "I'm in!", "");
addTab("http://tinyurl.com/3x666p", "Out", "ca-imout", "I'm out!", "");
}
);
}
// Admin tools
document.write('<script type="text/javascript" src="'
+ 'http://en.wikipedia.org/w/index.php?title=User:Mets501/admin monobook.js'
+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
}