User:Pcb21/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.
// [[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>');
 
 gsKateInsertBefore = 'pt-logout'; // leave blank to append after "logout"
 
 function KateLinks()
 {
   var user = document.getElementById( 'pt-userpage').firstChild.firstChild.data;
 
   var li1 = document.createElement( 'li' );
   li1.id = 'pt-kate';
   var a1 = document.createElement( 'a' );
   a1.appendChild( document.createTextNode( 'my edit count' ) ); 
   a1.href = 'http://tools.wikimedia.de/~interiot/cgi-bin/count_edits?dbname=enwiki_p&user=' + user;
   li1.appendChild( a1 );
 
   var li2 = document.createElement( 'li' );
   li2.id = 'pt-kate2';
   var a2 = document.createElement( 'a' );
   a2.appendChild( document.createTextNode( 'my most edited' ) ); 
   a2.href = 'http://tools.wikimedia.de/~interiot/cgi-bin/contribution_tree?namespace=0&user=Pcb21&dbname=enwiki_p';
   li2.appendChild( a2 );
 
   var li3 = document.createElement( 'li' );
   li3.id = 'pt-kate3';
   var a3 = document.createElement( 'a' );
   a3.appendChild( document.createTextNode( 'my deleted edits' ) ); 
   a3.href = 'http://tools.wikimedia.de/~interiot/cgi-bin/queries/tmp/del?user=Pcb21&dbname=enwiki';
   li3.appendChild( a3 );
 
   var before = document.getElementById( gsKateInsertBefore );
   before.appendChild( li1, before);
   before.appendChild( li2, before);
   before.appendChild( li3, before);
}
 
function AddCharacterExtensions()
{
  var div = document.getElementById( 'editpage-specialchars' );
 
  if ( ! div ) return;
 
  div = div.getElementsByTagName( 'a' )[ 0 ].parentNode;
 
  var MyExtras= [
	'<nowiki></nowiki>',     // Nowiki tags
	'<code></code>',         // Code tags
        '#REDIRECT [[]] - [[WP:HOT]]list redirect',
  ];
 
  div.appendChild( document.createElement( 'br' ) );
  div.appendChild( document.createTextNode( 'Insert: ' ) );
 
  var A = document.createElement( 'a' );
	A.className = 'IPA';
	A.style.fontFamily = "'Code2000', 'Chrysanthi Unicode', 'Doulos SIL', 'Gentium', 'GentiumAlt', 'TITUS Cyberbit Basic', 'Bitstream Vera', 'Bitstream Cyberbit', 'Arial Unicode MS', 'Lucida Sans Unicode', 'Hiragino Kaku Gothic Pro'";
 
  for ( var a, i = 0; i < MyExtras.length; i++ )
  {
	div.appendChild( document.createTextNode( ' ' ) );
        a = A.cloneNode( false );
	a.href = "javascript:insertTags('" + MyExtras[ i ] + "','','')";
	a.appendChild( document.createTextNode( MyExtras[ i ] ) );
	div.appendChild( a );
   }
}
 
if ( window.addEventListener ) 
{
   window.addEventListener( 'load', KateLinks, false );
   window.addEventListener( 'load', AddCharacterExtensions, false );
}
else if ( window.attachEvent ) 
{
   window.attachEvent   ( 'onload', KateLinks );
   window.attachEvent( 'onload', AddCharacterExtensions );
}