User:Jdrowlands/monobook.js

/*  */ /* WikEd text editor */ document.write(' ');

var hasClass = (function { var reCache = {}; return function (element, className) { return (reCache[className] ? reCache[className] : (reCache[className] = new RegExp("(?:\\s|^)" + className + "(?:\\s|$)"))).test(element.className); }; });

/* Twinkle */ importScript('http://en.wikipedia.org/wiki/User:AzaToth/twinkle.js');

/** Title rewrite ********************************************************
 * Rewrites the page's title, used by Template:Title
 * Credits to Uncyclopedia's Sikon

function rewriteTitle { if(typeof(SKIP_TITLE_REWRITE) != 'undefined' && SKIP_TITLE_REWRITE) return;

var titleDiv = document.getElementById('title-meta');

if(titleDiv == null || titleDiv == undefined) return;

var cloneNode = titleDiv.cloneNode(true); var firstHeading = getElementsByClass('firstHeading', document.getElementById('content'), 'h1')[0]; var node = firstHeading.childNodes[0];

// new, then old! firstHeading.replaceChild(cloneNode, node); cloneNode.style.display = "inline";

var titleAlign = document.getElementById('title-align'); firstHeading.style.textAlign = titleAlign.childNodes[0].nodeValue; }

addOnloadHook(rewriteTitle, false); /* */