Content deleted Content added
Latest from Bobblewik |
m Maintenance: Replacing addOnloadHook with native jQuery (mw:ResourceLoader/Migration_guide_(users)#addOnloadHook - phab:T130879) |
||
(3 intermediate revisions by one other user not shown) | |||
Line 1:
//'winc' function allows buttons to be added toolbar
winc('User:Omegatron/monobook.js/addlink.js');
function formatdates() {
document.getElementById('wpMinoredit').checked = true;
var txt = document.editform.wpTextbox1;
Line 13 ⟶ 18:
// 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 ⟶ 140:
var txt = document.editform.wpSummary;
//Made summary more accurate: not all links are removed. Keep summary brief
var summary = "Revising date links
if (txt.value.indexOf(summary) == -1) {
if (txt.value.match(/[^\*\/\s][^\/\s]?\s*$/)) {
Line 147 ⟶ 152:
}
if(document.forms.editform) {
addLink('p-cactions', 'javascript:formatdates()', 'dates', 'ca-datefixer', 'Fixes some date formatting', '', '');
|