// Fix sports medals to not use templates with bad sorting.
//
// Testing page is at [[User:MikeVitale/scripts/medals.js/tests]].
// Please report false positives on the talk page.
// <nowiki>
$.ajax('//tools-static.wmflabs.org/meta/scripts/pathoschild.templatescript.js', { dataType:'script', cache:true }).then(function() {
pathoschild.TemplateScript.add([{
name: 'Medal Fixer',
script: function(editor) {
// Do replacements
editor.replace(/{{goca}}/gi, `{{gold1}}`);
editor.replace(/{{gold01}}/gi, `{{gold1}}`);
editor.replace(/{{sica}}/gi, `{{silver2}}`);
editor.replace(/{{silver02}}/gi, `{{silver2}}`);
editor.replace(/{{brca}}/gi, `{{bronze3}}`);
editor.replace(/{{bronze03}}/gi, `{{bronze3}}`);
// Options
editor
.options({ minor: true })
.appendEditSummary("Fixed sports medals using [[User:MikeVitale/scripts/medals.js]]")
.clickDiff();
}
}]);
});
// </nowiki>