User:Gomdoli/ClearDeleteReason.js

/* Info: User:Gomdoli/ClearDeleteReason

By Wikipedia:User:IRTC1015.

Soarce: Wikipedia:ko:User:IRTC1015/clearDelReason.js



function ClearDeleteReason { var wpReason = $('#wpReason')[0]; var rsn = wpReason.value; wpReason.value = ''; var btn1 = $(" ").attr({		'title': 'Revert',		'style': 'cursor: pointer;'	}); btn1.text('↶'); btn1.click(function { wpReason.value = rsn; }); var btn2 = $(" ").attr({		'title': 'Clear',		'style': 'cursor: pointer;'}); btn2.text('❌'); btn2.click(function { wpReason.value = ''; }); $("#wpReason").after(btn2); $("#wpReason").after(btn1); }

jQuery( document ).ready( function( $ ) {	if ($.inArray( mw.config.get('wgAction'), ['delete']) !== -1) {		ClearDeleteReason;	} });