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.

*

* Template:A6

* Template:Attackpage

* Template:Attackpages

* Template:CSD:G10

* Template:Csd-a6

* Template:Db-Attack

* Template:Db-a

* Template:Db-a6

* Template:Db-ap

* Template:Db-atk

* Template:Db-attack

* Template:Db-attacktemplate

* Template:Db-g10

* Template:G10

*/