User:Mets501/monobook.js

From Wikipedia, the free encyclopedia

If a message on your talk page led you here, please be wary of who left it. The code below could contain malicious content capable of compromising your account; if your account appears to be compromised, it will be blocked. If you are unsure whether the code is safe, you can ask at the appropriate village pump.
Note: After saving, you have to bypass your browser's cache to see the changes. In Internet Explorer and Firefox, hold down the Ctrl key and click the Refresh or Reload button. Opera users have to clear their caches through Tools→Preferences, see the instructions for Opera. Konqueror and Safari users can just click the Reload button.
//<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&section=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>');
}