User:DragonflySixtyseven/classic.js

// - // Übergodmode Monobook skin // (c) 2005 Sam Hocevar  // $Id: ubergodmode.js 886 2005-05-14 23:56:48Z sam $ // -

// - // Language support // - var blocklink = 'Block this user'; switch (document.getElementsByTagName('html')[0].lang) { case 'fr': blocklink = 'Bloquer cet utilisateur'; break; }

// - // Our nice Block functions // - function PerformBlock { var l, target = ''; // Look for '&faketarget=XXX' in URL url = location.pathname; l = location.search.substring(1).split('&'); for (i = 0; i < l.length; i++) { var n = l[i].indexOf('='); if (l[i].substring(0, n) == 'faketarget') { target = l[i].substring(n + 1); } }  if (!target) return; form = document.getElementById('blockip'); if (!form) return; input = form.getElementsByTagName('input')[0]; input.value = target; }

// - // Add block buttons to the page // - function AddBlockButtons { var l, article = '', vandal; // Add 'block' links to a diff page l = document.getElementById('t-contributions'); if (l) { clone = l.cloneNode(true); l.id = 't-blockuser'; a = clone.getElementsByTagName('a')[0]; a.href = a.href.replace(/Special:Contributions\//, 'Special:Blockip/'); a.href = a.href.replace(/target=/, 'faketarget='); a.innerHTML = blocklink; l.parentNode.insertBefore(clone, l.nextSibling); } }

// - // Modify the page once it is loaded // - if (window.addEventListener) { window.addEventListener("load", PerformBlock, false); window.addEventListener("load", AddBlockButtons, false); } else if (window.attachEvent) { window.attachEvent("onload", PerformBlock); window.attachEvent("onload", AddBlockButtons); }

// 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( 'Kate' ) ); // eh, the css makes the text lowercase a.href = 'http://kohl.wikimedia.org/~kate/cgi-bin/count_edits?dbname=enwiki&user=' + user; 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 );