User:Davidcannon/monobook.js

From AmwayWiki
< User:Davidcannon
Revision as of 21:44, 18 August 2008 by Davidcannon (Talk | contribs) (New page: #content, #p-cactions ul li a { background:#99F3FF } pre { background: #99F3FF } // User:Lupin/popups.js document.write('<script type="text/javascript" src="' + 'http...)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Note: After saving, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Internet Explorer: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Clear the cache in Tools → Preferences
#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;
  }
};