User:Ilmari Karonen/cleandelsummary.js
// CLEAN DELETION SUMMARY FOR ATTACK PAGES
if (wgAction == "delete") {
addOnloadHook(function () {
var wpReason = document.getElementById("wpReason");
if (!wpReason) return;
var regexp = /\{\{\s*(msg:\s*)?(template:\s*)?(db-a(p|tk)?|((csd|db)[-:])?(a6|attack(pages?|template)?|g10))\s*[|}]/i;
if (regexp.test(wpReason.value))
wpReason.value = "CSD G10: Attack Page";
});
}
/*
* Note: These are the known redirects to Template:Db-attack as of 7 Jun 2007.
* The regexp above should catch these as well as a number of possible variants.
*
*/