From 02a9b06b7601ca604a192daac2aa867fc0818613 Mon Sep 17 00:00:00 2001 From: Siddharth VP Date: Thu, 8 Nov 2018 08:50:38 +0530 Subject: [PATCH] prod: alert user if BLPPROD is selected but article is not in Category:Living people --- modules/twinkleprod.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/modules/twinkleprod.js b/modules/twinkleprod.js index 63b64b79d..54209b19a 100644 --- a/modules/twinkleprod.js +++ b/modules/twinkleprod.js @@ -177,12 +177,23 @@ Twinkle.prod.callbacks = { var text = pageobj.getPageText(); var params = pageobj.getCallbackParameters(); + // Check for already existing deletion tags var tag_re = /({{(?:db-?|delete|[aitcmrs]fd|md1)[^{}]*?\|?[^{}]*?}})/i; if( tag_re.test( text ) ) { statelem.warn( 'Page already tagged with a deletion template, aborting procedure' ); return; } + // Alert if article is not in Category:Living people and BLPPROD is selected + if( params.blp ) { + var blpcheck_re = /\[\[Category:Living people\]\]/i; + if( !blpcheck_re.test( text ) ) { + if( ! confirm("Please note that the article is not in Category:Living people and hence may be ineligible for BLPPROD. Are you sure you want to continue? \n\nYou may wish to add the category if you proceed, unless the article is about a recently deceased person." ) ) { + return; + } + } + } + // Remove tags that become superfluous with this action text = text.replace(/{{\s*(new unreviewed article|unreviewed|userspace draft|mtc|(copy|move) to wikimedia commons|(copy |move )?to ?commons)\s*(\|(?:{{[^{}]*}}|[^{}])*)?}}\s*/gi, ""); var prod_re = /{{\s*(?:dated prod|dated files|dated prod blp|Prod blp\/dated|Proposed deletion\/dated)\s*\|(?:{{[^{}]*}}|[^{}])*}}/i;