User:Cyde/monobook.js/anwar.js

function formatdates { var txt = document.editform.wpTextbox1;

txt.value = txt.value.replace(/(?\<!February) \[\[(\d{1,4})\]\]/gi, '$1'); //txt.value = txt.value.replace(/\[\[(\d{1,4})\]\]/gi, '$1');

// Add a tag to the summary box var txt = document.editform.wpSummary; //Made summary more accurate: not all links are removed. Keep summary brief var summary = "Revising date links, see:\[\[WP:DATE\]\]"; if (txt.value.indexOf(summary) == -1) { if (txt.value.match(/[^\*\/\s][^\/\s]?\s*$/)) { txt.value += " | "; }		txt.value += summary; }

// Press the diff button to check it   document.editform.wpDiff.click }

$(function {    if(document.forms.editform) {        addLink('p-cactions', 'javascript:formatdates', 'anwar', 'ca-datefixer', 'Fixes some date formatting', , );    } });