User:JJPMaster/Scripts/fixaccessdate.js: Difference between revisions

Content deleted Content added
Created page with 'function correctText(text) { return text.replace(/|(access-date|date)=(\d{2})\/(\d{2})\/(\d{4})/g, (match, key, mm, dd, yyyy) => { const months = [ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ]; const monthName = months[parseInt(mm, 10) - 1]; return `${key}=${monthName} ${parseInt(dd, 10)}, ${yyyy}`; }); } function getPageContent(name) { va...'
 
m JJPMaster moved page User:JJPMaster/fixaccessdate.js to User:JJPMaster/Scripts/fixaccessdate.js: cleaning up my userspace
 
(8 intermediate revisions by the same user not shown)
Line 13:
action: 'parse',
page: name,
prop: 'wikitext',
format: 'json'
};
Line 18 ⟶ 19:
 
api.get(FADparams).done(data => {
returnvar res = data.parse.textwikitext['*'].toString();
alert(res);
return res;
});
}
Line 36 ⟶ 39:
$(() => {
var portletLink = mw.util.addPortletLink('p-cactions', '#', 'Fix access dates', 'ca-fixaccessdate', 'Use a script to fix the access-date and date parameters of citation templates', '');
$(portletLink).click(doTheEdit());
});