مدیاویکی:Gadget-twinklespeedy.js

از مشروطه
پرش به ناوبری پرش به جستجو

نکته: پس از ذخیره کردن ممکن است برای دیدن تغییرات نیاز باشد که حافظهٔ نهانی مرورگر خود را پاک کنید.

  • فایرفاکس / سافاری: کلید Shift را نگه دارید و روی دکمهٔ Reload کلیک کنید، یا کلید‌های Ctrl-F5 یا Ctrl-R را با هم فشار دهید (در رایانه‌های اپل مکینتاش کلید‌های ⌘-R)
  • گوگل کروم: کلیدهای Ctrl+Shift+R را با هم فشار دهید (در رایانه‌های اپل مکینتاش کلید‌های ⌘-Shift-R)
  • اینترنت اکسپلورر: کلید Ctrl را نگه‌دارید و روی دکمهٔ Refresh کلیک کنید، یا کلید‌های Ctrl-F5 را با هم فشار دهید
  • اپرا: بروید به Menu → Settings (Opera → Preferences on a Mac) and then to Privacy & security → Clear browsing data → Cached images and files.
//<nowiki>


(function($){


/*
 ****************************************
 *** twinklespeedy.js: CSD module
 ****************************************
 * Mode of invocation:     Tab ("حذف سریع")
 * Active on:              Non-special, existing pages
 * Config directives in:   TwinkleConfig
 *
 * NOTE FOR DEVELOPERS:
 *   If adding a new criterion, check out the default values of the CSD preferences
 *   in twinkle.header.js, and add your new criterion to those if you think it would
 *   be good. 
 */

Twinkle.speedy = function twinklespeedy() {
	// Disable on:
	// * special pages
	// * non-existent pages
	if (mw.config.get('wgNamespaceNumber') < 0 || !mw.config.get('wgArticleId')) {
		return;
	}

	Twinkle.addPortletLink( Twinkle.speedy.callback, "محس", "tw-csd", Morebits.userIsInGroup('sysop') ? "حذف صفحه مطابق وپ:محس" : "درخواست حذف مطابق وپ:محس" );
};

// This function is run when the CSD tab/header link is clicked
Twinkle.speedy.callback = function twinklespeedyCallback() {
	Twinkle.speedy.initDialog(Morebits.userIsInGroup( 'sysop' ) ? Twinkle.speedy.callback.evaluateSysop : Twinkle.speedy.callback.evaluateUser, true);
};

Twinkle.speedy.dialog = null;  // used by unlink feature

// Prepares the speedy deletion dialog and displays it
Twinkle.speedy.initDialog = function twinklespeedyInitDialog(callbackfunc) {
	var dialog;
	Twinkle.speedy.dialog = new Morebits.simpleWindow( Twinkle.getPref('speedyWindowWidth'), Twinkle.getPref('speedyWindowHeight') );
	dialog = Twinkle.speedy.dialog;
	dialog.setTitle( "معیار حذف سریع را برگزینید" );
	dialog.setScriptName( "توینکل" );
	dialog.addFooterLink( "سیاست حذف سریع", "وپ:محس" );
	dialog.addFooterLink( "راهنمای توینکل", "WP:TW/DOC#speedy" );

	var form = new Morebits.quickForm( callbackfunc, (Twinkle.getPref('speedySelectionStyle') === 'radioClick' ? 'change' : null) );
	if( Morebits.userIsInGroup( 'sysop' ) ) {
		form.append( {
				type: 'checkbox',
				list: [
					{
						label: 'فقط برچسب بزن، حذف نکن',
						value: 'tag_only',
						name: 'tag_only',
						tooltip: 'اگر قصد دارید به جای حذف صفخه را برچسب حذف بزنید',
						checked : Twinkle.getPref('deleteSysopDefaultToTag'),
						event: function( event ) {
							var cForm = event.target.form;
							var cChecked = event.target.checked;
							// enable/disable talk page checkbox
							if (cForm.talkpage) {
								cForm.talkpage.disabled = cChecked;
								cForm.talkpage.checked = !cChecked && Twinkle.getPref('deleteTalkPageOnDelete');
							}
							// enable/disable redirects checkbox
							cForm.redirects.disabled = cChecked;
							cForm.redirects.checked = !cChecked;

							// enable/disable notify checkbox
							cForm.notify.disabled = !cChecked;
							cForm.notify.checked = cChecked;
							// enable/disable multiple
							cForm.multiple.disabled = !cChecked;
							cForm.multiple.checked = false;

							Twinkle.speedy.callback.dbMultipleChanged(cForm, false);

							event.stopPropagation();
						}
					}
				]
			} );
		form.append( { type: 'header', label: 'بخش مرتبط با حذف' } );
		if (mw.config.get('wgNamespaceNumber') % 2 === 0 && (mw.config.get('wgNamespaceNumber') !== 2 || (/\//).test(mw.config.get('wgTitle')))) {  // hide option for user pages, to avoid accidentally deleting user talk page
			form.append( {
				type: 'checkbox',
				list: [
					{
						label: 'همچنین صفحه بحث',
						value: 'talkpage',
						name: 'talkpage',
						tooltip: "This option deletes the page's talk page in addition. If you choose the F8 (moved to Commons) criterion, this option is ignored and the talk page is *not* deleted.",
						checked: Twinkle.getPref('deleteTalkPageOnDelete'),
						disabled: Twinkle.getPref('deleteSysopDefaultToTag'),
						event: function( event ) {
							event.stopPropagation();
						}
					}
				]
			} );
		}
		form.append( {
				type: 'checkbox',
				list: [
					{
						label: 'همچنین همه تغییرمسیرها را نیز حذف کن',
						value: 'redirects',
						name: 'redirects',
						tooltip: "This option deletes all incoming redirects in addition. Avoid this option for procedural (e.g. move/merge) deletions.",
						checked: Twinkle.getPref('deleteRedirectsOnDelete'),
						disabled: Twinkle.getPref('deleteSysopDefaultToTag'),
						event: function( event ) {
							event.stopPropagation();
						}
					}
				]
			} );
		form.append( { type: 'header', label: 'گزینه‌های مرتبط با برچسب' } );
	}

	form.append( {
			type: 'checkbox',
			list: [
				{
					label: 'در صورت امکان سازندهٔ صفحه مطلع شود',
					value: 'notify',
					name: 'notify',
					tooltip: "A notification template will be placed on the talk page of the creator, IF you have a notification enabled in your Twinkle preferences " +
						"for the criterion you choose AND this box is checked. The creator may be welcomed as well.",
					checked: !Morebits.userIsInGroup( 'sysop' ) || Twinkle.getPref('deleteSysopDefaultToTag'),
					disabled: Morebits.userIsInGroup( 'sysop' ) && !Twinkle.getPref('deleteSysopDefaultToTag'),
					event: function( event ) {
						event.stopPropagation();
					}
				}
			]
		} );
	form.append( {
			type: 'checkbox',
			list: [
				{
					label: 'برچسب‌زنی با چندین معیار',
					value: 'multiple',
					name: 'multiple',
					tooltip: "When selected, you can select several criteria that apply to the page. For example, G11 and A7 are a common combination for articles.",
					disabled: Morebits.userIsInGroup( 'sysop' ) && !Twinkle.getPref('deleteSysopDefaultToTag'),
					event: function( event ) {
						Twinkle.speedy.callback.dbMultipleChanged( event.target.form, event.target.checked );
						event.stopPropagation();
					}
				}
			]
		} );

	form.append( {
			type: 'div',
			name: 'work_area',
			label: 'Failed to initialize the CSD module. Please try again, or tell the Twinkle developers about the issue.'
		} );

	if( Twinkle.getPref( 'speedySelectionStyle' ) !== 'radioClick' ) {
		form.append( { type: 'submit' } );
	}

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

	Twinkle.speedy.callback.dbMultipleChanged( result, false );
};

Twinkle.speedy.callback.dbMultipleChanged = function twinklespeedyCallbackDbMultipleChanged(form, checked) {
	var namespace = mw.config.get('wgNamespaceNumber');
	var value = checked;

	var work_area = new Morebits.quickForm.element( {
			type: 'div',
			name: 'work_area'
		} );

	if (checked && Twinkle.getPref('speedySelectionStyle') === 'radioClick') {
		work_area.append( {
				type: 'div',
				label: 'When finished choosing criteria, click:'
			} );
		work_area.append( {
				type: 'button',
				name: 'submit-multiple',
				label: 'ثبت درخواست',
				event: function( event ) {
					Twinkle.speedy.callback.evaluateUser( event );
					event.stopPropagation();
				}
			} );
	}

	var radioOrCheckbox = (value ? 'checkbox' : 'radio');

	if (namespace % 2 === 1 && namespace !== 3) {    
		// show db-talk on talk pages, but not user talk pages
		work_area.append( { type: 'header', label: 'صفحه‌های بحث' } );
		work_area.append( { type: radioOrCheckbox, name: 'csd', list: Twinkle.speedy.talkList } );
	}

	switch (namespace) {
		case 0:  // article
		case 1:  // talk
			work_area.append( { type: 'header', label: 'مقاله‌ها' } );
			work_area.append( { type: radioOrCheckbox, name: 'csd', list: Twinkle.speedy.getArticleList(value) } );
			break;

		case 2:  // user
		case 3:  // user talk
			work_area.append( { type: 'header', label: 'صفحه‌های کاربری' } );
			work_area.append( { type: radioOrCheckbox, name: 'csd', list: Twinkle.speedy.getUserList(value) } );
			break;

		case 6:  // file
		case 7:  // file talk
			work_area.append( { type: 'header', label: 'پرونده‌ها' } );
			work_area.append( { type: radioOrCheckbox, name: 'csd', list: Twinkle.speedy.getFileList(value) } );
			work_area.append( { type: 'div', label: 'Tagging for CSD F4 (no license), F5 (orphaned fair use), F6 (no fair use rationale), and F11 (no permission) can be done using Twinkle\'s "DI" tab.' } );
			break;

		case 10:  // template
		case 11:  // template talk
			work_area.append( { type: 'header', label: 'الگوها' } );
			work_area.append( { type: radioOrCheckbox, name: 'csd', list: Twinkle.speedy.getTemplateList(value) } );
			break;

		case 14:  // category
		case 15:  // category talk
			work_area.append( { type: 'header', label: 'رده‌ها' } );
			work_area.append( { type: radioOrCheckbox, name: 'csd', list: Twinkle.speedy.categoryList } );
			break;

		case 100:  // portal
		case 101:  // portal talk
			work_area.append( { type: 'header', label: 'درگاه‌ها' } );
			work_area.append( { type: radioOrCheckbox, name: 'csd', list: Twinkle.speedy.getPortalList(value) } );
			break;

		default:
			break;
	}

	work_area.append( { type: 'header', label: 'معیارهای عمومی' } );
	work_area.append( { type: radioOrCheckbox, name: 'csd', list: Twinkle.speedy.getGeneralList(value) });

	work_area.append( { type: 'header', label: 'تغییرمسیرها' } );
	work_area.append( { type: radioOrCheckbox, name: 'csd', list: Twinkle.speedy.redirectList } );

	var old_area = Morebits.quickForm.getElements(form, "work_area")[0];
	form.replaceChild(work_area.render(), old_area);
};

Twinkle.speedy.talkList = [
	{
		label: 'ع۸: بحث یتیم',
		value: 'talk',
		tooltip: 'This excludes any page that is useful to the project - in particular, user talk pages, talk page archives, and talk pages for files that exist on Wikimedia Commons.'
	}
];

// this is a function to allow for db-multiple filtering
Twinkle.speedy.getFileList = function twinklespeedyGetFileList(multiple) {
	var result = [];
	result.push({
		label: 'پ۱ : موجود در ویکی‌انبار یا ویکی‌پدیا فارسی',
		value: 'redundantimage',
		tooltip: 'Any file that is a redundant copy, in the same file format and same or lower resolution, of something else on Wikipedia. Likewise, other media that is a redundant copy, in the same format and of the same or lower quality. This does not apply to files duplicated on Wikimedia Commons, because of licence issues; these should be tagged with {{subst:ncd|Image:newname.ext}} or {{subst:ncd}} instead'
	});
	result.push({
		label: 'پ۲ : پرونده خراب یا خالی',
		value: 'noimage',
		tooltip: 'Before deleting this type of file, verify that the MediaWiki engine cannot read it by previewing a resized thumbnail of it. This also includes empty (i.e., no content) file description pages for Commons files'
	});
	if (!multiple) {
		result.push({
			label: 'پ۲ : توضیحات نامربوط برای تصویری که در ویکی‌انبار بارگذاری شده‌است',
			value: 'fpcfail',
			tooltip: 'An image, hosted on Commons, but with tags or information on its English Wikipedia description page that are no longer needed. (For example, a failed featured picture candidate.)'
		});
	}
	result.push({
		label: 'پ۳ : مجوز نادرست',
		value: 'noncom',
		tooltip: 'Files licensed as "for non-commercial use only", "non-derivative use" or "used with permission" that were uploaded on or after 2005-05-19, except where they have been shown to comply with the limited standards for the use of non-free content. This includes files licensed under a "Non-commercial Creative Commons License". Such files uploaded before 2005-05-19 may also be speedily deleted if they are not used in any articles'
	});
	if (Morebits.userIsInGroup('sysop')) {
		result.push({
			label: 'پ۴ : فاقد اجازه‌نامه',
			value: 'unksource',
			tooltip: 'Files in category "Files with unknown source", "Files with unknown copyright status", or "Files with no copyright tag" that have been tagged with a template that places them in the category for more than seven days, regardless of when uploaded. Note, users sometimes specify their source in the upload summary, so be sure to check the circumstances of the file.'
		});
		result.push({
			label: 'پ۵ : تصویر غیرآزاد استفاده نشده',
			value: 'unfree',
			tooltip: 'Files that are not under a free license or in the public domain that are not used in any article and that have been tagged with a template that places them in a dated subcategory of Category:Orphaned fairuse files for more than seven days. Reasonable exceptions may be made for file uploaded for an upcoming article. Use the "Orphaned fair use" option in Twinkle\'s DI module to tag files for forthcoming deletion.'
		});
		result.push({
			label: 'پ۶ : عدم استفادهٔ منصفانه',
			value: 'norat',
			tooltip: 'Any file without a fair use rationale may be deleted seven days after it is uploaded.  Boilerplate fair use templates do not constitute a fair use rationale.  Files uploaded before 2006-05-04 should not be deleted immediately; instead, the uploader should be notified that a fair-use rationale is needed.  Files uploaded after 2006-05-04 can be tagged using the "No fair use rationale" option in Twinkle\'s DI module. Such files can be found in the dated subcategories of Category:Files with no fair use rationale.'
		});
	}
	result.push({
		label: 'پ۷: برچسب منصفانه مشخصاً نادرست',
		value: 'badfairuse',  // same as below
		tooltip: 'This is only for files with a clearly invalid fair-use tag, such as a {{Non-free logo}} tag on a photograph of a mascot. For cases that require a waiting period (replaceable images or otherwise disputed rationales), use the options on Twinkle\'s DI tab.'
	});
	if (!multiple) {
		result.push({
			label: 'پ۷ : تصویر منصفانه از یک سازمان تجاری تهیه تصویر کپی شده است',
			value: 'badfairuse',  // same as above
			tooltip: 'Non-free images or media from a commercial source (e.g., Associated Press, Getty), where the file itself is not the subject of sourced commentary, are considered an invalid claim of fair use and fail the strict requirements of WP:NFCC.'
		});
	}
	if (!multiple) {
		result.push({
			label: 'پ۸ : تصویر با کیفیت بالاتر در ویکی‌انبار قرار دارد',
			value: 'nowcommons',
			tooltip: 'Provided the following conditions are met: 1: The file format of both images is the same. 2: The file\'s license and source status is beyond reasonable doubt, and the license is undoubtedly accepted at Commons. 3: All information on the file description page is present on the Commons file description page. That includes the complete upload history with links to the uploader\'s local user pages. 4: The file is not protected, and the file description page does not contain a request not to move it to Commons. 5: If the file is available on Commons under a different name than locally, all local references to the file must be updated to point to the title used at Commons. 6: For {{c-uploaded}} files: They may be speedily deleted as soon as they are off the Main Page'
		});
	}
	result.push({
		label: 'پ۹ : نقض آشکار حق تکثیر',
		value: 'imgcopyvio',
		tooltip: 'The file was copied from a website or other source that does not have a license compatible with Wikipedia, and the uploader neither claims fair use nor makes a credible assertion of permission of free use. Sources that do not have a license compatible with Wikipedia include stock photo libraries such as Getty Images or Corbis. Non-blatant copyright infringements should be discussed at Wikipedia:Files for deletion'
	});
	result.push({
		label: 'پ۱۰: پروندهٔ رسانه‌ای بی‌کاربرد',
		value: 'badfiletype',
		tooltip: 'Files uploaded that are neither image, sound, nor video files (e.g. .doc, .pdf, or .xls files) which are not used in any article and have no foreseeable encyclopedic use'
	});
	if (Morebits.userIsInGroup('sysop')) {
		result.push({
			label: 'پ۱۱: نشانی از مجوز نیست',
			value: 'nopermission',
			tooltip: 'If an uploader has specified a license and has named a third party as the source/copyright holder without providing evidence that this third party has in fact agreed, the item may be deleted seven days after notification of the uploader'
		});
	}
	result.push({
		label: 'ع۸: صفحهٔ توصیف بدون پروندهٔ مرتبط',
		value: 'imagepage',
		tooltip: 'This is only for use when the file doesn\'t exist at all. Corrupt files, and local description pages for files on Commons, should use F2; implausible redirects should use R3; and broken Commons redirects should use G6.'
	});
	return result;
};

Twinkle.speedy.getArticleList = function twinklespeedyGetArticleList(multiple) {
	var result = [];
	result.push({
		label: 'م۱ : فاقد متن یا خالی - مقاله‌هایی که متن کافی برای شناساندن موضوع مقاله ندارند.',
		value: 'nocontext',
		tooltip: 'Example: "He is a funny man with a red car. He makes people laugh." This applies only to very short articles. Context is different from content, treated in A3, below.'
	});
	result.push({
		label: 'م۲ : مقاله‌های ترجمه نشده',
		value: 'foreign',
		tooltip: 'If the article in question does not exist on another project, the template {{notenglish}} should be used instead. All articles in a non-English language that do not meet this criteria (and do not meet any other criteria for speedy deletion) should be listed at Pages Needing Translation (PNT) for review and possible translation'
	});
	result.push({
		label: 'م۳: تا کنون بی‌محتوا',
		value: 'nocontent',
		tooltip: 'Any article consisting only of links elsewhere (including hyperlinks, category tags and "see also" sections), a rephrasing of the title, and/or attempts to correspond with the person or group named by its title. This does not include disambiguation pages'
	});
	result.push({
		label: 'م۵: مقاله‌های انتقالی به دیگر ویکی‌ها',
		value: 'transwiki',
		tooltip: 'Any article that has been discussed at Articles for Deletion (et al), where the outcome was to transwiki, and where the transwikification has been properly performed and the author information recorded. Alternately, any article that consists of only a dictionary definition, where the transwikification has been properly performed and the author information recorded'
	});
	if (multiple) {
		result.push({
			label: 'م۷: افراد، گروه‌ها، شرکت‌ها، محتوای وب و تک‌جانوران نامهم',
			value: 'م۷',
			tooltip: 'An article about a real person, group of people, band, club, company, web content, or individual animal that does not assert the importance or significance of its subject. If controversial, or if there has been a previous AfD that resulted in the article being kept, the article should be nominated for AfD instead'
		});
	} else {
		result.push({
			label: 'م۷: شخص نامهم',
			value: 'person',
			tooltip: 'An article about a real person that does not assert the importance or significance of its subject. If controversial, or if there has been a previous AfD that resulted in the article being kept, the article should be nominated for AfD instead'
		});
		result.push({
			label: 'م۷: موسیقیدان یا باند نامهم',
			value: 'band',
			tooltip: 'مقاله در مورد یک گروه، خواننده، موسیقی‌دان، یا گروه موسیقی که اهمیت موضوع را نشان نمی‌دهد. '
		});
		result.push({
			label: 'م۷: باشگاه نامهم',
			value: 'club',
			tooltip: 'مقاله در مورد یک انجمن که اهمیت موضوع را نشان نمی‌دهد. '
		});
		result.push({
			label: 'م۷: شرکت یا سازمان نامهم',
			value: 'corp',
			tooltip: 'مقاله در مورد یک شرکت یا سازمان که اهمیت موضوع را نشان نمی‌دهد. '
		});
		result.push({
			label: 'م۷ : وب‌گاه یا محتوای وب ناسرشناس',
			value: 'web',
			tooltip: 'Article about a web site, blog, online forum, webcomic, podcast, or similar web content that does not assert the importance or significance of its subject'
		});
		result.push({
			label: 'م۷: تک‌جانور نامهم',
			value: 'animal',
			tooltip: 'مقاله در مورد جانور که اهمیت موضوع را نشان نمی‌دهد. '
		});
		result.push({
			label: 'م۷: رویداد سازمان‌دهی‌شدهٔ نامهم',
			value: 'event',
			tooltip: 'Article about an organized event (tour, function, meeting, party, etc.) that does not assert the importance or significance of its subject'
		});
	}
	result.push({
		label: 'م۵: اثر موسیقی ناسرشناس که هنرمند آن مقاله ندارد',
		value: 'م۹',
		tooltip: 'An article about a musical recording which does not indicate why its subject is important or significant, and where the artist\'s article has never existed or has been deleted'
	});
	result.push({
		label: 'م۱۰: مقاله‌های تازه‌ساز با موضوعی تکراری',
		value: 'م۱۰',
		tooltip: 'A recently created article with no relevant page history that does not aim to expand upon, detail or improve information within any existing article(s) on the subject, and where the title is not a plausible redirect. This does not include content forks, split pages or any article that aims at expanding or detailing an existing one.'
	});
	return result;
};

Twinkle.speedy.categoryList = [
	{
		label: 'ر۱: ردهٔ خالی',
		value: 'catempty',
		tooltip: 'Categories that have been unpopulated for at least four days. This does not apply to categories being discussed at WP:CFD, disambiguation categories, and certain other exceptions. If the category isn\'t relatively new, it possibly contained articles earlier, and deeper investigation is needed'
	},
	{
		label: 'ع۸: رده‌های پرشده با الگوی حذف‌شده یا تغییرهدف‌یافته',
		value: 'templatecat',
		tooltip: 'This is for situations where a category is effectively empty, because the template(s) that formerly placed pages in that category are now deleted. This excludes categories that are still in use.'
	}
];

Twinkle.speedy.getUserList = function twinklespeedyGetTemplateList(multiple) {
	var result = [];
	result.push({
		label: 'ک۱: درخواست کاربر',
		value: 'userreq',
		tooltip: 'Personal subpages, upon request by their user. In some rare cases there may be administrative need to retain the page. Also, sometimes, main user pages may be deleted as well. See Wikipedia:User page for full instructions and guidelines'
	});
	result.push({
		label: 'ک۲: کاربر ناموجود',
		value: 'nouser',
		tooltip: 'User pages of users that do not exist (Check Special:Listusers)'
	});
	result.push({
		label: 'ک۳: گالری‌های ناآزاد',
		value: 'gallery',
		tooltip: 'Galleries in the userspace which consist mostly of "fair use" or non-free files. Wikipedia\'s non-free content policy forbids users from displaying non-free files, even ones they have uploaded themselves, in userspace. It is acceptable to have free files, GFDL-files, Creative Commons and similar licenses along with public domain material, but not "fair use" files'
	});
	if (!multiple) {
		result.push({
			label: 'ع۱۱: صفحهٔ کاربری تبلیغاتی تحت یک نام کاربری تبلیغاتی',
			value: 'spamuser',
			tooltip: 'A promotional user page, with a username that promotes or implies affiliation with the thing being promoted. Note that simply having a page on a company or product in one\'s userspace does not qualify it for deletion. If a user page is spammy but the username is not, then consider tagging with regular G11 instead.'
		});
	}
	return result;
};

Twinkle.speedy.getTemplateList = function twinklespeedyGetTemplateList(multiple) {
	var result = [];
	result.push({
		label: 'ا۲: الگوهایی که به صورت آشکار نمایش نادرستی از یک سیاست جاافتاده باشند',
		value: 'policy',
		tooltip: 'This includes "speedy deletion" templates for issues that are not speedy deletion criteria and disclaimer templates intended to be used in articles'
	});
	if (!multiple) {
		result.push({
			label: 'ا۳: الگوهای تکراری یا نمونه‌های سخت‌کدبندی‌شده',
			value: 'duplicatetemplate',
			tooltip: 'Templates that are either substantial duplications of another template or hardcoded instances of another template where the same functionality could be provided by that other template'
		});
		result.push({
			label: 'ا۳: الگوهایی که هیچ کاربرد مفیدی ندارند',
			value: 'ا۳',
			tooltip: 'This criterion allows you to provide a rationale. In many cases, another criterion will be more appropriate, such as G1, G2, G6, or G8.'
		});
	}
	return result;
};

Twinkle.speedy.getPortalList = function twinklespeedyGetPortalList(multiple) {
	var result = [];
	if (!multiple) {
		result.push({
			label: 'د۱ : درگاهی که اگر مقاله بود، مشمول حذف سریع می‌شد',
			value: 'د۱',
			tooltip: 'You must specify the article criterion that applies in this case (A1, A3, A7, or A10).'
		});
	}
	result.push({
		label: 'د۲ : درگاه خالی',
		value: 'emptyportal',
		tooltip: 'Any Portal based on a topic for which there is not a non-stub header article, and at least three non-stub articles detailing subject matter that would be appropriate to discuss under the title of that Portal'
	});
	return result;
};

Twinkle.speedy.getGeneralList = function twinklespeedyGetGeneralList(multiple) {
	var result = [];
	if (!multiple) {
		result.push({
			label: 'دلیل سفارشی' + (Morebits.userIsInGroup('sysop') ? ' (برای سیاههٔ حذف)' : ' با کمک الگوی {'+'{حس}}'),
			value: 'reason',
			tooltip: '{'+'{db}} is short for "delete because". At least one of the other deletion criteria must still apply to the page, and you must make mention of this in your rationale. This is not a "catch-all" for when you can\'t find any criteria that fit.'
		});
	}
	result.push({
		label: 'ع۱: چرندیات محض. صفحه‌هایی که تنها از مطالب ناهمگرا یا نامفهوم تشکیل شده‌اند و مطلب یا تاریخچهٔ معنی‌داری ندارند.',
		value: 'nonsense',
		tooltip: 'This does not include poor writing, partisan screeds, obscene remarks, vandalism, fictional material, material not in English, poorly translated material, implausible theories, or hoaxes. In short, if you can understand it, G1 does not apply.'
	});
	result.push({
		label: 'ع۲: صفحهٔ آزمایشی',
		value: 'test',
		tooltip: 'A page created to test editing or other Wikipedia functions. Pages in the User namespace are not included, nor are valid but unused or duplicate templates (although criterion T3 may apply).'
	});
	result.push({
		label: 'ع۳: خرابکاری محض',
		value: 'vandalism',
		tooltip: 'Plain pure vandalism (including redirects left behind from pagemove vandalism)'
	});
	if (!multiple) {
		result.push({
			label: 'ع۳: کلک‌زنی آشکار',
			value: 'hoax',
			tooltip: 'مطلب فریب‌آمیز آشکار در حد خرابکاری'
		});
	}
	result.push({
		label: 'ع۴: بازسازی مطلبی که در پی نظرخواهی حذف شده است',
		value: 'repost',
		tooltip: 'A copy, by any title, of a page that was deleted via an XfD process or Deletion review, provided that the copy is substantially identical to the deleted version. This clause does not apply to content that has been "userfied", to content undeleted as a result of Deletion review, or if the prior deletions were proposed or speedy deletions, although in this last case, other speedy deletion criteria may still apply'
	});
	result.push({
		label: 'ع۵: کاربر تحریم یا بسته‌شده',
		value: 'banned',
		tooltip: 'صفحات ساخته‌شده توسط کاربران بسته‌شده در حین قطع دسترسی'
	});
	if (!multiple) {
		result.push({
			label: 'ع۶: ادغام تاریخچه',
			value: 'histmerge',
			tooltip: 'حذف موقت یک صفحه جهت ادغام تاریخچه‌های صفحه'
		});
		result.push({
			label: 'ع۶: انتقال',
			value: 'move',
			tooltip: 'Making way for an uncontroversial move like reversing a redirect'
		});
		result.push({
			label: 'ع۶: نبح',
			value: 'xfd',
			tooltip: 'An admin has closed a deletion discussion (at AfD, FfD, RfD, TfD, CfD, or MfD) as "delete", but they didn\'t actually delete the page.'
		});
		result.push({
			label: 'ع۶: صفحهٔ ابهام‌زدایی نالازم',
			value: 'disambig',
			tooltip: 'این تنها برای صفحه‌های ابهام‌زدایی یتیم که دارای یکی از این شرایط باشند به کار می‌رود: (۱) ابهام‌زدایی تنها دو مقاله‌ی موجود در ویکی‌پدیا یا کمتر که عنوانشان با "(ابهام‌زدایی)" پایان می‌پذیرد (یعنی موضوع اصلی دارند)، یا (۲) هیچ صفحه‌ای از ویکی‌پدیا را ابهام‌زدایی نمی‌کند، عنوانش مهم نیست.'
		});
		result.push({
			label: 'ع۶: تغییرمسیر نابجا به صفحهٔ ابهام‌زدایی',
			value: 'movedab',
			tooltip: 'This only applies for redirects to disambiguation pages ending in (disambiguation) where a primary topic does not exist.'
		});
		result.push({
			label: 'ع۶: انتقال با رونوشت‌برداری و چسباندن',
			value: 'copypaste',
			tooltip: 'This only applies for a copy-and-paste page move of another page that needs to be temporarily deleted to make room for a clean page move.'
		});
	}
	result.push({
		label: 'ع۶: تمیزکاری',
		value: 'ع۶',
		tooltip: 'Other non-controversial "housekeeping" tasks'
	});
	result.push({
		label: 'ع۷: نویسنده خواستار حذف است یا صفحه را خالی کرد',
		value: 'author',
		tooltip: 'Any page for which deletion is requested by the original author in good faith, provided the page\'s only substantial content was added by its author. If the author blanks the page, this can also be taken as a deletion request.'
	});
	result.push({
		label: 'ع۸: صفحه‌های وابسته به صفحه‌های ناموجود یا حذف شده',
		value: 'ع۸',
		tooltip: 'such as talk pages with no corresponding subject page; subpages with no parent page; file pages without a corresponding file; redirects to invalid targets, such as nonexistent targets, redirect loops, and bad titles; or categories populated by deleted or retargeted templates. This excludes any page that is useful to the project, and in particular: deletion discussions that are not logged elsewhere, user and user talk pages, talk page archives, plausible redirects that can be changed to valid targets, and file pages or talk pages for files that exist on Wikimedia Commons.'
	});
	if (!multiple) {
		result.push({
			label: 'ع۸: زیرصفحه‌های بدون صفحهٔ مادر',
			value: 'subpage',
			tooltip: 'This excludes any page that is useful to the project, and in particular: deletion discussions that are not logged elsewhere, user and user talk pages, talk page archives, plausible redirects that can be changed to valid targets, and file pages or talk pages for files that exist on Wikimedia Commons.'
		});
	}
	result.push({
		label: 'ع۱۰ : صفحه حمله',
		value: 'attack',
		tooltip: 'Pages that serve no purpose but to disparage their subject or some other entity (e.g., "John Q. Doe is an imbecile"). This includes a biography of a living person that is negative in tone and unsourced, where there is no NPOV version in the history to revert to. Administrators deleting such pages should not quote the content of the page in the deletion summary!'
	});
	if (!multiple) {
		result.push({
			label: 'ع۱۰: زندگی‌نامهٔ زندگان کاملاً منفی و بی‌منبع',
			value: 'negublp',
			tooltip: 'زندگی‌نامه یک فرد زنده که کاملا بدون منبع و با لحن منفی نوشته شده‌است. هیچ نسخه بی‌طرفی در تاریخچه مقاله وجود ندارد تا بدان واگردانده شود. '
		});
	}
	result.push({
		label: 'ع۱۱ : تبلیغات',
		value: 'spam',
		tooltip: 'Pages which exclusively promote a company, product, group, service, or person and which would need to be fundamentally rewritten in order to become encyclopedic. Note that an article about a company or a product which describes its subject from a neutral point of view does not qualify for this criterion; an article that is blatant advertising should have inappropriate content as well'
	});
	result.push({
		label: 'ع۱۲ : نقض حق تکثیر',
		value: 'copyvio',
		tooltip: 'Either: (1) Material was copied from another website that does not have a license compatible with Wikipedia, or is photography from a stock photo seller (such as Getty Images or Corbis) or other commercial content provider; (2) There is no non-infringing content in the page history worth saving; or (3) The infringement was introduced at once by a single person rather than created organically on wiki and then copied by another website such as one of the many Wikipedia mirrors'
	});
	result.push({
		label: 'ع۱۳: درخواست‌های ساخت مقالهٔ قدیمی',
		value: 'afc',
		tooltip: 'Any rejected or unsubmitted AfC submission that has not been edited for more than 6 months.'
	});
	return result;
};

Twinkle.speedy.redirectList = [
	{
		label: 'ت۲ : تغییرمسیر از فضای‌نام اصلی به هر فضای‌نام دیگری بجز فضاهای نام رده:، الگو:، ویکی‌پدیا:، راهنما: و درگاه:',
		value: 'rediruser',
		tooltip: '(this does not include the Wikipedia shortcut pseudo-namespaces). If this was the result of a page move, consider waiting a day or two before deleting the redirect'
	},
	{
		label: 'ت۳ : تغییرمسیر دارای اشتباه املایی نامحتمل که به تازگی ساخته شده‌است',
		value: 'redirtypo',
		tooltip: 'However, redirects from common misspellings or misnomers are generally useful, as are redirects in other languages'
	},
	{
		label: 'ع۸: تغییرمسیر به اهداف نامعتبر همچون اهداف ناموجود، تغییرمسیرهای حلقه‌ای و عنوان‌های نادرست',
		value: 'redirnone',
		tooltip: 'This excludes any page that is useful to the project, and in particular: deletion discussions that are not logged elsewhere, user and user talk pages, talk page archives, plausible redirects that can be changed to valid targets, and file pages or talk pages for files that exist on Wikimedia Commons.'
	}
];

Twinkle.speedy.normalizeHash = {
	'reason': 'db',
	'nonsense': 'ع۱',
	'test': 'ع۲',
	'vandalism': 'ع۳',
	'hoax': 'ع۳',
	'repost': 'ع۴',
	'banned': 'ع۵',
	'histmerge': 'ع۶',
	'move': 'ع۶',
	'xfd': 'ع۶',
	'disambig': 'ع۶',
	'movedab': 'ع۶',
	'copypaste': 'ع۶',
	'ع۶': 'ع۶',
	'author': 'ع۷',
	'ع۸': 'ع۸',
	'talk': 'ع۸',
	'subpage': 'ع۸',
	'redirnone': 'ع۸',
	'templatecat': 'ع۸',
	'imagepage': 'ع۸',
	'attack': 'ع۱۰',
	'negublp': 'ع۱۰',
	'spam': 'ع۱۱',
	'spamuser': 'ع۱۱',
	'copyvio': 'ع۱۲',
	'afc': 'ع۱۳',
	'nocontext': 'م۱',
	'foreign': 'م۲',
	'nocontent': 'م۳',
	'transwiki': 'م۵',
	'م۷': 'م۷',
	'person': 'م۷',
	'corp': 'م۷',
	'web': 'م۷',
	'band': 'م۷',
	'club': 'م۷',
	'animal': 'م۷',
	'event': 'م۷',
	'م۹': 'م۹',
	'م۱۰': 'م۱۰',
	'rediruser': 'ت۲',
	'redirtypo': 'ت۳',
	'redundantimage': 'پ۱',
	'noimage': 'پ۲',
	'fpcfail': 'پ۲',
	'noncom': 'پ۳',
	'unksource': 'پ۴',
	'unfree': 'پ۵',
	'norat': 'پ۶',
	'badfairuse': 'پ۷',
	'nowcommons': 'پ۸',
	'imgcopyvio': 'پ۹',
	'badfiletype': 'پ۱۰',
	'nopermission': 'پ۱۱',
	'catempty': 'ر۱',
	'userreq': 'ک۱',
	'nouser': 'ک۲',
	'gallery': 'ک۳',
	'policy':'ا۲',
	'duplicatetemplate': 'ا۳',
	'ا۳': 'ا۳',
	'د۱': 'د۱',
	'emptyportal': 'د۲'
};

// keep this synched with [[MediaWiki:Deletereason-dropdown]]
Twinkle.speedy.reasonHash = {
	'reason': '',
// General
	'nonsense': '[[وپ:چرند|چرندیات محض]]، بی‌معنا یا نامفهوم',
	'test': 'صفحهٔ آزمایش',
	'vandalism': '[[وپ:خرابکاری|خرابکاری]]',
	'hoax': '[[وپ:کلک مزنید|کلک]] آشکار',
	'repost': 'ساخت دوبارهٔ صفحه‌ای که برپایهٔ [[وپ:نظرخواهی برای حذف]] [[وپ:حذف|حذف]] شده است',
	'banned': 'ساخت به دست کاربران [[وپ:قطع دسترسی|مسدودشده]] یا [[وپ:تحریم|تحریم‌شده]] با زیر پا گذاشتن قطع دسترسی یا تحریم',
	'histmerge': 'حذف موقت برای ادغام تاریخچه‌ها',
	'move': 'باز کردن راه برای انتقال‌های بی‌مناقشه',
	'xfd': 'حذف صفحه بر پایهٔ نتیجهٔ [[وپ:نبح|نظرخواهی حذف]]',
	'disambig': 'صفحهٔ ابهام‌زدایی نالازم',
	'movedab': 'تغییرمسیر به [[:en:WP:MALPLACED|صفحهٔ ابهام‌زدایی بدجا]]',
	'copypaste': 'انتقال صفحه با[[:en:WP:CPMV|رونوشت‌برداری و چسباندن]]',
	'ع۶': 'تمیزکاری در راه نگهداری و روزمره (نابحث‌برانگیز)',
	'author': 'تک‌نویسنده که درخواست حذف داده یا صفحه را خالی کرده است',
	'ع۸': 'صفحهٔ وابسته به صفحهٔ حذف‌شده یا ناموجود',
	'talk': '[[وپ:صفحه بحث|صفحهٔ بحث]] صفحه‌ای نامجود یا حذف‌شده',
	'subpage': '[[وپ:زیرصفحه|زیرصفحهٔ]] صفحه‌ای ناموجود یا حذف‌شده',
	'redirnone': '[[وپ:تغییرمسیر|تغییرمسیر]] به صفحه‌ای ناموجود یا حذف‌شده',
	'templatecat': 'پرشده با الگوهای حذف‌شده یا تغییرهدف‌یافته',
	'imagepage': 'صفحهٔ توصیف پرونده برای پرونده‌ای که وجود ندارد',
	'attack': '[[وپ:صفحه حمله|صفحهٔ حمله]] یا منفی بدون منبع [[وپ:زز|زندگی‌نامه زندگان]]',
	'negublp': '[[وپ:زندگی‌نامه زندگان|زندگی‌نامهٔ]] منفی بدون منبع',
	'spam': '[[وپ:هرزنامه|هرزنگاری]] یا تبلیغ آشکار',
	'copyvio': 'زیر پا گذاشتن آشکار [[وپ:حق تکثیر|حق نشر]]',
	'afc': '[[:en:WP:AFC|درخواست ساخت]] مقالهٔ ترک‌شده',
// Articles
	'nocontext': 'مقاله‌ای کوتاه که بافت لازم را برای شناسایی موضوع فراهم نمی‌کند',
	'foreign': 'مقاله‌ای به زبان بیگانه که در پروژه‌ای دیگر وجود دارد',
	'nocontent': 'مقالهٔ فاقد محتوای عمده یا معنادار',
	'transwiki': 'مقالهٔ منتقل شده به پروژهٔ دیگر',
	'م۷': 'فاقد توضیح دربارهٔ اهمیت موضوع (شخص حقیقی، جانور، سازمان، یا محتوای وب)',
	'person' : 'فاقد توضیح دربارهٔ اهمیت موضوع (شخص حقیقی)',
	'web': 'فاقد توضیح دربارهٔ اهمیت موضوع (محتوای وب)',
	'corp': 'فاقد توضیح دربارهٔ اهمیت موضوع (سازمان)',
	'club': 'فاقد توضیح دربارهٔ اهمیت موضوع (سازمان)',
	'band': 'فاقد توضیح دربارهٔ اهمیت موضوع (باند/موسیقی‌دان)',
	'animal': 'فاقد توضیح دربارهٔ اهمیت موضوع (تک‌جانور)',
	'event': 'فاقد توضیح دربارهٔ اهمیت موضوع (رویداد)',
	'م۹': 'ضبط‌های موسیقی از هنرمندان با پیوند قرمز بدون نشانی از اهمیت یا سرشناسی',
	'م۱۰': 'مقالهٔ تازه‌ساز که موضوعی از پیش موجود را پوشش می‌دهد',
// Images and media
	'redundantimage': 'پرونده یکسان با پرونده‌ای دیگر در ویکی‌پدیا',
	'noimage': 'پروندهٔ خالی یا خراب',
	'fpcfail': 'صفحهٔ نالازم توصیف پرونده‌ای که در انبار است',
	'noncom': 'پرونده و با مجوز نامناسب',
	'unksource': 'کمبود اطلاعات در مورد مجوز',
	'unfree': 'رسانهٔ ناآزاد استفاده‌نشده',
	'norat': 'پروندهٔ ناآزاد بدون [[وپ:اصول استفاده از منابع غیر آزاد|دلیل استفادهٔ منصفانه]]',
	'badfairuse': 'زیر پا گذاشتن [[وپ:استفاده منصفانه|سیاست استفاده منصفانه]]',
	'nowcommons': 'پروندهٔ رسانه‌ای موجود در انبار',
	'imgcopyvio': '[[:en:WP:COPYVIO|نقض حق تکثیر]] آشکار',
	'badfiletype': 'پروندهٔ رسانه‌ای بی‌کاربرد (تصویر، صدا یا فیلم نباشد)',
	'nopermission': 'مدرکی در مورد مجوز ندارد',
// Categories
	'catempty': 'ردهٔ خالی',
// User pages
	'userreq': 'درخواست کاربر برای حذف صفحه‌ای در فضای نام کاربری خودش',
	'nouser': 'صفحهٔ کاربری یا زیرصفحهٔ کاربری کاربر ناموجود',
	'gallery': '[[:ویکی‌پدیا:خودآموز (تصاویر)|گالری]] [[:ویکی‌پدیا:استفاده منصفانه|ناآزاد]]',
// Templates
	'policy': 'الگویی که به روشنی نمایش نادرستی از ا سیاست‌های موجود باشد',
	'duplicatetemplate': 'الگوی بی‌استفاده و تکراری',
	'ا۳': 'الگوی بی‌استفاده و تکراری',
// Portals
	'د۱': '[[وپ:درگاه|درگاه]]ی که به عنوان مقاله حذف سریع می‌شود',
	'emptyportal': '[[وپ:درگاه|درگاه]] فاقد پایهٔ موضوعی عمده',
// Redirects
	'rediruser': '[[وپ:تغییرمسیر|تغییرمسیر]] میان [[وپ:فضای نام|فضاهای نام]] از فضای نام اصلی',
	'redirtypo': '[[وپ:تغییرمسیر|تغییرمسیر]] تازه‌ساز نامحتمل'
};

Twinkle.speedy.callbacks = {
	sysop: {
		main: function( params ) {
			var thispage;

			Morebits.wiki.addCheckpoint();  // prevent actionCompleted from kicking in until user interaction is done
			
			// look up initial contributor. If prompting user for deletion reason, just display a link.
			// Otherwise open the talk page directly
			if( params.openusertalk ) {
				thispage = new Morebits.wiki.page( mw.config.get('wgPageName') );  // a necessary evil, in order to clear incorrect status text
				thispage.setCallbackParameters( params );
				thispage.lookupCreator( Twinkle.speedy.callbacks.sysop.openUserTalkPage );
			}

			// delete page
			var reason;
			thispage = new Morebits.wiki.page( mw.config.get('wgPageName'), "Deleting page" );
			if (params.normalized === 'db') {
				reason = prompt("معیار حذف را که قصد دارید در سیاهه دیده شود را بنویسید:", "");
			} else {
				var presetReason = "[[وپ:محس#" + params.normalized.toUpperCase() + "|" + params.normalized.toUpperCase() + "]]: " + params.reason;
				if (Twinkle.getPref("promptForSpeedyDeletionSummary").indexOf(params.normalized) !== -1) {
					reason = prompt("معیار حذف را بنویسید یا دکمه تائید را کلیک کنید تا به صورت خودکار معیار نوشته شود", presetReason);
				} else {
					reason = presetReason;
				}
			}
			if (!reason || !reason.replace(/^\s*/, "").replace(/\s*$/, "")) {
				Morebits.status.error("Asking for reason", "you didn't give one.  I don't know... what with admins and their apathetic antics... I give up...");
				Morebits.wiki.removeCheckpoint();
				return;
			}
			thispage.setEditSummary( reason + Twinkle.getPref('deletionSummaryAd') );
			thispage.deletePage(function() { 
				thispage.getStatusElement().info("done");
				Twinkle.speedy.callbacks.sysop.deleteTalk( params );
			});
			Morebits.wiki.removeCheckpoint();
		},
		deleteTalk: function( params ) {
			// delete talk page
			if (params.deleteTalkPage &&
			    params.normalized !== 'پ۸' &&
			    document.getElementById( 'ca-talk' ).className !== 'new') {
				var talkpage = new Morebits.wiki.page( Morebits.wikipedia.namespaces[ mw.config.get('wgNamespaceNumber') + 1 ] + ':' + mw.config.get('wgTitle'), "Deleting talk page" );
				talkpage.setEditSummary('[[وپ:محس#ع۸|ع۸]]: بحث یتیم صفحهٔ حذف‌شدهٔ "' + mw.config.get('wgPageName') + '"' + Twinkle.getPref('deletionSummaryAd'));
				talkpage.deletePage();
				// this is ugly, but because of the architecture of wiki.api, it is needed
				// (otherwise success/failure messages for the previous action would be suppressed)
				window.setTimeout(function() { Twinkle.speedy.callbacks.sysop.deleteRedirects( params ) }, 1800);
			} else {
				Twinkle.speedy.callbacks.sysop.deleteRedirects( params );
			}
		},
		deleteRedirects: function( params ) {
			// delete redirects
			if (params.deleteRedirects) {
				var query = {
					'action': 'query',
					'list': 'backlinks',
					'blfilterredir': 'redirects',
					'bltitle': mw.config.get('wgPageName'),
					'bllimit': 5000  // 500 is max for normal users, 5000 for bots and sysops
				};
				var wikipedia_api = new Morebits.wiki.api( 'getting list of redirects...', query, Twinkle.speedy.callbacks.sysop.deleteRedirectsMain,
					new Morebits.status( 'Deleting redirects' ) );
				wikipedia_api.params = params;
				wikipedia_api.post();
			}

			// promote Unlink tool
			var $link, $bigtext;
			if( mw.config.get('wgNamespaceNumber') === 6 && params.normalized !== 'پ۸' ) {
				$link = $('<a/>', {
					'href': '#',
					'text': 'click here to go to the Unlink tool',
					'css': { 'fontSize': '130%', 'fontWeight': 'bold' },
					'click': function(){
						Morebits.wiki.actionCompleted.redirect = null;
						Twinkle.speedy.dialog.close();
						Twinkle.unlink.callback("زدودن استفاده‌های پروندهٔ حذف‌شده " + mw.config.get('wgPageName'));
					}
				});
				$bigtext = $('<span/>', {
					'text': 'To orphan backlinks and remove instances of file usage',
					'css': { 'fontSize': '130%', 'fontWeight': 'bold' }
				});
				Morebits.status.info($bigtext[0], $link[0]);
			} else if (params.normalized !== 'پ۸') {
				$link = $('<a/>', {
					'href': '#',
					'text': 'click here to go to the Unlink tool',
					'css': { 'fontSize': '130%', 'fontWeight': 'bold' },
					'click': function(){
						Morebits.wiki.actionCompleted.redirect = null;
						Twinkle.speedy.dialog.close();
						Twinkle.unlink.callback("Removing links to deleted page " + mw.config.get('wgPageName'));
					}
				});
				$bigtext = $('<span/>', {
					'text': 'To orphan backlinks',
					'css': { 'fontSize': '130%', 'fontWeight': 'bold' }
				});
				Morebits.status.info($bigtext[0], $link[0]);
			}
		},
		openUserTalkPage: function( pageobj ) {
			pageobj.getStatusElement().unlink();  // don't need it anymore
			var user = pageobj.getCreator();
			var params = pageobj.getCallbackParameters();

			var query = {
				'title': 'User talk:' + user,
				'action': 'edit',
				'preview': 'yes',
				'vanarticle': mw.config.get('wgPageName').replace(/_/g, ' ')
			};

			if (params.normalized === 'db' || Twinkle.getPref("promptForSpeedyDeletionSummary").indexOf(params.normalized) !== -1) {
				// provide a link to the user talk page
				var $link, $bigtext;
				$link = $('<a/>', {
					'href': mw.util.wikiScript('index') + '?' + Morebits.queryString.create( query ),
					'text': 'click here to open User talk:' + user,
					'target': '_blank',
					'css': { 'fontSize': '130%', 'fontWeight': 'bold' }
				});
				$bigtext = $('<span/>', {
					'text': 'To notify the page creator',
					'css': { 'fontSize': '130%', 'fontWeight': 'bold' }
				});
				Morebits.status.info($bigtext[0], $link[0]);
			} else {
				// open the initial contributor's talk page
				var statusIndicator = new Morebits.status('Opening user talk page edit form for ' + user, 'opening...');

				switch( Twinkle.getPref('userTalkPageMode') ) {
				case 'tab':
					window.open( mw.util.wikiScript('index') + '?' + Morebits.queryString.create( query ), '_tab' );
					break;
				case 'blank':
					window.open( mw.util.wikiScript('index') + '?' + Morebits.queryString.create( query ), '_blank', 'location=no,toolbar=no,status=no,directories=no,scrollbars=yes,width=1200,height=800' );
					break;
				case 'window':
					/* falls through */
				default:
					window.open( mw.util.wikiScript('index') + '?' + Morebits.queryString.create( query ),
						( window.name === 'twinklewarnwindow' ? '_blank' : 'twinklewarnwindow' ),
						'location=no,toolbar=no,status=no,directories=no,scrollbars=yes,width=1200,height=800' );
					break;
				}

				statusIndicator.info( 'complete' );
			}
		},
		deleteRedirectsMain: function( apiobj ) {
			var xmlDoc = apiobj.getXML();
			var $snapshot = $(xmlDoc).find('backlinks bl');
			var total = $snapshot.length;
			var statusIndicator = apiobj.statelem;

			if( !total ) {
				statusIndicator.status("no redirects found");
				return;
			}

			statusIndicator.status("0%");

			var current = 0;
			var onsuccess = function( apiobjInner ) {
				var now = parseInt( 100 * (++current)/total, 10 ) + '%';
				statusIndicator.update( now );
				apiobjInner.statelem.unlink();
				if( current >= total ) {
					statusIndicator.info( now + ' (completed)' );
					Morebits.wiki.removeCheckpoint();
				}
			};

			Morebits.wiki.addCheckpoint();

			$snapshot.each(function(key, value) {
				var title = $(value).attr('title');
				var page = new Morebits.wiki.page(title, 'Deleting redirect "' + title + '"');
				page.setEditSummary('[[وپ:محس#ع۸|ع۸]]: تغییرمسیر به صفحهٔ حذف‌شدهٔ "' + mw.config.get('wgPageName') + '"' + Twinkle.getPref('deletionSummaryAd'));
				page.deletePage(onsuccess);
			});
		}
	},





	user: {
		main: function(pageobj) {
			var statelem = pageobj.getStatusElement();

			if (!pageobj.exists()) {
				statelem.error( "به نظر می‌رسد که این صفحه قبلاً حذف شده است." );
				return;
			}

			var text = pageobj.getPageText();
			var params = pageobj.getCallbackParameters();

			statelem.status( 'چک کردن صفحه برای موجود بودن برچسب ...' );

			// check for existing deletion tags
			var tag = /(?:\{\{\s*(db|delete|db-.*?|speedy deletion-.*?)(?:\s*\||\s*\}\}))/.exec( text );
			if( tag ) {
				statelem.error( [ Morebits.htmlNode( 'strong', tag[1] ) , " is already placed on the page." ] );
				return;
			}

			var xfd = /(?:\{\{([rsaiftcm]fd|md1)[^{}]*?\}\})/i.exec( text );
			if( xfd && !confirm( "برچسب حذف {{" + xfd[1] + "}} در صفحه موجود است. آیا می‌خواهید برچسب دیگری بزنید؟" ) ) {
				return;
			}

			var code, parameters, i;
			if (params.normalizeds.length > 1)
			{
				code = "{{db-multiple";
				var breakFlag = false;
				$.each(params.normalizeds, function(index, norm) {
					code += "|" + norm.toUpperCase();
					parameters = Twinkle.speedy.getParameters(params.values[index], norm, statelem);
					if (!parameters) {
						breakFlag = true;
						return false;  // the user aborted
					}
					for (i in parameters) {
						if (typeof parameters[i] === 'string' && !parseInt(i, 10)) {  // skip numeric parameters - {{db-multiple}} doesn't understand them
							code += "|" + i + "=" + parameters[i];
						}
					}
				});
				if (breakFlag) {
					return;
				}
				code += "}}";
				params.utparams = [];
			}
			else
			{
				parameters = Twinkle.speedy.getParameters(params.values[0], params.normalizeds[0], statelem);
				if (!parameters) {
					return;  // the user aborted
				}
				code = "{{db-" + params.values[0];
				for (i in parameters) {
					if (typeof parameters[i] === 'string') {
						code += "|" + i + "=" + parameters[i];
					}
				}
				code += "}}";
				params.utparams = Twinkle.speedy.getUserTalkParameters(params.normalizeds[0], parameters);
			}

			var thispage = new Morebits.wiki.page(mw.config.get('wgPageName'));
			// patrol the page, if reached from Special:NewPages
			if( Twinkle.getPref('markSpeedyPagesAsPatrolled') ) {
				thispage.patrol();
			}

			// Wrap SD template in noinclude tags if we are in template space.
			// Won't work with userboxes in userspace, or any other transcluded page outside template space
			if (mw.config.get('wgNamespaceNumber') === 10) {  // Template:
				code = "<noinclude>" + code + "</noinclude>";
			}

			// Remove tags that become superfluous with this action
			text = text.replace(/\{\{\s*(New unreviewed article|Userspace draft)\s*(\|(?:\{\{[^{}]*\}\}|[^{}])*)?\}\}\s*/ig, "");
			if (mw.config.get('wgNamespaceNumber') === 6) {
				// remove "move to Commons" tag - deletion-tagged files cannot be moved to Commons
				text = text.replace(/\{\{(mtc|(copy |move )?to ?commons|move to wikimedia commons|copy to wikimedia commons)[^}]*\}\}/gi, "");
			}

			// Generate edit summary for edit
			var editsummary;
			if (params.normalizeds.length > 1) {
				editsummary = 'درخواست حذف سریع (';
				$.each(params.normalizeds, function(index, norm) {
					editsummary += '[[وپ:محس#' + norm.toUpperCase() + '|محس ' + norm.toUpperCase() + ']], ';
				});
				editsummary = editsummary.substr(0, editsummary.length - 2); // remove trailing comma
				editsummary += ').';
			} else if (params.normalizeds[0] === "db") {
				editsummary = 'Requesting [[وپ:محس|speedy deletion]] with rationale \"' + parameters["1"] + '\".';
			} else if (params.values[0] === "histmerge") {
				editsummary = "Requesting history merge with [[" + parameters["1"] + "]] ([[وپ:محس#G6|CSD G6]]).";
			} else {
				editsummary = "درخواست حذف سریع ([[وپ:محس#" + params.normalizeds[0].toUpperCase() + "|محس " + params.normalizeds[0].toUpperCase() + "]]).";
			}

			pageobj.setPageText(code + ((params.normalizeds.indexOf('ع۱۰') !== -1) ? '' : ("\n" + text) )); // cause attack pages to be blanked
			pageobj.setEditSummary(editsummary + Twinkle.getPref('summaryAd'));
			pageobj.setWatchlist(params.watch);
			pageobj.setCreateOption('nocreate');
			pageobj.save(Twinkle.speedy.callbacks.user.tagComplete);
		},

		tagComplete: function(pageobj) {
			var params = pageobj.getCallbackParameters();

			// Notification to first contributor
			if (params.usertalk) {
				var callback = function(pageobj) {
					var initialContrib = pageobj.getCreator();

					// don't notify users when their user talk page is nominated
					if (initialContrib === mw.config.get('wgTitle') && mw.config.get('wgNamespaceNumber') === 3) {
						Morebits.status.warn("Notifying initial contributor: this user created their own user talk page; skipping notification");
						return;
					}

					// quick hack to prevent excessive unwanted notifications, per request. Should actually be configurable on recipient page ...
					if ((initialContrib === "Cyberbot I" || initialContrib === "SoxBot") && params.normalizeds[0]==="پ۲") {
						Morebits.status.warn("Notifying initial contributor: page created procedurally by bot; skipping notification");
						return;
					}

					var usertalkpage = new Morebits.wiki.page('User talk:' + initialContrib, "Notifying initial contributor (" + initialContrib + ")"),
					    notifytext, i;

					// specialcase "db" and "db-multiple"
					if (params.normalizeds.length > 1) {
						notifytext = "\n{{subst:db-notice-multiple|1=" + mw.config.get('wgPageName');
						var count = 2;
						$.each(params.normalizeds, function(index, norm) {
							notifytext += "|" + (count++) + "=" + norm.toUpperCase();
						});
					} else if (params.normalizeds[0] === "db") {
						notifytext = "\n{{subst:db-reason-notice|1=" + mw.config.get('wgPageName');
					} else {
						notifytext = "\n{{subst:db-csd-notice-custom|1=" + mw.config.get('wgPageName') + "|2=" + params.values[0];
					}

					for (i in params.utparams) {
						if (typeof params.utparams[i] === 'string') {
							notifytext += "|" + i + "=" + params.utparams[i];
						}
					}
					notifytext += (params.welcomeuser ? "" : "|nowelcome=yes") + "}} ~~~~";

					var editsummary = "آگاه‌سازی: نامزدی برای حذف سریعِ";
					if (params.normalizeds.indexOf("ع۱۰") === -1) {  // no article name in summary for G10 deletions
						editsummary += " [[" + mw.config.get('wgPageName') + "]].";
					} else {
						editsummary += " یک صفحهٔ حمله.";
					}

					usertalkpage.setAppendText(notifytext);
					usertalkpage.setEditSummary(editsummary + Twinkle.getPref('summaryAd'));
					usertalkpage.setCreateOption('recreate');
					usertalkpage.setFollowRedirect(true);
					usertalkpage.append();

					// add this nomination to the user's userspace log, if the user has enabled it
					if (params.lognomination) {
						Twinkle.speedy.callbacks.user.addToLog(params, initialContrib);
					}
				};
				var thispage = new Morebits.wiki.page(mw.config.get('wgPageName'));
				thispage.lookupCreator(callback);
			}
			// or, if not notifying, add this nomination to the user's userspace log without the initial contributor's name
			else if (params.lognomination) {
				Twinkle.speedy.callbacks.user.addToLog(params, null);
			}
		},

		// note: this code is also invoked from twinkleimage
		// the params used are:
		//   for CSD: params.values, params.normalizeds  (note: normalizeds is an array)
		//   for DI: params.fromDI = true, params.type, params.normalized  (note: normalized is a string)
		addToLog: function(params, initialContrib) {
			var wikipedia_page = new Morebits.wiki.page("User:" + mw.config.get('wgUserName') + "/" + Twinkle.getPref('speedyLogPageName'), "Adding entry to userspace log");
			params.logInitialContrib = initialContrib;
			wikipedia_page.setCallbackParameters(params);
			wikipedia_page.load(Twinkle.speedy.callbacks.user.saveLog);
		},

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

			// add blurb if log page doesn't exist
			if (!pageobj.exists()) {
				text =
					"This is a log of all [[وپ:محس|speedy deletion]] nominations made by this user using [[WP:TW|Twinkle]]'s CSD module.\n\n" +
					"If you no longer wish to keep this log, you can turn it off using the [[Wikipedia:Twinkle/Preferences|preferences panel]], and " +
					"nominate this page for speedy deletion under [[وپ:محس#U1|CSD U1]].\n";
				if (Morebits.userIsInGroup("sysop")) {
					text += "\nThis log does not track outright speedy deletions made using Twinkle.\n";
				}
			}

			// create monthly header
			var date = new Date();
			var headerRe = new RegExp("^==+\\s*" + date.getUTCMonthName() + "\\s+" + date.getUTCFullYear() + "\\s*==+", "m");
			if (!headerRe.exec(text)) {
				text += "\n\n=== " + date.getUTCMonthName() + " " + date.getUTCFullYear() + " ===";
			}

			text += "\n# [[:" + mw.config.get('wgPageName') + "]]: ";
			if (params.fromDI) {
				text += "DI [[وپ:محس#" + params.normalized.toUpperCase() + "|CSD " + params.normalized.toUpperCase() + "]] (" + params.type + ")";
			} else {
				if (params.normalizeds.length > 1) {
					text += "multiple criteria (";
					$.each(params.normalizeds, function(index, norm) {
						text += "[[وپ:محس#" + norm.toUpperCase() + "|" + norm.toUpperCase() + ']], ';
					});
					text = text.substr(0, text.length - 2);  // remove trailing comma
					text += ')';
				} else if (params.normalizeds[0] === "db") {
					text += "{{tl|db-reason}}";
				} else {
					text += "[[وپ:محس#" + params.normalizeds[0].toUpperCase() + "|CSD " + params.normalizeds[0].toUpperCase() + "]] ({{tl|db-" + params.values[0] + "}})";
				}
			}

			if (params.logInitialContrib) {
				text += "; اطلاع‌رسانی به {{user|" + params.logInitialContrib + "}}";
			}
			text += " ~~~~~\n";

			pageobj.setPageText(text);
			pageobj.setEditSummary("Logging speedy deletion nomination of [[" + mw.config.get('wgPageName') + "]]." + Twinkle.getPref('summaryAd'));
			pageobj.setCreateOption("recreate");
			pageobj.save();
		}
	}
};

// prompts user for parameters to be passed into the speedy deletion tag
Twinkle.speedy.getParameters = function twinklespeedyGetParameters(value, normalized, statelem)
{
	var parameters = [];
	switch( normalized ) {
		case 'db':
			var dbrationale = prompt('افرودن معیار اجباری است   \n\"این صفحه برای حذف سریع کاندید شده است چون:\"', "");
			if (!dbrationale || !dbrationale.replace(/^\s*/, "").replace(/\s*$/, ""))
			{
				statelem.error( 'شما باید یک دلیل بیان کنید به وسیله کاربر لغو شد.' );
				return null;
			}
			parameters["1"] = dbrationale;
			break;
		case 'ک۱':
			if (mw.config.get('wgNamespaceNumber') === 3 && !((/\//).test(mw.config.get('wgTitle'))))
			{
				var u1rationale = prompt('لطفا دلیل خود را بیان کنید چرا صفجه بحث کاربر باید حذف شود، بیان دلیل اجباری است:', "");
				if (!u1rationale || !u1rationale.replace(/^\s*/, "").replace(/\s*$/, ""))
				{
					statelem.error( 'شما باید یک دلیل بیان کنید به وسیله کاربر لغو شد.' );
					return null;
				}
				parameters.rationale = u1rationale;
			}
			break;
		case 'پ۸':
			var pagenamespaces = mw.config.get('wgPageName').replace( '_', ' ' );
			var filename = prompt( 'لطفاً نام پرونده در ویکی انبار را بنویسید:', pagenamespaces );
			if (filename === null)
			{
				statelem.error( 'به وسیله کاربر لغو شد.' );
				return null;
			}
			if (filename !== '' && filename !== pagenamespaces)
			{
				if (filename.indexOf("Image:") === 0 || filename.indexOf("File:") === 0)
				{
					parameters["1"] = filename;
				}
				else
				{
					statelem.error("پرونده حذف شده‌است. درخواست شما لغو شد.");
					return null;
				}
			}
			parameters.date = "~~~~~";
			break;
		case 'ع۴':
			var deldisc = prompt( '[CSD G4] Please enter the name of the page where the deletion discussion took place.  \nNOTE: For regular AfD and MfD discussions, just click OK - a link will be automatically provided.', "" );
			if (deldisc === null)
			{
				statelem.error( 'به وسیله کاربر لغو شد.' );
				return null;
			}
			if (deldisc !== "" && deldisc.substring(0, 9) !== "Wikipedia" && deldisc.substring(0, 3) !== "WP:")
			{
				statelem.error( 'The deletion discussion page name, if provided, must start with "Wikipedia:".  Cannot proceed.' );
				return null;
			}
			parameters["1"] = deldisc;
			break;
		case 'ع۵':
			var banneduser = prompt( '[CSD G5] Please enter the username of the banned user if available:', "" );
			if (banneduser === null)
			{
				statelem.error( 'به وسیله کاربر لغو شد.' );
				return null;
			}
			parameters["1"] = banneduser;
			break;
		case 'ع۶':
			switch( value ) {
				case 'histmerge':
					var mergetitle = prompt( '[CSD G6: history merge] Please enter the title to be merged into this one:', "" );
					if (mergetitle === null)
					{
						statelem.error( 'به وسیله کاربر لغو شد.' );
						return null;
					}
					parameters["1"] = mergetitle;
					break;
				case 'move':
					var title = prompt( '[CSD G6: move] Please enter the title of the page to be moved here:', "" );
					if (title === null)
					{
						statelem.error( 'به وسیله کاربر لغو شد.' );
						return null;
					}
					var reason = prompt( '[CSD G6: move] Please enter the reason for the page move:', "" );
					if (reason === null)
					{
						statelem.error( 'به وسیله کاربر لغو شد.' );
						return null;
					}
					parameters["1"] = title;
					parameters["2"] = reason;
					break;
				case 'xfd':
					var votepage = prompt( '[CSD G6: xfd] Please provide a full link, without [[ ]], to the page where the deletion was discussed:', "" );
					if (votepage === null)
					{
						statelem.error( 'به وسیله کاربر لغو شد.' );
						return null;
					}
					parameters.fullvotepage = votepage;
					break;
				case 'copypaste':
					var copytitle = prompt( '[CSD G6: copypaste] Please enter the title of the original page that was copy-pasted here:', "" );
					if (copytitle === null)
					{
						statelem.error( 'به وسیله کاربر لغو شد.' );
						return null;
					}
					parameters["1"] = copytitle;
					break;
				case 'ع۶':
					var g6rationale = prompt( '[CSD G6] Please provide an optional rationale (leave empty to skip):', "" );
					if (g6rationale === null)
					{
						statelem.error( 'به وسیله کاربر لغو شد.' );
						return null;
					}
					if (g6rationale !== '')
					{
						parameters.rationale = g6rationale;
					}
					break;
				default:
					break;
			}
			break;
		case 'ع۷':
			if (Twinkle.getPref('speedyPromptOnG7'))
			{
				var g7rationale = prompt('[CSD G7] Please provide an optional rationale (perhaps linking to where the author requested this deletion - leave empty to skip):', "");
				if (g7rationale === null)
				{
					statelem.error( 'به وسیله کاربر لغو شد.' );
					return null;
				}
				if (g7rationale !== '')
				{
					parameters.rationale = g7rationale;
				}
			}
			break;
		case 'ع۱۲':
			var url = prompt( '[CSD G12] Please enter the URL if available, including the "http://":', "" );
			if (url === null)
			{
				statelem.error( 'به وسیله کاربر لغو شد.' );
				return null;
			}
			parameters.url = url;
			break;
		case 'پ۹':
			var f9url = prompt( '[CSD F9] Please enter the URL of the copyvio, including the "http://".  \nIf you cannot provide a URL, please do not use CSD F9.  (Exception: for copyvios of non-Internet sources, leave the box blank.)', "" );
			if (f9url === null)
			{
				statelem.error( 'Aborted by user.' );
				return null;
			}
			parameters.url = f9url;
			break;
		case 'م۲':
			var source = prompt('[CSD A2] Enter an interwiki link to the article on the foreign-language wiki (for example, "fr:Bonjour"):', "");
			if (source === null)
			{
				statelem.error('به وسیله کاربر لغو شد.');
				return null;
			}
			parameters.source = source;
			break;
		case 'م۱۰':
			var duptitle = prompt( '[CSD A10] Enter the article name that is duplicated:', "" );
			if (duptitle === null)
			{
				statelem.error( 'به وسیله کاربر لغو شد.' );
				return null;
			}
			parameters.article = duptitle;
			break;
		case 'پ۱':
			var img = prompt( '[CSD F1] Enter the file this is redundant to, excluding the "Image:" or "File:" prefix:', "" );
			if (img === null)
			{
				statelem.error( 'به وسیله کاربر لغو شد.' );
				return null;
			}
			parameters.filename = img;
			break;
		case 'ا۳':
			switch( value ) {
				case 'duplicatetemplate':
					var template = prompt( '[CSD T3] Enter the template this is redundant to, excluding the "Template:" prefix:', "" );
					if (template === null)
					{
						statelem.error( 'Aborted by user.' );
						return null;
					}
					parameters["1"] = "~~~~~";
					parameters["2"] = template;
					break;
				default:
					var t3rationale = prompt( '[CSD T3] Please enter a mandatory rationale:', "" );
					if (!t3rationale || !t3rationale.replace(/^\s*/, "").replace(/\s*$/, ""))
					{
						statelem.error( 'Aborted by user.' );
						return null;
					}
					parameters["1"] = "~~~~~";
					parameters.rationale = t3rationale;
					break;
			}
			break;
		case 'ع۱۰':
			parameters.blanked = 'yes';
			// it is actually blanked elsewhere in code, but setting the flag here
			break;
		case 'د۱':
			var criterion = prompt( '[CSD P1] Enter the code of the article CSD criterion which this portal falls under:   \n\n(A1 = no context, A3 = no content, A7 = non-notable, A10 = duplicate)', "" );
			if (!criterion || !criterion.replace(/^\s*/, "").replace(/\s*$/, ""))
			{
				statelem.error( 'شماباید یک معیار را مشخص نمایید به وسیله کاربر لغو شد.' );
				return null;
			}
			parameters["1"] = criterion;
			break;
		default:
			break;
	}
	return parameters;
};

// function for processing talk page notification template parameters
Twinkle.speedy.getUserTalkParameters = function twinklespeedyGetUserTalkParameters(normalized, parameters)
{
	var utparams = [];
	switch (normalized)
	{
		case 'db':
			utparams["2"] = parameters["1"];
			break;
		case 'ع۱۲':
			utparams.key1 = "url";
			utparams.value1 = utparams.url = parameters.url;
			break;
		case 'م۱۰':
			utparams.key1 = "article";
			utparams.value1 = utparams.article = parameters.article;
			break;
		default:
			break;
	}
	return utparams;
};


Twinkle.speedy.resolveCsdValues = function twinklespeedyResolveCsdValues(e) {
	var values = (e.target.form ? e.target.form : e.target).getChecked('csd');
	if (values.length === 0) {
		alert( "Please select a criterion!" );
		return null;
	}
	return values;
};

Twinkle.speedy.callback.evaluateSysop = function twinklespeedyCallbackEvaluateSysop(e)
{
	mw.config.set('wgPageName', mw.config.get('wgPageName').replace(/_/g, ' ')); // for queen/king/whatever and country!
	var form = (e.target.form ? e.target.form : e.target);

	var tag_only = form.tag_only;
	if( tag_only && tag_only.checked ) {
		Twinkle.speedy.callback.evaluateUser(e);
		return;
	}

	var value = Twinkle.speedy.resolveCsdValues(e)[0];
	if (!value) {
		return;
	}
	var normalized = Twinkle.speedy.normalizeHash[ value ];

	var params = {
		value: value,
		normalized: normalized,
		watch: Twinkle.getPref('watchSpeedyPages').indexOf( normalized ) !== -1,
		reason: Twinkle.speedy.reasonHash[ value ],
		openusertalk: Twinkle.getPref('openUserTalkPageOnSpeedyDelete').indexOf( normalized ) !== -1,
		deleteTalkPage: form.talkpage && form.talkpage.checked,
		deleteRedirects: form.redirects.checked
	};

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

	Twinkle.speedy.callbacks.sysop.main( params );
};

Twinkle.speedy.callback.evaluateUser = function twinklespeedyCallbackEvaluateUser(e) {
	mw.config.set('wgPageName', mw.config.get('wgPageName').replace(/_/g, ' '));  // for queen/king/whatever and country!
	var form = (e.target.form ? e.target.form : e.target);

	if (e.target.type === "checkbox") {
		return;
	}

	var values = Twinkle.speedy.resolveCsdValues(e);
	if (!values) {
		return;
	}
	//var multiple = form.multiple.checked;
	var normalizeds = [];
	$.each(values, function(index, value) {
		var norm = Twinkle.speedy.normalizeHash[ value ];

		// for sysops only
		if (['پ۴', 'پ۵', 'پ۶', 'پ۱۱'].indexOf(norm) !== -1) {
			alert("Tagging with F4, F5, F6, and F11 is not possible using the CSD module.  Try using DI instead, or unchecking \"Tag page only\" if you meant to delete the page.");
			return;
		}

		normalizeds.push(norm);
	});

	// analyse each criterion to determine whether to watch the page/notify the creator
	var watchPage = false;
	$.each(normalizeds, function(index, norm) {
		if (Twinkle.getPref('watchSpeedyPages').indexOf(norm) !== -1) {
			watchPage = true;
			return false;  // break
		}
	});

	var notifyuser = false;
	if (form.notify.checked) {
		$.each(normalizeds, function(index, norm) {
			if (Twinkle.getPref('notifyUserOnSpeedyDeletionNomination').indexOf(norm) !== -1) {
				if (norm === 'ع۶' && ['disambig', 'copypaste'].indexOf(values[index]) === -1) {
					return true;
				}
				notifyuser = true;
				return false;  // break
			}
		});
	}

	var welcomeuser = false;
	if (notifyuser) {
		$.each(normalizeds, function(index, norm) {
			if (Twinkle.getPref('welcomeUserOnSpeedyDeletionNotification').indexOf(norm) !== -1) {
				welcomeuser = true;
				return false;  // break
			}
		});
	}

	var csdlog = false;
	if (Twinkle.getPref('logSpeedyNominations')) {
		$.each(normalizeds, function(index, norm) {
			if (Twinkle.getPref('noLogOnSpeedyNomination').indexOf(norm) === -1) {
				csdlog = true;
				return false;  // break
			}
		});
	}

	var params = {
		values: values,
		normalizeds: normalizeds,
		watch: watchPage,
		usertalk: notifyuser,
		welcomeuser: welcomeuser,
		lognomination: csdlog
	};

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

	Morebits.wiki.actionCompleted.redirect = mw.config.get('wgPageName');
	Morebits.wiki.actionCompleted.notice = "Tagging complete";

	var wikipedia_page = new Morebits.wiki.page(mw.config.get('wgPageName'), "Tagging page");
	wikipedia_page.setCallbackParameters(params);
	wikipedia_page.load(Twinkle.speedy.callbacks.user.main);
};
})(jQuery);


//</nowiki>