User:AndyZ/monobook.js/s.js

winc('User:Omegatron/monobook.js/addlink.js');

function switchDate{ theText = document.editform.wpTextbox1.value var memory = theText

theText = theText.replace(/(\d)(\d) January/g,"January $1$2,") theText = theText.replace(/(\d)(\d) February/g,"February $1$2,") theText = theText.replace(/(\d)(\d) March/g,"March $1$2,") theText = theText.replace(/(\d)(\d) April/g,"April $1$2,") theText = theText.replace(/(\d)(\d) May/g,"May $1$2,") theText = theText.replace(/(\d)(\d) June/g,"June $1$2,") theText = theText.replace(/(\d)(\d) July/g,"July $1$2,") theText = theText.replace(/(\d)(\d) August/g,"August $1$2,") theText = theText.replace(/(\d)(\d) September/g,"September $1$2,") theText = theText.replace(/(\d)(\d) October/g,"October $1$2,") theText = theText.replace(/(\d)(\d) November/g,"November $1$2,") theText = theText.replace(/(\d)(\d) December/g,"December $1$2,")

theText = theText.replace(/(\d) January/g,"January $1,") theText = theText.replace(/(\d) February/g,"February $1,") theText = theText.replace(/(\d) March/g,"March $1,") theText = theText.replace(/(\d) April/g,"April $1,") theText = theText.replace(/(\d) May/g,"May $1,") theText = theText.replace(/(\d) June/g,"June $1,") theText = theText.replace(/(\d) July/g,"July $1,") theText = theText.replace(/(\d) August/g,"August $1,") theText = theText.replace(/(\d) September/g,"September $1,") theText = theText.replace(/(\d) October/g,"October $1,") theText = theText.replace(/(\d) November/g,"November $1,") theText = theText.replace(/(\d) December/g,"December $1,")

if(theText==memory){ alert("Matched!") } document.editform.wpTextbox1.value = theText }

addOnloadHook(function {    if(document.forms.editform) {        addLink('p-cactions', 'javascript:switchDate', 'switch', 'ca-datefixer', 'Switches month-date format', , );    } });