प्रयोगकर्ता:स/1.js

विकिपीडिया से

नोट: प्रकाशित करे के बाद, बदलाव देखे खातिर आपके अपने ब्राउजर के कैशे खाली करे के पड़ सकत बा।

  • फायरफॉक्स / सफारी:शिफ्ट दबा के रीलोड पर क्लिक करीं, या फिर Ctrl-F5 या Ctrl-R दबाईं (मैक पर ⌘-R)
  • गूगल क्रोम: Ctrl-Shift-R दबाईं (मैक पर ⌘-Shift-R)
  • इंटरनेट एक्स्प्लोरर/एज़: Ctrl दबा के Refresh पर क्लिक करीं, या Ctrl-F5 दबईं
  • ओपेरा: Menu → Settings में जाईं (मैक में Opera → Preferences) आ एकरे बाद Privacy & security → Clear browsing data → Cached images and files क्लिक करीं।
//<nowiki>


(function($){


/*
 ****************************************
 *** twinklexfd.js: XFD module
 ****************************************
 * Mode of invocation:     Tab ("XFD")
 * Active on:              Existing, non-special pages, except for file pages with no local (non-Commons) file which are not redirects
 * Config directives in:   TwinkleConfig
 */

Twinkle.xfd = function twinklexfd() {
	// Disable on:
	// * special pages
	// * non-existent pages
	// * files on Commons, whether there is a local page or not (unneeded local pages of files on Commons are eligible for CSD F2)
	// * file pages without actual files (these are eligible for CSD G8)
	if ( mw.config.get('wgNamespaceNumber') < 0 || !mw.config.get('wgArticleId') || (mw.config.get('wgNamespaceNumber') === 6 && (document.getElementById('mw-sharedupload') || (!document.getElementById('mw-imagepage-section-filehistory') && !Morebits.wiki.isPageRedirect()))) ) {
		return;
	}
	Twinkle.addPortletLink( Twinkle.xfd.callback, "हचर्चा", "tw-xfd", "हटावे खातिर नामांकन करीं" );
};

Twinkle.xfd.num2order = function twinklexfdNum2order( num ) {
	switch( num ) {
	case 1: return '';
	case 2: return '2सरा';
	case 3: return '3सरा';
	case 4: return '4था';	
	default: return num + 'वाँ';
	}
};

Twinkle.xfd.currentRationale = null;

// error callback on Morebits.status.object
Twinkle.xfd.printRationale = function twinklexfdPrintRationale() {
	if (Twinkle.xfd.currentRationale) {
		Morebits.status.printUserText(Twinkle.xfd.currentRationale, "हटावे खाती आपके द्वारा बतावल कारण नीचे दिहल जात बा, एकरा के आप कॉपी क सकत बानी आ नया हचर्चा डायलाग बक्सा में पेस्ट क सकत बानी अगर दोबारा कोसिस कइल चाहत होखीं:");
		// only need to print the rationale once
		Twinkle.xfd.currentRationale = null;
	}
};

Twinkle.xfd.callback = function twinklexfdCallback() {
	var Window = new Morebits.simpleWindow( 600, 350 );
	Window.setTitle( "हटावे खाती नामांकन करीं (XfD)" );
	Window.setScriptName( "ट्विंकल" );
	Window.addFooterLink( "हटावे खातिर चर्चा के बारे में", "WP:XFD" );
	Window.addFooterLink( "ट्विंकल मदद", "WP:TW/DOC#xfd" );

	var form = new Morebits.quickForm( Twinkle.xfd.callback.evaluate );
	var categories = form.append( {
			type: 'select',
			name: 'category',
			label: 'हटावे के चर्चा के जगह:',
			tooltip: 'जब एक्टिवेट होखी , आप जवना नाँवस्थान में होखब ओकरे अनुसार एगो डिफॉल्ट बिकल्प बीछल जाई। ई डिफॉल्ट सभसे उचित होखे के चाहीं',
			event: Twinkle.xfd.callback.change_category
		} );
	categories.append( {
			type: 'option',
			label: 'लेख हचर्चा  (हटावे खातिर लेख)',
			selected: mw.config.get('wgNamespaceNumber') === 0,  // Main namespace
			value: 'afd'
		} );
	categories.append( {
			type: 'option',
			label: 'टेम्पलेट हचर्चा (चर्चा खातिर टेम्पलेट)',
			selected: mw.config.get('wgNamespaceNumber') === 10,  // Template namespace
			value: 'tfd'
		} );
	categories.append( {
			type: 'option',
			label: 'फाइल हचर्चा (चर्चा खातिर फाइल)',
			selected: mw.config.get('wgNamespaceNumber') === 6,  // File namespace
			value: 'ffd'
		} );
	categories.append( {
			type: 'option',
			label: 'श्रेणी हचर्चा (चर्चा खातिर श्रेणी)',
			selected: mw.config.get('wgNamespaceNumber') === 14,  // Category namespace
			value: 'cfd'
		} );
	categories.append( {
			type: 'option',
			label: 'श्रेणी हचर्चा/तुरंत (जल्दी से नाँव बदले खातिर श्रेणी)',
			value: 'cfds'
		} );
	categories.append( {
			type: 'option',
			label: 'बिबिध हचर्चा (हटावे खातिर बिबिध)',
			selected: [ 0, 6, 10, 14 ].indexOf( mw.config.get('wgNamespaceNumber') ) === -1,
			value: 'mfd'
		} );
	categories.append( {
			type: 'option',
			label: 'अनुप्रेषण हचर्चा (चर्चा खातिर अनुप्रेषण)',
			selected: Morebits.wiki.isPageRedirect(),
			value: 'rfd'
		} );
	form.append( {
			type: 'checkbox',
			list: [
				{
					label: 'पन्ना बनावे वाला के सूचित करीं, अगर संभव होखे',
					value: 'notify',
					name: 'notify',
					tooltip: "अगर ई सही चिन्हित रही तब पन्ना बनावे वाला के वार्ता पन्ना प एगो नोटिफिकेशन टेम्पलेट लगा दिहल जाई।",
					checked: true
				}
			]
		}
	);
	form.append( {
			type: 'field',
			label:'वर्क एरिया',
			name: 'work_area'
		} );

	var previewlink = document.createElement( 'a' );
	$(previewlink).click(function(){
		Twinkle.xfd.callbacks.preview(result);  // |result| is defined below
	});
	previewlink.style.cursor = "pointer";
	previewlink.textContent = 'झलक देखीं';
	form.append( { type: 'div', id: 'xfdpreview', label: [ previewlink ] } );
	form.append( { type: 'div', id: 'twinklexfd-previewbox', style: 'display: none' } );

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

	var result = form.render();
	Window.setContent( result );
	Window.display();
	result.previewer = new Morebits.wiki.preview($(result).find('div#twinklexfd-previewbox').last()[0]);

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

Twinkle.xfd.previousNotify = true;

Twinkle.xfd.callback.change_category = function twinklexfdCallbackChangeCategory(e) {
	var value = e.target.value;
	var form = e.target.form;
	var old_area = Morebits.quickForm.getElements(e.target.form, "work_area")[0];
	var work_area = null;

	var oldreasontextbox = form.getElementsByTagName('textarea')[0];
	var oldreason = (oldreasontextbox ? oldreasontextbox.value : '');

	var appendReasonBox = function twinklexfdAppendReasonBox() {
		work_area.append( {
			type: 'textarea',
			name: 'xfdreason',
			label: 'कारण: ',
			value: oldreason,
			tooltip: 'आपन अपना कारण में विकिमार्कअप के इस्तमाल क सकत बानी। पोस्ट करत समय ट्विंकल राउर दसखत खुदे जोड़ दी।'
		} );
		// TODO possible future "preview" link here
	};

	form.previewer.closePreview();

	switch( value ) {
	case 'afd':
		work_area = new Morebits.quickForm.element( {
				type: 'field',
				label: 'हटावे खातिर लेख',
				name: 'work_area'
			} );
		work_area.append( {
				type: 'checkbox',
				list: [
						{
							label: 'हटावे के टैग <noinclude> में लपेटीं',
							value: 'noinclude',
							name: 'noinclude',
							tooltip: 'हटावे के टैग के &lt;noinclude&gt; टैग में लपेट दिहल जाई, जवना से कि ई ट्रांसक्लूड ना होखे। ई बिकल्प आमतौर पर इस्तेमाल में ना लिहल जाला।'
						}
					]
		} );
		var afd_category = work_area.append( {
				type:'select',
				name:'xfdcat',
				label:'बीछीं कि कवना श्रेणी में ई चर्चा आई:'
			} );

		afd_category.append( { type:'option', label:'नामालूम', value:'?', selected:true } );
		afd_category.append( { type:'option', label:'मीडिया आ म्यूजिक', value:'M' } );
		afd_category.append( { type:'option', label:'ऑर्गनाइजेशन, संस्था, कारपोरेशन, भा प्रोडक्ट', value:'O' } );
		afd_category.append( { type:'option', label:'जीवनी  या जीवनीपरक लेख', value:'B' } );
		afd_category.append( { type:'option', label:'समाज संबंधी बिसय', value:'S' } );
		afd_category.append( { type:'option', label:'वेब भा इंटरनेट', value:'W' } );
		afd_category.append( { type:'option', label:'खेल भा खेलकूद', value:'G' } );
		afd_category.append( { type:'option', label:'बिज्ञान आ टेक्नोलाजी', value:'T' } );
		afd_category.append( { type:'option', label:'कथाकहानी आ कला', value:'F' } );
		afd_category.append( { type:'option', label:'जगह आ परिवहन', value:'P' } );
		afd_category.append( { type:'option', label:'बिना बर्गीकरण', value:'I' } );
		afd_category.append( { type:'option', label:'अभिन बर्गीकरण ना कइल गइल बा', value:'U' } );

		appendReasonBox();
		work_area = work_area.render();
		old_area.parentNode.replaceChild( work_area, old_area );
		break;
	case 'tfd':
		work_area = new Morebits.quickForm.element( {
				type: 'field',
				label: 'चर्चा खातिर टेम्पलेट',
				name: 'work_area'
			} );
		work_area.append( {
				type: 'div',
				label: 'आधार प्रकार सभ आ प्रयोगकर्ता बक्सा सभ के टेम्पलेट हचर्चा लायक ना मानल जालें। आधार प्रकार के श्रेणी हचर्चा में आ प्रयोगकर्ता बक्सा के बिबिध हचर्चा में नामांकन कइल जाला।'
			} );
		var tfd_category = work_area.append( {
				type: 'select',
				label: 'ऊ कार्रवाई चुनीं जवन आप चाहत होखीं: ',
				name: 'xfdcat',
				event: function(e) {
					var target = e.target;
					// add/remove extra input box
					if( target.value === 'tfm' && !target.form.xfdtarget ) { //$(target.parentNode).find("input[name='xfdtarget']").length === 0 ) {
						var xfdtarget = new Morebits.quickForm.element( {
							name: 'xfdtarget',
							type: 'input',
							label: 'दुसरकी टेम्पलेट जवन बिलय कइल जाई: '
						} );
						target.parentNode.appendChild(xfdtarget.render());
					} else {
						$(Morebits.quickForm.getElementContainer(target.form.xfdtarget)).remove();
						target.form.xfdtarget = null;
						//$(target.parentNode).find("input[name='xfdtarget']").remove();
					}
				}
			} );
		tfd_category.append( { type: 'option', label: 'Deletion', value: 'tfd', selected: true } );
		tfd_category.append( { type: 'option', label: 'Merge', value: 'tfm' } );

		var tfd_template_type = work_area.append( {
			type: 'select',
			name: 'templatetype',
			label: 'हटावे के टैग के डिस्प्ले स्टाइल: ',
			tooltip: 'जवन <code>type=</code> पैरामीटर टेम्पलेट हचर्चा टैग में पास कइल जाई।'
		} );
		tfd_template_type.append( { type: 'option', value: 'standard', label: 'स्टैंडर्ड', selected: true } );
		tfd_template_type.append( { type: 'option', value: 'sidebar', label: 'साइडबार/ज्ञानसंदूक' } );
		tfd_template_type.append( { type: 'option', value: 'inline', label: 'इनलाइन टेम्पलेट' } );
		tfd_template_type.append( { type: 'option', value: 'tiny', label: 'नखी मुकी इनलाइन' } );

		work_area.append( {
				type: 'checkbox',
				list: [
						{
							label: 'हटावे के टैग के  <noinclude> में लपेटीं (सबस्टिच्यूट होखे वाली टेम्पलेट खातिर)',
							value: 'noinclude',
							name: 'noinclude',
							tooltip: 'हटावे के टैग के &lt;noinclude&gt; टैग में लपेट दिहल जाई, जवना से कि इहो ट्रांसक्लूड होके सबस्टिच्यूट न हो जाय।'
						}
					]
			} );

		appendReasonBox();
		work_area = work_area.render();
		old_area.parentNode.replaceChild( work_area, old_area );
		break;
	case 'mfd':
		work_area = new Morebits.quickForm.element( {
				type: 'field',
				label: 'हटावे खातिर बिबिध',
				name: 'work_area'
			} );
		work_area.append( {
				type: 'checkbox',
				list: [
						{
							label: 'हटावे के टैग  <noinclude> में लपेटीं',
							value: 'noinclude',
							name: 'noinclude',
							tooltip: 'हटावे के टैग के &lt;noinclude&gt; टैग में लपेट दिहल जाई, जवना से ई ट्रांसक्लूड न होखे। ई बिकल्प प्रयोगकर्ता बक्सा खातिर चुनीं।'
						}
					]
		} );
		if (mw.config.get('wgNamespaceNumber') === 2 /* User: */ || mw.config.get('wgNamespaceNumber') === 3 /* User talk: */) {
			work_area.append( {
				type: 'checkbox',
				list: [
						{
							label: 'एह प्रयोगकर्ता स्थान के मालिक के सूचित भी कइल जाय अगर ऊ पन्ना निर्माता न होखें',
							value: 'notifyuserspace',
							name: 'notifyuserspace',
							tooltip: 'अगर ऊहे प्रयोगकर्ता पन्ना निर्माता नइखे जेकरे प्रयोगकर्ता नाँवस्थान में पन्ना मौजूद बा,  (उदाहरण खाती, पन्ना बचा के स्थापित कइल गइल होखे आ प्रयोगकर्ता के ड्राफ्ट के रूप में स्थापित कइल गइल होखे), प्रयोगकर्ता स्थान के मालिक के भी सूचित कइल जाई।',
							checked: true
						}
					]
			} );
		}
		appendReasonBox();
		work_area = work_area.render();
		old_area.parentNode.replaceChild( work_area, old_area );
		break;
	case 'ffd':
		work_area = new Morebits.quickForm.element( {
				type: 'field',
				label: 'फाइल खातिर चर्चा के जगह',
				name: 'work_area'
			} );
		appendReasonBox();
		work_area = work_area.render();
		old_area.parentNode.replaceChild( work_area, old_area );
		break;
	case 'cfd':
		work_area = new Morebits.quickForm.element( {
				type: 'field',
				label: 'चर्चा खातिर श्रेणी',
				name: 'work_area'
			} );
		var cfd_category = work_area.append( {
				type: 'select',
				label: 'कार्रवाई के प्रकार चुनीं: ',
				name: 'xfdcat',
				event: function(e) {
					var value = e.target.value;
					var target = e.target.form.xfdtarget;
					// update enabled status
					if( value === 'cfd' ) {
						target.disabled = true;
					} else {
						target.disabled = false;
					}
					// update label
					if( value === 'cfs' ) {
						target.previousSibling.textContent = "टारगेट श्रेणी सभ: ";
					} else if( value === 'cfc' ) {
						target.previousSibling.textContent = "टारगेट लेख: ";
					} else {
						target.previousSibling.textContent = "टारगेट लेख: ";
					}
					// add/remove extra input box
					if( value === 'cfs' && $(target.parentNode).find("input[name='xfdtarget2']").length === 0 ) {
						var xfdtarget2 = document.createElement("input");
						xfdtarget2.setAttribute("name", "xfdtarget2");
						xfdtarget2.setAttribute("type", "text");
						target.parentNode.appendChild(xfdtarget2);
					} else {
						$(target.parentNode).find("input[name='xfdtarget2']").remove();
					}
				}
			} );
		cfd_category.append( { type: 'option', label: 'हटावल', value: 'cfd', selected: true } );
		cfd_category.append( { type: 'option', label: 'बिलय', value: 'cfm' } );
		cfd_category.append( { type: 'option', label: 'नाँव बदलाव', value: 'cfr' } );
		cfd_category.append( { type: 'option', label: 'बिभाजन', value: 'cfs' } );
		cfd_category.append( { type: 'option', label: 'लेख में बदलाव', value: 'cfc' } );

		work_area.append( {
				type: 'input',
				name: 'xfdtarget',
				label: 'टारगेट पन्ना: ',
				disabled: true,
				value: ''
			} );
		appendReasonBox();
		work_area = work_area.render();
		old_area.parentNode.replaceChild( work_area, old_area );
		break;
	case 'cfds':
		work_area = new Morebits.quickForm.element( {
				type: 'field',
				label: 'जल्दी से नाँव बदलाव खातिर श्रेणी',
				name: 'work_area'
			} );
		var cfds_category = work_area.append( {
				type: 'select',
				label: 'C2 उप-पैमाना: ',
				name: 'xfdcat',
				tooltip: 'देखीं  WP:CFDS जहाँ पूरा चीज समझावल बा',
				event: function(e) {
					var value = e.target.value;
					var target = e.target.form.xfdtarget;
					if( value === 'cfd' ) {
						target.disabled = true;
					} else {
						target.disabled = false;
					}
				}
			} );
		cfds_category.append( { type: 'option', label: 'C2A: टाइपो आ हिज्जे के गलती', value: 'C2A', selected: true } );
		cfds_category.append( { type: 'option', label: 'C2B: नाँव रखे के परंपरा', value: 'C2B' } );
		cfds_category.append( { type: 'option', label: 'C2C: अइसने श्रेणी सभ के साथ नाँव में एकरूपता खातिर', value: 'C2C' } );
		cfds_category.append( { type: 'option', label: 'C2D: लेख के नाँव से मैच करे खातिर', value: 'C2D' } );
		cfds_category.append( { type: 'option', label: 'C2E: लेखक के अनुरोध', value: 'C2E' } );

		work_area.append( {
				type: 'input',
				name: 'xfdtarget',
				label: 'नया नाँव: ',
				value: ''
			} );
		appendReasonBox();
		work_area = work_area.render();
		old_area.parentNode.replaceChild( work_area, old_area );
		break;
	case 'rfd':
		work_area = new Morebits.quickForm.element( {
				type: 'field',
				label: 'चर्चा खातिर अनुप्रेषण',
				name: 'work_area'
			} );
		appendReasonBox();
		work_area = work_area.render();
		old_area.parentNode.replaceChild( work_area, old_area );
		break;
	default:
		work_area = new Morebits.quickForm.element( {
				type: 'field',
				label: 'कौनों चीज खाती कुछ ना',
				name: 'work_area'
			} );
		work_area = work_area.render();
		old_area.parentNode.replaceChild( work_area, old_area );
		break;
	}

	// No creator notification for CFDS
	if (value === "cfds") {
		Twinkle.xfd.previousNotify = form.notify.checked;
		form.notify.checked = false;
		form.notify.disabled = true;
	} else {
		form.notify.checked = Twinkle.xfd.previousNotify;
		form.notify.disabled = false;
	}
};

Twinkle.xfd.callbacks = {
	// Currently supports afd, mfd, tfd/tfm, ffd
	getDiscussionWikitext: function(venue, params) {
		var text = "{{subst:" + venue + "2",
			reasonKey = venue === "ffd" ? "कारण" : "text";

		if (params.xfdcat) {
			text += "|cat=" + params.xfdcat;
		}

		// Add a reason unconditionally, so that at least a signature is added
		if (params.reason) {
			text += "|" + reasonKey + "=" + Morebits.string.formatReasonText(params.reason) + " ~~~~";
		} else {
			text += "|" + reasonKey + "=~~~~";
		}

		if (venue === "tfd" || venue === "tfm" || venue === "ffd") {
			text += "|1=" + mw.config.get('wgTitle');
		} else {
			text += "|pg=" + Morebits.pageNameNorm;
		}

		if (params.target) {
			text += "|2=" + params.target;
		}

		if (params.uploader) {
			text += "|Uploader=" + params.uploader;
		}

		text += "}}";
		return text;
	},
	showPreview: function(form, venue, params) {
		templatetext = Twinkle.xfd.callbacks.getDiscussionWikitext(venue, params);
		form.previewer.beginRender(templatetext, "विकिपीडिया:Null");
	},
	preview: function(form) {
		var templatetext;
		var venue = form.category.value;

		if (venue !== "afd" && venue !== "mfd" && venue !== "tfd" && venue !== "tfm" && venue !== "ffd") {
			alert("एह चर्चा जगह खाती अभी झलक सपोर्ट नइखे कइल जात! :(");
			return;
		}
		var params = {
			reason: form.xfdreason.value,
		};
		if (form.xfdcat) {
			params.xfdcat = form.xfdcat.value;
		}
		if (form.xfdtarget) {
			params.target = form.xfdtarget.value;
		}
		if (venue === "ffd") {
			// Fetch the uploader
			var page = new Morebits.wiki.page(mw.config.get('wgPageName'));
			page.lookupCreator(function() {
				params.uploader = page.getCreator();
				Twinkle.xfd.callbacks.showPreview(form, venue, params);
			});
		} else {
			Twinkle.xfd.callbacks.showPreview(form, venue, params);
		}
	},
	afd: {
		main: function(apiobj) {
			var xmlDoc = apiobj.responseXML;
			var titles = $(xmlDoc).find('allpages p');

			// There has been no earlier entries with this prefix, just go on.
			if( titles.length <= 0 ) {
				apiobj.params.numbering = apiobj.params.number = '';
			} else {
				var number = 0;
				for( var i = 0; i < titles.length; ++i ) {
					var title = titles[i].getAttribute('title');

					// First, simple test, is there an instance with this exact name?
					if( title === 'विकिपीडिया:हटावे खातिर लेख/' + Morebits.pageNameNorm ) {
						number = Math.max( number, 1 );
						continue;
					}

					var order_re = new RegExp( '^' +
						RegExp.escape( 'विकिपीडिया:हटावे खातिर लेख/' + Morebits.pageNameNorm, true ) +
						'\\s*\\(\\s*(\\d+)(?:(?:वाँ|सरा|था) ना(?:मांकन)?)?\\s*\\)\\s*$');
					var match = order_re.exec( title );

					// No match; A non-good value
					if( !match ) {
						continue;
					}

					// A match, set number to the max of current
					number = Math.max( number, Number(match[1]) );
				}
				apiobj.params.number = Twinkle.xfd.num2order( parseInt( number, 10 ) + 1);
				apiobj.params.numbering = number > 0 ? ' (' + apiobj.params.number + ' नामांकन)' : '';
			}
			apiobj.params.discussionpage = 'विकिपीडिया:हटावे खातिर लेख/' + Morebits.pageNameNorm + apiobj.params.numbering;

			Morebits.status.info( "अगिला चर्चा पन्ना", "[[" + apiobj.params.discussionpage + "]]" );

			// Updating data for the action completed event
			Morebits.wiki.actionCompleted.redirect = apiobj.params.discussionpage;
			Morebits.wiki.actionCompleted.notice = "नामांकन पूरा भइल, अब चर्चा पन्ना के ओर बढ़ल जात बा";

			// Tagging article
			var wikipedia_page = new Morebits.wiki.page(mw.config.get('wgPageName'), "लेख पर हटावे के नामांकन टैग जोड़ल जात बा");
			wikipedia_page.setFollowRedirect(true);  // should never be needed, but if the article is moved, we would want to follow the redirect
			wikipedia_page.setCallbackParameters(apiobj.params);
			wikipedia_page.load(Twinkle.xfd.callbacks.afd.taggingArticle);
		},
		// Tagging needs to happen before everything else: this means we can check if there is an AfD tag already on the page
		taggingArticle: function(pageobj) {
			var text = pageobj.getPageText();
			var params = pageobj.getCallbackParameters();
			var statelem = pageobj.getStatusElement();

			if (!pageobj.exists()) {
				statelem.error("अइसन बुझाता कि पन्ना मौजूदे नइखे, साइद ई पहिलहीं हटावल जा चुकल बा");
				return;
			}

			// Check for existing AfD tag, for the benefit of new page patrollers
			var textNoAfd = text.replace(/\{\{\s*(Article for deletion\/dated|AfDM)\s*(\|(?:\{\{[^{}]*\}\}|[^{}])*)?\}\}\s*/g, "");
			if (text !== textNoAfd) {
				if (confirm("लेख में एगो हचर्चा टेम्पलेट पावल गइल बा। साइद केहू आपो से आगे निकल गइल।  \nटैग हटा के नया लगावे खाती ओके पर क्लिक करीं (अइसन ना करे के सलाह बा), या नामांकन के प्रक्रिया छोड़ के हटे खाती कैंसिल पर क्लिक करीं।")) {
					text = textNoAfd;
				} else {
					statelem.error("लेख पहिलहीं से हचर्चा खाती टैग रहल, आप नामांकन प्रक्रिया छोड़ के हटे के फैसला कइलीं");
					window.location.reload();
					return;
				}
			}

			// Now we know we want to go ahead with it, trigger the other AJAX requests

			// Mark the page as patrolled, if wanted
			if (Twinkle.getPref('markXfdPagesAsPatrolled')) {
				pageobj.patrol();
			}

			// Starting discussion page
			var wikipedia_page = new Morebits.wiki.page(params.discussionpage, "लेख हटावे खातिर चर्चा पन्ना बनावल जात बा");
			wikipedia_page.setCallbackParameters(params);
			wikipedia_page.load(Twinkle.xfd.callbacks.afd.discussionPage);

			// Today's list
			var date = new Date();
			var edittoken = mw.user.tokens.get( 'editToken' );
			var xfdcsummary = 'हटाने का लॉग वाला पन्ना बनाने का सम्पादन सारांश ';
			var xfdtxt = 'template';
			var xfdpage = 'विकिपीडिया:हटावे खातिर लेख/लॉग/' + date.getUTCFullYear() + ' ' +
				date.getUTCMonthName() + ' ' + date.getUTCDate();
			var createxfdfirst = $.ajax( {url: mw.config.get( 'wgServer' ) + mw.config.get( 'wgScriptPath' ) + '/api.php?',
			data: {'action':'edit','title': xfdpage,'text': xfdtxt,'token': edittoken,'summary': xfdcsummary,'format': 'json','createonly': 'true'},dataType:'json',type: 'POST',});
			wikipedia_page = new Morebits.wiki.page('विकिपीडिया:हटावे खातिर लेख/लॉग/' + date.getUTCFullYear() + ' ' +
				date.getUTCMonthName() + ' ' + date.getUTCDate(), "आज के लिस्ट में चर्चा के जोड़ल जात बा");
			wikipedia_page.setFollowRedirect(true);
			wikipedia_page.setCallbackParameters(params);
			wikipedia_page.load(Twinkle.xfd.callbacks.afd.todaysList);

			// Notification to first contributor
			if (params.usertalk) {
				var thispage = new Morebits.wiki.page(mw.config.get('wgPageName'));
				thispage.setCallbackParameters(params);
				thispage.lookupCreator(Twinkle.xfd.callbacks.afd.userNotification);
			}

			// Remove some tags that should always be removed on AfD.
			text = text.replace(/\{\{\s*(dated prod|dated prod blp|Prod blp\/dated|Proposed deletion\/dated|prod2|Proposed deletion endorsed|New unreviewed article|Unreviewed|Userspace draft)\s*(\|(?:\{\{[^{}]*\}\}|[^{}])*)?\}\}\s*/ig, "");
			// Then, test if there are speedy deletion-related templates on the article.
			var textNoSd = text.replace(/\{\{\s*(db(-\w*)?|हटा(-\w*)?|हटाईं|delete|(?:hang|hold)[\- ]?on)\s*(\|(?:\{\{[^{}]*\}\}|[^{}])*)?\}\}\s*/ig, "");
			if (text !== textNoSd && confirm("एगो तुरंत हटावे के नामांकन टैग मिलल बा, का एकरा के हटा दिहल जाय ?")) {
				text = textNoSd;
			}

			pageobj.setPageText((params.noinclude ? "<noinclude>{{" : "{{") + (params.number === '' ? "subst:afd|help=off" : ('subst:afdx|' +
				params.number + "|help=off")) + (params.noinclude ? "}}</noinclude>\n" : "}}\n") + text);
			pageobj.setEditSummary("हटावे खाती नामांकित; देखीं  [[" + params.discussionpage + "]]।" + Twinkle.getPref('summaryAd'));
			switch (Twinkle.getPref('xfdWatchPage')) {
				case 'yes':
					pageobj.setWatchlist(true);
					break;
				case 'no':
					pageobj.setWatchlistFromPreferences(false);
					break;
				default:
					pageobj.setWatchlistFromPreferences(true);
					break;
			}
			pageobj.setCreateOption('nocreate');
			pageobj.save();
		},
		discussionPage: function(pageobj) {
			var params = pageobj.getCallbackParameters();

			pageobj.setPageText(Twinkle.xfd.callbacks.getDiscussionWikitext("afd", params));
			pageobj.setEditSummary("[[" + Morebits.pageNameNorm + "]] खातिर हचर्चा पन्ना बनावल जाता।" + Twinkle.getPref('summaryAd'));
			switch (Twinkle.getPref('xfdWatchDiscussion')) {
				case 'yes':
					pageobj.setWatchlist(true);
					break;
				case 'no':
					pageobj.setWatchlistFromPreferences(false);
					break;
				default:
					pageobj.setWatchlistFromPreferences(true);
					break;
			}
			pageobj.setCreateOption('createonly');
			pageobj.save(function() {
				Twinkle.xfd.currentRationale = null;  // any errors from now on do not need to print the rationale, as it is safely saved on-wiki
			});
		},
		todaysList: function(pageobj) {
			var old_text = pageobj.getPageText() + "\n";  // MW strips trailing blanks, but we like them, so we add a fake one
			var params = pageobj.getCallbackParameters();
			var statelem = pageobj.getStatusElement();

			var text = old_text.replace( /(<\!-- Add new entries to the TOP of the following list -->\n+)/, "$1{{subst:afd3|pg=" + Morebits.pageNameNorm + params.numbering + "}}\n");
			if( text === old_text ) {
				var linknode = document.createElement('a');
				linknode.setAttribute("href", mw.util.getUrl("विकिपीडिया:ट्विंकल/Fixing AFD") + "?action=purge" );
				linknode.appendChild(document.createTextNode('लेख हचर्चा कइसे फिक्स कइल जाय'));
				statelem.error( [ 'चर्चा खाती जगह ना मिलल। एह समस्या के फिक्स करे खातिर देखीं ', linknode, '.' ] );
				return;
			}
			pageobj.setPageText(text);
			pageobj.setEditSummary("[[" + params.discussionpage + "]] जोड़ल जाता।" + Twinkle.getPref('summaryAd'));
			switch (Twinkle.getPref('xfdWatchList')) {
				case 'yes':
					pageobj.setWatchlist(true);
					break;
				case 'no':
					pageobj.setWatchlistFromPreferences(false);
					break;
				default:
					pageobj.setWatchlistFromPreferences(true);
					break;
			}
			pageobj.setCreateOption('recreate');
			pageobj.save();
		},
		userNotification: function(pageobj) {
			var params = pageobj.getCallbackParameters();
			var initialContrib = pageobj.getCreator();

			// Disallow warning yourself
			if (initialContrib === mw.config.get('wgUserName')) {
				pageobj.getStatusElement().warn("आप  (" + initialContrib + ") खुदे पन्ना निर्माता बानी; सूचना प्रक्रिया छोड़ल जाता");
				return;
			}

			var usertalkpage = new Morebits.wiki.page('प्रयोगकर्ता वार्ता:' + initialContrib, "सुरुआती योगदानकर्ता (" + initialContrib + ") के सूचित कइल जाता");
			var notifytext = "\n{{subst:AFDWarning|1=" + Morebits.pageNameNorm + ( params.numbering !== '' ? '|order=&#32;' + params.numbering : '' ) + "}} ~~~~";
			usertalkpage.setAppendText(notifytext);
			usertalkpage.setEditSummary("नोटिफिकेशन: [[" + Morebits.pageNameNorm + "]] के [[WP:AFD|हटावे खातिर लेख]] में नामांकन कइल जाता।" + Twinkle.getPref('summaryAd'));
			usertalkpage.setCreateOption('recreate');
			switch (Twinkle.getPref('xfdWatchUser')) {
				case 'yes':
					usertalkpage.setWatchlist(true);
					break;
				case 'no':
					usertalkpage.setWatchlistFromPreferences(false);
					break;
				default:
					usertalkpage.setWatchlistFromPreferences(true);
					break;
			}
			usertalkpage.setFollowRedirect(true);
			usertalkpage.append();
		}
	},


	tfd: {
		taggingTemplate: function(pageobj) {
			var text = pageobj.getPageText();
			var params = pageobj.getCallbackParameters();

			pageobj.setPageText((params.noinclude ? "<noinclude>" : "") + "{{subst:template for discussion|help=off|" +
				(params.tfdtype !== "standard" ? "type=" + params.tfdtype + "|" : "") + mw.config.get('wgTitle') + (params.noinclude ? "}}</noinclude>" : "}}") + text);
			pageobj.setEditSummary("हटावे खाती नामांकित; देखीं [[" + params.logpage + "#" + Morebits.pageNameNorm + "]]।" + Twinkle.getPref('summaryAd'));
			switch (Twinkle.getPref('xfdWatchPage')) {
				case 'yes':
					pageobj.setWatchlist(true);
					break;
				case 'no':
					pageobj.setWatchlistFromPreferences(false);
					break;
				default:
					pageobj.setWatchlistFromPreferences(true);
					break;
			}
			pageobj.setCreateOption('nocreate');
			pageobj.save();
		},
		taggingTemplateForMerge: function(pageobj) {
			var text = pageobj.getPageText();
			var params = pageobj.getCallbackParameters();

			pageobj.setPageText((params.noinclude ? "<noinclude>" : "") + "{{subst:tfm|help=off|" +
				(params.tfdtype !== "standard" ? "type=" + params.tfdtype + "|" : "") + "1=" + params.otherTemplateName.replace(/^Template:/, "") +
				(params.noinclude ? "}}</noinclude>" : "}}\n") + text);
			pageobj.setEditSummary("[[" + params.otherTemplateName + "]] के साथ बिलय के नामांकन कइल गइल; देखीं [[" +
				params.logpage + "#" + Morebits.pageNameNorm + "]]." + Twinkle.getPref('summaryAd'));
			switch (Twinkle.getPref('xfdWatchPage')) {
				case 'yes':
					pageobj.setWatchlist(true);
					break;
				case 'no':
					pageobj.setWatchlistFromPreferences(false);
					break;
				default:
					pageobj.setWatchlistFromPreferences(true);
					break;
			}
			pageobj.setCreateOption('nocreate');
			pageobj.save();
		},
		todaysList: function(pageobj) {
			var old_text = pageobj.getPageText();
			var params = pageobj.getCallbackParameters();
			var statelem = pageobj.getStatusElement();

			var added_data = Twinkle.xfd.callbacks.getDiscussionWikitext(params.xfdcat, params);

			var text = old_text.replace( '-->', "-->\n" + added_data );
			if( text === old_text ) {
				statelem.error( 'चर्चा के टारगेट जगह खोजे में बिफल' );
				return;
			}
			pageobj.setPageText(text);
			pageobj.setEditSummary("[[टेम्पलेट:" + mw.config.get('wgTitle') + "]] जोड़ल जात बा।" + Twinkle.getPref('summaryAd'));
			switch (Twinkle.getPref('xfdWatchDiscussion')) {
				case 'yes':
					pageobj.setWatchlist(true);
					break;
				case 'no':
					pageobj.setWatchlistFromPreferences(false);
					break;
				default:
					pageobj.setWatchlistFromPreferences(true);
					break;
			}
			pageobj.setCreateOption('recreate');
			pageobj.save(function() {
				Twinkle.xfd.currentRationale = null;  // any errors from now on do not need to print the rationale, as it is safely saved on-wiki
			});
		},
		userNotification: function(pageobj) {
			var initialContrib = pageobj.getCreator();
			var params = pageobj.getCallbackParameters();

			// Disallow warning yourself
			if (initialContrib === mw.config.get('wgUserName')) {
				pageobj.getStatusElement().warn("आप (" + initialContrib + ") खुदे एह पन्ना के बनवले बानी; सूचना के कार्रवाई छोड़ल जात बा");
				return;
			}

			var usertalkpage = new Morebits.wiki.page('प्रयोगकर्ता वार्ता:' + initialContrib, "सुरुआती योगदानकर्ता (" + initialContrib + ") के सूचित कइल जात बा");
			var notifytext = "\n";
			switch (params.xfdcat) {
			case 'tfd':
				notifytext += "{{subst:tfdnotice|1=" + mw.config.get('wgTitle') + "}} ~~~~";
				break;
			case 'tfm':
				notifytext += "{{subst:tfmnotice|1=" + mw.config.get('wgTitle') + "|2=" + params.target + "}} ~~~~";
				break;
			default:
				alert("twinklexfd in userNotification: unknown TFD action");
				break;
			}

			usertalkpage.setAppendText(notifytext);
			usertalkpage.setEditSummary("नोटिफिकेशन: [[" + pageobj.getPageName() + "]] के [[WP:TFD|चर्चा खातिर टेम्पलेट]]  नामांकन।" + Twinkle.getPref('summaryAd'));
			usertalkpage.setCreateOption('recreate');
			switch (Twinkle.getPref('xfdWatchUser')) {
				case 'yes':
					usertalkpage.setWatchlist(true);
					break;
				case 'no':
					usertalkpage.setWatchlistFromPreferences(false);
					break;
				default:
					usertalkpage.setWatchlistFromPreferences(true);
					break;
			}
			usertalkpage.setFollowRedirect(true);
			usertalkpage.append();
		}
	},


	mfd: {
		main: function(apiobj) {
			var xmlDoc = apiobj.responseXML;
			var titles = $(xmlDoc).find('allpages p');

			// There has been no earlier entries with this prefix, just go on.
			if( titles.length <= 0 ) {
				apiobj.params.numbering = apiobj.params.number = '';
			} else {
				var number = 0;
				for( var i = 0; i < titles.length; ++i ) {
					var title = titles[i].getAttribute('title');

					// First, simple test, is there an instance with this exact name?
					if( title === 'विकिपीडिया:हटावे खातिर बिबिध/' + Morebits.pageNameNorm ) {
						number = Math.max( number, 1 );
						continue;
					}

					var order_re = new RegExp( '^' +
							RegExp.escape( 'विकिपीडिया:हटावे खातिर बिबिध/' + Morebits.pageNameNorm, true ) +
							'\\s*\\(\\s*(\\d+)(?:(?:ला|सरा|था|वाँ) ना(?:मांकन)?)?\\s*\\)\\s*$' );
					var match = order_re.exec( title );

					// No match; A non-good value
					if( !match ) {
						continue;
					}

					// A match, set number to the max of current
					number = Math.max( number, Number(match[1]) );
				}
				apiobj.params.number = Twinkle.xfd.num2order( parseInt( number, 10 ) + 1);
				apiobj.params.numbering = number > 0 ? ' (' + apiobj.params.number + ' नामांकन)' : '';
			}
			apiobj.params.discussionpage = "विकिपीडिया:हटावे खातिर बिबिध/" + Morebits.pageNameNorm + apiobj.params.numbering;

			apiobj.statelem.info( "अगिला बा [[" + apiobj.params.discussionpage + ']]');

			// Tagging page
			var wikipedia_page = new Morebits.wiki.page(mw.config.get('wgPageName'), "पन्ना के हटावे खाती टैग कइल जाता");
			wikipedia_page.setFollowRedirect(true);  // should never be needed, but if the page is moved, we would want to follow the redirect
			wikipedia_page.setCallbackParameters(apiobj.params);
			wikipedia_page.load(Twinkle.xfd.callbacks.mfd.taggingPage);

			// Updating data for the action completed event
			Morebits.wiki.actionCompleted.redirect = apiobj.params.discussionpage;
			Morebits.wiki.actionCompleted.notice = "नामांकन पूरा भइल, चर्चा पन्ना के ओर आगे बढ़ल जात बा";

			// Discussion page
			wikipedia_page = new Morebits.wiki.page(apiobj.params.discussionpage, "हटावे खातिर चर्चा पन्ना बनावल जात बा");
			wikipedia_page.setCallbackParameters(apiobj.params);
			wikipedia_page.load(Twinkle.xfd.callbacks.mfd.discussionPage);

			// Today's list
			wikipedia_page = new Morebits.wiki.page("विकिपीडिया:हटावे खातिर बिबिध", "चर्चा के आज के लिस्ट में जोड़ल जात बा");
			//wikipedia_page.setPageSection(2);
				// pageSection has been disabled - the API seems to throw up with nonexistent edit conflicts
				// it can be turned on again once the problem is fixed, to save bandwidth
			//wikipedia_page.setFollowRedirect(true);
			wikipedia_page.setCallbackParameters(apiobj.params);
			wikipedia_page.load(Twinkle.xfd.callbacks.mfd.todaysList);

			// Notification to first contributor, and notification to owner of userspace (if applicable and required)
			if (apiobj.params.usertalk) {
				var thispage = new Morebits.wiki.page(mw.config.get('wgPageName'));
				thispage.setCallbackParameters(apiobj.params);
				thispage.lookupCreator(Twinkle.xfd.callbacks.mfd.userNotification);
			}
		},
		taggingPage: function(pageobj) {
			var text = pageobj.getPageText();
			var params = pageobj.getCallbackParameters();

			pageobj.setPageText((params.noinclude ? "<noinclude>" : "") + "{{" +
				((params.number === '') ? "mfd" : ("mfdx|" + params.number)) + "|help=off}}\n" +
				(params.noinclude ? "</noinclude>" : "") + text);
			pageobj.setEditSummary("हटावे खातिर नामांकन; देखीं [[" + params.discussionpage + "]]।" + Twinkle.getPref('summaryAd'));
			switch (Twinkle.getPref('xfdWatchPage')) {
				case 'yes':
					pageobj.setWatchlist(true);
					break;
				case 'no':
					pageobj.setWatchlistFromPreferences(false);
					break;
				default:
					pageobj.setWatchlistFromPreferences(true);
					break;
			}
			pageobj.setCreateOption('nocreate');
			pageobj.save();
		},
		discussionPage: function(pageobj) {
			var params = pageobj.getCallbackParameters();

			pageobj.setPageText(Twinkle.xfd.callbacks.getDiscussionWikitext("mfd", params));
			pageobj.setEditSummary("[[" + Morebits.pageNameNorm + "]] खातिर हटावे के चर्चा पन्ना बनावल जात बा।" + Twinkle.getPref('summaryAd'));
			switch (Twinkle.getPref('xfdWatchDiscussion')) {
				case 'yes':
					pageobj.setWatchlist(true);
					break;
				case 'no':
					pageobj.setWatchlistFromPreferences(false);
					break;
				default:
					pageobj.setWatchlistFromPreferences(true);
					break;
			}
			pageobj.setCreateOption('createonly');
			pageobj.save(function() {
				Twinkle.xfd.currentRationale = null;  // any errors from now on do not need to print the rationale, as it is safely saved on-wiki
			});
		},
		todaysList: function(pageobj) {
			var text = pageobj.getPageText();
			var params = pageobj.getCallbackParameters();
			var statelem = pageobj.getStatusElement();

			var date = new Date();
			var date_header = "===" + date.getUTCMonthName() + ' ' + date.getUTCDate() + ', ' + date.getUTCFullYear() + "===\n";
			var date_header_regex = new RegExp( "(===\\s*" + date.getUTCMonthName() + '\\s+' + date.getUTCDate() + ',\\s+' + date.getUTCFullYear() + "\\s*===)" );
			var new_data = "{{subst:mfd3|pg=" + Morebits.pageNameNorm + params.numbering + "}}";

			if( date_header_regex.test( text ) ) { // we have a section already
				statelem.info( 'आज के खंड मिल गइल, नया एंट्री जोड़े खातिर आगे बढ़ल जात बा' );
				text = text.replace( date_header_regex, "$1\n" + new_data );
			} else { // we need to create a new section
				statelem.info( 'आज खातिर कौनो खंड ना मिलल, नया बनावे जा रहल बा' );
				text = text.replace("===", date_header + new_data + "\n\n===");
			}

			pageobj.setPageText(text);
			pageobj.setEditSummary("[[" + params.discussionpage + "]] जोड़ल जात बा।" + Twinkle.getPref('summaryAd'));
			switch (Twinkle.getPref('xfdWatchList')) {
				case 'yes':
					pageobj.setWatchlist(true);
					break;
				case 'no':
					pageobj.setWatchlistFromPreferences(false);
					break;
				default:
					pageobj.setWatchlistFromPreferences(true);
					break;
			}
			pageobj.setCreateOption('recreate');
			pageobj.save();
		},
		userNotification: function(pageobj) {
			var initialContrib = pageobj.getCreator();
			var params = pageobj.getCallbackParameters();

			// Disallow warning yourself
			if (initialContrib === mw.config.get('wgUserName')) {
				pageobj.getStatusElement().warn("आप (" + initialContrib + ") खुदे एह पन्ना के निर्माता बानी; सूचना के कार्रवाई छोड़ल जात बा");
			} else {
				// Really notify the creator
				Twinkle.xfd.callbacks.mfd.userNotificationMain(params, initialContrib, "सुरुआती योगदानकर्ता के सूचित कइल जात बा");
			}

			// Also notify the user who owns the subpage if they are not the creator
			if (params.notifyuserspace) {
				var userspaceOwner = ((mw.config.get('wgTitle').indexOf('/') === -1) ? mw.config.get('wgTitle') : mw.config.get('wgTitle').substring(0, mw.config.get('wgTitle').indexOf('/')));
				if (userspaceOwner !== initialContrib) {
					Twinkle.xfd.callbacks.mfd.userNotificationMain(params, userspaceOwner, "प्रयोगकर्ता नाँवस्थान के मालिक के सूचित कइल जात बा");
				}
			}
		},
		userNotificationMain: function(params, initialContrib, actionName)
		{
			var usertalkpage = new Morebits.wiki.page('प्रयोगकर्ता वार्ता:' + initialContrib, actionName + " (" + initialContrib + ")");
			var notifytext = "\n{{subst:MFDWarning|1=" + Morebits.pageNameNorm + ( params.numbering !== '' ? '|order=&#32;' + params.numbering : '' ) + "}} ~~~~";
			usertalkpage.setAppendText(notifytext);
			usertalkpage.setEditSummary("नोटिफिकेशन: [[" + Morebits.pageNameNorm + "]] के [[WP:MFD|हटावे खातिर बिबिध]] में लिस्ट कइल जात बा" + Twinkle.getPref('summaryAd'));
			usertalkpage.setCreateOption('recreate');
			switch (Twinkle.getPref('xfdWatchUser')) {
				case 'yes':
					usertalkpage.setWatchlist(true);
					break;
				case 'no':
					usertalkpage.setWatchlistFromPreferences(false);
					break;
				default:
					usertalkpage.setWatchlistFromPreferences(true);
					break;
			}
			usertalkpage.setFollowRedirect(true);
			usertalkpage.append();
		}
	},


	ffd: {
		main: function(pageobj) {
			// this is coming in from lookupCreator...!
			var params = pageobj.getCallbackParameters();
			var initialContrib = pageobj.getCreator();
			params.uploader = initialContrib;

			// Adding discussion
			var wikipedia_page = new Morebits.wiki.page(params.logpage, "चर्चा आज के लिस्ट में जोड़ल जात बा");
			wikipedia_page.setFollowRedirect(true);
			wikipedia_page.setCallbackParameters(params);
			wikipedia_page.load(Twinkle.xfd.callbacks.ffd.todaysList);

			// Notification to first contributor
			if (params.usertalk) {
				// Disallow warning yourself
				if (initialContrib === mw.config.get('wgUserName')) {
					pageobj.getStatusElement().warn("आप (" + initialContrib + ") खुदे एह पन्ना के निर्माता बानी; सूचना के कार्रवाई छोड़ल जात बा");
				} else {
					var usertalkpage = new Morebits.wiki.page('प्रयोगकर्ता वार्ता:' + initialContrib, "सुरुआती योगदानकर्ता (" + initialContrib + ") के सूचित कइल जात बा");
					var notifytext = "\n{{subst:fdw|1=" + mw.config.get('wgTitle') + "}}";
					usertalkpage.setAppendText(notifytext);
					usertalkpage.setEditSummary("नोटिफिकेशन: [[" + Morebits.pageNameNorm + "]] के [[WP:FFD|चर्चा खातिर फाइल]] में लिस्ट कइल जात बा" + Twinkle.getPref('summaryAd'));
					usertalkpage.setCreateOption('recreate');
					switch (Twinkle.getPref('xfdWatchUser')) {
						case 'yes':
							usertalkpage.setWatchlist(true);
							break;
						case 'no':
							usertalkpage.setWatchlistFromPreferences(false);
							break;
						default:
							usertalkpage.setWatchlistFromPreferences(true);
							break;
					}
					usertalkpage.setFollowRedirect(true);
					usertalkpage.append();
				}
			}
		},
		taggingImage: function(pageobj) {
			var text = pageobj.getPageText();
			var params = pageobj.getCallbackParameters();

			text = text.replace(/\{\{(mtc|(copy |move )?to ?commons|move to wikimedia commons|copy to wikimedia commons)[^}]*\}\}/gi, "");

			pageobj.setPageText("{{ffd|log=" + params.date + "|help=off}}\n" + text);
			pageobj.setEditSummary("[[" + params.logpage + "#" + Morebits.pageNameNorm + "]] पर चर्चा खातिर लिस्ट में जोड़ल गइल।" + Twinkle.getPref('summaryAd'));
			switch (Twinkle.getPref('xfdWatchPage')) {
				case 'yes':
					pageobj.setWatchlist(true);
					break;
				case 'no':
					pageobj.setWatchlistFromPreferences(false);
					break;
				default:
					pageobj.setWatchlistFromPreferences(true);
					break;
			}
			pageobj.setCreateOption('recreate');  // it might be possible for a file to exist without a description page
			pageobj.save();
		},
		todaysList: function(pageobj) {
			var text = pageobj.getPageText();
			var params = pageobj.getCallbackParameters();

			// add date header if the log is found to be empty (a bot should do this automatically, but it sometimes breaks down)
			if (!pageobj.exists()) {
				text = "{{subst:Ffd log}}";
			}

			pageobj.setPageText(text + "\n\n" + Twinkle.xfd.callbacks.getDiscussionWikitext("ffd", params));
			pageobj.setEditSummary("[[" + Morebits.pageNameNorm + "]] जोड़ल जात बा।" + Twinkle.getPref('summaryAd'));
			switch (Twinkle.getPref('xfdWatchDiscussion')) {
				case 'yes':
					pageobj.setWatchlist(true);
					break;
				case 'no':
					pageobj.setWatchlistFromPreferences(false);
					break;
				default:
					pageobj.setWatchlistFromPreferences(true);
					break;
			}
			pageobj.setCreateOption('recreate');
			pageobj.save(function() {
				Twinkle.xfd.currentRationale = null;  // any errors from now on do not need to print the rationale, as it is safely saved on-wiki
			});
		}
	},


	cfd: {
		taggingCategory: function(pageobj) {
			var text = pageobj.getPageText();
			var params = pageobj.getCallbackParameters();

			var added_data = "";
			var editsummary = "";
			switch( params.xfdcat ) {
			case 'cfd':
				added_data = "{{subst:cfd}}";
				editsummary = "हटावे खातिर श्रेणी; देखीं [[" + params.logpage + "#" + Morebits.pageNameNorm + "]]।";
				break;
			case 'cfm':
				added_data = "{{subst:cfm|" + params.target + "}}";
				editsummary = "बिलय खातिर श्रेणी; देखीं [[" + params.logpage + "#" + Morebits.pageNameNorm + "]]।";
				break;
			case 'cfr':
				added_data = "{{subst:cfr|" + params.target + "}}";
				editsummary = "श्रेणी के नाँव बदलाव खातिर चर्चा; देखीं [[" + params.logpage + "#" + Morebits.pageNameNorm + "]]।";
				break;
			case 'cfs':
				added_data = "{{subst:cfs|" + params.target + "|" + params.target2 + "}}";
				editsummary = "श्रेणी के बिभाजित करे खातिर चर्चा; देखीं [[" + params.logpage + "#" + Morebits.pageNameNorm + "]]।";
				break;
			case 'cfc':
				added_data = "{{subst:cfc|" + params.target + "}}";
				editsummary = "श्रेणी के लेख में बदले के ऊपर चर्चा; देखीं [[" + params.logpage + "#" + Morebits.pageNameNorm + "]]।";
				break;
			default:
				alert("twinklexfd in taggingCategory(): unknown CFD action");
				break;
			}

			pageobj.setPageText(added_data + "\n" + text);
			pageobj.setEditSummary(editsummary + Twinkle.getPref('summaryAd'));
			switch (Twinkle.getPref('xfdWatchPage')) {
				case 'yes':
					pageobj.setWatchlist(true);
					break;
				case 'no':
					pageobj.setWatchlistFromPreferences(false);
					break;
				default:
					pageobj.setWatchlistFromPreferences(true);
					break;
			}
			pageobj.setCreateOption('recreate');  // since categories can be populated without an actual page at that title
			pageobj.save();
		},
		todaysList: function(pageobj) {
			var old_text = pageobj.getPageText();
			var params = pageobj.getCallbackParameters();
			var statelem = pageobj.getStatusElement();

			var added_data = "";
			var editsummary = "";
			switch( params.xfdcat ) {
			case 'cfd':
				added_data = "{{subst:cfd2|text=" + Morebits.string.formatReasonText(params.reason) +
					" ~~~~|1=" + mw.config.get('wgTitle') + "}}";
				editsummary = "[[:" + Morebits.pageNameNorm + "]] के हटावे के नामांकन जोड़ल गइल।";
				break;
			case 'cfm':
				added_data = "{{subst:cfm2|text=" + Morebits.string.formatReasonText(params.reason) +
					" ~~~~|1=" + mw.config.get('wgTitle') + "|2=" + params.target + "}}";
				editsummary = "[[:" + Morebits.pageNameNorm + "]] के बिलय के नामांकन जोड़ल गइल।";
				break;
			case 'cfr':
				added_data = "{{subst:cfr2|text=" + Morebits.string.formatReasonText(params.reason) +
					" ~~~~|1=" + mw.config.get('wgTitle') + "|2=" + params.target + "}}";
				editsummary = "[[:" + Morebits.pageNameNorm + "]] के नाँवबदलाव के नामांकन जोड़ल गइल।";
				break;
			case 'cfs':
				added_data = "{{subst:cfs2|text=" + Morebits.string.formatReasonText(params.reason) +
					" ~~~~|1=" + mw.config.get('wgTitle') + "|2=" + params.target + "|3=" + params.target2 + "}}";
				editsummary = "[[:" + Morebits.pageNameNorm + "]] के बिभाजित करे के नामांकन जोड़ल गइल।";
				break;
			case 'cfc':
				added_data = "{{subst:cfc2|text=" + Morebits.string.formatReasonText(params.reason) +
					" ~~~~|1=" + mw.config.get('wgTitle') + "|2=" + params.target + "}}";
				editsummary = "[[:" + Morebits.pageNameNorm + "]] के कन्वर्ट करे के नामांकन जोड़ल गइल।";
				break;
			default:
				alert("twinklexfd in todaysList: unknown CFD action");
				break;
			}

			var text = old_text.replace( 'below this line -->', "below this line -->\n" + added_data );
			if( text === old_text ) {
				statelem.error( 'चर्चा के टारगेट जगह खोजे में बिफल रहल' );
				return;
			}

			pageobj.setPageText(text);
			pageobj.setEditSummary(editsummary + Twinkle.getPref('summaryAd'));
			switch (Twinkle.getPref('xfdWatchDiscussion')) {
				case 'yes':
					pageobj.setWatchlist(true);
					break;
				case 'no':
					pageobj.setWatchlistFromPreferences(false);
					break;
				default:
					pageobj.setWatchlistFromPreferences(true);
					break;
			}
			pageobj.setCreateOption('recreate');
			pageobj.save(function() {
				Twinkle.xfd.currentRationale = null;  // any errors from now on do not need to print the rationale, as it is safely saved on-wiki
			});
		},
		userNotification: function(pageobj) {
			var initialContrib = pageobj.getCreator();

			// Disallow warning yourself
			if (initialContrib === mw.config.get('wgUserName')) {
				pageobj.getStatusElement().warn("आप (" + initialContrib + ") खुदे एह पन्ना के निर्माता बानी; सूचना के प्रक्रिया छोड़ के हटल जात बा");
				return;
			}

			var usertalkpage = new Morebits.wiki.page('प्रयोगकर्ता वार्ता:' + initialContrib, "सुरुआती योगदानकर्ता के सूचित कइल जात बा (" + initialContrib + ")");
			var notifytext = "\n{{subst:cfd-notify|1=" + Morebits.pageNameNorm + "}} ~~~~";
			usertalkpage.setAppendText(notifytext);
			usertalkpage.setEditSummary("नोटिफिकेशन: [[" + Morebits.pageNameNorm + "]] के [[WP:CFD|चर्चा खातिर श्रेणी]] पर लिस्ट में जोड़ल जाता।" + Twinkle.getPref('summaryAd'));
			usertalkpage.setCreateOption('recreate');
			switch (Twinkle.getPref('xfdWatchUser')) {
				case 'yes':
					usertalkpage.setWatchlist(true);
					break;
				case 'no':
					usertalkpage.setWatchlistFromPreferences(false);
					break;
				default:
					usertalkpage.setWatchlistFromPreferences(true);
					break;
			}
			usertalkpage.setFollowRedirect(true);
			usertalkpage.append();
		}
	},


	cfds: {
		taggingCategory: function(pageobj) {
			var text = pageobj.getPageText();
			var params = pageobj.getCallbackParameters();

			pageobj.setPageText("{{subst:cfr-speedy|1=" + params.target + "}}\n" + text);
			pageobj.setEditSummary("तुरंत नाँवबदलाव खाती नामांकित; देखल जाय [[WP:CFDS|चर्चा खातिर श्रेणी/जल्दी से]]।" + Twinkle.getPref('summaryAd'));
			switch (Twinkle.getPref('xfdWatchPage')) {
				case 'yes':
					pageobj.setWatchlist(true);
					break;
				case 'no':
					pageobj.setWatchlistFromPreferences(false);
					break;
				default:
					pageobj.setWatchlistFromPreferences(true);
					break;
			}
			pageobj.setCreateOption('recreate');  // since categories can be populated without an actual page at that title
			pageobj.save();
		},
		addToList: function(pageobj) {
			var old_text = pageobj.getPageText();
			var params = pageobj.getCallbackParameters();
			var statelem = pageobj.getStatusElement();

			var newcatname = (/^श्रेणी:/.test(params.target) ? params.target : ("श्रेणी:" + params.target));
			var text = old_text.replace( 'BELOW THIS LINE -->', "BELOW THIS LINE -->\n* [[:" + Morebits.pageNameNorm + "]] से [[:" +
				newcatname + "]]\u00A0\u2013 " + params.xfdcat + (params.reason ? (": " + Morebits.string.formatReasonText(params.reason)) : "।") +
				" ~~~~" );
				// U+00A0 NO-BREAK SPACE; U+2013 EN RULE
			if( text === old_text ) {
				statelem.error( 'चर्चा के टारगेट जगह खोजे में बिफल रहल' );
				return;
			}

			pageobj.setPageText(text);
			pageobj.setEditSummary("[[" + Morebits.pageNameNorm + "]] जोड़ल जात बा।" + Twinkle.getPref('summaryAd'));
			switch (Twinkle.getPref('xfdWatchDiscussion')) {
				case 'yes':
					pageobj.setWatchlist(true);
					break;
				case 'no':
					pageobj.setWatchlistFromPreferences(false);
					break;
				default:
					pageobj.setWatchlistFromPreferences(true);
					break;
			}
			pageobj.setCreateOption('recreate');
			pageobj.save(function() {
				Twinkle.xfd.currentRationale = null;  // any errors from now on do not need to print the rationale, as it is safely saved on-wiki
			});
		}
	},


	rfd: {
		// This is a callback from an API request, which gets the target of the redirect
		findTargetCallback: function(apiobj) {
			var xmlDoc = apiobj.responseXML;
			var target = $(xmlDoc).find('redirects r').first().attr('to');
			if( !target ) {
				apiobj.statelem.error( "वर्तमान में ई पन्ना अनुप्रेषण ना बा, प्रक्रिया छोड़ के हटल जात बा" );
				return;
			}
			apiobj.params.target = target;
			Twinkle.xfd.callbacks.rfd.main(apiobj.params);
		},
		main: function(params) {
			var date = new Date();
			params.logpage = 'विकिपीडिया:चर्चा खातिर अनुप्रेषण/लॉग/' + date.getUTCFullYear() + ' ' + date.getUTCMonthName() + ' ' + date.getUTCDate();

			// Tagging redirect
			var wikipedia_page = new Morebits.wiki.page(mw.config.get('wgPageName'), "अनुप्रेषण पर हटावे के टैग लगावल जात बा");
			wikipedia_page.setFollowRedirect(false);
			wikipedia_page.setCallbackParameters(params);
			wikipedia_page.load(Twinkle.xfd.callbacks.rfd.taggingRedirect);

			// Updating data for the action completed event
			Morebits.wiki.actionCompleted.redirect = params.logpage;
			Morebits.wiki.actionCompleted.notice = "नामांकन पूरा भइल, अब आज के लॉग के ओर बढ़ल जात बा";

			// Adding discussion
			wikipedia_page = new Morebits.wiki.page(params.logpage, "आज के लॉग में चर्चा जोड़ल जात बा");
			wikipedia_page.setFollowRedirect(true);
			wikipedia_page.setCallbackParameters(params);
			wikipedia_page.load(Twinkle.xfd.callbacks.rfd.todaysList);

			// Notifying initial contributor
			if (params.usertalk) {
				var thispage = new Morebits.wiki.page(mw.config.get('wgPageName'));
				thispage.setCallbackParameters(params);
				thispage.lookupCreator(Twinkle.xfd.callbacks.rfd.userNotification);
			}
		},
		taggingRedirect: function(pageobj) {
			var text = pageobj.getPageText();
			var params = pageobj.getCallbackParameters();

			pageobj.setPageText("{{subst:rfd|content=\n" + text + "\n}}");
			pageobj.setEditSummary("[[" + params.logpage + "#" + Morebits.pageNameNorm + "]] पर चर्चा खाती लिस्ट में लगावल गइल।" + Twinkle.getPref('summaryAd'));
			switch (Twinkle.getPref('xfdWatchPage')) {
				case 'yes':
					pageobj.setWatchlist(true);
					break;
				case 'no':
					pageobj.setWatchlistFromPreferences(false);
					break;
				default:
					pageobj.setWatchlistFromPreferences(true);
					break;
			}
			pageobj.setCreateOption('nocreate');
			pageobj.save();
		},
		todaysList: function(pageobj) {
			var old_text = pageobj.getPageText();
			var params = pageobj.getCallbackParameters();
			var statelem = pageobj.getStatusElement();

			var text = old_text.replace( /(<\!-- Add new entries directly below this line\.? -->)/, "$1\n{{subst:rfd2|text=" +
				Morebits.string.formatReasonText(params.reason) + "|redirect="+ Morebits.pageNameNorm + "|target=" +
				params.target + "}} ~~~~\n" );
			if( text === old_text ) {
				statelem.error( 'चर्चा के टारगेट वाला जगह खोजे में सफल ना भइल' );
				return;
			}

			pageobj.setPageText(text);
			pageobj.setEditSummary("[[" + Morebits.pageNameNorm + "]] जोड़ल जात बा।" + Twinkle.getPref('summaryAd'));
			switch (Twinkle.getPref('xfdWatchDiscussion')) {
				case 'yes':
					pageobj.setWatchlist(true);
					break;
				case 'no':
					pageobj.setWatchlistFromPreferences(false);
					break;
				default:
					pageobj.setWatchlistFromPreferences(true);
					break;
			}
			pageobj.setCreateOption('recreate');
			pageobj.save(function() {
				Twinkle.xfd.currentRationale = null;  // any errors from now on do not need to print the rationale, as it is safely saved on-wiki
			});
		},
		userNotification: function(pageobj) {
			var initialContrib = pageobj.getCreator();

			// Disallow warning yourself
			if (initialContrib === mw.config.get('wgUserName')) {
				pageobj.getStatusElement().warn("आप (" + initialContrib + ") खुद एह पन्ना के निर्माता बाड़ीं; अधिसूचना छोड़ल जात बा");
				return;
			}

			var usertalkpage = new Morebits.wiki.page('प्रयोगकर्ता वार्ता:' + initialContrib, "शुरुआती योगदानकर्ता के सूचित कइल जात बा (" + initialContrib + ")");
			var notifytext = "\n{{subst:RFDNote|1=" + Morebits.pageNameNorm + "}} ~~~~";
			usertalkpage.setAppendText(notifytext);
			usertalkpage.setEditSummary("नोटिफिकेशन: [[WP:RFD|चर्चा खातिर अनुप्रेषण]] पर [[" + Morebits.pageNameNorm + "]] के लिस्ट कइल जाता।" + Twinkle.getPref('summaryAd'));
			usertalkpage.setCreateOption('recreate');
			switch (Twinkle.getPref('xfdWatchUser')) {
				case 'yes':
					usertalkpage.setWatchlist(true);
					break;
				case 'no':
					usertalkpage.setWatchlistFromPreferences(false);
					break;
				default:
					usertalkpage.setWatchlistFromPreferences(true);
					break;
			}
			usertalkpage.setFollowRedirect(true);
			usertalkpage.append();
		}
	}
};



Twinkle.xfd.callback.evaluate = function(e) {
	var type = e.target.category.value;
	var usertalk = e.target.notify.checked;
	var reason = e.target.xfdreason.value;
	var xfdcat, xfdtarget, xfdtarget2, noinclude, tfdtype, notifyuserspace;
	if( type === "afd" || type === "cfd" || type === "cfds" || type === "tfd" ) {
		xfdcat = e.target.xfdcat.value;
	}
	if( type === "cfd" || type === "cfds" ) {
		xfdtarget = e.target.xfdtarget.value;
		if (e.target.xfdtarget2) {
			xfdtarget2 = e.target.xfdtarget2.value;
		}
	}
	if( type === "afd" || type === "mfd" || type === "tfd" ) {
		noinclude = e.target.noinclude.checked;
	}
	if( type === 'tfd' ) {
		if (e.target.xfdtarget) {
			xfdtarget = e.target.xfdtarget.value;
		}
		tfdtype = e.target.templatetype.value;
	}
	if( type === 'mfd' ) {
		notifyuserspace = e.target.notifyuserspace && e.target.notifyuserspace.checked;
	}

	Morebits.simpleWindow.setButtonsEnabled( false );
	Morebits.status.init( e.target );

	Twinkle.xfd.currentRationale = reason;
	Morebits.status.onError(Twinkle.xfd.printRationale);

	if( !type ) {
		Morebits.status.error( 'Error', 'no action given' );
		return;
	}

	var query, wikipedia_page, wikipedia_api, logpage, params;
	var date = new Date();
	switch( type ) {

	case 'afd': // AFD
		query = {
			'action': 'query',
			'list': 'allpages',
			'apprefix': 'हटावे खातिर लेख/' + Morebits.pageNameNorm,
			'apnamespace': 4,
			'apfilterredir': 'nonredirects',
			'aplimit': Morebits.userIsInGroup( 'sysop' ) ? 5000 : 500
		};
		wikipedia_api = new Morebits.wiki.api( 'लेख पर हटावे के टैग लगावल जात बा', query, Twinkle.xfd.callbacks.afd.main );
		wikipedia_api.params = { usertalk:usertalk, reason:reason, noinclude:noinclude, xfdcat:xfdcat };
		wikipedia_api.post();
		break;

	case 'tfd': // TFD
		Morebits.wiki.addCheckpoint();

		if (xfdtarget) {
			xfdtarget = Morebits.string.toUpperCaseFirstChar(xfdtarget.replace(/^\:?Template\:/i, ''));
		} else {
			xfdtarget = '';
		}

		logpage = 'विकिपीडिया:चर्चा खातिर टेम्पलेट/लॉग/' + date.getUTCFullYear() + ' ' + date.getUTCMonthName() + ' ' + date.getUTCDate();

		params = { tfdtype: tfdtype, logpage: logpage, noinclude: noinclude, xfdcat: xfdcat, target: xfdtarget, reason: reason };

		// Tagging template(s)
		if (xfdcat === "tfm") {
			// Tag this template
			wikipedia_page = new Morebits.wiki.page(mw.config.get('wgPageName'), "एह टेम्पलेट पर बिलय के टैग लगावल जात बा");
			wikipedia_page.setFollowRedirect(true);
			params.otherTemplateName = "टेम्पलेट:" + xfdtarget;
			wikipedia_page.setCallbackParameters(params);
			wikipedia_page.load(Twinkle.xfd.callbacks.tfd.taggingTemplateForMerge);

			// Tag other template
			wikipedia_page = new Morebits.wiki.page("टेम्पलेट:" + xfdtarget, "दुसरकी टेम्पलेट पर बिलय के टैग जोड़ल जात बा");
			wikipedia_page.setFollowRedirect(true);
			params = $.extend(params);
			params.otherTemplateName = Morebits.pageNameNorm;
			wikipedia_page.setCallbackParameters(params);
			wikipedia_page.load(Twinkle.xfd.callbacks.tfd.taggingTemplateForMerge);
		} else {
			wikipedia_page = new Morebits.wiki.page(mw.config.get('wgPageName'), "टेम्पलेट पर हटावे के टैग जोड़ल जात बा");
			wikipedia_page.setFollowRedirect(true);  // should never be needed, but if the page is moved, we would want to follow the redirect
			wikipedia_page.setCallbackParameters(params);
			wikipedia_page.load(Twinkle.xfd.callbacks.tfd.taggingTemplate);
		}

		// Updating data for the action completed event
		Morebits.wiki.actionCompleted.redirect = logpage;
		Morebits.wiki.actionCompleted.notice = "नामांकन पूरा भइल, अब आज के लॉग के ओर बढ़ल जात बा";

		// Adding discussion
		wikipedia_page = new Morebits.wiki.page(logpage, "चर्चा के आज के लॉग में जोड़ल जात बा");
		wikipedia_page.setFollowRedirect(true);
		wikipedia_page.setCallbackParameters(params);
		wikipedia_page.load(Twinkle.xfd.callbacks.tfd.todaysList);

		// Notification to first contributor
		if (usertalk) {
			var thispage = new Morebits.wiki.page(mw.config.get('wgPageName'));
			thispage.setCallbackParameters(params);
			thispage.lookupCreator(Twinkle.xfd.callbacks.tfd.userNotification);

			// Nice try, but what if the two page creators are the same user?
			// Also, other XFD types don't do this... yet!
			//if (xfdcat === "tfm") {
			//	thispage = new Morebits.wiki.page("Template:" + xfdtarget);
			//	thispage.setCallbackParameters(params);
			//	thispage.lookupCreator(Twinkle.xfd.callbacks.tfd.userNotification);
			//}
		}

		Morebits.wiki.removeCheckpoint();
		break;

	case 'mfd': // MFD
		query = {
			'action': 'query',
			'list': 'allpages',
			'apprefix': 'हटावे खातिर बिबिध/' + Morebits.pageNameNorm,
			'apnamespace': 4,
			'apfilterredir': 'nonredirects',
			'aplimit': Morebits.userIsInGroup( 'sysop' ) ? 5000 : 500
		};
		wikipedia_api = new Morebits.wiki.api( "एह पन्ना के पुराना नामांकन सभ के खोज कइल जात बा", query, Twinkle.xfd.callbacks.mfd.main );
		wikipedia_api.params = { usertalk: usertalk, notifyuserspace: notifyuserspace, reason: reason, noinclude: noinclude, xfdcat: xfdcat };
		wikipedia_api.post();
		break;

	case 'ffd': // FFD
		var dateString = date.getUTCFullYear() + ' ' + date.getUTCMonthName() + ' ' + date.getUTCDate();
		logpage = 'विकिपीडिया:चर्चा खातिर फाइल/' + dateString;
		params = { usertalk: usertalk, reason: reason, date: dateString, logpage: logpage };

		Morebits.wiki.addCheckpoint();

		// Updating data for the action completed event
		Morebits.wiki.actionCompleted.redirect = logpage;
		Morebits.wiki.actionCompleted.notice = "नामांकन पूरा भइल, अब चर्चा पन्ना के ओर बढ़ल जात बा";

		// Tagging file
		wikipedia_page = new Morebits.wiki.page(mw.config.get('wgPageName'), "फाइल पन्ना पर हटावे के टैग लगावल जात बा");
		wikipedia_page.setFollowRedirect(true);
		wikipedia_page.setCallbackParameters(params);
		wikipedia_page.load(Twinkle.xfd.callbacks.ffd.taggingImage);

		// Contributor specific edits
		wikipedia_page = new Morebits.wiki.page(mw.config.get('wgPageName'));
		wikipedia_page.setCallbackParameters(params);
		wikipedia_page.lookupCreator(Twinkle.xfd.callbacks.ffd.main);

		Morebits.wiki.removeCheckpoint();
		break;

	case 'cfd':
		Morebits.wiki.addCheckpoint();

		if( xfdtarget ) {
			xfdtarget = xfdtarget.replace( /^\:?श्रेणी\:/i, '' );
		} else {
			xfdtarget = '';
		}

		if( xfdtarget2 ) {
			xfdtarget2 = xfdtarget2.replace( /^\:?श्रेणी\:/i, '' );
		}

		logpage = 'विकिपीडिया:चर्चा खातिर श्रेणी/लॉग/' + date.getUTCFullYear() + ' ' + date.getUTCMonthName() + ' ' + date.getUTCDate();

		params = { reason: reason, xfdcat: xfdcat, target: xfdtarget, target2: xfdtarget2, logpage: logpage };

		// Updating data for the action completed event
		Morebits.wiki.actionCompleted.redirect = logpage;
		Morebits.wiki.actionCompleted.notice = "नामांकन पूरा भइल, अब एह महीना के लॉग के रो बढ़ल जात बा";

		// Tagging category
		wikipedia_page = new Morebits.wiki.page(mw.config.get('wgPageName'), "श्रेणी पर हटावे के टैग जोड़ल जात बा");
		wikipedia_page.setCallbackParameters(params);
		wikipedia_page.load(Twinkle.xfd.callbacks.cfd.taggingCategory);

		// Adding discussion to list
		wikipedia_page = new Morebits.wiki.page(logpage, "चर्चा के आज के लिस्ट में जोड़ल जात बा");
		//wikipedia_page.setPageSection(2);
			// pageSection has been disabled - the API seems to throw up with nonexistent edit conflicts
			// it can be turned on again once the problem is fixed, to save bandwidth
		//wikipedia_page.setFollowRedirect(true);
		wikipedia_page.setCallbackParameters(params);
		wikipedia_page.load(Twinkle.xfd.callbacks.cfd.todaysList);

		// Notification to first contributor
		if (usertalk) {
			wikipedia_page = new Morebits.wiki.page(mw.config.get('wgPageName'));
			wikipedia_page.setCallbackParameters(params);
			wikipedia_page.lookupCreator(Twinkle.xfd.callbacks.cfd.userNotification);
		}

		Morebits.wiki.removeCheckpoint();
		break;

	case 'cfds':
		xfdtarget = xfdtarget.replace( /^\:?श्रेणी\:/, '' );

		logpage = "विकिपीडिया:चर्चा खातिर श्रेणी/जल्दी से";
		params = { reason: reason, xfdcat: xfdcat, target: xfdtarget };

		// Updating data for the action completed event
		Morebits.wiki.actionCompleted.redirect = logpage;
		Morebits.wiki.actionCompleted.notice = "नामांकन पूरा भइल, अब चर्चा पन्ना पर जाइल जा रहल बा";

		// Tagging category
		wikipedia_page = new Morebits.wiki.page(mw.config.get('wgPageName'), "श्रेणी पर नाँव बदलाव  के टैग जोड़ल जात बा");
		wikipedia_page.setCallbackParameters(params);
		wikipedia_page.load(Twinkle.xfd.callbacks.cfds.taggingCategory);

		// Adding discussion to list
		wikipedia_page = new Morebits.wiki.page(logpage, "चर्चा के लिस्ट में जोड़ल जात बा");
		wikipedia_page.setCallbackParameters(params);
		wikipedia_page.load(Twinkle.xfd.callbacks.cfds.addToList);

		break;

	case 'rfd':
		params = { usertalk: usertalk, reason: reason };
		if (document.getElementById("softredirect")) {
			// For soft redirects, skip straight to the callback
			params.target = document.getElementById("softredirect").textContent.replace(/^\:+/, "");
			Twinkle.xfd.callbacks.rfd.main(params);
		} else {
			// Find current target of redirect
			query = {
				'action': 'query',
				'titles': mw.config.get('wgPageName'),
				'redirects': true
			};
			wikipedia_api = new Morebits.wiki.api( "अनुप्रेषण के टारगेट खोजल जात बा ", query, Twinkle.xfd.callbacks.rfd.findTargetCallback );
			wikipedia_api.params = params;
			wikipedia_api.post();
		}
		break;
	default:
		alert("twinklexfd: unknown XFD discussion venue");
		break;
	}
};
})(jQuery);


//</nowiki>