Qeyd: Dəyişiklikləri yayımladıqdan sonra etdiyiniz dəyişikliklərin görünməsi üçün brauzerinizin keşinin təmizlənməsi lazım ola bilər.

  • Firefox / Safari: Reload düyməsinə basılı tutarkən Shift düyməsinə basın, və ya Ctrl+F5 və ya Ctrl+R (Mac üçün ⌘-R )
  • Google Chrome: Ctrl-Shift-R (Mac üçün ⌘-Shift-R)
  • Internet Explorer / Edge: Ctrl düyməsini basılı tutarkən Refresh düyməsinə basın, və ya sadəcə Ctrl+F5
  • Opera: Ctrl+F5.
// <nowiki>


(function($) {


/*
 ****************************************
 *** twinklespeedy.js: SSK module
 ****************************************
 * Mode of invocation:     Tab ("SSK")
 * Active on:              Non-special, existing pages
 *
 * NOTE FOR DEVELOPERS:
 *   If adding a new criterion, add it to the appropriate places at the top of
 *   twinkleconfig.js.  Also check out the default values of the SSK preferences
 *   in twinkle.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, 'SSK', 'tw-csd', Morebits.userIsSysop ? 'Səhifəni VP:SSK qaydasına uyğun olaraq sil' : 'Səhifənin VP:SSK qaydasına uyğun olaraq silinməsini tələb et');
};

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

// Used by unlink feature
Twinkle.speedy.dialog = null;
// Used throughout
Twinkle.speedy.hasCSD = !!$('#delete-reason').length;

// 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('Sürətli silmə kriteriyasını seçin');
	dialog.setScriptName('Twinkle');
	dialog.addFooterLink('Sürətli silmə kriteriyaları', 'VP:SSK');
	dialog.addFooterLink('Kömək', 'VP:TW/DOC#ssk');

	var form = new Morebits.quickForm(callbackfunc, Twinkle.getPref('speedySelectionStyle') === 'radioClick' ? 'change' : null);
	if (Morebits.userIsSysop) {
		form.append({
			type: 'checkbox',
			list: [
				{
					label: 'Səhifəni silmə, sadəcə işarələ',
					value: 'tag_only',
					name: 'tag_only',
					tooltip: 'Əgər səhifəni indi silmək əvəzinə sadəcə işarələmək istəyirsinizsə, bu seçimdən istifadə edə bilərsiniz.',
					checked: !(Twinkle.speedy.hasCSD || Twinkle.getPref('deleteSysopDefaultToDelete')),
					event: function(event) {
						var cForm = event.target.form;
						var cChecked = event.target.checked;
						// enable talk page checkbox
						if (cForm.talkpage) {
							cForm.talkpage.checked = !cChecked && Twinkle.getPref('deleteTalkPageOnDelete');
						}
						// enable redirects checkbox
						cForm.redirects.checked = !cChecked;
						// enable delete multiple
						cForm.delmultiple.checked = false;
						// enable notify checkbox
						cForm.notify.checked = cChecked;
						// enable deletion notification checkbox
						cForm.warnusertalk.checked = !cChecked && !Twinkle.speedy.hasCSD;
						// enable multiple
						cForm.multiple.checked = false;
						// enable requesting creation protection
						cForm.salting.checked = false;

						Twinkle.speedy.callback.modeChanged(cForm);

						event.stopPropagation();
					}
				}
			]
		});

		var deleteOptions = form.append({
			type: 'div',
			name: 'delete_options'
		});
		deleteOptions.append({
			type: 'header',
			label: 'Silmə ilə əlaqəli seçimlər'
		});
		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
			deleteOptions.append({
				type: 'checkbox',
				list: [
					{
						label: 'Müzakirə səhifəsini də sil',
						value: 'talkpage',
						name: 'talkpage',
						tooltip: "Bu seçim səhifənin müzakirə səhifəsini də əlavə olaraq silir. Əgər F8 (Vikianbarda faylın dublikatı) kriteriyasını seçsəniz, bu seçim nəzərə alınmayacaq və müzakirə səhifəsi *silinməyəcək*.",
						checked: Twinkle.getPref('deleteTalkPageOnDelete'),
						event: function(event) {
							event.stopPropagation();
						}
					}
				]
			});
		}
		deleteOptions.append({
			type: 'checkbox',
			list: [
				{
					label: 'Həmçinin bütün istiqamətləndirmələri də sil',
					value: 'redirects',
					name: 'redirects',
					tooltip: 'Bu seçim vasitəsilə səhifəyə olan bütün istiqamətləndirmələri də silə bilərsiniz.',
					checked: Twinkle.getPref('deleteRedirectsOnDelete'),
					event: function (event) {
						event.stopPropagation();
					}
				},
				{
					label: 'Bir neçə kriteriya əsasında sil',
					value: 'delmultiple',
					name: 'delmultiple',
					tooltip: 'Əgər səhifəni bir neçə kriteriyaya əsasən silmək istəyirisinizsə, bu parametrdən istifadə edə biləsiniz.',
					event: function(event) {
						Twinkle.speedy.callback.modeChanged(event.target.form);
						event.stopPropagation();
					}
				},
				{
					label: 'Silinəcək səhifənin müəllifinə bildiriş göndər',
					value: 'warnusertalk',
					name: 'warnusertalk',
					tooltip: 'Səhifəni yaradan istifadəçinin müzakirə səhifəsinə bildiriş şablonu yerləşdiriləcəkdir.',
					checked: !Twinkle.speedy.hasCSD,
					event: function(event) {
						event.stopPropagation();
					}
				}
			]
		});
	}

	var tagOptions = form.append({
		type: 'div',
		name: 'tag_options'
	});

	if (Morebits.userIsSysop) {
		tagOptions.append({
			type: 'header',
			label: 'Seçimlər'
		});
	}

	tagOptions.append({
		type: 'checkbox',
		list: [
			{
				label: 'Mümkün olsa, səhifə müəllifinə bildiriş göndər',
				value: 'notify',
				name: 'notify',
				tooltip: 'Səhifəni yaradan istifadəçinin müzakirə səhifəsinə bildiriş şablonu yerləşdiriləcəkdir.',
				checked: !Morebits.userIsSysop || !(Twinkle.speedy.hasCSD || Twinkle.getPref('deleteSysopDefaultToDelete')),
				event: function(event) {
					event.stopPropagation();
				}
			},
			{
				label: 'Tag for creation protection (salting) as well',
				value: 'salting',
				name: 'salting',
				tooltip: 'When selected, the speedy deletion tag will be accompanied by a {{salt}} tag requesting that the deleting administrator apply creation protection. Only select if this page has been repeatedly recreated.',
				event: function(event) {
					event.stopPropagation();
				}
			},
			{
				label: 'Bir neçə kriteriya ilə işarələ',
				value: 'multiple',
				name: 'multiple',
				tooltip: 'Bunun vasitəsilə səhifənin bir neçə kriteriya əsasında sürətli silinməsi tələb edə bilərsiniz.',
				event: function(event) {
					Twinkle.speedy.callback.modeChanged(event.target.form);
					event.stopPropagation();
				}
			}
		]
	});

	form.append({
		type: 'div',
		id: 'prior-deletion-count',
		style: 'font-style: italic'
	});

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

	if (Twinkle.getPref('speedySelectionStyle') !== 'radioClick') {
		form.append({ type: 'submit', className: 'tw-speedy-submit' }); // Renamed in modeChanged
	}

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

	Twinkle.speedy.callback.modeChanged(result);

	// Check for prior deletions.  Just once, upon init
	Twinkle.speedy.callback.priorDeletionCount();
};

Twinkle.speedy.callback.modeChanged = function twinklespeedyCallbackModeChanged(form) {
	var namespace = mw.config.get('wgNamespaceNumber');

	// first figure out what mode we're in
	var mode = {
		isSysop: !!form.tag_only && !form.tag_only.checked,
		isMultiple: form.tag_only && !form.tag_only.checked ? form.delmultiple.checked : form.multiple.checked,
		isRadioClick: Twinkle.getPref('speedySelectionStyle') === 'radioClick'
	};

	if (mode.isSysop) {
		$('[name=delete_options]').show();
		$('[name=tag_options]').hide();
		$('button.tw-speedy-submit').text('Səhifəni sil');
	} else {
		$('[name=delete_options]').hide();
		$('[name=tag_options]').show();
		$('button.tw-speedy-submit').text('Səhifəni işarələ');
	}

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

	if (mode.isMultiple && mode.isRadioClick) {
		var evaluateType = mode.isSysop ? 'evaluateSysop' : 'evaluateUser';

		work_area.append({
			type: 'div',
			label: 'When finished choosing criteria, click:'
		});
		work_area.append({
			type: 'button',
			name: 'submit-multiple',
			label: mode.isSysop ? 'Delete page' : 'Tag page',
			event: function(event) {
				Twinkle.speedy.callback[evaluateType](event);
				event.stopPropagation();
			}
		});
	}

	var appendList = function(headerLabel, csdList) {
		work_area.append({ type: 'header', label: headerLabel });
		work_area.append({ type: mode.isMultiple ? 'checkbox' : 'radio', name: 'csd', list: Twinkle.speedy.generateCsdList(csdList, mode) });
	};

	if (mode.isSysop && !mode.isMultiple) {
		appendList('Fərqli səbəb', Twinkle.speedy.customRationale);
	}

	if (namespace % 2 === 1 && namespace !== 3) {
		// show db-talk on talk pages, but not user talk pages
		appendList('Talk pages', Twinkle.speedy.talkList);
	}

	if (!Morebits.isPageRedirect()) {
		switch (namespace) {
			case 0:  // article
			case 1:  // talk
				appendList('Məqalələr', Twinkle.speedy.articleList);
				break;

			case 2:  // user
			case 3:  // user talk
				appendList('İstifadəçi səhifələri', Twinkle.speedy.userList);
				break;

			case 6:  // file
			case 7:  // file talk
				appendList('Fayllar', Twinkle.speedy.fileList);
				if (!mode.isSysop) {
					work_area.append({ type: 'div', label: 'Tagging for SSK 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 14:  // category
			case 15:  // category talk
				appendList('Categories', Twinkle.speedy.categoryList);
				break;

			case 100:  // portal
			case 101:  // portal talk
				appendList('Portals', Twinkle.speedy.portalList);
				break;

			default:
				break;
		}
	} else {
		if (namespace === 2 || namespace === 3) {
			appendList('User pages', Twinkle.speedy.userList);
		}
		appendList('Redirects', Twinkle.speedy.redirectList);
	}

	var generalCriteria = Twinkle.speedy.generalList;

	// custom rationale lives under general criteria when tagging
	if (!mode.isSysop) {
		generalCriteria = Twinkle.speedy.customRationale.concat(generalCriteria);
	}
	appendList('Ümumi kriteriyalar', generalCriteria);

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

	// if sysop, check if SSK is already on the page and fill in custom rationale
	if (mode.isSysop && Twinkle.speedy.hasCSD) {
		var customOption = $('input[name=csd][value=reason]')[0];
		if (customOption) {
			if (Twinkle.getPref('speedySelectionStyle') !== 'radioClick') {
				// force listeners to re-init
				customOption.click();
				customOption.parentNode.appendChild(customOption.subgroup);
			}
			customOption.subgroup.querySelector('input').value = decodeURIComponent($('#delete-reason').text()).replace(/\+/g, ' ');
		}
	}
};

Twinkle.speedy.callback.priorDeletionCount = function () {
	var query = {
		action: 'query',
		format: 'json',
		list: 'logevents',
		letype: 'delete',
		leaction: 'delete/delete', // Just pure page deletion, no redirect overwrites or revdel
		letitle: mw.config.get('wgPageName'),
		leprop: '', // We're just counting we don't actually care about the entries
		lelimit: 5  // A little bit goes a long way
	};

	new Morebits.wiki.api('Checking for past deletions', query, function(apiobj) {
		var response = apiobj.getResponse();
		var delCount = response.query.logevents.length;
		if (delCount) {
			var message = delCount + ' əvvəlki silinmə';
			if (delCount > 1) {
				message += '';
				if (response.continue) {
					message = '' + message;
				}

				// 3+ seems problematic
				if (delCount >= 3) {
					$('#prior-deletion-count').css('color', 'red');
				}
			}

			// Provide a link to page logs (SSK templates have one for sysops)
			var link = Morebits.htmlNode('a', '(tarixçə)');
			link.setAttribute('href', mw.util.getUrl('Special:Log', {page: mw.config.get('wgPageName')}));
			link.setAttribute('target', '_blank');

			$('#prior-deletion-count').text(message + ' '); // Space before log link
			$('#prior-deletion-count').append(link);
		}
	}).post();
};


Twinkle.speedy.generateCsdList = function twinklespeedyGenerateCsdList(list, mode) {

	var pageNamespace = mw.config.get('wgNamespaceNumber');

	var openSubgroupHandler = function(e) {
		$(e.target.form).find('input').prop('disabled', true);
		$(e.target.form).children().css('color', 'gray');
		$(e.target).parent().css('color', 'black').find('input').prop('disabled', false);
		$(e.target).parent().find('input:text')[0].focus();
		e.stopPropagation();
	};
	var submitSubgroupHandler = function(e) {
		var evaluateType = mode.isSysop ? 'evaluateSysop' : 'evaluateUser';
		Twinkle.speedy.callback[evaluateType](e);
		e.stopPropagation();
	};

	return $.map(list, function(critElement) {
		var criterion = $.extend({}, critElement);

		if (mode.isMultiple) {
			if (criterion.hideWhenMultiple) {
				return null;
			}
			if (criterion.hideSubgroupWhenMultiple) {
				criterion.subgroup = null;
			}
		} else {
			if (criterion.hideWhenSingle) {
				return null;
			}
			if (criterion.hideSubgroupWhenSingle) {
				criterion.subgroup = null;
			}
		}

		if (mode.isSysop) {
			if (criterion.hideWhenSysop) {
				return null;
			}
			if (criterion.hideSubgroupWhenSysop) {
				criterion.subgroup = null;
			}
		} else {
			if (criterion.hideWhenUser) {
				return null;
			}
			if (criterion.hideSubgroupWhenUser) {
				criterion.subgroup = null;
			}
		}

		if (Morebits.isPageRedirect() && criterion.hideWhenRedirect) {
			return null;
		}

		if (criterion.showInNamespaces && criterion.showInNamespaces.indexOf(pageNamespace) < 0) {
			return null;
		}
		if (criterion.hideInNamespaces && criterion.hideInNamespaces.indexOf(pageNamespace) > -1) {
			return null;
		}

		if (criterion.subgroup && !mode.isMultiple && mode.isRadioClick) {
			if (Array.isArray(criterion.subgroup)) {
				criterion.subgroup = criterion.subgroup.concat({
					type: 'button',
					name: 'submit',
					label: mode.isSysop ? 'Delete page' : 'Tag page',
					event: submitSubgroupHandler
				});
			} else {
				criterion.subgroup = [
					criterion.subgroup,
					{
						type: 'button',
						name: 'submit',  // ends up being called "csd.submit" so this is OK
						label: mode.isSysop ? 'Delete page' : 'Tag page',
						event: submitSubgroupHandler
					}
				];
			}
			// FIXME: does this do anything?
			criterion.event = openSubgroupHandler;
		}

		return criterion;
	});
};

Twinkle.speedy.customRationale = [
	{
		label: 'Fərqli səbəb' + (Morebits.userIsSysop ? ' (silinmənin əsaslandırılması)' : ' ({{sil}} şablonu vasitəsilə)'),
		value: 'reason',
		tooltip: 'Daxil edəcəyiniz əsaslandırma {{sil}} şablonu daxilində yerləşdiriləcəkdir.',
		subgroup: {
			name: 'reason_1',
			type: 'input',
			label: 'Səbəb:',
			size: 60
		},
		hideWhenMultiple: true
	}
];

Twinkle.speedy.talkList = [
	{
		label: 'Ü8: Talk pages with no corresponding subject page',
		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.'
	}
];

Twinkle.speedy.fileList = [
	{
		label: 'F1: Redundant file',
		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',
		subgroup: {
			name: 'redundantimage_filename',
			type: 'input',
			label: 'File this is redundant to:',
			tooltip: 'The "File:" prefix can be left off.'
		}
	},
	{
		label: 'F2: Corrupt, missing, or empty file',
		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'
	},
	{
		label: 'F2: Unneeded file description page for a file on Commons',
		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.)',
		hideWhenMultiple: true
	},
	{
		label: 'F3: Improper license',
		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'
	},
	{
		label: 'F4: Lack of licensing information',
		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.',
		hideWhenUser: true
	},
	{
		label: 'F5: Unused non-free copyrighted file',
		value: 'f5',
		tooltip: 'Files that are not under a free license or in the public domain that are not used in any article, whose only use is in a deleted article, and that are very unlikely to be used on any other article. Reasonable exceptions may be made for files uploaded for an upcoming article. For other unused non-free files, use the "Orphaned fair use" option in Twinkle\'s DI tab.',
		hideWhenUser: true
	},
	{
		label: 'F6: Missing fair-use rationale',
		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.',
		hideWhenUser: true
	},
	{
		label: 'F7: Fair-use media from a commercial image agency which is not the subject of sourced commentary',
		value: 'badfairuse',
		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 VP:NFCC. For cases that require a waiting period (invalid or otherwise disputed rationales or replaceable images), use the options on Twinkle\'s DI tab.',
		subgroup: {
			name: 'badfairuse_rationale',
			type: 'input',
			label: 'Optional explanation:',
			size: 60
		},
		hideWhenMultiple: true
	},
	{
		label: 'F8: File available as an identical or higher-resolution copy on Wikimedia Commons',
		value: 'commons',
		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',
		subgroup: {
			name: 'commons_filename',
			type: 'input',
			label: 'Filename on Commons:',
			value: Morebits.pageNameNorm,
			tooltip: 'This can be left blank if the file has the same name on Commons as here. The "File:" prefix is optional.'
		},
		hideWhenMultiple: true
	},
	{
		label: 'F9: Birmənalı şəkildə müəllif hüquqları pozuntusu',
		value: 'imgcopyvio',
		tooltip: 'Bu kriteriya yükləyənin ədalətli istifadə qaydalarına uyğunluğu təsdiq etmədiyi açıq-aşkar azad olmayan şəkillərə (və ya digər media fayllarına) aiddir. URL və ya faylın harada yarandığına dair başqa bir göstərici qeyd edilməlidir. Bu kriteriyaya sahibinin Vikipediyaya uyğun azad lisenziyaya əsasən sərbəst buraxdığı barədə etibarlı sübutları olan fayllar daxil deyil.',
		subgroup: [
			{
				name: 'imgcopyvio_url',
				type: 'input',
				label: 'URL of the copyvio, including the "http://".  If the copyvio is of a non-internet source and you cannot provide a URL, you must use the deletion rationale box.',
				size: 60
			},
			{
				name: 'imgcopyvio_rationale',
				type: 'input',
				label: 'Deletion rationale for non-internet copyvios:',
				size: 60
			}
		]
	},
	{
		label: 'F10: İstifadəsiz qeyri-mediafayllar',
		value: 'badfiletype',
		tooltip: 'Bu kriteriya nə görüntü, nə səs, nə də videofayllar üçün nəzərdə tutulub. Bu kriteriya heç bir məqalədə istifadə olunmayan bu tipli fayllar aiddir: .doc, .pdf, .ps, .html, .rtf, .txt, .xls və .zip faylları'
	},
	{
		label: 'F11: İcazənin dəlilinin olmaması',
		value: 'nopermission',
		tooltip: 'Yükləyən faylın lisenziyasını göstərmişsə və bu üçüncü tərəfin həqiqətən razılaşdığına dair bir sübut təqdim etmədən mənbə / müəllif hüququ sahibi olaraq üçüncü bir şəxsi qeyd etmişdirsə, əvvəlcə yükləyən məlumatlandırılır və yeddi gün sonra isə müvafiq dəyişikliklər edilməsə, fayl silinir.',
		hideWhenUser: true
	},
	{
		label: 'G8: File description page with no corresponding file',
		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 R4.'
	}
];

Twinkle.speedy.articleList = [
	{
		label: 'M1: Boş məqalə.',
		value: 'nocontext',
		tooltip: 'Bu kriteriya kifayət qədər material ehtiva etməyən məqalələrə tətbiq olunur. Məsələn: "Filankəs Filankəsov — alim, yazıçı. O, 1933-cü ildə Şuşada doğulub, 1982-ci ildə Bakıda vəfat etmişdir." Bu kriteriya sadəcə həddindən artıq qısa məqalələrə tətbiq olunur. Nəzərə alın ki, boş məqalə və məzmunsuz məqalə ayrı anlayışlardır və məzmunsuz məqalələrlə bağlı M3 kriteriyası mövcuddur.'
	},
	{
		label: 'M2: Azərbaycan dilində olmayan və ya maşın tərcüməsi olan səhifələr',
		value: 'foreign',
		tooltip: 'Bu kriteriya Azərbaycan dilində olmayan və digər Vikimedia layihələrindəki məqalələr ilə demək olar ki, eynilik təşkil edən məqalələr üçün keçərlidir.',
		subgroup: {
			name: 'foreign_source',
			type: 'input',
			label: 'Xarici dildəki viki səhifənin intervikisi:',
			tooltip: 'Məsələn, en:Azerbaijan'
		}
	},
	{
		label: 'M3: Məzmunsuz məqalə',
		value: 'nocontent',
		tooltip: 'Bu kriteriya yalnız xarici keçidlərdən, kateqoriya etiketlərindən, "Həmçinin bax" bölmələrindən, məqalənin yenidən tərcüməsindən, məqalənin adının aid olduğu şəxs, qrup və s. ilə bağlı məlumat verməyə cəhd olunmasından, söhbət tipli şərhlərdən, şablonlardan və ya fayllardan ibarət məqalələrə aiddir.'
	},/*
	{
		label: 'A5: Transwikied articles',
		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',
		subgroup: {
			name: 'transwiki_location',
			type: 'input',
			label: 'Link to where the page has been transwikied:',
			tooltip: 'For example, https://en.wiktionary.org/wiki/twinkle or [[wikt:twinkle]]'
		}
	},*/
	{
		label: 'M5: Əhəmiyyəti təsdiqlənməyən məqalə (qrup, heyvan, təşkilat, veb kontent, hadisə)',
		value: 'a7',
		tooltip: 'Bu kriteriya təhsil müəssisələri xaricində həqiqi bir insan, xüsusi bir heyvan, ticarət və ya qeyri-kommersiya təşkilatı, veb-məzmun və hadisə haqqında olan məqalələrin niyə vacib və ya əhəmiyyətli olduğunun göstərilmədiyi hallarda tətbiq olunur. Bu kriteriya yoxlanılabilərlik və mənbələrin etibarlılığından fərqlənir və ensiklopediklikdən daha aşağı bir standartdır.',
		hideWhenSingle: true
	},/*
	{
		label: 'M5: Əhəmiyyəti təsdiqlənməyən məqalə (şəxslər)',
		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',
		hideWhenMultiple: true
	},*/
	{
		label: 'M6: Əhəmiyyəti təsdiqlənməyən məqalə (mahnılar, musiqiçilər və s.)',
		value: 'band',
		tooltip: 'Bu kriteriya hər hansı bir yaradıcı sənətkarın vikipediyada məqaləsi olmadığı və mövzusunun niyə vacib və ya əhəmiyyətli olduğunu göstərilmədiyi bir musiqi məhsulu və ya musiqi məhsullarının siyahısını ehtiva edən məqalələrə aiddir (hər iki şərt yerinə yetirilməlidir).',
		hideWhenMultiple: true
	},/*
	{
		label: 'A7: No indication of importance (club, society or group)',
		value: 'club',
		tooltip: 'Article about a club, society or group that does not assert the importance or significance of the subject',
		hideWhenMultiple: true
	},
	{
		label: 'A7: No indication of importance (company or organization)',
		value: 'corp',
		tooltip: 'Article about a company or organization that does not assert the importance or significance of the subject',
		hideWhenMultiple: true
	},
	{
		label: 'A7: No indication of importance (website or web content)',
		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',
		hideWhenMultiple: true
	},
	{
		label: 'A7: No indication of importance (individual animal)',
		value: 'animal',
		tooltip: 'Article about an individual animal (e.g. pet) that does not assert the importance or significance of its subject',
		hideWhenMultiple: true
	},
	{
		label: 'A7: No indication of importance (organized event)',
		value: 'event',
		tooltip: 'Article about an organized event (tour, function, meeting, party, etc.) that does not assert the importance or significance of its subject',
		hideWhenMultiple: true
	},
	{
		label: 'A9: Unremarkable musical recording where artist\'s article doesn\'t exist',
		value: 'a9',
		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'
	},*/
	{
		label: 'M7: Mövcud olan bir mövzunun dublikatı və ya oxşarı olan yeni yaradılmış məqalə',
		value: 'a10',
		tooltip: 'Bu kriteriya Azərbaycan dilli Vikipediyada mövcud olan mövzunu təkrarlayan və o mövzu ilə əlaqəli mövcud məqalə(lər) içindəki məlumatları genişləndirməyən, təfərrüatlandırmayan, yaxşılaşdırmayan, eyni zamanda tarixçəsi olmayan və başlığın inandırıcı olmadığı məqalələrə (və bəzən məqbul olmayan istiqamətləndirmələrə) aiddir.',
		subgroup: {
			name: 'a10_article',
			type: 'input',
			label: 'Dublikatı olan məqalə:'
		}
	},
	{
		label: 'M8: Orijinal tədqiqat',
		value: 'madeup',
		tooltip: 'Bu kriteriya mövzunun məqalənin yaradıcısı və ya yaradıcının şəxsən tanıdığı bir şəxs tərəfindən icad / ixtira / kəşf edildiyini açıq şəkildə göstərən və mövzusunun niyə vacib və ya əhəmiyyətli olduğunu etibarlı şəkildə göstərməyən hər hansı bir məqaləyə tətbiq olunur.'
	}
];

Twinkle.speedy.categoryList = [
	{
		label: 'K1: Boş kateqoriyalar',
		value: 'catempty',
		tooltip: 'Bu kriteriya ən azı 7 gün istifadəsiz, boş qalan kateqoriyalar üçün istifadə olunur. Bu kriteriya dəqiqləşdirmə funksiyası görən kateqoriyalar, bəzi kateqoriyaların ümumi başlıq altında toplanması funksiyasını görən kateqoriyalar, müzakirəsi davam edən kateqoriyalar və təbii olaraq boş ola biləcək kateqoriyalar (texniki) üçün uyğun deyil.'
	},
	{
		label: 'Ü8: Silinmiş ya da istiqamətləndirmə səhifəsinə çevrilmiş şablonlardan ibarət kateqoriyalar',
		value: 'templatecat',
		tooltip: 'Bu, asılı olduğu şablonun silinməsi nəticəsində boş qalmış kateqoriyalara şamil edilir. Xüsusi hallarda boş saxlananılan kateqoriyalar istisna təşkil edirlər.',
		subgroup: {
			name: 'templatecat_rationale',
			type: 'input',
			label: 'Əlavə izah:',
			size: 60
		}
	},
	{
		label: 'Ü8: Mövcud olmayan səhifəyə olan istiqamətləndirmə',
		value: 'redirnone',
		tooltip: 'Layihəyə faydalı olan müzakirə səhifələri, yəni müzakirələr, arxivlər istisna təşkil edir.',
		hideWhenMultiple: true
	}
];

Twinkle.speedy.userList = [
	{
		label: 'İS1: İstifadəçi istəyi',
		value: 'is1',
		tooltip: 'Şəxsi istifadəçi səhifələri və onun alt səhifələri (istifadəçi müzakirəsi istisna olmaqla) istifadəçilərin öz istəyi ilə silinə bilər. İstifadəçi müzakirə səhifələrinə bu kriteriya tətbiq oluna bilməz.',
		subgroup: mw.config.get('wgNamespaceNumber') === 3 && mw.config.get('wgTitle').indexOf('/') === -1 ? {
			name: 'userreq_rationale',
			type: 'input',
			label: 'A mandatory rationale to explain why this user talk page should be deleted:',
			tooltip: 'User talk pages are deleted only in highly exceptional circumstances. See VP:DELTALK.',
			size: 60
		} : null,
		hideSubgroupWhenMultiple: true
	},
	{
		label: 'İS2: Mövcud olmayan istifadəçi',
		value: 'is1',
		tooltip: 'Mövcud olmayan istifadəçilərin istifadəçi səhifələri'
	},
	{
		label: 'İS3: Azad olmayan qalereyalar',
		value: 'İS3',
		tooltip: 'Azad istifadə qaydalarına uyğun olmayan və ya azad olmayan fayllardan ibarət albom yerləşdirilmiş istifadəçi səhifələri Vikipediyanın azad məzmun siyasətini pozduğu üçün bu kriteriya ilə sürətli silinə bilər.',
		hideWhenRedirect: true
	},
	/*{
		label: 'İS4: Reklam, təbliğat və bu kimi məqsədlərlə istifadə',
		value: 'İS4',
		tooltip: 'İstifadəçi ad fəzasındakı səhifələr məlumatlar, müzakirələr və ya Vikipediyanın hədəfləri ilə yaxından əlaqəli olmayan fəaliyyətlərdən ibarətdirsə və sahibinin istifadəçi səhifələrinin xaricində az və ya heç bir dəyişiklik etmədiyi hallarda bu kriteriya ödənir.',
		hideWhenRedirect: true
	},*/
	{
		label: 'Ü11: Birmənalı şəkildə reklam və ya təbliğat',
		value: 'Ü11',
		tooltip: 'Bu kriteriya açıq-aşkar reklam şəklində yaradılan və ensiklopedik qaydalara uyğunlaşması üçün fundamental şəkildə redaktə olunması tələb olunan səhifələr üçün keçərlidir.',
		hideWhenMultiple: true,
		hideWhenRedirect: true
	},
	{
		label: 'Ü13: Tərk edilmiş qaralamalar',
		value: 'Ü13',
		tooltip: '6 ay ərzində heç bir istifadəçi (bot olmayan) tərəfindən redaktə olunmayan qaralama səhifələri və boş səhifələr bu kriteriya ilə silinə bilər. İstiqamətləndirmələr bu kriteriyaya şamil edilmir.',
		hideWhenMultiple: true,
		hideWhenRedirect: true
	}
];

Twinkle.speedy.portalList = [
	{
		label: 'P1: Portal that would be subject to speedy deletion if it were an article',
		value: 'p1',
		tooltip: 'You must specify a single article criterion that applies in this case (A1, A3, A7, or A10).',
		subgroup: {
			name: 'p1_criterion',
			type: 'input',
			label: 'Article criterion that would apply:'
		}
	},
	{
		label: 'P2: Underpopulated portal (fewer than three non-stub articles)',
		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'
	}
];

Twinkle.speedy.generalList = [
	{
		label: 'Ü1: Heç bir məna ifadə etməyən səhifə',
		value: 'ü1',
		tooltip: 'Bu kriteriya qənaətbəxş olmayan yazı formatını, absurd nəzəriyyələri, xəyali materialları, Azərbaycan dilində olmayan materialları, pis tərcümə olunmuş materialları, maşın tərcümələrini və vandalizmi əhatə etmir.',
		hideInNamespaces: [ 2 ] // Not applicable in userspace
	},
	{
		label: 'Ü2: Test səhifələri',
		value: 'ü2',
		tooltip: 'Bu kriteriya Vikipediya funksiyalarını yoxlamaq üçün yaradılan səhifələrə tətbiq olunur. Birbaşa olaraq istifadəçi qaralama səhifələrinə və istifadəçi səhifələrinə tətbiq olunmur.',
		hideInNamespaces: [ 2 ] // Not applicable in userspace
	},
	{
		label: 'Ü3: Birmənalı şəkildə vandalizm',
		value: 'Ü3',
		tooltip: 'Bu kriteriya vandalizm məqsədilə yaradılan məqalələrə aiddir.'
	},
	{
		label: 'Ü3: Saxtakarlıq halları',
		value: 'Ü3',
		tooltip: 'Bu kriteriya açıq-aşkar dezinformasiyalar olan səhifələr, açıq-aşkar saxtakarlıq olan məqalələrə tətbiq olunur.',
		hideWhenMultiple: true
	},
	{
		label: 'Ü4: Müzakirə nəticəsində silinən səhifənin yenidən yaradılması',
		value: 'Ü4',
		tooltip: 'Bu kriteriya ən son tamamlanan müzakirə ilə silinməsi qərara alınan səhifənin məzmunu və başlığı ilə tamamilə eynilik və ya oxşarlıq təşkil edən məqalələri əhatə edir.',
		subgroup: {
			name: 'repost_xfd',
			type: 'input',
			label: 'Silinməyə namizəd səhifələrdəki keçidi daxil edin:',
			tooltip: '"Vikipediya:" ilə başlamalıdır ',
			size: 60
		}
	},
	{
		label: 'Ü5: Bloklanmış və ya qadağan edilmiş istifadəçilərin töhfələri',
		value: 'Ü5',
		tooltip: 'Bu kriteriya bloklanmış və ya qadağan edilmiş istifadəçilərin bloklarının və qadağalarının davam etdiyi müddətdə qaydaları pozaraq müxtəlif yollarla yaratdığı, digər istifadəçilər tərəfindən əhəmiyyətli dəyişikliklər edilməyən məqalələrə şamil edilir.',
		subgroup: {
			name: 'banned_user',
			type: 'input',
			label: 'Bloklanmış istifadəçinin adı (əgər varsa):',
			tooltip: '"İstifadəçi:" ilə başlamamalıdır'
		}
	},
	{
		label: 'Ü6: Ad dəyişməyə maneə yaradan səhifə',
		value: 'move',
		tooltip: 'İstiqamətləndirməni dəyişmək kimi konsensus lazım olmayan əməliyyatlar bu kriteriyaya aid edilir.',
		subgroup: [
			{
				name: 'move_page',
				type: 'input',
				label: 'Bura köçürüləcək səhifə:'
			},
			{
				name: 'move_reason',
				type: 'input',
				label: 'Səbəb:',
				size: 60
			}
		],
		hideWhenMultiple: true
	},
	{
		label: 'Ü6: SNS müzakirəsi nəticəsində silinməsi unudulan səhifə',
		value: 'sns',
		tooltip: 'Silinməyə namizəd səhifələrdə səhifənin silinməsi barədə qərar qəbul edilib, amma səhifə silinməyibsə, bu kriteriyadan istifadə edə bilərsiniz.',
		subgroup: {
			name: 'xfd_fullvotepage',
			type: 'input',
			label: 'Müzakirənin aparıldığı səhifə:',
			tooltip: '"Vikipediya:" ilə başlamalıdır',
			size: 40
		},
		hideWhenMultiple: true
	},
	{
		label: 'Ü6: Surətini köçürməklə səhifənin adını dəyişmə',
		value: 'copypaste',
		tooltip: 'Əgər texniki təmizləmə məqsədilə başqa səhifənin məzmunu bu səhifəyə köçürülübsə, bu kriteriyadan istifadə edə bilərsiniz.',
		subgroup: {
			name: 'copypaste_sourcepage',
			type: 'input',
			label: 'Mətnin orijinalının yerləşdiyi səhifə:'
		},
		hideWhenMultiple: true
	},
	{
		label: 'G6: Housekeeping and non-controversial cleanup',
		value: 'g6',
		tooltip: 'Other routine maintenance tasks',
		subgroup: {
			name: 'g6_rationale',
			type: 'input',
			label: 'Rationale:',
			size: 60
		}
	},
	{
		label: 'Ü7: Müəllif istəyi ilə silinmə',
		value: 'author',
		tooltip: 'Əgər istək xoş niyyətlə edilmişdirsə və məlumatların vacib qismi müəllif tərəfindən yaradılıbsa, bu kriteriya ödənə bilər. Əgər bir istifadəçi öz müəllifi olduğu kateqoriya səhifələrini, müzakirə səhifələrini, öz istifadəçi səhifəsini tamamilə boşaldarsa, bu silinmə tələbi kimi qəbul olunur.',
		subgroup: {
			name: 'author_rationale',
			type: 'input',
			label: 'Optional explanation:',
			tooltip: 'Perhaps linking to where the author requested this deletion.',
			size: 60
		},
		hideSubgroupWhenSysop: true
	},
	{
		label: 'Ü8: Silinmiş və ya mövcud olmayan səhifələrdən asılı səhifələr',
		value: 'ü8',
		tooltip: 'Mövcud olmayan səhifəyə aid müzakirə səhifəsi, əsas səhifəsi olmayan alt səhifələr, müvafiq faylı olmayan fayl səhifələri, heç vaxt mövcud olmamış, yaxud silinmiş səhifələrə olan istiqamətləndirmələr, boş kateqoriyalar və sair göstəricilər bu qəbildən hesab edilir.',
		subgroup: {
			name: 'g8_rationale',
			type: 'input',
			label: 'Əlavə izah:',
			size: 60
		},
		hideSubgroupWhenSysop: true
	},
	{
		label: 'G8: Subpages with no parent page',
		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.',
		hideWhenMultiple: true,
		hideInNamespaces: [ 0, 6, 8 ]  // hide in main, file, and mediawiki-spaces
	},
	{
		label: 'Ü10: Hücum səhifəsi',
		value: 'ü10',
		tooltip: 'Bütün adlar fəzasında onun subyektini təhqir, yaxud təhdid etmək məqsədilə yaradılmış səhifə.'
	},
	{
		label: 'Ü10: Tamamilə mənfi və mənbəsiz bioqrafiya',
		value: 'ü10',
		tooltip: 'Yaşayan insan haqqında tamamilə mənfi tonda və mənbəsiz bioqrafik materialdan ibarət səhifə.',
		hideWhenMultiple: true
	},
	{
		label: 'G11: Unambiguous advertising or promotion',
		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'
	},
	{
		label: 'G12: Unambiguous copyright infringement',
		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',
		subgroup: [
			{
				name: 'copyvio_url',
				type: 'input',
				label: 'URL (if available):',
				tooltip: 'If the material was copied from an online source, put the URL here, including the "http://" or "https://" protocol.',
				size: 60
			},
			{
				name: 'copyvio_url2',
				type: 'input',
				label: 'Additional URL:',
				tooltip: 'Optional. Should begin with "http://" or "https://"',
				size: 60
			},
			{
				name: 'copyvio_url3',
				type: 'input',
				label: 'Additional URL:',
				tooltip: 'Optional. Should begin with "http://" or "https://"',
				size: 60
			}
		]
	},
	{
		label: 'Ü13: Page in draft namespace or userspace AfC submission, stale by over 6 months',
		value: 'Ü13',
		tooltip: 'Any rejected or unsubmitted AfC submission in userspace or any non-redirect page in draft namespace, that has not been edited for more than 6 months. Blank drafts in either namespace are also included.',
		hideWhenRedirect: true,
		showInNamespaces: [2, 118]  // user, draft namespaces only
	},
	{
		label: 'Ü14: Lazımsız dəqiqləşdirmə səhifələri',
		value: 'Ü14',
		tooltip: 'Bu kriteriya dəqiqləşdirmə səhifələri üçün keçərlidir: (1) Sadəcə mövcud olan bir vikipediya səhifəsinə keçid verən dəqiqləşdirmə səhifələri, (2) Heç bir səhifəyə keçid verməyən dəqiqləşdirmə səhifələri, (3) Səhifə adında "(dəqiqləşdirmə)" sözü olub başqa bir səhifəyə (dəqiqləşdirmə və ya digər) istiqamətləndirmə funksiyası görən səhifələr.'
	}
];

Twinkle.speedy.redirectList = [
	{
		label: 'R2: Redirect from mainspace to any other namespace except the Category:, Template:, Wikipedia:, Help: and Portal: namespaces',
		value: 'rediruser',
		tooltip: 'This does not include the pseudo-namespace shortcuts. If this was the result of a page move, consider waiting a day or two before deleting the redirect',
		showInNamespaces: [ 0 ]
	},
	{
		label: 'R3: Recently created redirect from an implausible typo or misnomer',
		value: 'redirtypo',
		tooltip: 'However, redirects from common misspellings or misnomers are generally useful, as are redirects in other languages'
	},
	{
		label: 'R4: File namespace redirect with a name that matches a Commons page',
		value: 'redircom',
		tooltip: 'The redirect should have no incoming links (unless the links are cleary intended for the file or redirect at Commons).',
		showInNamespaces: [ 6 ]
	},
	{
		label: 'G6: Redirect to malplaced disambiguation page',
		value: 'movedab',
		tooltip: 'This only applies for redirects to disambiguation pages ending in (disambiguation) where a primary topic does not exist.',
		hideWhenMultiple: true
	},
	{
		label: 'G8: Redirects to non-existent targets',
		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.',
		hideWhenMultiple: true
	}
];

Twinkle.speedy.normalizeHash = {
	reason: 'db',
	Ü1: 'ü1',
	Ü2: 'ü2',
	Ü3: 'ü3',
	Ü4: 'ü4',
	Ü5: 'ü5',
	move: 'g6',
	xfd: 'g6',
	movedab: 'g6',
	copypaste: 'ü6',
	Ü6: 'ü6',
	sns: 'ü6',
	author: 'g7',
	ü8: 'ü8',
	talk: 'ü8',
	subpage: 'ü8',
	redirnone: 'ü8',
	templatecat: 'ü8',
	imagepage: 'ü8',
	Ü10: 'ü10',
	Ü11: 'ü11',
	copyvio: 'g12',
	Ü13: 'ü13',
	Ü14: 'ü14',
	nocontext: 'a1',
	foreign: 'a2',
	nocontent: 'a3',
	transwiki: 'a5',
	a7: 'a7',
	person: 'a7',
	corp: 'a7',
	web: 'a7',
	band: 'a7',
	club: 'a7',
	animal: 'a7',
	event: 'a7',
	a9: 'a9',
	a10: 'a10',
	madeup: 'a11',
	rediruser: 'r2',
	redirtypo: 'r3',
	redircom: 'r4',
	redundantimage: 'f1',
	noimage: 'f2',
	fpcfail: 'f2',
	noncom: 'f3',
	unksource: 'f4',
	unfree: 'f5',
	f5: 'f5',
	norat: 'f6',
	badfairuse: 'f7',
	commons: 'f8',
	imgcopyvio: 'f9',
	badfiletype: 'f10',
	nopermission: 'f11',
	catempty: 'c1',
	İS1: 'is1',
	İS2: 'is2',
	İS3: 'is3',
	İS4: 'is4',
	p1: 'p1',
	emptyportal: 'p2'
};

Twinkle.speedy.callbacks = {
	getTemplateCodeAndParams: function(params) {
		var code, parameters, i;
		if (params.normalizeds.length > 1) {
			code = '{{db-multiple';
			params.utparams = {};
			$.each(params.normalizeds, function(index, norm) {
				code += '|' + norm.toUpperCase();
				parameters = params.templateParams[index] || [];
				for (var i in parameters) {
					if (typeof parameters[i] === 'string' && !parseInt(i, 10)) {  // skip numeric parameters - {{db-multiple}} doesn't understand them
						code += '|' + i + '=' + parameters[i];
					}
				}
				$.extend(params.utparams, Twinkle.speedy.getUserTalkParameters(norm, parameters));
			});
			code += '}}';
		} else {
			parameters = params.templateParams[0] || [];
			code = '{{sil|' + 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);
		}

		return [code, params.utparams];
	},

	parseWikitext: function(wikitext, callback) {
		var query = {
			action: 'parse',
			prop: 'text',
			pst: 'true',
			text: wikitext,
			contentmodel: 'wikitext',
			title: mw.config.get('wgPageName'),
			disablelimitreport: true,
			format: 'json'
		};

		var statusIndicator = new Morebits.status('Building deletion summary');
		var api = new Morebits.wiki.api('Parsing deletion template', query, function(apiobj) {
			var reason = decodeURIComponent($(apiobj.getResponse().parse.text).find('#delete-reason').text()).replace(/\+/g, ' ');
			if (!reason) {
				statusIndicator.warn('Unable to generate summary from deletion template');
			} else {
				statusIndicator.info('complete');
			}
			callback(reason);
		}, statusIndicator);
		api.post();
	},

	noteToCreator: function(pageobj) {
		var params = pageobj.getCallbackParameters();
		var initialContrib = pageobj.getCreator();

		// disallow notifying yourself
		if (initialContrib === mw.config.get('wgUserName')) {
			Morebits.status.warn('You (' + initialContrib + ') created this page; skipping user notification');
			initialContrib = null;

		// don't notify users when their user talk page is nominated/deleted
		} else 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');
			initialContrib = null;

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

		// Check for already existing tags
		} else if (Twinkle.speedy.hasCSD && params.warnUser && !confirm('The page is has a deletion-related tag, and thus the creator has likely been notified.  Do you want to notify them for this deletion as well?')) {
			Morebits.status.info('Notifying initial contributor', 'canceled by user; skipping notification.');
			initialContrib = null;
		}

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

			// special cases: "db" and "db-multiple"
			if (params.normalizeds.length > 1) {
				notifytext = '\n{{subst:db-' + (params.warnUser ? 'deleted' : 'notice') + '-multiple|1=' + Morebits.pageNameNorm;
				var count = 2;
				$.each(params.normalizeds, function(index, norm) {
					notifytext += '|' + count++ + '=' + norm.toUpperCase();
				});
			} else if (params.normalizeds[0] === 'db') {
				notifytext = '\n{{subst:db-reason-' + (params.warnUser ? 'deleted' : 'notice') + '|1=' + Morebits.pageNameNorm;
			} else {
				notifytext = '\n{{subst:db-csd-' + (params.warnUser ? 'deleted' : 'notice') + '-custom|1=';
				if (params.values[0] === 'copypaste') {
					notifytext += params.templateParams[0].sourcepage;
				} else {
					notifytext += Morebits.pageNameNorm;
				}
				notifytext += '|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') + '}} ~~~~';

			editsummary = 'Bildiriş:';
			if (params.normalizeds.indexOf('ü10') === -1) {  // no article name in summary for G10 taggings
				editsummary += ' "[[:' + Morebits.pageNameNorm + ']]" səhifəsinin sürətli' + (params.warnUser ? ' silinməsi' : ' silinməyə namizəd göstərilməsi');
			} else {
				editsummary += ' of an attack page.';
			}

			usertalkpage.setAppendText(notifytext);
			usertalkpage.setEditSummary(editsummary);
			usertalkpage.setChangeTags(Twinkle.changeTags);
			usertalkpage.setCreateOption('recreate');
			usertalkpage.setWatchlist(Twinkle.getPref('watchSpeedyUser'));
			usertalkpage.setFollowRedirect(true, false);
			usertalkpage.append(function onNotifySuccess() {
				// 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);
				}
			}, function onNotifyError() {
				// if user could not be notified, log nomination without mentioning that notification was sent
				if (params.lognomination) {
					Twinkle.speedy.callbacks.user.addToLog(params, null);
				}
			});
		} else if (params.lognomination) {
			// log nomination even if the user notification wasn't sent
			Twinkle.speedy.callbacks.user.addToLog(params, null);
		}
	},

	sysop: {
		main: function(params) {
			var reason;
			if (!params.normalizeds.length && params.normalizeds[0] === 'db') {
				reason = prompt('Enter the deletion summary to use, which will be entered into the deletion log:', '');
				Twinkle.speedy.callbacks.sysop.deletePage(reason, params);
			} else {
				var code = Twinkle.speedy.callbacks.getTemplateCodeAndParams(params)[0];
				Twinkle.speedy.callbacks.parseWikitext(code, function(reason) {
					if (params.promptForSummary) {
						reason = prompt('Enter the deletion summary to use, or press OK to accept the automatically generated one.', reason);
					}
					Twinkle.speedy.callbacks.sysop.deletePage(reason, params);
				});
			}
		},
		deletePage: function(reason, params) {
			var thispage = new Morebits.wiki.page(mw.config.get('wgPageName'), 'Deleting page');

			if (reason === null) {
				return Morebits.status.error('Asking for reason', 'User cancelled');
			} else if (!reason || !reason.replace(/^\s*/, '').replace(/\s*$/, '')) {
				return 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...");
			}

			var deleteMain = function(callback) {
				thispage.setEditSummary(reason);
				thispage.setChangeTags(Twinkle.changeTags);
				thispage.setWatchlist(params.watch);
				thispage.deletePage(function() {
					thispage.getStatusElement().info('done');
					typeof callback === 'function' && callback();
					Twinkle.speedy.callbacks.sysop.deleteTalk(params);
				});
			};

			// look up initial contributor. If prompting user for deletion reason, just display a link.
			// Otherwise open the talk page directly
			if (params.warnUser) {
				thispage.setCallbackParameters(params);
				thispage.lookupCreation(function(pageobj) {
					deleteMain(function() {
						Twinkle.speedy.callbacks.noteToCreator(pageobj);
					});
				});
			} else {
				deleteMain();
			}
		},
		deleteTalk: function(params) {
			// delete talk page
			if (params.deleteTalkPage &&
					params.normalized !== 'f8' &&
					!document.getElementById('ca-talk').classList.contains('new')) {
				var talkpage = new Morebits.wiki.page(mw.config.get('wgFormattedNamespaces')[mw.config.get('wgNamespaceNumber') + 1] + ':' + mw.config.get('wgTitle'), 'Deleting talk page');
				talkpage.setEditSummary('[[VP:Ü8|Ü8]]: silinmiş ' + '"' + Morebits.pageNameNorm + '" səhifəsinin müzakirə səhifəsi');
				talkpage.setChangeTags(Twinkle.changeTags);
				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',
					titles: mw.config.get('wgPageName'),
					prop: 'redirects',
					rdlimit: 'max', // 500 is max for normal users, 5000 for bots and sysops
					format: 'json'
				};
				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 !== 'f8') {
				$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 usages of and/or links to deleted file ' + Morebits.pageNameNorm);
					}
				});
				$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 !== 'f8') {
				$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 ' + Morebits.pageNameNorm);
					}
				});
				$bigtext = $('<span/>', {
					text: 'To orphan backlinks',
					css: { fontSize: '130%', fontWeight: 'bold' }
				});
				Morebits.status.info($bigtext[0], $link[0]);
			}
		},
		deleteRedirectsMain: function(apiobj) {
			var response = apiobj.getResponse();
			var snapshot = response.query.pages[0].redirects || [];
			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.forEach(function(value) {
				var title = value.title;
				var page = new Morebits.wiki.page(title, 'Deleting redirect "' + title + '"');
				page.setEditSummary('[[VP:G8|G8]]: Redirect to deleted page "' + Morebits.pageNameNorm + '"');
				page.setChangeTags(Twinkle.changeTags);
				page.deletePage(onsuccess);
			});
		}
	},

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

			if (!pageobj.exists()) {
				statelem.error("It seems that the page doesn't exist; perhaps it has already been deleted");
				return;
			}

			var params = pageobj.getCallbackParameters();

			// given the params, builds the template and also adds the user talk page parameters to the params that were passed in
			// returns => [<string> wikitext, <object> utparams]
			var buildData = Twinkle.speedy.callbacks.getTemplateCodeAndParams(params),
				code = buildData[0];
			params.utparams = buildData[1];

			// Set the correct value for |ts= parameter in {{db-g13}}
			if (params.normalizeds.indexOf('g13') !== -1) {
				code = code.replace('$TIMESTAMP', pageobj.getLastEditTime());
			}

			// Tag if possible, post on talk if not
			if (pageobj.canEdit() && ['wikitext', 'Scribunto', 'javascript', 'css', 'sanitized-css'].indexOf(pageobj.getContentModel()) !== -1) {
				var text = pageobj.getPageText();

				statelem.status('Səhifədə silmə şablonları axtarılır...');

				// check for existing deletion tags
				var tag = /(?:\{\{\s*(db|delete|db-.*?|speedy deletion-.*?)(?:\s*\||\s*\}\}))/.exec(text);
				// This won't make use of the db-multiple template but it probably should
				if (tag && !confirm('Bu səhifədə onsuz da sürətli silmə ilə əlaqəli {{' + tag[1] + '}} şablonu vardır. Başqa şablonun əlavə edilməsini istəyirsinizmi?')) {
					return;
				}

				var xfd = /\{\{((?:article for deletion|proposed deletion|prod blp|template for discussion)\/dated|[cfm]fd\b)/i.exec(text) || /#invoke:(RfD)/.exec(text);
				if (xfd && !confirm('Səhifədə silmə ilə əlaqəli {{' + xfd[1] + '}} şablonu aşkar edildi. Yenə də sürətli silmə şablonunun əlavə edilməsini istəyirsinizmi?')) {
					return;
				}

				// curate/patrol the page
				if (Twinkle.getPref('markSpeedyPagesAsPatrolled')) {
					pageobj.triage();
				}

				// 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*([Uu]serspace draft)\s*(\|(?:\{\{[^{}]*\}\}|[^{}])*)?\}\}\s*/g, '');
				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, '');
				}

				if (params.requestsalt) {
					if (params.normalizeds.indexOf('ü10') === -1) {
						code += '\n{{salt}}';
					} else {
						code = '{{salt}}\n' + code;
					}
				}

				if (mw.config.get('wgPageContentModel') === 'Scribunto') {
					// Scribunto isn't parsed like wikitext, so SSK templates on modules need special handling to work
					var equals = '';
					while (code.indexOf(']' + equals + ']') !== -1) {
						equals += '=';
					}
					code = "require('Module:Module wikitext')._addText([" + equals + '[' + code + ']' + equals + ']);';
				} else if (['javascript', 'css', 'sanitized-css'].indexOf(mw.config.get('wgPageContentModel')) !== -1) {
					// Likewise for JS/CSS pages
					code = '/* ' + code + ' */';
				}

				// Generate edit summary for edit
				var editsummary;
				if (params.normalizeds.length > 1) {
					editsummary = 'Sürətli silmə tələbi əlavə edilir (';
					$.each(params.normalizeds, function(index, norm) {
						editsummary += '[[VP:' + norm.toUpperCase() + '|SSK: ' + norm.toUpperCase() + ']], ';
					});
					editsummary = editsummary.substr(0, editsummary.length - 2); // remove trailing comma
					editsummary += ').';
				} else if (params.normalizeds[0] === 'db') {
					editsummary = '[[VP:SSK|Sürətli silmə]] tələbi əlavə edilir.';
				} else {
					editsummary = 'Sürətli silmə tələbi əlavə edilir ([[VP:' + params.normalizeds[0].toUpperCase() + '|SSK: ' + params.normalizeds[0].toUpperCase() + ']]).';
				}

				// Blank attack pages
				if (params.normalizeds.indexOf('ü10') !== -1) {
					text = code;
				} else {
					// Insert tag after short description or any hatnotes
					var wikipage = new Morebits.wikitext.page(text);
					text = wikipage.insertAfterTemplates(code + '\n', Twinkle.hatnoteRegex).getText();
				}


				pageobj.setPageText(text);
				pageobj.setEditSummary(editsummary);
				pageobj.setWatchlist(params.watch);
				pageobj.save(Twinkle.speedy.callbacks.user.tagComplete);
			} else { // Attempt to place on talk page
				var talkName = new mw.Title(pageobj.getPageName()).getTalkPage().toText();
				if (talkName !== pageobj.getPageName()) {
					if (params.requestsalt) {
						code += '\n{{salt}}';
					}

					pageobj.getStatusElement().warn('Səhifəni redaktə etmək mümkün olmadı, şablon müzakirə səhifəsində yerləşdirilir');

					var talk_page = new Morebits.wiki.page(talkName, 'Müzakirə səhifəsinə avtomatik olaraq silinmə şablonu yerləşdirilir.');
					talk_page.setNewSectionTitle(pageobj.getPageName() + ' nominated for SSK, request deletion');
					talk_page.setNewSectionText(code + '\n\nMən ' + pageobj.getPageName() + 'səhifəsinə silmə şablonu əlavə edə bilmədim. Zəhmət olmasa, bunu silərsiniz. ~~~~');
					talk_page.setCreateOption('recreate');
					talk_page.setFollowRedirect(true);
					talk_page.setWatchlist(params.watch);
					talk_page.setChangeTags(Twinkle.changeTags);
					talk_page.setCallbackParameters(params);
					talk_page.newSection(Twinkle.speedy.callbacks.user.tagComplete);
				} else {
					pageobj.getStatusElement().error('Page protected and nowhere to add an edit request, aborting');
				}
			}
		},

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

			// Notification to first contributor, will also log nomination to the user's userspace log
			if (params.usertalk) {
				var thispage = new Morebits.wiki.page(Morebits.pageNameNorm);
				thispage.setCallbackParameters(params);
				thispage.lookupCreation(Twinkle.speedy.callbacks.noteToCreator);
			// 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);
			}
		},

		addToLog: function(params, initialContrib) {
			var usl = new Morebits.userspaceLogger(Twinkle.getPref('speedyLogPageName'));
			usl.initialText =
				"This is a log of all [[VP:SSK|speedy deletion]] nominations made by this user using [[VP:TW|Twinkle]]'s SSK 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 [[VP:U1|SSK U1]].' +
				(Morebits.userIsSysop ? '\n\nThis log does not track outright speedy deletions made using Twinkle.' : '');

			var formatParamLog = function(normalize, csdparam, input) {
				if ((normalize === 'Ü4' && csdparam === 'sns') ||
					(normalize === 'Ü6' && csdparam === 'səhifə') ||
					(normalize === 'Ü6' && csdparam === 'sns') ||
					(normalize === 'Ü6' && csdparam === 'mənbəsəhifə') ||
					(normalize === 'M2' && csdparam === 'mənbə') ||
					(normalize === 'M10' && csdparam === 'məqalə') ||
					(normalize === 'F1' && csdparam === 'fayl')) {
					input = '[[:' + input + ']]';
				} else if (normalize === 'Ü5' && csdparam === 'istifadəçi') {
					input = '[[:User:' + input + ']]';
				} else if (normalize === 'Ü12' && csdparam.lastIndexOf('url', 0) === 0 && input.lastIndexOf('http', 0) === 0) {
					input = '[' + input + ' ' + input + ']';
				} else if (normalize === 'F8' && csdparam === 'fayl') {
					input = '[[commons:' + input + ']]';
				} else if (normalize === 'P1' && csdparam === 'kriteriya') {
					input = '[[VP:' + input + ']]';
				}
				return ' {' + normalize + ' ' + csdparam + ': ' + input + '}';
			};

			var extraInfo = '';

			// If a logged file is deleted but exists on commons, the wikilink will be blue, so provide a link to the log
			var fileLogLink = mw.config.get('wgNamespaceNumber') === 6 ? ' ([{{fullurl:Special:Log|page=' + mw.util.wikiUrlencode(mw.config.get('wgPageName')) + '}} log])' : '';

			var editsummary = 'Sürətli silinmə təklifi əlavə edilir';
			var appendText = '# [[:' + Morebits.pageNameNorm;

			if (params.normalizeds.indexOf('ü10') === -1) {  // no article name in log for G10 taggings
				appendText += ']]' + fileLogLink + ': ';
				editsummary += ' of [[:' + Morebits.pageNameNorm + ']].';
			} else {
				appendText += '|This]] attack page' + fileLogLink + ': ';
				editsummary += ' of an attack page.';
			}
			if (params.normalizeds.length > 1) {
				appendText += 'multiple criteria (';
				$.each(params.normalizeds, function(index, norm) {
					appendText += '[[VP:' + norm.toUpperCase() + '|' + norm.toUpperCase() + ']], ';
				});
				appendText = appendText.substr(0, appendText.length - 2);  // remove trailing comma
				appendText += ')';
			} else if (params.normalizeds[0] === 'db') {
				appendText += '{{tl|db-reason}}';
			} else {
				appendText += '[[VP:' + params.normalizeds[0].toUpperCase() + '|SSK ' + params.normalizeds[0].toUpperCase() + ']] ({{tl|db-' + params.values[0] + '}})';
			}

			// If params is "empty" it will still be full of empty arrays, but ask anyway
			if (params.templateParams) {
				// Treat custom rationale individually
				if (params.normalizeds[0] && params.normalizeds[0] === 'db') {
					extraInfo += formatParamLog('Custom', 'rationale', params.templateParams[0]['2']);
				} else {
					params.templateParams.forEach(function(item, index) {
						var keys = Object.keys(item);
						if (keys[0] !== undefined && keys[0].length > 0) {
							// Second loop required since some items (G12, F9) may have multiple keys
							keys.forEach(function(key, keyIndex) {
								if (keys[keyIndex] === 'blanked' || keys[keyIndex] === 'ts') {
									return true; // Not worth logging
								}
								extraInfo += formatParamLog(params.normalizeds[index].toUpperCase(), keys[keyIndex], item[key]);
							});
						}
					});
				}
			}

			if (params.requestsalt) {
				appendText += '; requested creation protection ([[VP:SALT|salting]])';
			}
			if (extraInfo) {
				appendText += '; additional information:' + extraInfo;
			}
			if (initialContrib) {
				appendText += '; notified {{user|1=' + initialContrib + '}}';
			}
			appendText += ' ~~~~~\n';

			usl.changeTags = Twinkle.changeTags;
			usl.log(appendText, editsummary);
		}
	}
};

// validate subgroups in the form passed into the speedy deletion tag
Twinkle.speedy.getParameters = function twinklespeedyGetParameters(form, values) {
	var parameters = [];

	$.each(values, function(index, value) {
		var currentParams = [];
		switch (value) {
			case 'reason':
				if (form['csd.reason_1']) {
					var dbrationale = form['csd.reason_1'].value;
					if (!dbrationale || !dbrationale.trim()) {
						alert('Custom rationale:  Please specify a rationale.');
						parameters = null;
						return false;
					}
					currentParams['1'] = dbrationale;
				}
				break;

			case 'İS1':  // U1
				if (form['csd.userreq_rationale']) {
					var u1rationale = form['csd.userreq_rationale'].value;
					if (mw.config.get('wgNamespaceNumber') === 3 && !(/\//).test(mw.config.get('wgTitle')) &&
							(!u1rationale || !u1rationale.trim())) {
						alert('SSK İS1: Xahiş olunur, stifadəçi müzakirə səhifəsinin silmə səbəbini əsaslandırın.');
						parameters = null;
						return false;
					}
					currentParams.rationale = u1rationale;
				}
				break;

			case 'Ü4':  // SNS 
				if (form['csd.repost_xfd']) {
					var deldisc = form['csd.repost_xfd'].value;
					if (deldisc) {
						if (!new RegExp('^:?' + Morebits.namespaceRegex(4) + ':', 'i').test(deldisc)) {
							alert('SSK Ü4: Xahiş olunur, "Vikipediya:" ilə başlayan müzakirə səhifəsini daxil edin.');
							parameters = null;
							return false;
						}
						currentParams.xfd = deldisc;
					}
				}
				break;

			case 'Ü5':  // G5
				if (form['csd.banned_user'] && form['csd.banned_user'].value) {
					currentParams.user = form['csd.banned_user'].value.replace(/^\s*User:/i, '');
				}
				break;

			case 'move':  // G6
				if (form['csd.move_page'] && form['csd.move_reason']) {
					var movepage = form['csd.move_page'].value,
						movereason = form['csd.move_reason'].value;
					if (!movepage || !movepage.trim()) {
						alert('SSK G6 (move):  Please specify the page to be moved here.');
						parameters = null;
						return false;
					}
					if (!movereason || !movereason.trim()) {
						alert('SSK G6 (move):  Please specify the reason for the move.');
						parameters = null;
						return false;
					}
					currentParams.page = movepage;
					currentParams.reason = movereason;
				}
				break;

			case 'sns':  // G6
				if (form['csd.xfd_fullvotepage']) {
					var xfd = form['csd.xfd_fullvotepage'].value;
					if (xfd) {
						if (!new RegExp('^:?' + Morebits.namespaceRegex(4) + ':', 'i').test(xfd)) {
							alert('SSK Ü6 (SNS): Səhifənin silinməsi ilə bağlı aparılan müzakirə ("Vikipediya:" ilə başlamalıdır).');
							parameters = null;
							return false;
						}
						currentParams.fullvotepage = xfd;
					}
				}
				break;

			case 'copypaste':  // G6
				if (form['csd.copypaste_sourcepage']) {
					var copypaste = form['csd.copypaste_sourcepage'].value;
					if (!copypaste || !copypaste.trim()) {
						alert('SSK G6 (copypaste):  Please specify the source page name.');
						parameters = null;
						return false;
					}
					currentParams.sourcepage = copypaste;
				}
				break;

			case 'g6':  // G6
				if (form['csd.g6_rationale'] && form['csd.g6_rationale'].value) {
					currentParams.rationale = form['csd.g6_rationale'].value;
				}
				break;

			case 'author':  // G7
				if (form['csd.author_rationale'] && form['csd.author_rationale'].value) {
					currentParams.rationale = form['csd.author_rationale'].value;
				}
				break;

			case 'ü8':  // G8
				if (form['csd.g8_rationale'] && form['csd.g8_rationale'].value) {
					currentParams.rationale = form['csd.g8_rationale'].value;
				}
				break;

			case 'templatecat':  // G8
				if (form['csd.templatecat_rationale'] && form['csd.templatecat_rationale'].value) {
					currentParams.rationale = form['csd.templatecat_rationale'].value;
				}
				break;

			case 'attack':  // G10
				currentParams.blanked = 'yes';
				// it is actually blanked elsewhere in code, but setting the flag here
				break;

			case 'copyvio':  // G12
				if (form['csd.copyvio_url'] && form['csd.copyvio_url'].value) {
					currentParams.url = form['csd.copyvio_url'].value;
				}
				if (form['csd.copyvio_url2'] && form['csd.copyvio_url2'].value) {
					currentParams.url2 = form['csd.copyvio_url2'].value;
				}
				if (form['csd.copyvio_url3'] && form['csd.copyvio_url3'].value) {
					currentParams.url3 = form['csd.copyvio_url3'].value;
				}
				break;

			case 'Ü13':  // G13
				currentParams.ts = '$TIMESTAMP'; // to be replaced by the last revision timestamp when page is saved
				break;

			case 'redundantimage':  // F1
				if (form['csd.redundantimage_filename']) {
					var redimage = form['csd.redundantimage_filename'].value;
					if (!redimage || !redimage.trim()) {
						alert('SSK F1:  Please specify the filename of the other file.');
						parameters = null;
						return false;
					}
					currentParams.filename = new RegExp('^\\s*' + Morebits.namespaceRegex(6) + ':', 'i').test(redimage) ? redimage : 'File:' + redimage;
				}
				break;

			case 'badfairuse':  // F7
				if (form['csd.badfairuse_rationale'] && form['csd.badfairuse_rationale'].value) {
					currentParams.rationale = form['csd.badfairuse_rationale'].value;
				}
				break;

			case 'commons':  // F8
				if (form['csd.commons_filename']) {
					var filename = form['csd.commons_filename'].value;
					if (filename && filename.trim() && filename !== Morebits.pageNameNorm) {
						currentParams.filename = new RegExp('^\\s*' + Morebits.namespaceRegex(6) + ':', 'i').test(filename) ? filename : 'File:' + filename;
					}
				}
				break;

			case 'imgcopyvio':  // F9
				if (form['csd.imgcopyvio_url'] && form['csd.imgcopyvio_rationale']) {
					var f9url = form['csd.imgcopyvio_url'].value;
					var f9rationale = form['csd.imgcopyvio_rationale'].value;
					if ((!f9url || !f9url.trim()) && (!f9rationale || !f9rationale.trim())) {
						alert('SSK F9: You must enter a url or reason (or both) when nominating a file under F9.');
						parameters = null;
						return false;
					}
					if (form['csd.imgcopyvio_url'].value) {
						currentParams.url = f9url;
					}
					if (form['csd.imgcopyvio_rationale'].value) {
						currentParams.rationale = f9rationale;
					}
				}
				break;

			case 'foreign':  // A2
				if (form['csd.foreign_source']) {
					var foreignlink = form['csd.foreign_source'].value;
					if (!foreignlink || !foreignlink.trim()) {
						alert('SSK A2:  Please specify an interwiki link to the article of which this is a copy.');
						parameters = null;
						return false;
					}
					currentParams.source = foreignlink;
				}
				break;

			case 'transwiki':  // A5
				if (form['csd.transwiki_location'] && form['csd.transwiki_location'].value) {
					currentParams.location = form['csd.transwiki_location'].value;
				}
				break;

			case 'a10':  // A10
				if (form['csd.a10_article']) {
					var duptitle = form['csd.a10_article'].value;
					if (!duptitle || !duptitle.trim()) {
						alert('SSK A10:  Please specify the name of the article which is duplicated.');
						parameters = null;
						return false;
					}
					currentParams.article = duptitle;
				}
				break;

			case 'p1':  // P1
				if (form['csd.p1_criterion']) {
					var criterion = form['csd.p1_criterion'].value;
					if (!criterion || !criterion.trim()) {
						alert('SSK P1:  Please specify a single criterion.');
						parameters = null;
						return false;
					}
					currentParams.criterion = criterion;
				}
				break;

			default:
				break;
		}
		parameters.push(currentParams);
	});
	return parameters;
};

// Function for processing talk page notification template parameters
// key1/value1: for {{db-criterion-[notice|deleted]}} (via {{db-csd-[notice|deleted]-custom}})
// utparams.param: for {{db-[notice|deleted]-multiple}}
Twinkle.speedy.getUserTalkParameters = function twinklespeedyGetUserTalkParameters(normalized, parameters) {
	var utparams = [];

	// Special cases
	if (normalized === 'db') {
		utparams['2'] = parameters['1'];
	} else if (normalized === 'g6') {
		utparams.key1 = 'to';
		utparams.value1 = Morebits.pageNameNorm;
	} else if (normalized === 'g12') {
		['url', 'url2', 'url3'].forEach(function(item, idx) {
			if (parameters[item]) {
				idx++;
				utparams['key' + idx] = item;
				utparams['value' + idx] = utparams[item] = parameters[item];
			}
		});
	} else {
		// Handle the rest
		var param;
		switch (normalized) {
			case 'g4':
				param = 'sns';
				break;
			case 'a2':
				param = 'mənbə';
				break;
			case 'a5':
				param = 'yer';
				break;
			case 'a10':
				param = 'məqalə';
				break;
			case 'f9':
				param = 'url';
				break;
			case 'p1':
				param = 'kriteriya';
				break;
			default:
				break;
		}
		// No harm in providing a usertalk template with the others' parameters
		if (param && parameters[param]) {
			utparams.key1 = param;
			utparams.value1 = utparams[param] = parameters[param];
		}
	}
	return utparams;
};

/**
 * @param {Event} e
 * @returns {Array}
 */
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) {
	var form = e.target.form ? e.target.form : e.target;

	if (e.target.type === 'checkbox' || e.target.type === 'text' ||
			e.target.type === 'select') {
		return;
	}

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

	var values = Twinkle.speedy.resolveCsdValues(e);
	if (!values) {
		return;
	}
	var templateParams = Twinkle.speedy.getParameters(form, values);
	if (!templateParams) {
		return;
	}

	var normalizeds = values.map(function(value) {
		return Twinkle.speedy.normalizeHash[value];
	});

	// analyse each criterion to determine whether to watch the page, prompt for summary, or notify the creator
	var watchPage, promptForSummary;
	normalizeds.forEach(function(norm) {
		if (Twinkle.getPref('watchSpeedyPages').indexOf(norm) !== -1) {
			watchPage = Twinkle.getPref('watchSpeedyExpiry');
		}
		if (Twinkle.getPref('promptForSpeedyDeletionSummary').indexOf(norm) !== -1) {
			promptForSummary = true;
		}
	});

	var warnusertalk = form.warnusertalk.checked && normalizeds.some(function (norm, index) {
		return Twinkle.getPref('warnUserOnSpeedyDelete').indexOf(norm) !== -1 &&
			!(norm === 'g6' && values[index] !== 'copypaste');
	});

	var welcomeuser = warnusertalk && normalizeds.some(function (norm) {
		return Twinkle.getPref('welcomeUserOnSpeedyDeletionNotification').indexOf(norm) !== -1;
	});

	var params = {
		values: values,
		normalizeds: normalizeds,
		watch: watchPage,
		deleteTalkPage: form.talkpage && form.talkpage.checked,
		deleteRedirects: form.redirects.checked,
		warnUser: warnusertalk,
		welcomeuser: welcomeuser,
		promptForSummary: promptForSummary,
		templateParams: templateParams
	};

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

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

Twinkle.speedy.callback.evaluateUser = function twinklespeedyCallbackEvaluateUser(e) {
	var form = e.target.form ? e.target.form : e.target;

	if (e.target.type === 'checkbox' || e.target.type === 'text' ||
			e.target.type === 'select') {
		return;
	}

	var values = Twinkle.speedy.resolveCsdValues(e);
	if (!values) {
		return;
	}
	var templateParams = Twinkle.speedy.getParameters(form, values);
	if (!templateParams) {
		return;
	}

	// var multiple = form.multiple.checked;

	var normalizeds = values.map(function(value) {
		return Twinkle.speedy.normalizeHash[value];
	});

	// analyse each criterion to determine whether to watch the page/notify the creator
	var watchPage = normalizeds.some(function(norm) {
		return Twinkle.getPref('watchSpeedyPages').indexOf(norm) !== -1 && Twinkle.getPref('watchSpeedyExpiry');
	});
	var notifyuser = form.notify.checked && normalizeds.some(function(norm, index) {
		return Twinkle.getPref('notifyUserOnSpeedyDeletionNomination').indexOf(norm) !== -1 &&
			!(norm === 'g6' && values[index] !== 'copypaste');
	});
	var welcomeuser = notifyuser && normalizeds.some(function(norm) {
		return Twinkle.getPref('welcomeUserOnSpeedyDeletionNotification').indexOf(norm) !== -1;
	});
	var csdlog = Twinkle.getPref('logSpeedyNominations') && normalizeds.some(function(norm) {
		return Twinkle.getPref('noLogOnSpeedyNomination').indexOf(norm) === -1;
	});

	var params = {
		values: values,
		normalizeds: normalizeds,
		watch: watchPage,
		usertalk: notifyuser,
		welcomeuser: welcomeuser,
		lognomination: csdlog,
		requestsalt: form.salting.checked,
		templateParams: templateParams
	};

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

	Morebits.wiki.actionCompleted.redirect = mw.config.get('wgPageName');
	Morebits.wiki.actionCompleted.notice = 'İşarələnmə yerinə yetirildi';

	var wikipedia_page = new Morebits.wiki.page(mw.config.get('wgPageName'), 'Səhifə işarələnir');
	wikipedia_page.setChangeTags(Twinkle.changeTags); // Here to apply to triage
	wikipedia_page.setCallbackParameters(params);
	wikipedia_page.load(Twinkle.speedy.callbacks.user.main);
};

Twinkle.addInitCallback(Twinkle.speedy, 'speedy');
})(jQuery);


// </nowiki>
Mənbə — ""

Informasiya Melumat Axtar

Anarim.Az

Sayt Rehberliyi ile Elaqe

Saytdan Istifade Qaydalari

Anarim.Az 2004-2023