மீடியாவிக்கி:Gadget-twinkleprotect.js: திருத்தங்களுக்கு இடையிலான வேறுபாடு

கட்டற்ற கலைக்களஞ்சியமான விக்கிப்பீடியாவில் இருந்து.
உள்ளடக்கம் நீக்கப்பட்டது உள்ளடக்கம் சேர்க்கப்பட்டது
மொழிபெயர்ப்பு
மொழிபெயர்ப்பு நிறைவு
வரிசை 1,086: வரிசை 1,086:
break;
break;
case 'pp-create-blp':
case 'pp-create-blp':
typereason = 'அண்மையில் அழிக்கப்பட்ட [[WP:BLP|வாழும் மனிதரின் வாழ்க்கை வரலாறு]]';
typereason = 'அண்மையில் அழித்த [[WP:BLP|வாழும் மனிதரின் வாழ்க்கை வரலாறு]]';
break;
break;
case 'pp-create-salt':
case 'pp-create-salt':
வரிசை 1,153: வரிசை 1,153:
var re_result = oldtag_re.exec(text);
var re_result = oldtag_re.exec(text);
if (re_result) {
if (re_result) {
if (confirm("{{" + re_result[1] + "}} பக்கத்தில் கண்டுபிடிக்க்பட்டுள்ளது. \nஅதனை நீக்குவதற்குச் சரி என்பதைச் சொடுக்குங்கள். அல்லது அதனை அவ்வாறே விடுவதற்குக் கைவிடு என்பதைச் சொடுக்குங்கள்.")) {
if (confirm("{{" + re_result[1] + "}} was found on the page. \nClick OK to remove it, or click Cancel to leave it there.")) {
text = text.replace( oldtag_re, '' );
text = text.replace( oldtag_re, '' );
}
}
வரிசை 1,172: வரிசை 1,172:


if( params.tag === 'none' ) {
if( params.tag === 'none' ) {
summary = 'Removing protection template' + Twinkle.getPref('summaryAd');
summary = 'காப்பு வார்ப்புரு நீக்கம்' + Twinkle.getPref('summaryAd');
} else {
} else {
if( params.noinclude ) {
if( params.noinclude ) {
வரிசை 1,181: வரிசை 1,181:
text = "{{" + tag + "}}\n" + text;
text = "{{" + tag + "}}\n" + text;
}
}
summary = "Adding {{" + params.tag + "}}" + Twinkle.getPref('summaryAd');
summary = "சேர்க்கப்பட்டது: {{" + params.tag + "}}" + Twinkle.getPref('summaryAd');
}
}


வரிசை 1,205: வரிசை 1,205:


if ( tag ) {
if ( tag ) {
statusElement.error( [ 'There is already a protection request for this page at ', rppLink, ', aborting.' ] );
statusElement.error( [ 'இப்பக்கத்திற்கு ஏற்கனவே ஒரு காப்பு வேண்டுகோள் இங்கு உள்ளது:', rppLink, ', கைவிடுகின்றது.' ] );
return;
return;
}
}
வரிசை 1,211: வரிசை 1,211:
var newtag = '=== [[:' + Morebits.pageNameNorm + ']] ===\n';
var newtag = '=== [[:' + Morebits.pageNameNorm + ']] ===\n';
if( ( new RegExp( '^' + RegExp.escape( newtag ).replace( /\s+/g, '\\s*' ), 'm' ) ).test( text ) ) {
if( ( new RegExp( '^' + RegExp.escape( newtag ).replace( /\s+/g, '\\s*' ), 'm' ) ).test( text ) ) {
statusElement.error( [ 'There is already a protection request for this page at ', rppLink, ', aborting.' ] );
statusElement.error( [ 'இப்பக்கத்திற்கு ஏற்கனவே ஒரு காப்பு வேண்டுகோள் இங்கு உள்ளது:', rppLink, ', கைவிடுகின்றது.' ] );
return;
return;
}
}
வரிசை 1,219: வரிசை 1,219:
switch( params.expiry ) {
switch( params.expiry ) {
case 'temporary':
case 'temporary':
words = "Temporary ";
words = "தற்காலிகம் ";
break;
break;
case 'indefinite':
case 'indefinite':
words = "Indefinite ";
words = "முடிவிலி ";
break;
break;
default:
default:
வரிசை 1,271: வரிசை 1,271:
var reg;
var reg;
if ( increase ) {
if ( increase ) {
reg = /(\n==\s*Current requests for increase in protection level\s*==\s*\n\s*\{\{[^\}\}]+\}\}\s*\n)([\s\S]*?)\s*(\n==[^=])/;
reg = /(\n==\s*காப்பு நிலையைக் கூட்டுவதற்கான தற்போதைய வேண்டுகோள்கள்\s*==\s*\n\s*\{\{[^\}\}]+\}\}\s*\n)([\s\S]*?)\s*(\n==[^=])/;
} else {
} else {
reg = /(\n==\s*Current requests for reduction in protection level\s*==\s*\n\s*\{\{[^\}\}]+\}\}\s*\n)([\s\S]*?)\s*(\n==[^=])/;
reg = /(\n==\s*காப்பு நிலையைக் குறைப்பதற்கான தற்போதைய வேண்டுகோள்கள்\s*==\s*\n\s*\{\{[^\}\}]+\}\}\s*\n)([\s\S]*?)\s*(\n==[^=])/;
}
}
var originalTextLength = text.length;
var originalTextLength = text.length;
வரிசை 1,280: வரிசை 1,280:
{
{
var linknode = document.createElement('a');
var linknode = document.createElement('a');
linknode.setAttribute("href", mw.util.getUrl("Wikipedia:Twinkle/Fixing RPP") );
linknode.setAttribute("href", mw.util.getUrl("விக்கிப்பீடியா:மின்னல்/பக்கக் காப்புக்கான வேண்டுகோள்களைச் சரிசெய்தல்") );
linknode.appendChild(document.createTextNode('How to fix RPP'));
linknode.appendChild(document.createTextNode('How to fix RPP'));
statusElement.error( [ 'WP:RPPஇல் தொடர்புடைய தலைப்பைக் கண்டுபிடிக்கமுடியவில்லை. இதனைச் சரிசெய்வதற்கு அருள்கூர்ந்து காண்க: ', linknode, '.' ] );
statusElement.error( [ 'Could not find relevant heading on WP:RPP. To fix this problem, please see ', linknode, '.' ] );
return;
return;
}
}

01:52, 31 திசம்பர் 2015 இல் நிலவும் திருத்தம்

//<nowiki>


(function($){


/*
 ****************************************
 *** twinkleprotect.js: Protect/RPP module
 ****************************************
 * Mode of invocation:     Tab ("PP"/"RPP")
 * Active on:              Non-special pages
 * Config directives in:   TwinkleConfig
 */

// Note: a lot of code in this module is re-used/called by batchprotect.

Twinkle.protect = function twinkleprotect() {
	if ( mw.config.get('wgNamespaceNumber') < 0 ) {
		return;
	}

	Twinkle.addPortletLink(Twinkle.protect.callback, Morebits.userIsInGroup('sysop') ? "PP" : "RPP", "tw-rpp",
		Morebits.userIsInGroup('sysop') ? "பக்கக் காப்பு" : "பக்கக் காப்பு வேண்டுகோள்" );
};

Twinkle.protect.callback = function twinkleprotectCallback() {
	var Window = new Morebits.simpleWindow( 620, 530 );
	Window.setTitle( Morebits.userIsInGroup( 'sysop' ) ? "பக்கக் காப்புச் செய்தல், கோருதல், வார்ப்புரு இணைத்தல்" : " பக்கக் காப்புக் கோருதல், வார்ப்புரு இணைத்தல்" );
	Window.setScriptName( "மின்னல்" );
	Window.addFooterLink( "காப்பு வார்ப்புருக்கள்", "Template:Protection templates" );
	Window.addFooterLink( "பாதுகாப்புக் கொள்கை", "WP:PROT" );
	Window.addFooterLink( "மின்னல் உதவி", "WP:TW/DOC#protect" );

	var form = new Morebits.quickForm( Twinkle.protect.callback.evaluate );
	var actionfield = form.append( {
			type: 'field',
			label: 'செயல் வகை'
		} );
	if( Morebits.userIsInGroup( 'sysop' ) ) {
		actionfield.append( {
				type: 'radio',
				name: 'actiontype',
				event: Twinkle.protect.callback.changeAction,
				list: [
					{
						label: 'பக்கக் காப்பு',
						value: 'protect',
						tooltip: 'பக்கக் காப்பைச் செய்தல்.',
						checked: true
					}
				]
			} );
	}
	actionfield.append( {
			type: 'radio',
			name: 'actiontype',
			event: Twinkle.protect.callback.changeAction,
			list: [
				{
					label: 'பக்கக் காப்பு வேண்டுகோள்',
					value: 'request',
					tooltip: 'WP:RPP ஊடாகப் பக்கக் காப்பு வேண்டுகோள் விடுத்தல்' + (Morebits.userIsInGroup('sysop') ? ' (பக்கத்தை நீங்களே காப்பதற்குப் பதிலாக)' : '.'),
					checked: !Morebits.userIsInGroup('sysop')
				},
				{
					label: 'பக்கத்தில் காப்பு வார்ப்புருவை இணைத்தல்',
					value: 'tag',
					tooltip: 'பக்கத்தைக் காத்த நிருவாகியோ நீங்களோ, ஒரு காப்பு வார்ப்புருவையிட மறந்தால், உரிய காப்பு வார்ப்புருவையிட இதனைப் பயன்படுத்தலாம்.',
					disabled: mw.config.get('wgArticleId') === 0
				}
			]
		} );

	form.append({ type: 'field', label: 'முன்னடுக்கு', name: 'field_preset' });
	form.append({ type: 'field', label: '1', name: 'field1' });
	form.append({ type: 'field', label: '2', name: 'field2' });

	form.append( { type:'submit' } );

	var result = form.render();
	Window.setContent( result );
	Window.display();

	// We must init the controls
	var evt = document.createEvent( "Event" );
	evt.initEvent( 'change', true, true );
	result.actiontype[0].dispatchEvent( evt );

	Morebits.wiki.actionCompleted.postfix = false;  // avoid Action: completed notice

	// get current protection level asynchronously
	Twinkle.protect.fetchProtectionLevel();
};

// Contains the current protection level in an object
// Once filled, it will look something like:
// { edit: { level: "sysop", expiry: <some date>, cascade: true }, ... }
Twinkle.protect.currentProtectionLevels = {};

Twinkle.protect.fetchProtectionLevel = function twinkleprotectFetchProtectionLevel() {

	var api = new mw.Api();
	var protectDeferred = api.get({
		format: 'json',
		indexpageids: true,
		action: 'query',
		list: 'logevents',
		letype: 'protect',
		letitle: mw.config.get('wgPageName'),
		prop: 'info|flagged',
		inprop: 'protection',
		titles: mw.config.get('wgPageName')
	});
	var stableDeferred = api.get({
		format: 'json',
		action: 'query',
		list: 'logevents',
		letype: 'stable',
		letitle: mw.config.get('wgPageName')
	});

	$.when.apply($, [protectDeferred, stableDeferred]).done(function(protectData, stableData){
		var pageid = protectData[0].query.pageids[0];
		var page = protectData[0].query.pages[pageid];
		var current = {};

		$.each(page.protection, function( index, protection ) {
			if (protection.type !== "aft") {
				current[protection.type] = {
					level: protection.level,
					expiry: protection.expiry,
					cascade: protection.cascade === ''
				};
			}
		});

		if (page.flagged) {
			current.stabilize = {
				level: page.flagged.protection_level,
				expiry: page.flagged.protection_expiry
			};
		}

		// show the protection level and log info
		Twinkle.protect.hasProtectLog = !!protectData[0].query.logevents.length;
		Twinkle.protect.hasStableLog = !!stableData[0].query.logevents.length;
		Twinkle.protect.currentProtectionLevels = current;
		Twinkle.protect.callback.showLogAndCurrentProtectInfo();
	});
};

Twinkle.protect.callback.showLogAndCurrentProtectInfo = function twinkleprotectCallbackShowLogAndCurrentProtectInfo() {
	var currentlyProtected = !$.isEmptyObject(Twinkle.protect.currentProtectionLevels);

	if (Twinkle.protect.hasProtectLog || Twinkle.protect.hasStableLog) {
		var $linkMarkup = $("<span>");

		if (Twinkle.protect.hasProtectLog)
			$linkMarkup.append(
				$( '<a target="_blank" href="' + mw.util.getUrl('Special:Log', {action: 'view', page: mw.config.get('wgPageName'), type: 'protect'}) + '">காப்புப் பதிகை</a>' ),
				Twinkle.protect.hasStableLog ? $("<span> &bull; </span>") : null
			);
		if (Twinkle.protect.hasStableLog)
			$linkMarkup.append($( '<a target="_blank" href="' + mw.util.getUrl('Special:Log', {action: 'view', page: mw.config.get('wgPageName'), type: 'stable'}) + '">pending changes log</a>)' ));

		Morebits.status.init($('div[name="hasprotectlog"] span')[0]);
		Morebits.status.warn(
			currentlyProtected ? 'முந்திய காப்புகள்' : 'இப்பக்கம் முன்பு காக்கப்பட்டுள்ளது.',
			$linkMarkup[0]
		);
	}

	Morebits.status.init($('div[name="currentprot"] span')[0]);
	var protectionNode = [], statusLevel = 'info';

	if (currentlyProtected) {
		$.each(Twinkle.protect.currentProtectionLevels, function(type, settings) {
			var label = type === 'stabilize' ? 'Pending Changes' : Morebits.string.toUpperCaseFirstChar(type);
			protectionNode.push($("<b>" + label + ": " + settings.level + "</b>")[0]);
			if (settings.expiry === 'infinity') {
				protectionNode.push(" (indefinite) ");
			} else {
				protectionNode.push(" (expires " + new Date(settings.expiry).toUTCString() + ") ");
			}
			if (settings.cascade) {
				protectionNode.push("(cascading) ");
			}
		});
		statusLevel = 'warn';
	} else {
		protectionNode.push($("<b>காப்பு இல்லை</b>")[0]);
	}

	Morebits.status[statusLevel]("தற்போதைய காப்பு நிலை", protectionNode);
};

Twinkle.protect.callback.changeAction = function twinkleprotectCallbackChangeAction(e) {
	var field_preset;
	var field1;
	var field2;
	var isTemplate = mw.config.get("wgNamespaceNumber") === 10 || mw.config.get("wgNamespaceNumber") === 828;

	switch (e.target.values) {
		case 'protect':
			field_preset = new Morebits.quickForm.element({ type: 'field', label: 'Preset', name: 'field_preset' });
			field_preset.append({
					type: 'select',
					name: 'category',
					label: 'ஒரு முன்னடுக்கைத் தெரிக:',
					event: Twinkle.protect.callback.changePreset,
					list: (mw.config.get('wgArticleId') ?
						Twinkle.protect.protectionTypes.filter(function(v) {
							return isTemplate || v.label !== 'வார்ப்புருக் காப்பு';
						}) :
						Twinkle.protect.protectionTypesCreate)
				});

			field2 = new Morebits.quickForm.element({ type: 'field', label: 'காப்புத் தெரிவுகள்', name: 'field2' });
			field2.append({ type: 'div', name: 'currentprot', label: ' ' });  // holds the current protection level, as filled out by the async callback
			field2.append({ type: 'div', name: 'hasprotectlog', label: ' ' });
			// for existing pages
			if (mw.config.get('wgArticleId')) {
				field2.append({
						type: 'checkbox',
						name: 'editmodify',
						event: Twinkle.protect.formevents.editmodify,
						list: [
							{
								label: 'தொகுத்தல் காப்பை மாற்றுக',
								value: 'editmodify',
								tooltip: 'இது தெரிந்தெடுக்கப்படாவிட்டால், தொகுத்தல் காப்பு நிலையும் முடிவு நேரமும் ஏற்கனவே இருந்தது போலேயே இருக்கும்.',
								checked: true
							}
						]
					});
				var editlevel = field2.append({
						type: 'select',
						name: 'editlevel',
						label: 'தொகுத்தல் காப்பு:',
						event: Twinkle.protect.formevents.editlevel
					});
				editlevel.append({
						type: 'option',
						label: 'அனைவரும்',
						value: 'all'
					});
				editlevel.append({
						type: 'option',
						label: 'தானாக உறுதியளிக்கப்பட்ட பயனர்கள்',
						value: 'autoconfirmed'
					});
				editlevel.append({
						type: 'option',
						label: 'நிருவாகி',
						value: 'sysop',
						selected: true
					});
				field2.append({
						type: 'select',
						name: 'editexpiry',
						label: 'முடிவு:',
						event: function(e) {
							if (e.target.value === 'custom') {
								Twinkle.protect.doCustomExpiry(e.target);
							}
						},
						list: [
							{ label: '1 மணி', value: '1 hour' },
							{ label: '2 மணிகள்', value: '2 hours' },
							{ label: '3 மணிகள்', value: '3 hours' },
							{ label: '6 மணிகள்', value: '6 hours' },
							{ label: '12 மணிகள்', value: '12 hours' },
							{ label: '1 நாள்', value: '1 day' },
							{ label: '2 நாள்கள்', selected: true, value: '2 days' },
							{ label: '3 நாள்கள்', value: '3 days' },
							{ label: '4 நாள்கள்', value: '4 days' },
							{ label: '1 கிழமை', value: '1 week' },
							{ label: '2 கிழமைகள்', value: '2 weeks' },
							{ label: '1 மாதம்', value: '1 month' },
							{ label: '2 மாதங்கள்', value: '2 months' },
							{ label: '3 மாதங்கள்', value: '3 months' },
							{ label: '1 ஆண்டு', value: '1 year' },
							{ label: 'முடிவிலி', value:'indefinite' },
							{ label: 'வேறு...', value: 'custom' }
						]
					});
				field2.append({
						type: 'checkbox',
						name: 'movemodify',
						event: Twinkle.protect.formevents.movemodify,
						list: [
							{
								label: 'நகர்த்தல் காப்பை மாற்றுக',
								value: 'movemodify',
								tooltip: 'இது தெரிந்தெடுக்கப்படாவிட்டால், நகர்த்தல் காப்பு நிலையும் முடிவு நேரமும் ஏற்கனவே இருந்தது போலேயே இருக்கும்.',
								checked: true
							}
						]
					});
				var movelevel = field2.append({
						type: 'select',
						name: 'movelevel',
						label: 'நகர்த்தல் காப்பு:',
						event: Twinkle.protect.formevents.movelevel
					});
				movelevel.append({
						type: 'option',
						label: 'அனைவரும்',
						value: 'all'
					});
				movelevel.append({
						type: 'option',
						label: 'தானாக உறுதியளிக்கப்பட்ட பயனர்கள்',
						value: 'autoconfirmed'
					});
				movelevel.append({
						type: 'option',
						label: 'நிருவாகி',
						value: 'sysop',
						selected: true
					});
				field2.append({
						type: 'select',
						name: 'moveexpiry',
						label: 'முடிவு:',
						event: function(e) {
							if (e.target.value === 'custom') {
								Twinkle.protect.doCustomExpiry(e.target);
							}
						},
						list: [
							{ label: '1 மணி', value: '1 hour' },
							{ label: '2 மணிகள்', value: '2 hours' },
							{ label: '3 மணிகள்', value: '3 hours' },
							{ label: '6 மணிகள்', value: '6 hours' },
							{ label: '12 மணிகள்', value: '12 hours' },
							{ label: '1 நாள்', value: '1 day' },
							{ label: '2 நாள்கள்', value: '2 days' },
							{ label: '3 நாள்கள்', value: '3 days' },
							{ label: '4 நாள்கள்', value: '4 days' },
							{ label: '1 கிழமை', value: '1 week' },
							{ label: '2 கிழமைகள்', value: '2 weeks' },
							{ label: '1 மாதம்', value: '1 month' },
							{ label: '2 மாதங்கள்', value: '2 months' },
							{ label: '3 மாதங்கள்', value: '3 months' },
							{ label: '1 ஆண்டு', value: '1 year' },
							{ label: 'முடிவிலி', selected: true, value:'indefinite' },
							{ label: 'வேறு...', value: 'custom' }
						]
					});
			} else {  // for non-existing pages
				var createlevel = field2.append({
						type: 'select',
						name: 'createlevel',
						label: 'உருவாக்கல் காப்பு:',
						event: Twinkle.protect.formevents.createlevel
					});
				createlevel.append({
						type: 'option',
						label: 'அனைவரும்',
						value: 'all'
					});
				createlevel.append({
						type: 'option',
						label: 'தானாக உறுதியளிக்கப்பட்ட பயனர்கள்',
						value: 'autoconfirmed'
					});
				createlevel.append({
						type: 'option',
						label: 'நிருவாகி',
						value: 'sysop',
						selected: true
					});
				field2.append({
						type: 'select',
						name: 'createexpiry',
						label: 'முடிவு:',
						event: function(e) {
							if (e.target.value === 'custom') {
								Twinkle.protect.doCustomExpiry(e.target);
							}
						},
						list: [
							{ label: '1 மணி', value: '1 hour' },
							{ label: '2 மணிகள்', value: '2 hours' },
							{ label: '3 மணிகள்', value: '3 hours' },
							{ label: '6 மணிகள்', value: '6 hours' },
							{ label: '12 மணிகள்', value: '12 hours' },
							{ label: '1 நாள்', value: '1 day' },
							{ label: '2 நாள்கள்', value: '2 days' },
							{ label: '3 நாள்கள்', value: '3 days' },
							{ label: '4 நாள்கள்', value: '4 days' },
							{ label: '1 கிழமை', value: '1 week' },
							{ label: '2 கிழமைகள்', value: '2 weeks' },
							{ label: '1 மாதம்', value: '1 month' },
							{ label: '2 மாதங்கள்', value: '2 months' },
							{ label: '3 மாதங்கள்', value: '3 months' },
							{ label: '1 ஆண்டு', value: '1 year' },
							{ label: 'முடிவிலி', selected: true, value: 'indefinite' },
							{ label: 'வேறு...', value: 'custom' }
						]
					});
			}
			field2.append({
					type: 'textarea',
					name: 'protectReason',
					label: 'காரணம் (காப்புப் பதிகையில் குறிப்பிட):'
				});
			if (!mw.config.get('wgArticleId')) {  // tagging isn't relevant for non-existing pages
				break;
			}
			/* falls through */
		case 'tag':
			field1 = new Morebits.quickForm.element({ type: 'field', label: 'அடையாளப்படுத்தல் தெரிவுகள்', name: 'field1' });
			field1.append({ type: 'div', name: 'currentprot', label: ' ' });  // holds the current protection level, as filled out by the async callback
			field1.append({ type: 'div', name: 'hasprotectlog', label: ' ' });
			field1.append( {
					type: 'select',
					name: 'tagtype',
					label: 'காப்பு வார்ப்புருவைத் தெரிக:',
					list: Twinkle.protect.protectionTags,
					event: Twinkle.protect.formevents.tagtype
				} );
			field1.append( {
					type: 'checkbox',
					list: [
						{
							name: 'small',
							label: 'படவுருவாக்கு (small=yes)',
							tooltip: '|small=yes என்ற வார்ப்புரு வசதியைப் பயன்படுத்தி, பூட்டை மட்டும் காட்டும்.',
							checked: true
						},
						{
							name: 'noinclude',
							label: 'காப்பு வார்ப்புருவை <noinclude>இனுள் உள்ளடக்கு',
							tooltip: '&lt;noinclude&gt; அடையாளங்களுக்குள் காப்பு வார்ப்புருவை உள்ளடக்கும். எனவே, அது வேறிடந்தோன்றாது.',
							checked: (mw.config.get('wgNamespaceNumber') === 10)
						}
					]
				} );
			break;

		case 'request':
			field_preset = new Morebits.quickForm.element({ type: 'field', label: 'Type of protection', name: 'field_preset' });
			field_preset.append({
					type: 'select',
					name: 'category',
					label: 'வகையும் காரணமும்:',
					event: Twinkle.protect.callback.changePreset,
					list: (mw.config.get('wgArticleId') ? Twinkle.protect.protectionTypes : Twinkle.protect.protectionTypesCreate)
				});

			field1 = new Morebits.quickForm.element({ type: 'field', label: 'தெரிவுகள்', name: 'field1' });
			field1.append({ type: 'div', name: 'currentprot', label: ' ' });  // holds the current protection level, as filled out by the async callback
			field1.append({ type: 'div', name: 'hasprotectlog', label: ' ' });
			field1.append( {
					type: 'select',
					name: 'expiry',
					label: 'காலம்: ',
					list: [
						{ label: 'தற்காலிகம்', value: 'temporary' },
						{ label: 'முடிவிலி', value: 'indefinite' },
						{ label: '', selected: true, value: '' }
					]
				} );
			field1.append({
					type: 'textarea',
					name: 'reason',
					label: 'காரணம்: '
				});
			break;
		default:
			alert("Something's afoot in twinkleprotect");
			break;
	}

	var oldfield;

	if (field_preset) {
		oldfield = $(e.target.form).find('fieldset[name="field_preset"]')[0];
		oldfield.parentNode.replaceChild(field_preset.render(), oldfield);
	} else {
		$(e.target.form).find('fieldset[name="field_preset"]').css('display', 'none');
	}
	if (field1) {
		oldfield = $(e.target.form).find('fieldset[name="field1"]')[0];
		oldfield.parentNode.replaceChild(field1.render(), oldfield);
	} else {
		$(e.target.form).find('fieldset[name="field1"]').css('display', 'none');
	}
	if (field2) {
		oldfield = $(e.target.form).find('fieldset[name="field2"]')[0];
		oldfield.parentNode.replaceChild(field2.render(), oldfield);
	} else {
		$(e.target.form).find('fieldset[name="field2"]').css('display', 'none');
	}

	if (e.target.values === 'protect') {
		// fake a change event on the preset dropdown
		var evt = document.createEvent( "Event" );
		evt.initEvent( 'change', true, true );
		e.target.form.category.dispatchEvent( evt );

		// reduce vertical height of dialog
		$(e.target.form).find('fieldset[name="field2"] select').parent().css({ display: 'inline-block', marginRight: '0.5em' });
	}

	// re-add protection level and log info, if it's available
	Twinkle.protect.callback.showLogAndCurrentProtectInfo();
};

Twinkle.protect.formevents = {
	editmodify: function twinkleprotectFormEditmodifyEvent(e) {
		e.target.form.editlevel.disabled = !e.target.checked;
		e.target.form.editexpiry.disabled = !e.target.checked || (e.target.form.editlevel.value === 'all');
		e.target.form.editlevel.style.color = e.target.form.editexpiry.style.color = (e.target.checked ? "" : "transparent");
	},
	editlevel: function twinkleprotectFormEditlevelEvent(e) {
		e.target.form.editexpiry.disabled = (e.target.value === 'all');
	},
	movemodify: function twinkleprotectFormMovemodifyEvent(e) {
		// sync move settings with edit settings if applicable
		if (e.target.form.movelevel.disabled && !e.target.form.editlevel.disabled) {
			e.target.form.movelevel.value = e.target.form.editlevel.value;
			e.target.form.moveexpiry.value = e.target.form.editexpiry.value;
		} else if (e.target.form.editlevel.disabled) {
			e.target.form.movelevel.value = 'sysop';
			e.target.form.moveexpiry.value = 'indefinite';
		}
		e.target.form.movelevel.disabled = !e.target.checked;
		e.target.form.moveexpiry.disabled = !e.target.checked || (e.target.form.movelevel.value === 'all');
		e.target.form.movelevel.style.color = e.target.form.moveexpiry.style.color = (e.target.checked ? "" : "transparent");
	},
	movelevel: function twinkleprotectFormMovelevelEvent(e) {
		e.target.form.moveexpiry.disabled = (e.target.value === 'all');
	},
	pcmodify: function twinkleprotectFormPcmodifyEvent(e) {
		e.target.form.pclevel.disabled = !e.target.checked;
		e.target.form.pcexpiry.disabled = !e.target.checked || (e.target.form.pclevel.value === 'none');
		e.target.form.pclevel.style.color = e.target.form.pcexpiry.style.color = (e.target.checked ? "" : "transparent");
	},
	pclevel: function twinkleprotectFormPclevelEvent(e) {
		e.target.form.pcexpiry.disabled = (e.target.value === 'none');
	},
	createlevel: function twinkleprotectFormCreatelevelEvent(e) {
		e.target.form.createexpiry.disabled = (e.target.value === 'all');
	},
	tagtype: function twinkleprotectFormTagtypeEvent(e) {
		e.target.form.small.disabled = e.target.form.noinclude.disabled = (e.target.value === 'none') || (e.target.value === 'noop');
	}
};

Twinkle.protect.doCustomExpiry = function twinkleprotectDoCustomExpiry(target) {
	var custom = prompt('முடிவு நேரத்தை உள்ளிடுக.  \n"1 minute" அல்லது "19 days" என்றவாறு சார்பு நேரத்தையோ "ஆஆஆஆமாமாநாநாநிநி" (எ-டு: "200602011405" என்பது பெப்ரவரி 1, 2006 அன்று ஒ. அ. நே. 14:05ஐக் குறிக்கும்.) என்றவாறு தனிநேரத்தையோ பயன்படுத்தலாம்.', '');
	if (custom) {
		var option = document.createElement('option');
		option.setAttribute('value', custom);
		option.textContent = custom;
		target.appendChild(option);
		target.value = custom;
	} else {
		target.selectedIndex = 0;
	}
};

Twinkle.protect.protectionTypes = [
	{ label: 'காப்பு நீக்கம்', value: 'unprotect' },
	{
		label: 'முழுக்காப்பு',
		list: [
			{ label: 'பொது (முழு)', value: 'pp-protected' },
			{ label: 'உள்ளடக்கப் பிணக்கு/தொகுப்புப் போர் (முழு)', value: 'pp-dispute' },
			{ label: 'தொடர்ச்சியான நாசவேலை (முழு)', value: 'pp-vandalism' },
			{ label: 'தடைசெய்த பயனரின் பேச்சுப் பக்கம் (முழு)', value: 'pp-usertalk' }
		]
	},
	{
		label: 'வார்ப்புருக் காப்பு',
		list: [
			{ label: 'கூடுதலாகப் பயன்படுத்தப்படும் வார்ப்புரு', value: 'pp-template' }
		]
	},
	{
		label: 'பகுதிக் காப்பு',
		list: [
			{ label: 'பொது (பகுதி)', value: 'pp-semi-protected' },
			{ label: 'தொடர்ச்சியான நாசவேலை (பகுதி)', selected: true, value: 'pp-semi-vandalism' },
			{ label: 'தீங்கிழைக்கும் தொகுப்புகள் (பகுதி)', value: 'pp-semi-disruptive' },
			{ label: 'மேற்கோளிடப்படாத உள்ளடக்கம் இணைக்கப்படுகின்றது (பகுதி)', value: 'pp-semi-unsourced' },
			{ label: 'வாழும் மனிதர்களின் வாழ்க்கை வரலாற்றுக் கொள்கை மீறல்கள் (பகுதி)', value: 'pp-semi-blp' },
			{ label: 'கைப்பாவை (பகுதி)', value: 'pp-semi-sock' },
			{ label: 'தடைசெய்த பயனரின் பேச்சுப் பக்கம் (பகுதி)', value: 'pp-semi-usertalk' }
		]
	},
	{
		label: 'நகர்த்தல் காப்பு',
		list: [
			{ label: 'பொது (நகர்த்தல்)', value: 'pp-move' },
			{ label: 'பிணக்கு/நகர்த்தற் போர் (நகர்த்தல்)', value: 'pp-move-dispute' },
			{ label: 'பக்க நகர்த்தல் நாசவேலை (நகர்த்தல்)', value: 'pp-move-vandalism' },
			{ label: 'கூடுதலாகப் பார்வையிடப்படும் பக்கம் (நகர்த்தல்)', value: 'pp-move-indef' }
		]
	}
];

Twinkle.protect.protectionTypesCreate = [
	{ label: 'காப்பு நீக்கம்', value: 'unprotect' },
	{
		label: 'உருவாக்கல் காப்பு',
		list: [
			{ label: 'பொது ({{pp-create}})', value: 'pp-create' },
			{ label: 'புண்படுத்தும் பெயர்', value: 'pp-create-offensive' },
			{ label: 'தொடர்ச்சியாக மீளவுருவாக்கப்படுகின்றது', selected: true, value: 'pp-create-salt' },
			{ label: 'அண்மையில் அழித்த வாழும் மனிதரின் வாழ்க்கை வரலாறு', value: 'pp-create-blp' }
		]
	}
];

// A page with both regular and PC protection will be assigned its regular
// protection weight plus 2 (for PC1) or 7 (for PC2)
Twinkle.protect.protectionWeight = {
	sysop: 30,
	templateeditor: 20,
	flaggedrevs_review: 15,  // Pending Changes level 2 protection alone
	autoconfirmed: 10,
	flaggedrevs_autoconfirmed: 5,  // Pending Changes level 1 protection alone
	all: 0,
	flaggedrevs_none: 0  // just in case
};

// NOTICE: keep this synched with [[MediaWiki:Protect-dropdown]]
// Also note: stabilize = Pending Changes level
Twinkle.protect.protectionPresetsInfo = {
	'pp-protected': {
		edit: 'sysop',
		move: 'sysop',
		reason: null
	},
	'pp-dispute': {
		edit: 'sysop',
		move: 'sysop',
		reason: '[[WP:PP|தொகுப்புப் போர்/உள்ளடக்கப் பிணக்கு]]'
	},
	'pp-vandalism': {
		edit: 'sysop',
		move: 'sysop',
		reason: 'தொடர்ச்சியான நாசவேலை'
	},
	'pp-usertalk': {
		edit: 'sysop',
		move: 'sysop',
		reason: '[[WP:PP|தடைசெய்யப்பட்டுள்ளபோது பயனர் பேச்சுப் பக்கத்தைப் பொருத்தமற்ற வகையில் பயன்படுத்துதல்.]]'
	},
	'pp-template': {
		edit: 'sysop',
		move: 'sysop',
		reason: 'கூடுதலாகப் பயன்படுத்தப்படும் வார்ப்புரு'
	},
	'pp-semi-vandalism': {
		edit: 'autoconfirmed',
		reason: 'தொடர்ச்சியான நாசவேலை',
		template: 'pp-vandalism'
	},
	'pp-semi-disruptive': {
		edit: 'autoconfirmed',
		reason: 'தொடர்ச்சியான சீர்குலைக்கும் தொகுப்புகள்',
		template: 'pp-protected'
	},
	'pp-semi-unsourced': {
		edit: 'autoconfirmed',
		reason: 'மேற்கோளிடப்படாத அல்லது வறிதாக மேற்கோளிடப்பட்ட உள்ளடக்கம் தொடர்ச்சியாகச் சேர்க்கப்படுதல்.',
		template: 'pp-protected'
	},
	'pp-semi-blp': {
		edit: 'autoconfirmed',
		reason: '[[WP:BLP|வாழும் மனிதர்களின் வாழ்க்கை வரலாற்றுக் கொள்கை]] மீறல்கள்',
		template: 'pp-blp'
	},
	'pp-semi-usertalk': {
		edit: 'autoconfirmed',
		move: 'autoconfirmed',
		reason: '[[WP:PP|தடைசெய்யப்பட்டுள்ளபோது பயனர் பேச்சுப் பக்கத்தைப் பொருத்தமற்ற வகையில் பயன்படுத்துதல்.]]',
		template: 'pp-usertalk'
	},
	'pp-semi-template': {  // removed for now
		edit: 'autoconfirmed',
		move: 'autoconfirmed',
		reason: 'கூடுதலாகப் பயன்படுத்தப்படும் வார்ப்புரு',
		template: 'pp-template'
	},
	'pp-semi-sock': {
		edit: 'autoconfirmed',
		reason: 'தொடர்ச்சியான [[விக்கிப்பீடியா:கைப்பாவை|கைப்பாவை]]த் தாக்குதல்',
		template: 'pp-sock'
	},
	'pp-semi-protected': {
		edit: 'autoconfirmed',
		reason: null,
		template: 'pp-protected'
	},
	'pp-move': {
		move: 'sysop',
		reason: null
	},
	'pp-move-dispute': {
		move: 'sysop',
		reason: '[[WP:PP|நகர்த்தற் போர்]]'
	},
	'pp-move-vandalism': {
		move: 'sysop',
		reason: '[[WP:PP|பக்க நகர்த்தல் நாசவேலை]]'
	},
	'pp-move-indef': {
		move: 'sysop',
		reason: '[[WP:PP|கூடுதலாகப் பார்வையிடப்படும் பக்கம்]]'
	},
	'unprotect': {
		edit: 'all',
		move: 'all',
		stabilize: 'none',
		create: 'all',
		reason: null,
		template: 'none'
	},
	'pp-create-offensive': {
		create: 'sysop',
		reason: '[[WP:PP|புண்படுத்தும் பெயர்]]'
	},
	'pp-create-salt': {
		create: 'sysop',
		reason: '[[WP:PP|தொடர்ச்சியாக மீளவுருவாக்கப்படுகின்றது]]'
	},
	'pp-create-blp': {
		create: 'sysop',
		reason: '[[WP:BLP|அண்மையில் அழித்த வாழும் மனிதரின் வாழ்க்கை வரலாறு]]'
	},
	'pp-create': {
		create: 'sysop',
		reason: '{{pp-create}}'
	}
};

Twinkle.protect.protectionTags = [
	{
		label: 'எதுவுமில்லை (ஏற்கனவேயுள்ள காப்பு வார்ப்புருக்களை நீக்குக.)',
		value: 'none'
	},
	{
		label: 'எதுவுமில்லை (ஏற்கனவேயுள்ள காப்பு வார்ப்புருக்களை நீக்கவேண்டாம்.)',
		value: 'noop'
	},
	{
		label: 'தொகுத்தற் காப்பு வார்ப்புருக்கள்',
		list: [
			{ label: '{{pp-vandalism}}: நாசவேலை', value: 'pp-vandalism' },
			{ label: '{{pp-dispute}}: பிணக்கு/தொகுப்புப் போர்', value: 'pp-dispute', selected: true },
			{ label: '{{pp-blp}}: வாழும் மனிதர்களின் வாழ்க்கை வரலாற்றுக் கொள்கை மீறல்கள்', value: 'pp-blp' },
			{ label: '{{pp-sock}}: கைப்பாவைத் தாக்குதல்கள்', value: 'pp-sock' },
			{ label: '{{pp-template}}: கூடுதலாகப் பயன்படுத்தப்படும் வார்ப்புரு', value: 'pp-template' },
			{ label: '{{pp-usertalk}}: தடைசெய்த பயனர் பேச்சு', value: 'pp-usertalk' },
			{ label: '{{pp-protected}}: பொதுவான காப்பு', value: 'pp-protected' },
			{ label: '{{pp-semi-indef}}: பொதுவான நீண்ட காலப் பகுதிக் காப்பு', value: 'pp-semi-indef' }
		]
	},
	{
		label: 'நகர்த்தற் காப்பு வார்ப்புருக்கள்',
		list: [
			{ label: '{{pp-move-dispute}}: பிணக்கு/நகர்த்தற் போர்', value: 'pp-move-dispute' },
			{ label: '{{pp-move-vandalism}}: பக்க நகர்த்தல் நாசவேலை', value: 'pp-move-vandalism' },
			{ label: '{{pp-move-indef}}: பொதுவான நீண்ட கால', value: 'pp-move-indef' },
			{ label: '{{pp-move}}: வேறு', value: 'pp-move' }
		]
	}
];

Twinkle.protect.callback.changePreset = function twinkleprotectCallbackChangePreset(e) {
	var form = e.target.form;

	var actiontypes = form.actiontype;
	var actiontype;
	for( var i = 0; i < actiontypes.length; i++ )
	{
		if( !actiontypes[i].checked ) {
			continue;
		}
		actiontype = actiontypes[i].values;
		break;
	}

	if (actiontype === 'protect') {  // actually protecting the page
		var item = Twinkle.protect.protectionPresetsInfo[form.category.value];
		if (mw.config.get('wgArticleId')) {
			if (item.edit) {
				form.editmodify.checked = true;
				Twinkle.protect.formevents.editmodify({ target: form.editmodify });
				form.editlevel.value = item.edit;
				Twinkle.protect.formevents.editlevel({ target: form.editlevel });
			} else {
				form.editmodify.checked = false;
				Twinkle.protect.formevents.editmodify({ target: form.editmodify });
			}

			if (item.move) {
				form.movemodify.checked = true;
				Twinkle.protect.formevents.movemodify({ target: form.movemodify });
				form.movelevel.value = item.move;
				Twinkle.protect.formevents.movelevel({ target: form.movelevel });
			} else {
				form.movemodify.checked = false;
				Twinkle.protect.formevents.movemodify({ target: form.movemodify });
			}

			if (item.stabilize) {
				form.pcmodify.checked = true;
				Twinkle.protect.formevents.pcmodify({ target: form.pcmodify });
				form.pclevel.value = item.stabilize;
				Twinkle.protect.formevents.pclevel({ target: form.pclevel });
			} else {
				form.pcmodify.checked = false;
				Twinkle.protect.formevents.pcmodify({ target: form.pcmodify });
			}
		} else {
			if (item.create) {
				form.createlevel.value = item.create;
				Twinkle.protect.formevents.createlevel({ target: form.createlevel });
			}
		}

		var reasonField = (actiontype === "protect" ? form.protectReason : form.reason);
		if (item.reason) {
			reasonField.value = item.reason;
		} else {
			reasonField.value = '';
		}

		// sort out tagging options
		if (mw.config.get('wgArticleId')) {
			if( form.category.value === 'unprotect' ) {
				form.tagtype.value = 'none';
			} else {
				form.tagtype.value = (item.template ? item.template : form.category.value);
			}
			Twinkle.protect.formevents.tagtype({ target: form.tagtype });

			if( /template/.test( form.category.value ) ) {
				form.noinclude.checked = true;
				form.editexpiry.value = form.moveexpiry.value = form.pcexpiry.value = "indefinite";
			} else if( mw.config.get('wgNamespaceNumber') !== 10 ) {
				form.noinclude.checked = false;
			}
		}

	} else {  // RPP request
		if( form.category.value === 'unprotect' ) {
			form.expiry.value = '';
			form.expiry.disabled = true;
		} else {
			form.expiry.disabled = false;
		}
	}
};

Twinkle.protect.callback.evaluate = function twinkleprotectCallbackEvaluate(e) {
	var form = e.target;

	var actiontypes = form.actiontype;
	var actiontype;
	for( var i = 0; i < actiontypes.length; i++ )
	{
		if( !actiontypes[i].checked ) {
			continue;
		}
		actiontype = actiontypes[i].values;
		break;
	}

	var tagparams;
	if( actiontype === 'tag' || (actiontype === 'protect' && mw.config.get('wgArticleId')) ) {
		tagparams = {
			tag: form.tagtype.value,
			reason: ((form.tagtype.value === 'pp-protected' || form.tagtype.value === 'pp-semi-protected' || form.tagtype.value === 'pp-move') && form.protectReason) ? form.protectReason.value : null,
			expiry: (actiontype === 'protect') ?
				(form.editmodify.checked ? form.editexpiry.value :
					(form.movemodify.checked ? form.moveexpiry.value :
						(form.pcmodify.checked ? form.pcexpiry.value : null)
					)
				) : null,
			small: form.small.checked,
			noinclude: form.noinclude.checked
		};
	}

	switch (actiontype) {
		case 'protect':
			// protect the page

			Morebits.wiki.actionCompleted.redirect = mw.config.get('wgPageName');
			Morebits.wiki.actionCompleted.notice = "காப்பு நிறைவு";

			var statusInited = false;
			var thispage;

			var allDone = function twinkleprotectCallbackAllDone() {
				if (thispage) {
					thispage.getStatusElement().info("done");
				}
				if (tagparams) {
					Twinkle.protect.callbacks.taggingPageInitial(tagparams);
				}
			};

			var stabilizeValues = {};
			if (form.pclevel) {
				stabilizeValues = {
					pclevel: form.pclevel.value,
					pcexpiry: form.pcexpiry.value,
					protectReason: form.protectReason.value
				};
			}

			var protectIt = function twinkleprotectCallbackProtectIt(next) {
				thispage = new Morebits.wiki.page(mw.config.get('wgPageName'), "பக்கத்தைக் காக்கின்றது");
				if (mw.config.get('wgArticleId')) {
					if (form.editmodify.checked) {
						thispage.setEditProtection(form.editlevel.value, form.editexpiry.value);
					}
					if (form.movemodify.checked) {
						thispage.setMoveProtection(form.movelevel.value, form.moveexpiry.value);
					}
				} else {
					thispage.setCreateProtection(form.createlevel.value, form.createexpiry.value);
					thispage.setWatchlist(false);
				}

				if (form.protectReason.value) {
					thispage.setEditSummary(form.protectReason.value);
				} else {
					alert("காப்புப் பதிகையில் பதிவதற்காக, நீங்கள் ஒரு காரணத்தைக் கட்டாயம் குறிப்பிடவேண்டும்.");
					return;
				}

				if (!statusInited) {
					Morebits.simpleWindow.setButtonsEnabled( false );
					Morebits.status.init( form );
					statusInited = true;
				}

				thispage.protect(next);
			};

			var stabilizeIt = function twinkleprotectCallbackStabilizeIt() {
				if (thispage) {
					thispage.getStatusElement().info("done");
				}

				thispage = new Morebits.wiki.page(mw.config.get('wgPageName'), "Applying pending changes protection");
				thispage.setFlaggedRevs(stabilizeValues.pclevel, stabilizeValues.pcexpiry);

				if (stabilizeValues.protectReason) {
					thispage.setEditSummary(stabilizeValues.protectReason);
				} else {
					alert("காப்புப் பதிகையில் பதிவதற்காக, நீங்கள் ஒரு காரணத்தைக் கட்டாயம் குறிப்பிடவேண்டும்.");
					return;
				}

				if (!statusInited) {
					Morebits.simpleWindow.setButtonsEnabled(false);
					Morebits.status.init(form);
					statusInited = true;
				}

				thispage.stabilize(allDone);
			};

			if ((form.editmodify && form.editmodify.checked) || (form.movemodify && form.movemodify.checked) ||
				!mw.config.get('wgArticleId')) {
				if (form.pcmodify && form.pcmodify.checked) {
					protectIt(stabilizeIt);
				} else {
					protectIt(allDone);
				}
			} else if (form.pcmodify && form.pcmodify.checked) {
				stabilizeIt();
			} else {
				alert("அருள்கூர்ந்து மின்னலிடம் ஒரு பணியை ஒப்படையுங்கள்.! \nநீங்கள் இப்பக்கத்தை அடையாளப்படுத்தவேண்டுமாயின், மேலேயுள்ள 'பக்கத்தில் காப்பு வார்ப்புருவை இணைத்தல்' என்பதைத் தெரிவுசெய்யுங்கள்.");
			}

			break;

		case 'tag':
			// apply a protection template

			Morebits.simpleWindow.setButtonsEnabled( false );
			Morebits.status.init( form );

			Morebits.wiki.actionCompleted.redirect = mw.config.get('wgPageName');
			Morebits.wiki.actionCompleted.followRedirect = false;
			Morebits.wiki.actionCompleted.notice = "அடையாளப்படுத்தல் நிறைவு";

			Twinkle.protect.callbacks.taggingPageInitial(tagparams);
			break;

		case 'request':
			// file request at RPP
			var typename, typereason;
			switch( form.category.value ) {
				case 'pp-dispute':
				case 'pp-vandalism':
				case 'pp-usertalk':
				case 'pp-protected':
					typename = 'முழுக் காப்பு';
					break;
				case 'pp-template':
					typename = 'வார்ப்புருக் காப்பு';
					break;
				case 'pp-semi-vandalism':
				case 'pp-semi-disruptive':
				case 'pp-semi-unsourced':
				case 'pp-semi-usertalk':
				case 'pp-semi-sock':
				case 'pp-semi-blp':
				case 'pp-semi-protected':
					typename = 'பகுதிக் காப்பு';
					break;
				case 'pp-move':
				case 'pp-move-dispute':
				case 'pp-move-indef':
				case 'pp-move-vandalism':
					typename = 'நகர்த்தற் காப்பு';
					break;
				case 'pp-create':
				case 'pp-create-offensive':
				case 'pp-create-blp':
				case 'pp-create-salt':
					typename = 'உருவாக்கற் காப்பு';
					break;
				case 'unprotect':
					/* falls through */
				default:
					typename = 'காப்பு நீக்கம்';
					break;
			}
			switch (form.category.value) {
				case 'pp-dispute':
					typereason = 'உள்ளடக்கப் பிணக்கு/தொகுப்புப் போர்';
					break;
				case 'pp-vandalism':
				case 'pp-semi-vandalism':
				case 'pp-pc-vandalism':
					typereason = 'தொடர்ச்சியான நாசவேலை';
					break;
				case 'pp-semi-disruptive':
				case 'pp-pc-disruptive':
					typereason = 'தொடர்ச்சியான சீர்குலைக்கும் தொகுப்புகள்';
					break;
				case 'pp-semi-unsourced':
				case 'pp-pc-unsourced':
					typereason = 'மேற்கோளிடப்படாத அல்லது வறிதாக மேற்கோளிடப்பட்ட உள்ளடக்கம் தொடர்ச்சியாகச் சேர்க்கப்படுதல்.';
					break;
				case 'pp-template':
					typereason = 'கூடுதலாகப் பயன்படுத்தப்படும் வார்ப்புரு';
					break;
				case 'pp-usertalk':
				case 'pp-semi-usertalk':
					typereason = 'தடைசெய்யப்பட்டுள்ளபோது பயனர் பேச்சுப் பக்கத்தைப் பொருத்தமற்ற வகையில் பயன்படுத்துதல்.';
					break;
				case 'pp-semi-sock':
					typereason = 'தொடர்ச்சியான கைப்பாவைத் தாக்குதல்';
					break;
				case 'pp-semi-blp':
				case 'pp-pc-blp':
					typereason = '[[WP:BLP|வாழும் மனிதர்களின் வாழ்க்கை வரலாற்றுக்]] கொள்கை மீறல்கள்';
					break;
				case 'pp-move-dispute':
					typereason = 'பக்கத் தலைப்புப் பிணக்கு/நகர்த்தற் போர்';
					break;
				case 'pp-move-vandalism':
					typereason = 'பக்க நகர்த்தல் நாசவேலை';
					break;
				case 'pp-move-indef':
					typereason = 'கூடுதலாகப் பார்வையிடப்படும் பக்கம்';
					break;
				case 'pp-create-offensive':
					typereason = 'புண்படுத்தும் பெயர்';
					break;
				case 'pp-create-blp':
					typereason = 'அண்மையில் அழித்த [[WP:BLP|வாழும் மனிதரின் வாழ்க்கை வரலாறு]]';
					break;
				case 'pp-create-salt':
					typereason = 'தொடர்ச்சியாக மீளவுருவாக்கப்படுகின்றது';
					break;
				default:
					typereason = '';
					break;
			}

			var reason = typereason;
			if( form.reason.value !== '') {
				if ( typereason !== '' ) {
					reason += "\u00A0\u2013 ";  // U+00A0 NO-BREAK SPACE; U+2013 EN RULE
				}
				reason += form.reason.value;
			}
			if( reason !== '' && reason.charAt( reason.length - 1 ) !== '.' ) {
				reason += '.';
			}

			var rppparams = {
				reason: reason,
				typename: typename,
				category: form.category.value,
				expiry: form.expiry.value
			};

			Morebits.simpleWindow.setButtonsEnabled( false );
			Morebits.status.init( form );

			var rppName = 'விக்கிப்பீடியா:பக்கக் காப்புக்கான வேண்டுகோள்கள்';

			// Updating data for the action completed event
			Morebits.wiki.actionCompleted.redirect = rppName;
			Morebits.wiki.actionCompleted.notice = "பரிந்துரை நிறைவு, உரையாடற் பக்கத்திற்கு இப்போது வழிமாற்றுகின்றது.";

			var rppPage = new Morebits.wiki.page( rppName, 'பக்கக் காப்பைக் கோருகின்றது.');
			rppPage.setFollowRedirect( true );
			rppPage.setCallbackParameters( rppparams );
			rppPage.load( Twinkle.protect.callbacks.fileRequest );
			break;
		default:
			alert("மின்னற் காப்பு: அறியப்படாத செயல்");
			break;
	}
};

Twinkle.protect.callbacks = {
	taggingPageInitial: function( tagparams ) {
		if (tagparams.tag === 'noop') {
			Morebits.status.info("காப்பு வார்ப்புருவைச் சேர்க்கின்றது.", "செய்ய எதுவுமில்லை.");
			return;
		}

		var protectedPage = new Morebits.wiki.page( mw.config.get('wgPageName'), 'பக்கத்தை அடையாளப்படுத்துகின்றது.');
		protectedPage.setCallbackParameters( tagparams );
		protectedPage.load( Twinkle.protect.callbacks.taggingPage );
	},
	taggingPage: function( protectedPage ) {
		var params = protectedPage.getCallbackParameters();
		var text = protectedPage.getPageText();
		var tag, summary;

		var oldtag_re = /\s*(?:<noinclude>)?\s*\{\{\s*(pp-[^{}]*?|protected|(?:t|v|s|p-|usertalk-v|usertalk-s|sb|move)protected(?:2)?|protected template|privacy protection)\s*?\}\}\s*(?:<\/noinclude>)?\s*/gi;
		var re_result = oldtag_re.exec(text);
		if (re_result) {
			if (confirm("{{" + re_result[1] + "}} பக்கத்தில் கண்டுபிடிக்க்பட்டுள்ளது. \nஅதனை நீக்குவதற்குச் சரி என்பதைச் சொடுக்குங்கள். அல்லது அதனை அவ்வாறே விடுவதற்குக் கைவிடு என்பதைச் சொடுக்குங்கள்.")) {
				text = text.replace( oldtag_re, '' );
			}
		}

		if ( params.tag !== 'none' ) {
			tag = params.tag;
			if( params.reason ) {
				tag += '|reason=' + params.reason;
			}
			if( ['indefinite', 'infinite', 'never', null].indexOf(params.expiry) === -1 ) {
				tag += '|expiry={{subst:#time:j F Y|' + (/^\s*\d+\s*$/.exec(params.expiry) ? params.expiry : '+' + params.expiry) + '}}';
			}
			if( params.small ) {
				tag += '|small=yes';
			}
		}

		if( params.tag === 'none' ) {
			summary = 'காப்பு வார்ப்புரு நீக்கம்' + Twinkle.getPref('summaryAd');
		} else {
			if( params.noinclude ) {
				text = "<noinclude>{{" + tag + "}}</noinclude>" + text;
			} else if( Morebits.wiki.isPageRedirect() ) {
				text = text + "\n{{" + tag + "}}";
			} else {
				text = "{{" + tag + "}}\n" + text;
			}
			summary = "சேர்க்கப்பட்டது: {{" + params.tag + "}}" + Twinkle.getPref('summaryAd');
		}

		protectedPage.setEditSummary( summary );
		protectedPage.setPageText( text );
		protectedPage.setCreateOption( 'nocreate' );
		protectedPage.suppressProtectWarning(); // no need to let admins know they are editing through protection
		protectedPage.save();
	},

	fileRequest: function( rppPage ) {

		var params = rppPage.getCallbackParameters();
		var text = rppPage.getPageText();
		var statusElement = rppPage.getStatusElement();

		var rppRe = new RegExp( '===\\s*(\\[\\[)?\s*:?\s*' + RegExp.escape( Morebits.pageNameNorm, true ) + '\s*(\\]\\])?\\s*===', 'm' );
		var tag = rppRe.exec( text );

		var rppLink = document.createElement('a');
		rppLink.setAttribute('href', mw.util.getUrl(rppPage.getPageName()) );
		rppLink.appendChild(document.createTextNode(rppPage.getPageName()));

		if ( tag ) {
			statusElement.error( [ 'இப்பக்கத்திற்கு ஏற்கனவே ஒரு காப்பு வேண்டுகோள் இங்கு உள்ளது:', rppLink, ', கைவிடுகின்றது.' ] );
			return;
		}

		var newtag = '=== [[:' + Morebits.pageNameNorm + ']] ===\n';
		if( ( new RegExp( '^' + RegExp.escape( newtag ).replace( /\s+/g, '\\s*' ), 'm' ) ).test( text ) ) {
			statusElement.error( [ 'இப்பக்கத்திற்கு ஏற்கனவே ஒரு காப்பு வேண்டுகோள் இங்கு உள்ளது:', rppLink, ', கைவிடுகின்றது.' ] );
			return;
		}
		newtag += '* {{pagelinks|' + Morebits.pageNameNorm + '}}\n\n';

		var words;
		switch( params.expiry ) {
		case 'temporary':
			words = "தற்காலிகம் ";
			break;
		case 'indefinite':
			words = "முடிவிலி ";
			break;
		default:
			words = "";
			break;
		}

		words += params.typename;

		newtag += "'''" + Morebits.string.toUpperCaseFirstChar(words) + ( params.reason !== '' ? ( ":''' " +
			Morebits.string.formatReasonText(params.reason) ) : ".'''" ) + " ~~~~";

		// If either protection type results in a increased status, then post it under increase
		// else we post it under decrease
		var increase = false;
		var protInfo = Twinkle.protect.protectionPresetsInfo[params.category];

		// function to compute protection weights (see comment at Twinkle.protect.protectionWeight)
		var computeWeight = function(mainLevel, stabilizeLevel) {
			var result = Twinkle.protect.protectionWeight[mainLevel || 'all'];
			if (stabilizeLevel) {
				if (result) {
					if (stabilizeLevel.level === "autoconfirmed") {
						result += 2;
					} else if (stabilizeLevel.level === "review") {
						result += 7;
					}
				} else {
					result = Twinkle.protect.protectionWeight["flaggedrevs_" + stabilizeLevel];
				}
			}
			return result;
		};

		// compare the page's current protection weights with the protection we are requesting
		var editWeight = computeWeight(Twinkle.protect.currentProtectionLevels.edit &&
			Twinkle.protect.currentProtectionLevels.edit.level,
			Twinkle.protect.currentProtectionLevels.stabilize &&
			Twinkle.protect.currentProtectionLevels.stabilize.level);
		if (computeWeight(protInfo.edit, protInfo.stabilize) > editWeight ||
			computeWeight(protInfo.move) > computeWeight(Twinkle.protect.currentProtectionLevels.move &&
			Twinkle.protect.currentProtectionLevels.move.level) ||
			computeWeight(protInfo.create) > computeWeight(Twinkle.protect.currentProtectionLevels.create &&
			Twinkle.protect.currentProtectionLevels.create.level)) {
			increase = true;
		}

		var reg;
		if ( increase ) {
			reg = /(\n==\s*காப்பு நிலையைக் கூட்டுவதற்கான தற்போதைய வேண்டுகோள்கள்\s*==\s*\n\s*\{\{[^\}\}]+\}\}\s*\n)([\s\S]*?)\s*(\n==[^=])/;
		} else {
			reg = /(\n==\s*காப்பு நிலையைக் குறைப்பதற்கான தற்போதைய வேண்டுகோள்கள்\s*==\s*\n\s*\{\{[^\}\}]+\}\}\s*\n)([\s\S]*?)\s*(\n==[^=])/;
		}
		var originalTextLength = text.length;
		text = text.replace( reg, "$1$2\n\n" + newtag + "\n$3");
		if (text.length === originalTextLength)
		{
			var linknode = document.createElement('a');
			linknode.setAttribute("href", mw.util.getUrl("விக்கிப்பீடியா:மின்னல்/பக்கக் காப்புக்கான வேண்டுகோள்களைச் சரிசெய்தல்") );
			linknode.appendChild(document.createTextNode('How to fix RPP'));
			statusElement.error( [ 'WP:RPPஇல் தொடர்புடைய தலைப்பைக் கண்டுபிடிக்கமுடியவில்லை. இதனைச் சரிசெய்வதற்கு அருள்கூர்ந்து காண்க: ', linknode, '.' ] );
			return;
		}
		statusElement.status( 'Adding new request...' );
		rppPage.setEditSummary( "Requesting " + params.typename + (params.typename === "pending changes" ? ' on [[' : ' of [[') +
			Morebits.pageNameNorm + ']].' + Twinkle.getPref('summaryAd') );
		rppPage.setPageText( text );
		rppPage.setCreateOption( 'recreate' );
		rppPage.save();
	}
};
})(jQuery);
"https://ta.wikipedia.org/w/index.php?title=மீடியாவிக்கி:Gadget-twinkleprotect.js&oldid=1990626" இலிருந்து மீள்விக்கப்பட்டது