مستخدم:Salam32/friendlytag.js: الفرق بين النسختين

من ويكيبيديا، الموسوعة الحرة
تم حذف المحتوى تمت إضافة المحتوى
لا ملخص تعديل
لا ملخص تعديل
سطر 47: سطر 47:
isRedirect = true;
isRedirect = true;
addPortletLink( 'p-cactions', "javascript:friendlytag.callback()", "Tag", "friendly-tag", "Tag redirect", "");
addPortletLink( 'p-cactions', "javascript:friendlytag.callback()", "Tag", "friendly-tag", "Tag redirect", "");
} else if( wgNamespaceNumber != 0 || wgCurRevisionId == false ) {
} else if( wgNamespaceNumber == 0 || wgCurRevisionId == false ) {
return;
return;
} else {
} else {

نسخة 15:42، 6 يوليو 2010

// <nowiki>
// If FriendlyConfig aint exist.
if( typeof( FriendlyConfig ) == 'undefined' ) {
	FriendlyConfig = {};
}

/**
 FriendlyConfig.summaryAd ( string )
 If ad should be added or not to summary, default [[وب:فرندلي|فرندلي]]
 */
if( typeof( FriendlyConfig.summaryAd ) == 'undefined' ) {
	FriendlyConfig.summaryAd = " باستخدام [[وب:فرندلي|فرندلي]]";
}

/**
 FriendlyConfig.groupByDefault ( boolean )
 */
if( typeof( FriendlyConfig.groupByDefault ) == 'undefined' ) {
	FriendlyConfig.groupByDefault = true;
}

/**
 FriendlyConfig.watchTaggedPages ( boolean )
 */
if( typeof( FriendlyConfig.watchTaggedPages ) == 'undefined' ) {
	FriendlyConfig.watchTaggedPages = true;
}

/**
 FriendlyConfig.markTaggedPagesAsMinor ( boolean )
 */
if( typeof( FriendlyConfig.markTaggedPagesAsMinor ) == 'undefined' ) {
	FriendlyConfig.markTaggedPagesAsMinor = true;
}

/**
 FriendlyConfig.markTaggedPagesAsPatrolled ( boolean )
 */
if( typeof( FriendlyConfig.markTaggedPagesAsPatrolled ) == 'undefined' ) {
	FriendlyConfig.markTaggedPagesAsPatrolled = true;
}

var isRedirect = false;

function friendlytag() {
	if( QueryString.exists( 'redirect' ) && QueryString.get( 'redirect' ) == 'no' && !QueryString.exists( 'rcid' ) ) {
		isRedirect = true;
		addPortletLink( 'p-cactions', "javascript:friendlytag.callback()", "Tag", "friendly-tag", "Tag redirect", "");
	} else if( wgNamespaceNumber == 0 || wgCurRevisionId == false ) {
		return;
	} else {
		addPortletLink( 'p-cactions', "javascript:friendlytag.callback()", "Tag", "friendly-tag", "Tag article", "");
	}
}

addOnloadHook(friendlytag);

friendlytag.callback = function friendlytagCallback( uid ) {
	var Window = new SimpleWindow( 600, 400 );
	var form = new QuickForm( friendlytag.callback.evaluate );

	if( !isRedirect ) {
		Window.setTitle( "وسم المقالات بقوالب صيانة" );

		form.append( {
				type: 'checkbox',
				list: [
					{
						label: 'اجمع القوالب في {{article issues}} إذا أمكن',
						value: 'group',
						name: 'group',
						tooltip: 'إذا تم استخدام ثلاثة قوالب أو أكثر تدعمها قالب {{article issues}} وتم اختيار هذا خيار، كل القوالب التي تدعم هذا القالب سيتم جمعهم في قالب {{article issues}}.',
						disabled: true
					}
				]
			}
		);

		form.append( { type:'submit', label:'أرسل' } );

		form.append( { type:'header', label:'قوالب صيانة' } );
		form.append( { type:'checkbox', name: 'maintenance', list: friendlytag.maintenanceList } );

		form.append( { type:'header', label:'قوالب مشاكل' } );
		form.append( { type:'checkbox', name: 'problem', list: friendlytag.problemList } );

		form.append( { type:'header', label:'قوالب تنبيه' } );
		form.append( { type:'checkbox', name: 'notice', list: friendlytag.noticeList } );

		if( typeof( FriendlyConfig.customTagList ) == 'object' ) {
			form.append( { type:'header', label:'قوالب مخصصة' } );
			form.append( { type: 'checkbox', name: 'custom', list: FriendlyConfig.customTagList } );
		}
	} else {
		Window.setTitle( "وسم التحويلات" );

		form.append( { type:'submit', label:'أرسل' } );

		form.append( { type:'header', label:'قوالب لغوية' } );
		form.append( { type:'checkbox', name: 'spelling', list: friendlytag.spellingList } );

		form.append( { type:'header', label:'قوالب تسمية بديلة' } );
		form.append( { type:'checkbox', name: 'alternative', list: friendlytag.alternativeList } );

		form.append( { type:'header', label:'قوالب تحويل متنوعة وإدارية' } );
		form.append( { type:'checkbox', name: 'administrative', list: friendlytag.administrativeList } );
	}

	form.append( { type:'submit', label:'أرسل' } );

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

friendlytag.maintenanceList = [
	{
		label: '\{\{catimprove\}\}: المقالة قد تحتاج للمزيد من التصنيف.',
		value: 'catimprove'
	},
	{
		label: '\{\{cleanup\}\}: المقالة قد تحتاج للتنظيف',
		value: 'cleanup'
	},
	{
		label: '\{\{confusing\}\}: المقالة قد تكون مربكة أو غير واضحة',
		value: 'confusing'
	},
	{
		label: '\{\{copyedit\}\}: المقالة قد تحتاج للتحرير بسبب النحو، النمط، التماسك، اللهجة، أو التهجئة',
		value: 'copyedit'
	},
	{
		label: '\{\{citation style\}\}: المقالة تحتوي على مصادر متضمنة غير واضحة أو متضاربة',
		value: 'citation style'
	},
	{
		label: '\{\{deadend\}\}: المقالة لا تحتوي علة وصلات داخلية أو القليل منها',
		value: 'deadend'
	},
	{
		label: '\{\{do-attempt\}\}: لا يوجد مقالات تصل إلى هذه المقالة أو القليل من المقالات تصل إليها',
		value: 'do-attempt'
	},
	{
		label: '\{\{essay-like\}\}: المقالة مكتوبة بأسلوب مقالة أدبية وتحتاج للتنظيف',
		value: 'essay-like'
	},
	{
		label: '\{\{expand\}\}: المقالة تحتاج للتوسيع',
		value: 'expand' 
	},
	{
		label: '\{\{expert\}\}: المقالة تحتاج للاهتمام من قبل شخص مختص بالموضوع',
		value: 'expert'
	},
	{
		label: '\{\{fansite\}\}: المقالة تشبه موقعا للمعجبين',
		value: 'fansite'
	},
	{
		label: '\{\{in-universe\}\}: المقالة عن موضوع خيالي وتحتاج لإعادة الكتابة بأسلوب غير خيالاي',
		value: 'in-universe'
	},
	{
		label: '\{\{internallinks\}\}: المقالة تحتاج لوصلات خارجية أكثر ذات صلة بالموضوع',
		value: 'internallinks'
	},
	{
		label: '\{\{intro-missing\}\}: المقالة لا تحتوي على قسم رئيسي',
		value: 'intromissing'
	},
	{
		label: '\{\{intro-toolong\}\}: مقدمة المقالة طويلة جدا وتحتاج للتقصير',
		value: 'intro length'
	},
	{
		label: '\{\{intro-tooshort\}\}: مقدمة المقالة قصيرة جدا وتحتاج للتطويل',
		value: 'tooshort'
	},
	{
		label: '\{\{intro-rewrite\}\}: القسم الرئيسي من هذه المقالة مكتوب بأسلوب المبادئ التوجيهية',
		value: 'introrewrite'
	},
	{
		label: '\{\{morefootnotes\}\}: المقالة تحتوي على مصادر ولكن لا تحتوي على توثيق مضمن كافي',
		value: 'morefootnotes'
	},
	{
		label: '\{\{nofootnotes\}\}: المقالة تحتوي على مصادر ولكن لا تحتوي على توثيق مضمن',
		value: 'nofootnotes'
	},
	{
		label: '\{\{notarabic\}\}: المقالة مكتوبة بلغير غير العربية وبحاجة للترجمة',
		value: 'notarabic'
	},
	{
		label: '\{\{orphan\}\}: لا يوجد مقالات تصل إلى هذه المقالة أو القليل من المقالات تصل إليها',
		value: 'orphan' 
	},
	{
		label: '\{\{plot\}\}: ملخص أحداث الرواية أو الفيلم طويل جدا',
		value: 'plot' 
	},
	{
		label: '\{\{prose\}\}: المقالة مكتوبة بعدة أنماط و من الأحسن عرضها بأسلوب النثر',
		value: 'prose'
	},
	{
		label: '\{\{pov-check\}\}: رشح المقالة ليتم تدقيقها بسبب الحيادية',
		value: 'pov-check'
	},
	{
		label: '\{\{sections\}\}: المقالة تحتاج للتقسيم إلى أجزاء',
		value: 'sections'
	},
	{
		label: '\{\{tone\}\}: لهجة المقالة غير لائقة',
		value: 'tone'
	},
	{
		label: '\{\{uncategorized\}\}: المقالة غير مصنفة',
		value: 'uncategorized'
	},
	{
		label: '\{\{verylong\}\}: المقالة طويلة جدا',
		value: 'verylong'
	},
	{
		label: '\{\{wikify\}\}: المقالة بحاجة للتنسيق',
		value: 'wikify'
	}
];


friendlytag.problemList = [
	{
		label: '\{\{advert\}\}: المقالة مكتوبة بأسلوب الترويج',
		value: 'advert'
	},
	{
		label: '\{\{autobiography\}\}: المقالة هي عن سيرة ذاتية وقد لا تكون من وجهة نظر حيادية',
		value: 'autobiography'
	},
	{
		label: '\{\{coi\}\}: لدى كاتب المقالة أو المساهم الأكبر تضارب في المصالح',
		value: 'coi'
	},
	{
		label: '\{\{context\}\}: المقالة لا تحتوي على السياق الكافي',
		value: 'context'
	},/*
	{
		label: '\{\{copypaste\}\}: يبدو أن المقالة قد تم نسخها ولسقها من مصدر آخر',
		value: 'copypaste'
	},*/
	{
		label: '\{\{disputed\}\}: المقالة مشكوك في دقة واقعيتها',
		value: 'disputed'
	},
	{
		label: '\{\{external links\}\}: وصلات المقالة الخارجية قد لا تتوافق مع سياسة المحتوى أو المبادئ التوجيهية',
		value: 'external links'
	},
	{
		label: '\{\{globalize\}\}: المقالة قد لا تمثل النظرة العالمية للموضوع',
		value: 'globalize',
		subgroup: {
			name: 'globalize',
			type: 'select',
			list: [
				{
					label: "\{\{globalize\}\}: المقالة قد لا تمثل النظرة العالمية للموضوع",
					value: "globalize"
				}/*,
				{
					label: "قوالب \{\{globalize\}\} مخصصة حسب المناطق",
					list: [
						{
							label: "\{\{globalize/Australia\}\}: المقالة تتكلم بشكل رئيسي عن وجهة نظر أسترالية",
							value: "globalize/Australia"
						},
						{
							label: "\{\{globalize/Belgium\}\}: المقالة تتكلم بشكل رئيسي عن وجهة نظر بلجيكية",
							value: "globalize/Belgium"
						},
						{
							label: "\{\{globalize/Canada\}\}: المقالة تتكلم بشكل رئيسي عن وجهة نظر كندية",
							value: "globalize/Canada"
						},
						{
							label: "\{\{globalize/Common law\}\}: المقالة تتكلم بشكل رئيسي عن وجهة نظر القانون العام",
							value: "globalize/Common law"
						},
						{
							label: "\{\{globalize/Eng\}\}: المقالة تتكلم بشكل رئيسي عن وجهة نظر متكلمي الإنجليزية",
							value: "globalize/Eng"
						},
						{
							label: "\{\{globalize/Europe\}\}: المقالة تتكلم بشكل رئيسي عن وجهة نظر أوروبية",
							value: "globalize/Europe"
						},
						{
							label: "\{\{globalize/France\}\}: المقالة تتكلم بشكل رئيسي عن وجهة نظر فرنسية",
							value: "globalize/France"
						},
						{
							label: "\{\{globalize/Germany\}\}: المقالة تتكلم بشكل رئيسي عن وجهة نظر ألمانية",
							value: "globalize/Germany"
						},
						{
							label: "\{\{globalize/Greece\}\}: المقالة تتكلم بشكل رئيسي عن وجهة نظر يونانية",
							value: "globalize/Greece"
						},
						{
							label: "\{\{globalize/Luxembourg\}\}: المقالة تتكلم بشكل رئيسي عن وجهة نظر لكسمبوغية",
							value: "globalize/Luxembourg"
						},
						{
							label: "\{\{globalize/Netherlands\}\}: المقالة تتكلم بشكل رئيسي عن وجهة نظر هلندية",
							value: "globalize/Netherlands"
						},
						{
							label: "\{\{globalize/North America\}\}: المقالة تتكلم بشكل رئيسي عن وجهة نظر شمكال أمريكية",
							value: "globalize/North America"
						},
						{
							label: "\{\{globalize/Northern\}\}: المقالة تتكلم بشكل رئيسي عن وجهة نظر الدول الشمالية",
							value: "globalize/Northern"
						},
						{
							label: "\{\{globalize/Russia\}\}: المقالة تتكلم بشكل رئيسي عن وجهة نظر روسية",
							value: "globalize/Russia"
						},
						{
							label: "\{\{globalize/Southern\}\}: المقالة تتكلم بشكل رئيسي عن وجهة نظر الدول الجنوبية",
							value: "globalize/Southern"
						},
						{
							label: "\{\{globalize/UK\}\}: المقالة تتكلم بشكل رئيسي عن وجهة نظر بريطانية",
							value: "globalize/UK"
						},
						{
							label: "\{\{globalize/UK and Canada\}\}: المقالة تتكلم بشكل رئيسي عن وجهة نظر بريطانية وكندية",
							value: "globalize/UK and Canada"
						},
						{
							label: "\{\{globalize/USA\}\}: المقالة تتكلم بشكل رئيسي عن وجهة نظر أمريكية",
							value: "globalize/USA"
						}
					]
				}*/
			]
		}
	},
	{
		label: '\{\{hoax\}\}: قد تكون المقالة خدعة',
		value: 'hoax'
	},
	{
		label: '\{\{notability\}\}: موضوع المقالة قد لا يحقق معيير الملحوظية',
		value: 'notability',
		subgroup: {
			name: 'notability',
			type: 'select',
			list: [
				{
					label: "\{\{notability\}\}: موضوع المقالة قد لا يحقق معيير الملحوظية",
					value: "none"
				}/*,
				{
					label: "\{\{notability|Academics\}\}: ملحوظية أكاديمية",
					value: "Academics"
				},
				{
					label: "\{\{notability|Biographies\}\}: ملحوظية السير الذاتية",
					value: "Biographies"
				},
				{
					label: "\{\{notability|Books\}\}: ملحوظية الكتب",
					value: "Books"
				},
				{
					label: "\{\{notability|Companies\}\}: ملحوظية المؤسسات والشركات",
					value: "Companies"
				},
				{
					label: "\{\{notability|Episode\}\}: ملحوظية حلقات المسلسلات التلفزيونية",
					value: "Episode"
				},
				{
					label: "\{\{notability|Fiction\}\}: ملحوظية المواضيع الخيالية",
					value: "Fiction"
				},
				{
					label: "\{\{notability|Films\}\}: ولحوظية الأفلام",
					value: "Films"
				},
				{
					label: "\{\{notability|Institutions\}\}: مرادف لقالب الشركات",
					value: "Institutions"
				},
				{
					label: "\{\{notability|Music\}\}: ملحوظية موسيقية",
					value: "Music"
				},
				{
					label: "\{\{notability|Neologisms\}\}: ملحوظية الكلمات الجديدة",
					value: "Neologisms"
				},
				{
					label: "\{\{notability|Numbers\}\}: ملحوظية الأرقام",
					value: "Numbers"
				},
				{
					label: "\{\{notability|Organizations\}\}: مرادف لقالب الشركات",
					value: "Organizations"
				},
				{
					label: "\{\{notability|Products\}\}: ملحوظية المنتجات والخدمات",
					value: "Products"
				},
				{
					label: "\{\{notability|Web\}\}: ملحوظية محتويات الوب",
					value: "Web"
				}*/
			]
		}
	},
	{
		label: '\{\{npov\}\}: المقالة لا ليست من وجهة نظر حيادية',
		value: 'npov'
	},
	{
		label: '\{\{one source\}\}: المقالة مبنية بحجم كبير علة مصدر واحد',
		value: 'one source'
	},
	{
		label: '\{\{original research\}\}: المقالة تحتوي على أبحاث أصلية',
		value: 'original research'
	},/*
	{
		label: '\{\{overcoverage\}\}: الأمثلة ووجهات النظر في هذه المقالة قد تكون متحيزة أو أو تغطية على نحو غير متكافئ',
		value: 'overcoverage'
	},*/
	{
		label: '\{\{peacock\}\}: المقالة قد تحتوي على عبارات تباهي لا تضيف إلى مقالة معلومات مفيدة',
		value: 'peacock'
	},/*
	{
		label: '\{\{primarysources\}\}: المقالة تحتاج لمصادر معتمدة ذات طرف ثالث',
		value: 'primarysources'
	},
	{
		label: "\{\{recentism\}\}: المقالة تميل نحو أحداث جارية",
		value: "recentism"
	},*/
	{ 
		label: '\{\{refimprove\}\}: المقالة تحتاج لمصادر وتوثيق إضافي للتحقق منها',
		value: 'refimprove' 
	},/*
	{ 
		label: '\{\{refimproveBLP\}\}: السيرة الذاتية تحتاج للمزيد من مصادر والمراجع لتأكيدها',
		value: 'refimproveBLP' 
	},
	{
		label: '\{\{self-published\}\}: المقالة تحتوي على مصادر غير صحيح أو منشورة ذاتيا',
		value: 'self-published'
	},
	{
		label: '\{\{synthesis\}\}: المقالة تحتوي على توليف لم ينشر لمواد تم نشرها التي تبلغ أفكار مجهولة الهوية',
		value: 'synthesis'
	},
	{
		label: "\{\{toofewopinions\}\}: المقالة قد لا تحتوي على وجهات نظر هامة",
		value: "toofewopinions"
	},*/
	{
		label: '\{\{unencyclopedic\}\}: المقالة تحتوي على مواد غير موسوعية',
		value: 'unencyclopedic'
	},
	{
		label: '\{\{unreferenced\}\}: المقالة لا تحتوي على أي مصدر',
		value: 'unreferenced'
	},/*
	{
		label: '\{\{unreferencedBLP\}\}: السيرة الذاتية لا تحتوي على أي مصدر',
		value: 'unreferencedBLP'
	},*/
	{
		label: '\{\{update\}\}: معلومات المقالة قديمة ',
		value: 'update'
	},
	{
		label: '\{\{weasel\}\}: جودة المقالة قد تتأثر باستخدام عبارات مراوغة',
		value: 'weasel'
	}
];

friendlytag.noticeList = [
	{
		label: '\{\{current\}\}: المقالة توثق أحداثا جارية',
		value: 'current',
		subgroup: {
			name: 'current',
			type: 'select',
			list: [
				{
					label: "\{\{current\}\}: المقالة توثق أحداثا جارية",
					value: "current"
				}/*,
				{
					label: "\{\{current person\}\}:المقالة هي عن شخص مشارك في أحداث جارية",
					value: "current person"
				},
				{
					label: "\{\{current spaceflight\}\}: المقالة أو قسم منها يوثق رحلة فضائية جارية",
					value: "current spaceflight"
				},
				{
					label: "\{\{current sport\}\}: المقالة توثق حدث رياضي جاري",
					value: "current sport"
				},
				{
					label: "\{\{current related\}\}: المقالة تتعلق بحدث جاري",
					value: "current related"
				},
				{
					label: "\{\{recent death\}\}: المقالة تتكلم عن شخص توفي مؤخرا",
					value: "recent death"
				}*/
			]
		}
	},
/*	{
		label: '\{\{goceinuse\}\}: article is currently undergoing a major copy edit by the Guild of Copy Editors',
		value: 'goceinuse' },*/
	{
		label: '\{\{inuse\}\}: المقالة تخضع لتحرير كثيف لمدة قصيرة',
		value: 'inuse' }/*,
	{
		label: '\{\{underconstruction\}\}: المقالة تخضع حاليا لتوسيع أو تجديد أساسي',
		value: 'underconstruction' }*/
];


friendlytag.spellingList = [
	{
		label: '\{\{R from abbreviation\}\}: تحويال من عنوان مختصر',
		value: 'R from abbreviation' 
	},
	{
		label: '\{\{R to list entry\}\}: تحويل لنوع من المقالات تتألف من \"قائمة من الكيانات الصغيرة\" التي هي مجموعة من تفاصيل عن مواضيع ليس لها ملحوظية كافية لتحصل على مقالات خاصة بها',
		value: 'R to list entry' 
	},
	{
		label: '\{\{R to section\}\}: مشابه لقالب  \{\{R to list entry\}\}، توجد القائمة في قسم من المقالة الرئيسية، مثل قائمة عن الشخصيات الخيالية في فيلم خيالي.',
		value: 'R to section' 
	},
	{
		label: '\{\{R from misspelling\}\}: تحويل من خطأ مطبعي أو إملائي',
		value: 'R from misspelling' 
	},/*
	{
		label: '\{\{R from alternative spelling\}\}: redirect from a title with a different spelling',
		value: 'R from alternative spelling' 
	},*/
	{
		label: '\{\{R from plural\}\}: تحويل من كلمة الجمع إلى كلمة مفردة',
		value: 'R from plural' 
	},
	{
		label: '\{\{R from related word\}\}: تحويل من كلمة ذات صلة',
		value: 'R from related word' 
	},
	{
		label: '\{\{R with possibilities\}\}: تحويل من عنوان لموضوع مفصل أكثر من الموجود في المقالة الهدف، أوقسم من تلك المقالة، أي شيئا يمكن وينبغي توسيعه',
		value: 'R with possibilities' 
	},
	{
		label: '\{\{R from member\}\}: تحويل من شخص عضون في مجموعة إلى موضوع شامل ذو صلة، مثل المجموعة التي ينتمي إليها، مؤسسة’ طاقم أو الفريق الذي ينتمي إليه',
		value: 'R from member' 
	}/*,
	{
		label: '\{\{R from other capitalisation\}\}: redirect from a title with another method of capitalisation',
		value: 'R from other capitalisation'
	}*/
];

friendlytag.alternativeList = [
	{
		label: '\{\{R from alternative name\}\}: تحويل من عنوان الذي هو اسم مستعار، لقب أو مرادف للمقالة الهدف',
		value: 'R from alternative name' 
	},
	{
		label: '\{\{R from full name\}\}: تحويل من عنوان الذي هو الأشمل أو أكثر شمولا للمقالة الهدف',
		value: 'R from full name' 
	},
	{
		label: '\{\{R from surname\}\}: تحويل من عنوان الذي هو اسم العائلة',
		value: 'R from surname' 
	},
	{
		label: '\{\{R from historic name\}\}: تحويل من عنوان الذي هو اسم مستعار، لقب أو مرادف للمقالة الهدف وله تاريخ ماضي مهم لكونه منطقة، ولاية، إمارة، مدينة، ولكن تم تصنيف المنطقة في العصر الحديث كبلدية، مقاطعة أو ولاية، أو تم تغير اسمها على مر الزمن',
		value: 'R from historic name' 
	},
	{
		label: '\{\{R from scientific name\}\}: تحويل من اسم علمي إلى اسم شائع',
		value: 'R from scientific name' 
	},
	{
		label: '\{\{R to scientific name\}\}: تحويل من اسم شائع إلى اسم علمي',
		value: 'R to scientific name' 
	},
	{
		label: '\{\{R from name and country\}\}: تحويل من اسم محدد إلى اسم مختصر',
		value: 'R from name and country' 
	},
	{
		label: '\{\{R from alternative language\}\}: تحويل من اسم باللغة العربية إلى اسم بلغة أجنبية أو عكسها',
		value: 'R from alternative language' 
	},/*
	{
		label: '\{\{R from ASCII\}\}: redirect from a title in basic ASCII to the formal article title, with differences that are not diacritical marks (accents, umlauts, etc.)',
		value: 'R from ASCII' 
	},*/
	{
		label: '\{\{R from title without diacritics\}\}: تحويل من عنوان يحوي علامات التشكيل',
		value: 'R from title without diacritics'
	}
];

friendlytag.administrativeList = [
	{
		label: '\{\{R from merge\}\}: تحويل من مقالة تم دمجة للحفاظ على تاريخ التعديلات',
		value: 'R from merge' 
	},
	{
		label: '\{\{R to disambiguation page\}\}: تحويل من صفحة لصفحة توضيح',
		value: 'R to disambiguation page' 
	},
	{
		label: '\{\{R from duplicated article\}\}: تحويل لمقالة مشابهة للحفاظ على تاريخ التعديلات',
		value: 'R from duplicated article' 
	},
	{
		label: '\{\{R to decade\}\}: تحويل من صفحة سنة إلى صفحة عقد',
		value: 'R to decade' 
	},
	{
		label: '\{\{R from shortcut\}\}: تحويل من اختصار لصفحة ويكيبيديا',
		value: 'R from shortcut' 
	},/*
	{
		label: '\{\{R from CamelCase\}\}: redirect from a CamelCase title',
		value: 'R from CamelCase' 
	},
	{
		label: '\{\{R from EXIF\}\}: redirect of a wikilink created from JPEG EXIF information (i.e. the \"metadata\" section on some image description pages)',
		value: 'R from EXIF' 
	},*/
	{
		label: '\{\{R from school\}\}: تحويل من صفحة عنة مدرسة تحتوي على القليل من المعلومات',
		value: 'R from school'
	}
];

// Set to true if template can be grouped into {{articleissues}}
friendlytag.groupHash = {
	'3O': true,
	'advert': true,
	'autobiography': true,
	'biased': true,
	'blpdispute': true,
	'BLPrefimprove': true,
	'BLPsources': true,
	'BLP sources': true,
	'BLPunsourced': true,
	'BLPunreferenced': true,
	'BLPunref': true,
	'citations missing': true,
	'citationstyle': true,
	'citecheck': true,
	'cleanup': true,
	'COI': true,
	'coi': true,
	'colloquial': true,
	'confusing': true,
	'context': true,
	'contradict': true,
	'copyedit': true,
	'citation style': true,
	'criticisms': true,
	'crystal': true,
	'deadend': true,
	'disputed': true,
	'do-attempt': true,
	'essay': true,
	'essay-like': true,
	'examplefarm': true,
	'expand': true,
	'expert': false,
	'external links': true,
	'fancruft': true,
	'fansite': true,
	'fiction': true,
	'gameguide': true,
	'globalize': true,
	'grammar': true,
	'histinfo': true,
	'hoax': true,
	'howto': true,
	'importance': true,
	'inappropriate person': true,
	'incomplete': true,
	'intro length': true,
	'intromissing': true,
	'introrewrite': true,
	'intro-toolong': true,
	'intro-tooshort': true,
	'in-universe': true,
	'jargon': true,
	'laundry': true,
	'laundrylists': true,
	'likeresume': true,
	'long': true,
	'newsrelease': true,
	'notability': true,
	'notable': true,
	'NPOV': true,
	'npov': true,
	'one source': true,
	'OR': true,
	'or': true,
	'original research': true,
	'out of date': true,
	'peacock': true,
	'plot': true,
	'POV': true,
	'pov': true,
	'primarysources': true,
	'prose': true,
	'proseline': true,
	'quotefarm': true,
	'recentism': true,
	'refimprove': true,
	'refimproveBLP': true,
	'restructure': true,
	'review': true,
	'rewrite': true,
	'roughtranslation': true,
	'sections': true,
	'self-published': true,
	'spam': true,
	'story': true,
	'synthesis': true,
	'technical': true,
	'tone': true,
	'toolong': true,
	'tooshort': true,
	'travelguide': true,
	'trivia': true,
	'unbalanced': true,
	'unencyclopedic': true,
	'unref': true,
	'unreferenced': true,
	'unrefBLP': true,
	'unreferencedBLP': true,
	'update': true,
	'verylong': true,
	'weasel': true,
	'wikify': true
}

friendlytag.callbacks = {
	main: function( self ) {
		var form = self.responseXML.getElementById( 'editform' );
		var tagRe, text = '', summaryText = 'اضافة';
		var tags = new Array(), groupableTags = new Array();

		if( !isRedirect ) {
			// Check for preexisting tags and separate tags into groupable and non-groupable arrays
			Status.info( 'ملاحظة', 'يتم التأكد من الوسم الموجود في المقالة' );
			for( var i = 0; i < self.params.tags.length; i++ ) {
				tagRe = new RegExp( '(\\{\\{' + self.params.tags[i] + '(\\||\\}\\}))', 'im' );
				if( !tagRe.exec( form.wpTextbox1.value ) ) {
					if( friendlytag.groupHash[ self.params.tags[i] ] ) {
						groupableTags = groupableTags.concat( self.params.tags[i] );
					} else {
						tags = tags.concat( self.params.tags[i] );
					}
				} else {
					Status.info( 'ملاحظة', 'تم العثور على \{\{' + self.params.tags[i]
						+ '\}\} في المقالة...تم استبعاد القالب' );
				}
			}

			if( self.params.group && groupableTags.length >= 3 ) {
				Status.info( 'ملاحظة', 'يتم تجميع القوالب التي تدعم \{\{article issues\}\}' );

				groupableTags.sort();
				text += '\{\{article issues|article=yes';
				summaryText += ' \{\{[[Template:article issues|article issues]]\}\} مع المعلمات';
				for( var i = 0; i < groupableTags.length; i++ ) {
					text += '|' + groupableTags[i]
					+ '=\{\{subst:CURRENTMONTHNAME\}\} \{\{subst:CURRENTYEAR\}\}';

					if( i == (groupableTags.length - 1) ) {
						summaryText += ' و';
					} else if ( i < (groupableTags.length - 1) && i != 0 ) {
						summaryText += ',';
					}
					summaryText += ' ' + groupableTags[i];
				}
				text += '\}\}\n';
			} else {
				tags = tags.concat( groupableTags );
			}
		} else {
			// Check for preexisting tags
			Status.info( 'ملاحظة', 'يتم التأكد من الوسم الموجود في التحويل' );
			for( var i = 0; i < self.params.tags.length; i++ ) {
				tagRe = new RegExp( '(\\{\\{' + self.params.tags[i] + '(\\||\\}\\}))', 'im' );
				if( !tagRe.exec( form.wpTextbox1.value ) ) {
					tags = tags.concat( self.params.tags[i] );
				} else {
					Status.info( 'ملاحظة', 'تم العثور على \{\{' + self.params.tags[i]
						+ '\}\} في التحويل...تم استبعاد القالب' );
				}
			}
		}

		tags.sort();
		for( var i = 0; i < tags.length; i++ ) {
			if( tags[i] == 'uncategorized' || tags[i] == 'catimprove' ) {
				form.wpTextbox1.value += '\n\n\{\{' + tags[i]
				+ '|تاريخ=\{\{subst:CURRENTMONTHNAME\}\} \{\{subst:CURRENTYEAR\}\}\}\}';
			} else {
				if( tags[i] == 'globalize' ) {
					text += '\{\{' + self.params.globalizeSubcategory;
				} else if( tags[i] == 'current' ) {
					text += '\{\{' + self.params.currentSubcategory;
				} else {
					text += ( isRedirect ? '\n' : '' ) + '\{\{' + tags[i];
				}

				if( tags[i] == 'notability' && self.params.notabilitySubcategory != 'none' ) {
					text += '|' + self.params.notabilitySubcategory;
				} else {
					text += isRedirect ? '\}\}' : '|تاريخ=\{\{subst:CURRENTMONTHNAME\}\} \{\{subst:CURRENTYEAR\}\}\}\}\n';
				}
			}

			if( i == (tags.length - 1) && ( i > 0 || groupableTags.length > 3 ) ) {
				summaryText += ' و';
			} else if ( i < (tags.length - 1) && ( i != 0 || groupableTags.length > 3 ) ) {
				summaryText += ',';
			}

			summaryText += ' \{\{[[Template:';
			if( tags[i] == 'globalize' ) {
				summaryText += self.params.globalizeSubcategory + '|' + self.params.globalizeSubcategory;			
			} else if( tags[i] == 'current' ) {
				summaryText += self.params.currentSubcategory + '|' + self.params.currentSubcategory;
			} else {
				summaryText += tags[i] + '|' + tags[i];
			}
			summaryText += ']]\}\}';
		}

		if( !isRedirect ) {
			//smartly insert the new tags after any hatnotes. Regex is a bit more
			//complicated than it'd need to be, to allow templates as parameters,
			//and to handle whitespace properly.
			text = form.wpTextbox1.value.replace(/^\s*(?:((?:\s*{{\s*(?:about|dablink|distinguish|for|other(?:hurricaneuses|people|persons|places|uses(?:of)?)|redirect(?:-acronym)?|see also|selfref|the)\d*\s*(\|(?:{{[^{}]*}}|[^{}])*)?}})+(?:\s*\n)?)\s*)?/i, "$1"+text);
		} else {
			text = form.wpTextbox1.value + text;
		}
		summaryText += ' إلى ' + ( isRedirect ? 'التحويل' : 'المقالة' ) + FriendlyConfig.summaryAd;

		var postData = {
			'wpMinoredit': FriendlyConfig.markTaggedPagesAsMinor ? 1 : undefined,
			'wpWatchthis': form.wpWatchthis.checked ? 1 : (FriendlyConfig.watchTaggedPages ? 1 : undefined),
			'wpStarttime': form.wpStarttime.value,
			'wpEdittime': form.wpEdittime.value,
			'wpAutoSummary': form.wpAutoSummary.value,
			'wpEditToken': form.wpEditToken.value,
			'wpSummary': summaryText,
			'wpTextbox1': text
		};

		self.post( postData );
		
		if( FriendlyConfig.markTaggedPagesAsPatrolled && self.params.rcid != '' ) {
			var query = {
				'title': wgPageName,
				'action': 'markpatrolled',
				'rcid': self.params.rcid
			};

			var wikipedia_wiki = new Wikipedia.wiki( 'يتم التعليم على أن الصفحة مراجعة', query );
			wikipedia_wiki.post();
		}
	}
}

friendlytag.callback.evaluate = function friendlytagCallbackEvaluate(e) {
	var form = e.target;
	if( isRedirect ) {
		var tags = form.getChecked( 'administrative' ).concat( form.getChecked( 'alternative' ) ).concat( form.getChecked( 'spelling' ) );
	} else {
		if( typeof( FriendlyConfig.customTagList ) == 'object' ) {
			var tags = form.getChecked( 'notice' ).concat( form.getChecked( 'problem' ) ).concat( form.getChecked( 'maintenance' ) ).concat( form.getChecked( 'custom' ) );
		} else {
			var tags = form.getChecked( 'notice' ).concat( form.getChecked( 'problem' ) ).concat( form.getChecked( 'maintenance' ) );
		}
		var globalizeSubcategory = form.getChecked( 'problem.globalize' );
		var notabilitySubcategory = form.getChecked( 'problem.notability' );
		var currentSubcategory = form.getChecked( 'notice.current' );
	}
	var params;

	if( tags.length == 0 ) {
		alert( 'ينبغ اختيار قالب واحد على الأقل!' );
		return;
	}
	if( !isRedirect ) {
		params = {
			tags: tags,
			group: form.group.checked,
			globalizeSubcategory: globalizeSubcategory ? globalizeSubcategory[0] : null,
			notabilitySubcategory: notabilitySubcategory ? notabilitySubcategory[0] : null,
			currentSubcategory: currentSubcategory ? currentSubcategory[0] : null,
			rcid: QueryString.exists( 'rcid' ) ? QueryString.get( 'rcid' ) : ''
		}
	} else {
		params = {
			tags: tags,
			rcid: QueryString.exists( 'rcid' ) ? QueryString.get( 'rcid' ) : ''
		}
	}

	Status.init( form );

	var query = { 
		'title': wgPageName, 
		'action': 'submit'
	};
	Wikipedia.actionCompleted.redirect = wgPageName;
	Wikipedia.actionCompleted.notice = "تم الوسم، يتم إعادة فتح الصفحة";
	var wikipedia_wiki = new Wikipedia.wiki( 'يتم تعديل الصفحة', query, friendlytag.callbacks.main );
	wikipedia_wiki.params = params;
	wikipedia_wiki.get();
}
// </nowiki>