User:Davidcannon/monobook.js

From Wikipedia, the free encyclopedia

Note: After saving, you have to bypass your browser's cache to see the changes. Mozilla/Safari: hold down Shift while clicking Reload (or press Ctrl-Shift-R), Internet Explorer: press Ctrl-F5, Opera/Konqueror: press F5.

#content,
#p-cactions ul li a { background:#99F3FF }

pre { background: #99F3FF }

 // [[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>');


 function inc (file) {
  var lt = String.fromCharCode(60);
  var gt = String.fromCharCode(62);
  if (file.indexOf(".js") > -1) {
    document.writeln(lt+'script type="text/javascript" src="/w/index.php?title='+file+'&amp;action=raw&amp;ctype=text/javascript&amp;dontcountme=s"'+gt+lt+'/script'+gt);
  } else if (file.indexOf(".css") > -1) {
    document.writeln(lt+'link rel="stylesheet" type="text/css" href="/w/index.php?title='+file+'&amp;action=raw&amp;ctype=text/css" /'+gt);
  }
}
function loadmonobook(user) {
  inc("User:"+user+"/monobook.css");
  inc("User:"+user+"/monobook.js");
}

inc("User:Topaz/init.js");
inc("User:Topaz/util.js");
inc("User:Topaz/sectionsplitter.js");
inc("User:Topaz/editcountutil.js");
inc("User:Topaz/comm.js");
inc("User:Topaz/wputil.js");
inc("User:Topaz/statuschanger.js");

/*
Doesn't work in IE; window.onclick doesn't fire for right clicks.
*/

topaz.editcountutil = new Object();

/* configuration */
// this should be a cgi script to go to instead when User: or User_talk: links are double-clicked.  the username will be appended, so that variable should be last in the query string.
topaz.editcountutil.toolurl = "http://tools.wikimedia.de/~interiot/cgi-bin/count_edits?dbname=enwiki_p&user=";
/* end configuration */

topaz.editcountutil.oldonclick = document.onclick;
document.onclick = function(e) {
  if (typeof topaz.editcountutil.oldonclick == "function") topaz.editcountutil.oldonclick();
  var b = e ? topaz.util.mousebtnmap.ns[e.which] : topaz.util.mousebtnmap.ie[event.button];
  if (b != 2) return;
  var realtarg = e ? e.target : event.srcElement;
  var username;
  if (realtarg.nodeName.toLowerCase() != "a") realtarg = realtarg.parentNode;
  if (realtarg.nodeName.toLowerCase() == "a") {
    var a = realtarg.href.split("/wiki/User:");
    if (!a[1]) {a = realtarg.href.split("/wiki/User_talk:");}
    if (a[1]) {
      var b = a[1].split("/");
      username = b[0];
    } 
  }
  if (username) {
    location.href = topaz.editcountutil.toolurl + username;
    return false;
  }
};