User:Cyde/monobook.js/dates.js: Difference between revisions

Content deleted Content added
Cyde (talk | contribs)
Latest from Bobblewik
Cyde (talk | contribs)
Latest from Bobblewik
Line 1:
//'winc' function allows buttons to be added toolbar
 
winc('User:Omegatron/monobook.js/addlink.js');
 
function formatdates() {
var txt = document.editform.wpTextbox1;
Line 13 ⟶ 17:
 
// piped decades and years
txt.value = txt.value.replace(/\[\[(\d{1,4}\'?s)\]\]/gi, '$1');
txt.value = txt.value.replace(/\[\[(\d{1,4}s? (?:AD|BC|CE|BCE))\]\]/gi, '$1');
txt.value = txt.value.replace(/\[\[\d{1,4}s? (?:AD|BC|CE|BCE)\|(\d{1,4})\]\]/gi, '$1');
Line 135 ⟶ 139:
var txt = document.editform.wpSummary;
//Made summary more accurate: not all links are removed. Keep summary brief
var summary = "Revising date links. See:per guidelines at \[\[WP:DATE\]\].";
if (txt.value.indexOf(summary) == -1) {
if (txt.value.match(/[^\*\/\s][^\/\s]?\s*$/)) {