مدیاویکی:Gadget-UserMessages.js: تفاوت میان نسخهها
ظاهر
imported>Jeeputer |
imported>Huji تبدیل به dot notation برای فرونشانی تذکرات Ace Editor |
||
| خط ۵۶: | خط ۵۶: | ||
this.buttons = []; | this.buttons = []; | ||
this.buttons | this.buttons.Groups = []; | ||
this.buttons | this.buttons.Noobs = []; | ||
this.buttons | this.buttons.Warnings = []; | ||
this.buttons | this.buttons.Tools = []; | ||
this.buttons | this.buttons.Article = []; | ||
this.buttons | this.buttons.Copyright = []; | ||
this.buttons | this.buttons.Advanced = []; | ||
this.buttons | this.buttons.Spam = []; | ||
this.buttons | this.buttons.Block = []; | ||
this.buttons | this.buttons.Rights = []; | ||
this.buttons | this.buttons.Groups.Noobs = new OO.ui.ButtonOptionWidget({ | ||
label: 'تازهکاران', | label: 'تازهکاران', | ||
data: { | data: { | ||
| خط ۷۳: | خط ۷۳: | ||
} | } | ||
}); | }); | ||
this.buttons | this.buttons.Groups.Warnings = new OO.ui.ButtonOptionWidget({ | ||
label: 'هشدارها', | label: 'هشدارها', | ||
data: { | data: { | ||
| خط ۷۹: | خط ۷۹: | ||
} | } | ||
}); | }); | ||
this.buttons | this.buttons.Groups.Tools = new OO.ui.ButtonOptionWidget({ | ||
label: 'ابزارها', | label: 'ابزارها', | ||
data: { | data: { | ||
| خط ۸۵: | خط ۸۵: | ||
} | } | ||
}); | }); | ||
this.buttons | this.buttons.Groups.Article = new OO.ui.ButtonOptionWidget({ | ||
label: 'مقاله', | label: 'مقاله', | ||
data: { | data: { | ||
| خط ۹۱: | خط ۹۱: | ||
} | } | ||
}); | }); | ||
this.buttons | this.buttons.Groups.Copyright = new OO.ui.ButtonOptionWidget({ | ||
label: 'حق تکثیر', | label: 'حق تکثیر', | ||
data: { | data: { | ||
| خط ۹۷: | خط ۹۷: | ||
} | } | ||
}); | }); | ||
this.buttons | this.buttons.Groups.Advanced = new OO.ui.ButtonOptionWidget({ | ||
label: 'پیشرفته', | label: 'پیشرفته', | ||
data: { | data: { | ||
| خط ۱۰۳: | خط ۱۰۳: | ||
} | } | ||
}); | }); | ||
this.buttons | this.buttons.Groups.Spam = new OO.ui.ButtonOptionWidget({ | ||
label: 'هرزنگاری', | label: 'هرزنگاری', | ||
data: { | data: { | ||
| خط ۱۰۹: | خط ۱۰۹: | ||
} | } | ||
}); | }); | ||
this.buttons | this.buttons.Groups.Block = new OO.ui.ButtonOptionWidget({ | ||
label: 'بستن', | label: 'بستن', | ||
data: { | data: { | ||
| خط ۱۱۵: | خط ۱۱۵: | ||
} | } | ||
}); | }); | ||
this.buttons | this.buttons.Groups.Rights = new OO.ui.ButtonOptionWidget({ | ||
label: 'دسترسی', | label: 'دسترسی', | ||
data: { | data: { | ||
| خط ۱۲۴: | خط ۱۲۴: | ||
this.buttonSelectGroups = new OO.ui.ButtonSelectWidget({ | this.buttonSelectGroups = new OO.ui.ButtonSelectWidget({ | ||
items: [ | items: [ | ||
this.buttons | this.buttons.Groups.Noobs, | ||
this.buttons | this.buttons.Groups.Warnings, | ||
this.buttons | this.buttons.Groups.Tools, | ||
this.buttons | this.buttons.Groups.Article, | ||
this.buttons | this.buttons.Groups.Copyright, | ||
this.buttons | this.buttons.Groups.Advanced, | ||
this.buttons | this.buttons.Groups.Spam | ||
] | ] | ||
}); | }); | ||
if ($(mw.config.get('wgUserGroups')).filter(['eliminator', 'sysop']).length > 0) { | if ($(mw.config.get('wgUserGroups')).filter(['eliminator', 'sysop']).length > 0) { | ||
this.buttonSelectGroups.addItems([ | this.buttonSelectGroups.addItems([ | ||
this.buttons | this.buttons.Groups.Block | ||
]); | ]); | ||
} | } | ||
if ($(mw.config.get( 'wgUserGroups' )).filter(['sysop']).length > 0) { | if ($(mw.config.get( 'wgUserGroups' )).filter(['sysop']).length > 0) { | ||
this.buttonSelectGroups.addItems([ | this.buttonSelectGroups.addItems([ | ||
this.buttons | this.buttons.Groups.Rights | ||
]); | ]); | ||
} | } | ||
this.buttonSelectGroups.selectItem(this.buttons | this.buttonSelectGroups.selectItem(this.buttons.Groups.Noobs); | ||
this.buttonSelectGroups.on('choose', function(item) { | this.buttonSelectGroups.on('choose', function(item) { | ||
dialog.buttonSelectChoices = new OO.ui.ButtonSelectWidget({ | dialog.buttonSelectChoices = new OO.ui.ButtonSelectWidget({ | ||
| خط ۱۵۷: | خط ۱۵۷: | ||
}); | }); | ||
this.buttons | this.buttons.Noobs.WelcomeUser = new OO.ui.ButtonOptionWidget({ | ||
label: 'خوشامد (کاربر)', | label: 'خوشامد (کاربر)', | ||
data: { | data: { | ||
| خط ۱۶۹: | خط ۱۶۹: | ||
} | } | ||
}); | }); | ||
this.buttons | this.buttons.Noobs.WelcomeIP = new OO.ui.ButtonOptionWidget({ | ||
label: 'خوشامد (آیپی)', | label: 'خوشامد (آیپی)', | ||
data: { | data: { | ||
| خط ۱۷۵: | خط ۱۷۵: | ||
} | } | ||
}); | }); | ||
this.buttons | this.buttons.Noobs.Sign = new OO.ui.ButtonOptionWidget({ | ||
label: 'امضا کنید', | label: 'امضا کنید', | ||
data: { | data: { | ||
| خط ۱۸۷: | خط ۱۸۷: | ||
} | } | ||
}); | }); | ||
this.buttons | this.buttons.Noobs.DoNotSign = new OO.ui.ButtonOptionWidget({ | ||
label: 'امضا مکنید', | label: 'امضا مکنید', | ||
data: { | data: { | ||
| خط ۱۹۹: | خط ۱۹۹: | ||
} | } | ||
}); | }); | ||
this.buttons | this.buttons.Noobs.Ping = new OO.ui.ButtonOptionWidget({ | ||
label: 'آگاهسازی کنید', | label: 'آگاهسازی کنید', | ||
data: { | data: { | ||
| خط ۲۰۵: | خط ۲۰۵: | ||
} | } | ||
}); | }); | ||
this.buttons | this.buttons.Noobs.UploadGuide = new OO.ui.ButtonOptionWidget({ | ||
label: 'بارگذاری در ویکیفا (منصفانه)', | label: 'بارگذاری در ویکیفا (منصفانه)', | ||
data: { | data: { | ||
| خط ۲۱۱: | خط ۲۱۱: | ||
} | } | ||
}); | }); | ||
this.buttons | this.buttons.Noobs.CommonsGuide = new OO.ui.ButtonOptionWidget({ | ||
label: 'بارگذاری در ویکیانبار (آزاد)', | label: 'بارگذاری در ویکیانبار (آزاد)', | ||
data: { | data: { | ||
| خط ۲۱۷: | خط ۲۱۷: | ||
} | } | ||
}); | }); | ||
this.buttons | this.buttons.Noobs.Keyboard = new OO.ui.ButtonOptionWidget({ | ||
label: 'صفحه کلید فارسی', | label: 'صفحه کلید فارسی', | ||
data: { | data: { | ||
| خط ۲۲۳: | خط ۲۲۳: | ||
} | } | ||
}); | }); | ||
this.buttons | this.buttons.Noobs.Preview = new OO.ui.ButtonOptionWidget({ | ||
label: 'عدم ذخیره متعدد', | label: 'عدم ذخیره متعدد', | ||
data: { | data: { | ||
| خط ۲۳۵: | خط ۲۳۵: | ||
} | } | ||
}); | }); | ||
this.buttons | this.buttons.Noobs.SisterProjects = new OO.ui.ButtonOptionWidget({ | ||
label: 'ویکی خواهر', | label: 'ویکی خواهر', | ||
data: { | data: { | ||
| خط ۲۴۷: | خط ۲۴۷: | ||
} | } | ||
}); | }); | ||
this.buttons | this.buttons.Noobs.EditSummary = new OO.ui.ButtonOptionWidget({ | ||
label: 'خلاصه ویرایش', | label: 'خلاصه ویرایش', | ||
data: { | data: { | ||
| خط ۲۵۳: | خط ۲۵۳: | ||
} | } | ||
}); | }); | ||
this.buttons | this.buttons.Noobs.Sandbox = new OO.ui.ButtonOptionWidget({ | ||
label: 'صفحه تمرین', | label: 'صفحه تمرین', | ||
data: { | data: { | ||
| خط ۲۵۹: | خط ۲۵۹: | ||
} | } | ||
}); | }); | ||
this.buttons | this.buttons.Noobs.FakeArticle = new OO.ui.ButtonOptionWidget({ | ||
label: 'صفحهٔ کاربری مقالهنما', | label: 'صفحهٔ کاربری مقالهنما', | ||
data: { | data: { | ||
| خط ۲۷۱: | خط ۲۷۱: | ||
} | } | ||
}); | }); | ||
this.buttons | this.buttons.Noobs.SeggestedLinks = new OO.ui.ButtonOptionWidget({ | ||
label: 'پیوندهای پیشنهادی', | label: 'پیوندهای پیشنهادی', | ||
data: { | data: { | ||
| خط ۲۸۳: | خط ۲۸۳: | ||
} | } | ||
}); | }); | ||
this.buttons | this.buttons.Warnings.Vandalism = new OO.ui.ButtonOptionWidget({ | ||
label: 'هشدار خرابکاری', | label: 'هشدار خرابکاری', | ||
data: { | data: { | ||
| خط ۲۸۹: | خط ۲۸۹: | ||
} | } | ||
}); | }); | ||
this.buttons | this.buttons.Warnings.VandalismFinal = new OO.ui.ButtonOptionWidget({ | ||
label: 'آخرین هشدار خرابکاری', | label: 'آخرین هشدار خرابکاری', | ||
data: { | data: { | ||
| خط ۲۹۵: | خط ۲۹۵: | ||
} | } | ||
}); | }); | ||
this.buttons | this.buttons.Warnings.Disruption = new OO.ui.ButtonOptionWidget({ | ||
label: 'هشدار اخلالگری', | label: 'هشدار اخلالگری', | ||
data: { | data: { | ||
| خط ۳۰۷: | خط ۳۰۷: | ||
} | } | ||
}); | }); | ||
this.buttons | this.buttons.Warnings.Responsiveness = new OO.ui.ButtonOptionWidget({ | ||
label: 'هشدار پاسخگویی', | label: 'هشدار پاسخگویی', | ||
data: { | data: { | ||
| خط ۳۱۳: | خط ۳۱۳: | ||
} | } | ||
}); | }); | ||
this.buttons | this.buttons.Warnings.SockPupptery = new OO.ui.ButtonOptionWidget({ | ||
label: 'هشدار زاپاسبازی', | label: 'هشدار زاپاسبازی', | ||
data: { | data: { | ||
| خط ۳۱۹: | خط ۳۱۹: | ||
} | } | ||
}); | }); | ||
this.buttons | this.buttons.Tools.VE = new OO.ui.ButtonOptionWidget({ | ||
label: 'ویرایشگر دیداری', | label: 'ویرایشگر دیداری', | ||
data: { | data: { | ||
| خط ۳۲۵: | خط ۳۲۵: | ||
} | } | ||
}); | }); | ||
this.buttons | this.buttons.Tools.ToWikifa = new OO.ui.ButtonOptionWidget({ | ||
label: 'به ویکیفا', | label: 'به ویکیفا', | ||
data: { | data: { | ||
| خط ۳۳۱: | خط ۳۳۱: | ||
} | } | ||
}); | }); | ||
this.buttons | this.buttons.Tools.Translator = new OO.ui.ButtonOptionWidget({ | ||
label: 'کمکمترجم', | label: 'کمکمترجم', | ||
data: { | data: { | ||
| خط ۳۳۷: | خط ۳۳۷: | ||
} | } | ||
}); | }); | ||
this.buttons | this.buttons.Tools.ExtraEditTools = new OO.ui.ButtonOptionWidget({ | ||
label: 'ابزارهای ویرایشی', | label: 'ابزارهای ویرایشی', | ||
data: { | data: { | ||
| خط ۳۴۳: | خط ۳۴۳: | ||
} | } | ||
}); | }); | ||
this.buttons | this.buttons.Tools.Abar = new OO.ui.ButtonOptionWidget({ | ||
label: 'ابرابزار', | label: 'ابرابزار', | ||
data: { | data: { | ||
| خط ۳۴۹: | خط ۳۴۹: | ||
} | } | ||
}); | }); | ||
this.buttons | this.buttons.Tools.Applications = new OO.ui.ButtonOptionWidget({ | ||
label: 'ابزارهای کاربردی', | label: 'ابزارهای کاربردی', | ||
data: { | data: { | ||
| خط ۳۵۵: | خط ۳۵۵: | ||
} | } | ||
}); | }); | ||
this.buttons | this.buttons.Tools.ProveIt = new OO.ui.ButtonOptionWidget({ | ||
label: 'ابزار اثباتش کن', | label: 'ابزار اثباتش کن', | ||
data: { | data: { | ||
| خط ۳۶۱: | خط ۳۶۱: | ||
} | } | ||
}); | }); | ||
this.buttons | this.buttons.Tools.AWD = new OO.ui.ButtonOptionWidget({ | ||
label: 'ویرایشگر خودکار', | label: 'ویرایشگر خودکار', | ||
data: { | data: { | ||
| خط ۳۶۷: | خط ۳۶۷: | ||
} | } | ||
}); | }); | ||
this.buttons | this.buttons.Tools.Patrol = new OO.ui.ButtonOptionWidget({ | ||
label: 'ابزار گشت سریع', | label: 'ابزار گشت سریع', | ||
data: { | data: { | ||
| خط ۳۷۳: | خط ۳۷۳: | ||
} | } | ||
}); | }); | ||
this.buttons | this.buttons.Tools.CheckDictation = new OO.ui.ButtonOptionWidget({ | ||
label: 'اشتباهیاب', | label: 'اشتباهیاب', | ||
data: { | data: { | ||
| خط ۳۸۰: | خط ۳۸۰: | ||
}); | }); | ||
this.buttons | this.buttons.Article.Featured = new OO.ui.ButtonOptionWidget({ | ||
label: 'برگزیده/خوبیده', | label: 'برگزیده/خوبیده', | ||
data: { | data: { | ||
| خط ۳۸۶: | خط ۳۸۶: | ||
} | } | ||
}); | }); | ||
this.buttons | this.buttons.Article.Tutorial = new OO.ui.ButtonOptionWidget({ | ||
label: 'آموزش ویکینویسی', | label: 'آموزش ویکینویسی', | ||
data: { | data: { | ||
| خط ۳۹۲: | خط ۳۹۲: | ||
} | } | ||
}); | }); | ||
this.buttons | this.buttons.Article.Student = new OO.ui.ButtonOptionWidget({ | ||
label: 'ویرایش دانشجویی', | label: 'ویرایش دانشجویی', | ||
data: { | data: { | ||
| خط ۳۹۸: | خط ۳۹۸: | ||
} | } | ||
}); | }); | ||
this.buttons | this.buttons.Article.Incomplete = new OO.ui.ButtonOptionWidget({ | ||
label: 'نوشتار نامناسب', | label: 'نوشتار نامناسب', | ||
data: { | data: { | ||
| خط ۴۱۰: | خط ۴۱۰: | ||
} | } | ||
}); | }); | ||
this.buttons | this.buttons.Article.TooShort = new OO.ui.ButtonOptionWidget({ | ||
label: 'زیادی کوتاه', | label: 'زیادی کوتاه', | ||
data: { | data: { | ||
| خط ۴۲۲: | خط ۴۲۲: | ||
} | } | ||
}); | }); | ||
this.buttons | this.buttons.Article.Minima = new OO.ui.ButtonOptionWidget({ | ||
label: 'حداقلها', | label: 'حداقلها', | ||
data: { | data: { | ||
| خط ۴۲۸: | خط ۴۲۸: | ||
} | } | ||
}); | }); | ||
this.buttons | this.buttons.Article.Deleted = new OO.ui.ButtonOptionWidget({ | ||
label: 'حذف شده', | label: 'حذف شده', | ||
data: { | data: { | ||
| خط ۴۴۰: | خط ۴۴۰: | ||
} | } | ||
}); | }); | ||
this.buttons | this.buttons.Article.Redirect = new OO.ui.ButtonOptionWidget({ | ||
label: 'تغییرمسیر', | label: 'تغییرمسیر', | ||
data: { | data: { | ||
| خط ۴۴۶: | خط ۴۴۶: | ||
} | } | ||
}); | }); | ||
this.buttons | this.buttons.Article.Move = new OO.ui.ButtonOptionWidget({ | ||
label: 'انتقال', | label: 'انتقال', | ||
data: { | data: { | ||
| خط ۴۵۲: | خط ۴۵۲: | ||
} | } | ||
}); | }); | ||
this.buttons | this.buttons.Article.Titles = new OO.ui.ButtonOptionWidget({ | ||
label: 'القاب ممنوع', | label: 'القاب ممنوع', | ||
data: { | data: { | ||
| خط ۴۵۸: | خط ۴۵۸: | ||
} | } | ||
}); | }); | ||
this.buttons | this.buttons.Article.Spoiler = new OO.ui.ButtonOptionWidget({ | ||
label: 'مخدوشکردن داستان فیلم', | label: 'مخدوشکردن داستان فیلم', | ||
data: { | data: { | ||
| خط ۴۶۴: | خط ۴۶۴: | ||
} | } | ||
}); | }); | ||
this.buttons | this.buttons.Article.MachineTranslation = new OO.ui.ButtonOptionWidget({ | ||
label: 'ترجمه ماشینی', | label: 'ترجمه ماشینی', | ||
data: { | data: { | ||
| خط ۴۷۶: | خط ۴۷۶: | ||
} | } | ||
}); | }); | ||
this.buttons | this.buttons.Article.NoFlag = new OO.ui.ButtonOptionWidget({ | ||
label: 'پرچم نزنید', | label: 'پرچم نزنید', | ||
data: { | data: { | ||
| خط ۴۸۲: | خط ۴۸۲: | ||
} | } | ||
}); | }); | ||
this.buttons | this.buttons.Copyright.DoNotCopy = new OO.ui.ButtonOptionWidget({ | ||
label: 'کپی مکنید', | label: 'کپی مکنید', | ||
data: { | data: { | ||
| خط ۴۹۴: | خط ۴۹۴: | ||
} | } | ||
}); | }); | ||
this.buttons | this.buttons.Copyright.UseCitation = new OO.ui.ButtonOptionWidget({ | ||
label: 'یادکرد دقیق', | label: 'یادکرد دقیق', | ||
data: { | data: { | ||
| خط ۵۰۶: | خط ۵۰۶: | ||
} | } | ||
}); | }); | ||
this.buttons | this.buttons.Copyright.CiteNotCopy = new OO.ui.ButtonOptionWidget({ | ||
label: 'ارجاع به جای کپی', | label: 'ارجاع به جای کپی', | ||
data: { | data: { | ||
| خط ۵۱۲: | خط ۵۱۲: | ||
} | } | ||
}); | }); | ||
this.buttons | this.buttons.Copyright.ReliableSources = new OO.ui.ButtonOptionWidget({ | ||
label: 'منابع معتبر', | label: 'منابع معتبر', | ||
data: { | data: { | ||
| خط ۵۱۸: | خط ۵۱۸: | ||
} | } | ||
}); | }); | ||
this.buttons | this.buttons.Copyright.CitationTutorial = new OO.ui.ButtonOptionWidget({ | ||
label: 'آموزش یادکرد', | label: 'آموزش یادکرد', | ||
data: { | data: { | ||
| خط ۵۲۴: | خط ۵۲۴: | ||
} | } | ||
}); | }); | ||
this.buttons | this.buttons.Copyright.License = new OO.ui.ButtonOptionWidget({ | ||
label: 'مجوز نگاره', | label: 'مجوز نگاره', | ||
data: { | data: { | ||
| خط ۵۳۰: | خط ۵۳۰: | ||
} | } | ||
}); | }); | ||
this.buttons | this.buttons.Copyright.Copyvio = new OO.ui.ButtonOptionWidget({ | ||
label: 'هشدار نگاره', | label: 'هشدار نگاره', | ||
data: { | data: { | ||
| خط ۵۳۶: | خط ۵۳۶: | ||
} | } | ||
}); | }); | ||
this.buttons | this.buttons.Copyright.Ownership = new OO.ui.ButtonOptionWidget({ | ||
label: 'قانون مالکیت', | label: 'قانون مالکیت', | ||
data: { | data: { | ||
| خط ۵۴۳: | خط ۵۴۳: | ||
}); | }); | ||
this.buttons | this.buttons.Advanced.Coord = new OO.ui.ButtonOptionWidget({ | ||
label: 'مختصات', | label: 'مختصات', | ||
data: { | data: { | ||
| خط ۵۴۹: | خط ۵۴۹: | ||
} | } | ||
}); | }); | ||
this.buttons | this.buttons.Advanced.Categories = new OO.ui.ButtonOptionWidget({ | ||
label: 'ردهبندی', | label: 'ردهبندی', | ||
data: { | data: { | ||
| خط ۵۵۵: | خط ۵۵۵: | ||
} | } | ||
}); | }); | ||
this.buttons | this.buttons.Advanced.Interwiki = new OO.ui.ButtonOptionWidget({ | ||
label: 'میانویکی', | label: 'میانویکی', | ||
data: { | data: { | ||
| خط ۵۶۲: | خط ۵۶۲: | ||
}); | }); | ||
this.buttons | this.buttons.Spam.Advertisement = new OO.ui.ButtonOptionWidget({ | ||
label: 'تبلیغ', | label: 'تبلیغ', | ||
data: { | data: { | ||
| خط ۵۷۴: | خط ۵۷۴: | ||
} | } | ||
}); | }); | ||
this.buttons | this.buttons.Spam.Notability = new OO.ui.ButtonOptionWidget({ | ||
label: 'سرشناسی', | label: 'سرشناسی', | ||
data: { | data: { | ||
| خط ۵۹۰: | خط ۵۹۰: | ||
} | } | ||
}); | }); | ||
this.buttons | this.buttons.Spam.Sereh = new OO.ui.ButtonOptionWidget({ | ||
label: 'سرهنویسی', | label: 'سرهنویسی', | ||
data: { | data: { | ||
| خط ۶۰۲: | خط ۶۰۲: | ||
} | } | ||
}); | }); | ||
this.buttons | this.buttons.Spam.WP_3RR = new OO.ui.ButtonOptionWidget({ | ||
label: 'سهبرگردان', | label: 'سهبرگردان', | ||
data: { | data: { | ||
| خط ۶۱۴: | خط ۶۱۴: | ||
} | } | ||
}); | }); | ||
this.buttons | this.buttons.Spam.Autobiography = new OO.ui.ButtonOptionWidget({ | ||
label: 'خودنوشته', | label: 'خودنوشته', | ||
data: { | data: { | ||
| خط ۶۲۰: | خط ۶۲۰: | ||
} | } | ||
}); | }); | ||
this.buttons | this.buttons.Spam.WP_NOT = new OO.ui.ButtonOptionWidget({ | ||
label: 'اشتباه گرفتهاید', | label: 'اشتباه گرفتهاید', | ||
data: { | data: { | ||
| خط ۶۳۲: | خط ۶۳۲: | ||
} | } | ||
}); | }); | ||
this.buttons | this.buttons.Spam.Username = new OO.ui.ButtonOptionWidget({ | ||
label: 'نام کاربری', | label: 'نام کاربری', | ||
data: { | data: { | ||
| خط ۶۴۴: | خط ۶۴۴: | ||
} | } | ||
}); | }); | ||
this.buttons | this.buttons.Spam.Canvassing = new OO.ui.ButtonOptionWidget({ | ||
label: 'جارزنی', | label: 'جارزنی', | ||
data: { | data: { | ||
| خط ۶۵۱: | خط ۶۵۱: | ||
}); | }); | ||
this.buttons | this.buttons.Block.Username = new OO.ui.ButtonOptionWidget({ | ||
label: 'نام کاربری نامناسب', | label: 'نام کاربری نامناسب', | ||
data: { | data: { | ||
| خط ۶۵۷: | خط ۶۵۷: | ||
} | } | ||
}); | }); | ||
this.buttons | this.buttons.Block.OneDay = new OO.ui.ButtonOptionWidget({ | ||
label: 'یکروزه', | label: 'یکروزه', | ||
data: { | data: { | ||
| خط ۶۶۹: | خط ۶۶۹: | ||
} | } | ||
}); | }); | ||
this.buttons | this.buttons.Block.Indefinite = new OO.ui.ButtonOptionWidget({ | ||
label: 'بیپایان', | label: 'بیپایان', | ||
data: { | data: { | ||
| خط ۶۸۱: | خط ۶۸۱: | ||
} | } | ||
}); | }); | ||
this.buttons | this.buttons.Block.Detailed = new OO.ui.ButtonOptionWidget({ | ||
label: 'با ذکر مدت و دلیل', | label: 'با ذکر مدت و دلیل', | ||
data: { | data: { | ||
| خط ۶۹۷: | خط ۶۹۷: | ||
} | } | ||
}); | }); | ||
this.buttons | this.buttons.Block.Partial = new OO.ui.ButtonOptionWidget({ | ||
label: 'موردی', | label: 'موردی', | ||
data: { | data: { | ||
| خط ۷۲۱: | خط ۷۲۱: | ||
} | } | ||
}); | }); | ||
this.buttons | this.buttons.Block.AbuseFilter = new OO.ui.ButtonOptionWidget({ | ||
label: 'اشتباه پالایه', | label: 'اشتباه پالایه', | ||
data: { | data: { | ||
| خط ۷۲۸: | خط ۷۲۸: | ||
}); | }); | ||
this.buttons | this.buttons.Rights.Autopatrol = new OO.ui.ButtonOptionWidget({ | ||
label: 'گشت خودکار', | label: 'گشت خودکار', | ||
data: { | data: { | ||
| خط ۷۳۴: | خط ۷۳۴: | ||
} | } | ||
}); | }); | ||
this.buttons | this.buttons.Rights.Revert = new OO.ui.ButtonOptionWidget({ | ||
label: 'واگردان', | label: 'واگردان', | ||
data: { | data: { | ||
| خط ۷۴۰: | خط ۷۴۰: | ||
} | } | ||
}); | }); | ||
this.buttons | this.buttons.Rights.Patroller = new OO.ui.ButtonOptionWidget({ | ||
label: 'گشتزن', | label: 'گشتزن', | ||
data: { | data: { | ||
| خط ۷۴۶: | خط ۷۴۶: | ||
} | } | ||
}); | }); | ||
this.buttons | this.buttons.Rights.TemplateEditor = new OO.ui.ButtonOptionWidget({ | ||
label: 'ویرایشگر الگو', | label: 'ویرایشگر الگو', | ||
data: { | data: { | ||
| خط ۷۵۲: | خط ۷۵۲: | ||
} | } | ||
}); | }); | ||
this.buttons | this.buttons.Rights.Eliminator = new OO.ui.ButtonOptionWidget({ | ||
label: 'ویکیبان', | label: 'ویکیبان', | ||
data: { | data: { | ||
| خط ۷۵۸: | خط ۷۵۸: | ||
} | } | ||
}); | }); | ||
this.buttons | this.buttons.Rights.Sysop = new OO.ui.ButtonOptionWidget({ | ||
label: 'مدیر', | label: 'مدیر', | ||
data: { | data: { | ||
| خط ۷۶۴: | خط ۷۶۴: | ||
} | } | ||
}); | }); | ||
this.buttons | this.buttons.Rights.ReinstateEliminator = new OO.ui.ButtonOptionWidget({ | ||
label: 'تمدید ویکیبانی', | label: 'تمدید ویکیبانی', | ||
data: { | data: { | ||
| خط ۷۷۲: | خط ۷۷۲: | ||
this.buttonSelectChoicesItems = []; | this.buttonSelectChoicesItems = []; | ||
this.buttonSelectChoicesItems | this.buttonSelectChoicesItems.Noobs = [ | ||
this.buttons | this.buttons.Noobs.WelcomeUser, | ||
this.buttons | this.buttons.Noobs.WelcomeIP, | ||
this.buttons | this.buttons.Noobs.Sign, | ||
this.buttons | this.buttons.Noobs.DoNotSign, | ||
this.buttons | this.buttons.Noobs.Ping, | ||
this.buttons | this.buttons.Noobs.UploadGuide, | ||
this.buttons | this.buttons.Noobs.CommonsGuide, | ||
this.buttons | this.buttons.Noobs.Keyboard, | ||
this.buttons | this.buttons.Noobs.Preview, | ||
this.buttons | this.buttons.Noobs.Sandbox, | ||
this.buttons | this.buttons.Noobs.SisterProjects, | ||
this.buttons | this.buttons.Noobs.EditSummary, | ||
this.buttons | this.buttons.Noobs.FakeArticle, | ||
this.buttons | this.buttons.Noobs.SeggestedLinks | ||
]; | ]; | ||
this.buttonSelectChoicesItems | this.buttonSelectChoicesItems.Warnings = [ | ||
this.buttons | this.buttons.Warnings.Vandalism, | ||
this.buttons | this.buttons.Warnings.VandalismFinal, | ||
this.buttons | this.buttons.Warnings.Disruption, | ||
this.buttons | this.buttons.Warnings.Responsiveness, | ||
this.buttons | this.buttons.Warnings.SockPupptery | ||
]; | ]; | ||
this.buttonSelectChoicesItems | this.buttonSelectChoicesItems.Tools = [ | ||
this.buttons | this.buttons.Tools.VE, | ||
this.buttons | this.buttons.Tools.ToWikifa, | ||
this.buttons | this.buttons.Tools.Translator, | ||
this.buttons | this.buttons.Tools.ExtraEditTools, | ||
this.buttons | this.buttons.Tools.Abar, | ||
this.buttons | this.buttons.Tools.Applications, | ||
this.buttons | this.buttons.Tools.ProveIt, | ||
this.buttons | this.buttons.Tools.AWD, | ||
this.buttons | this.buttons.Tools.Patrol, | ||
this.buttons | this.buttons.Tools.CheckDictation | ||
]; | ]; | ||
this.buttonSelectChoicesItems | this.buttonSelectChoicesItems.Article = [ | ||
this.buttons | this.buttons.Article.Featured, | ||
this.buttons | this.buttons.Article.Tutorial, | ||
this.buttons | this.buttons.Article.Student, | ||
this.buttons | this.buttons.Article.Incomplete, | ||
this.buttons | this.buttons.Article.TooShort, | ||
this.buttons | this.buttons.Article.Minima, | ||
this.buttons | this.buttons.Article.Deleted, | ||
this.buttons | this.buttons.Article.Redirect, | ||
this.buttons | this.buttons.Article.Move, | ||
this.buttons | this.buttons.Article.Titles, | ||
this.buttons | this.buttons.Article.Spoiler, | ||
this.buttons | this.buttons.Article.MachineTranslation, | ||
this.buttons | this.buttons.Article.NoFlag | ||
]; | ]; | ||
this.buttonSelectChoicesItems | this.buttonSelectChoicesItems.Copyright = [ | ||
this.buttons | this.buttons.Copyright.DoNotCopy, | ||
this.buttons | this.buttons.Copyright.UseCitation, | ||
this.buttons | this.buttons.Copyright.CiteNotCopy, | ||
this.buttons | this.buttons.Copyright.ReliableSources, | ||
this.buttons | this.buttons.Copyright.CitationTutorial, | ||
this.buttons | this.buttons.Copyright.License, | ||
this.buttons | this.buttons.Copyright.Copyvio, | ||
this.buttons | this.buttons.Copyright.Ownership | ||
]; | ]; | ||
this.buttonSelectChoicesItems | this.buttonSelectChoicesItems.Advanced = [ | ||
this.buttons | this.buttons.Advanced.Coord, | ||
this.buttons | this.buttons.Advanced.Categories, | ||
this.buttons | this.buttons.Advanced.Interwiki | ||
]; | ]; | ||
this.buttonSelectChoicesItems | this.buttonSelectChoicesItems.Spam = [ | ||
this.buttons | this.buttons.Spam.Advertisement, | ||
this.buttons | this.buttons.Spam.Notability, | ||
this.buttons | this.buttons.Spam.Sereh, | ||
this.buttons | this.buttons.Spam.WP_3RR, | ||
this.buttons | this.buttons.Spam.Autobiography, | ||
this.buttons | this.buttons.Spam.WP_NOT, | ||
this.buttons | this.buttons.Spam.Username, | ||
this.buttons | this.buttons.Spam.Canvassing | ||
]; | ]; | ||
this.buttonSelectChoicesItems | this.buttonSelectChoicesItems.Block = [ | ||
this.buttons | this.buttons.Block.Username, | ||
this.buttons | this.buttons.Block.OneDay, | ||
this.buttons | this.buttons.Block.Indefinite, | ||
this.buttons | this.buttons.Block.Detailed, | ||
this.buttons | this.buttons.Block.Partial, | ||
this.buttons | this.buttons.Block.AbuseFilter | ||
]; | ]; | ||
this.buttonSelectChoicesItems | this.buttonSelectChoicesItems.Rights = [ | ||
this.buttons | this.buttons.Rights.Autopatrol, | ||
this.buttons | this.buttons.Rights.Revert, | ||
this.buttons | this.buttons.Rights.Patroller, | ||
this.buttons | this.buttons.Rights.TemplateEditor, | ||
this.buttons | this.buttons.Rights.Eliminator, | ||
this.buttons | this.buttons.Rights.Sysop, | ||
this.buttons | this.buttons.Rights.ReinstateEliminator | ||
]; | ]; | ||
// The default choice | // The default choice | ||
this.buttonSelectChoices = new OO.ui.ButtonSelectWidget({ | this.buttonSelectChoices = new OO.ui.ButtonSelectWidget({ | ||
items: this.buttonSelectChoicesItems | items: this.buttonSelectChoicesItems.Noobs | ||
}); | }); | ||
| خط ۸۸۲: | خط ۸۸۲: | ||
dialog.textParamLayouts[i].setData(item.data.params[i].id); | dialog.textParamLayouts[i].setData(item.data.params[i].id); | ||
} | } | ||
for ( | for (i = item.data.params.length; i < 4; i++) { | ||
dialog.textParamLayouts[i].toggle(false); | dialog.textParamLayouts[i].toggle(false); | ||
} | } | ||
} else { | } else { | ||
for (var | for (var k = 0; k < 4; k++) { | ||
dialog.textParamLayouts[ | dialog.textParamLayouts[k].toggle(false); | ||
} | } | ||
dialog.panelParams.toggle(true); | dialog.panelParams.toggle(true); | ||
| خط ۸۹۵: | خط ۸۹۵: | ||
windowManager.getCurrentWindow().updateSize(); | windowManager.getCurrentWindow().updateSize(); | ||
}); | }); | ||
} | }; | ||
this.setChooseAction(); | this.setChooseAction(); | ||
| خط ۱٬۰۲۶: | خط ۱٬۰۲۶: | ||
wikitext += '}}'; | wikitext += '}}'; | ||
return wikitext; | return wikitext; | ||
} | }; | ||
UserMessages.prototype.getSetupProcess = function(data) { | UserMessages.prototype.getSetupProcess = function(data) { | ||
data = data || {}; | data = data || {}; | ||
نسخهٔ ۱۵ ژانویهٔ ۲۰۲۲، ساعت ۲۱:۲۹
/**
* This gadget is a substantial rewrite of the UserMessages gadget, influenced by
* [[n:en:MediaWiki:Gadget-UserMessages.js]] and [[n:MediaWiki:Gadget-UserMessages.js]]
*
* Unlike the previous versions, this uses OOUI and can accept one or more
* parameters for the messages that are being posted on the user's talk page.
*/
(function($, mw) {
'use strict';
var windowManager;
var UM;
var UMOptions = {
install: function() {
if (mw.config.get('wgAction') === 'view' | (mw.config.get('wgAction') === 'edit' & mw.config.get('wgCurRevisionId') === 0)) {
$(mw.util.addPortletLink( 'p-cactions', '#', 'اعلان', 'ca-warn', 'درج یک اعلان مبتنی بر الگو', '*')).click(function(e) {
mw.loader.using(['oojs-ui-core', 'oojs-ui-widgets', 'oojs-ui-windows', 'mediawiki.api']).done(UMOptions.createWindow);
e.preventDefault();
});
// Late pre-loading
mw.loader.load(['oojs-ui-core', 'oojs-ui-widgets', 'oojs-ui-windows', 'mediawiki.api']);
}
},
createWindow: function() {
function PreviewPanel(config) {
PreviewPanel.parent.call(this, config);
this.$content = $('<div>').addClass('oo-ui-PreviewPanel');
}
OO.inheritClass(PreviewPanel, OO.ui.PanelLayout);
PreviewPanel.prototype.setContent = function ($content) {
this.$element.children().detach();
this.$element.append($content);
windowManager.getCurrentWindow().updateSize();
};
function UserMessages(config) {
UserMessages.super.call(this, config);
}
OO.inheritClass(UserMessages, OO.ui.ProcessDialog);
UserMessages.static.name = 'Warn dialog';
UserMessages.static.title = 'درج اعلان (پیام یا تذکر)';
UserMessages.static.actions = [
{
action: 'warn',
label: 'ثبت',
flags: 'primary'
},
{
label: 'لغو',
flags: 'safe'
}
];
UserMessages.prototype.initialize = function() {
var dialog = this;
UserMessages.super.prototype.initialize.apply(this, arguments);
this.buttons = [];
this.buttons.Groups = [];
this.buttons.Noobs = [];
this.buttons.Warnings = [];
this.buttons.Tools = [];
this.buttons.Article = [];
this.buttons.Copyright = [];
this.buttons.Advanced = [];
this.buttons.Spam = [];
this.buttons.Block = [];
this.buttons.Rights = [];
this.buttons.Groups.Noobs = new OO.ui.ButtonOptionWidget({
label: 'تازهکاران',
data: {
group: 'Noobs'
}
});
this.buttons.Groups.Warnings = new OO.ui.ButtonOptionWidget({
label: 'هشدارها',
data: {
group: 'Warnings'
}
});
this.buttons.Groups.Tools = new OO.ui.ButtonOptionWidget({
label: 'ابزارها',
data: {
group: 'Tools'
}
});
this.buttons.Groups.Article = new OO.ui.ButtonOptionWidget({
label: 'مقاله',
data: {
group: 'Article'
}
});
this.buttons.Groups.Copyright = new OO.ui.ButtonOptionWidget({
label: 'حق تکثیر',
data: {
group: 'Copyright'
}
});
this.buttons.Groups.Advanced = new OO.ui.ButtonOptionWidget({
label: 'پیشرفته',
data: {
group: 'Advanced'
}
});
this.buttons.Groups.Spam = new OO.ui.ButtonOptionWidget({
label: 'هرزنگاری',
data: {
group: 'Spam'
}
});
this.buttons.Groups.Block = new OO.ui.ButtonOptionWidget({
label: 'بستن',
data: {
group: 'Block'
}
});
this.buttons.Groups.Rights = new OO.ui.ButtonOptionWidget({
label: 'دسترسی',
data: {
group: 'Rights'
}
});
this.buttonSelectGroups = new OO.ui.ButtonSelectWidget({
items: [
this.buttons.Groups.Noobs,
this.buttons.Groups.Warnings,
this.buttons.Groups.Tools,
this.buttons.Groups.Article,
this.buttons.Groups.Copyright,
this.buttons.Groups.Advanced,
this.buttons.Groups.Spam
]
});
if ($(mw.config.get('wgUserGroups')).filter(['eliminator', 'sysop']).length > 0) {
this.buttonSelectGroups.addItems([
this.buttons.Groups.Block
]);
}
if ($(mw.config.get( 'wgUserGroups' )).filter(['sysop']).length > 0) {
this.buttonSelectGroups.addItems([
this.buttons.Groups.Rights
]);
}
this.buttonSelectGroups.selectItem(this.buttons.Groups.Noobs);
this.buttonSelectGroups.on('choose', function(item) {
dialog.buttonSelectChoices = new OO.ui.ButtonSelectWidget({
items: dialog.buttonSelectChoicesItems[item.data.group]
});
dialog.buttonSelectChoices.selectItem();
dialog.panelChoices.$element.children().detach();
dialog.panelChoices.$element.append(dialog.buttonSelectChoices.$element);
dialog.setChooseAction();
dialog.panelParams.toggle(false);
dialog.previewResult.toggle(false);
windowManager.getCurrentWindow().updateSize();
});
this.buttons.Noobs.WelcomeUser = new OO.ui.ButtonOptionWidget({
label: 'خوشامد (کاربر)',
data: {
template: 'خوشامد',
params: [
{
id: '1',
label: 'پیام تکمیلی (اختیاری)'
}
]
}
});
this.buttons.Noobs.WelcomeIP = new OO.ui.ButtonOptionWidget({
label: 'خوشامد (آیپی)',
data: {
template: 'خوشامد-آیپی'
}
});
this.buttons.Noobs.Sign = new OO.ui.ButtonOptionWidget({
label: 'امضا کنید',
data: {
template: 'امضا کنید',
params: [
{
id: '1',
label: 'پیام تکمیلی (اختیاری)'
}
]
}
});
this.buttons.Noobs.DoNotSign = new OO.ui.ButtonOptionWidget({
label: 'امضا مکنید',
data: {
template: 'امضا مکنید',
params: [
{
id: '1',
label: 'عنوان مقاله (اختیاری)'
}
]
}
});
this.buttons.Noobs.Ping = new OO.ui.ButtonOptionWidget({
label: 'آگاهسازی کنید',
data: {
template: 'آموزش آگاهسازی'
}
});
this.buttons.Noobs.UploadGuide = new OO.ui.ButtonOptionWidget({
label: 'بارگذاری در ویکیفا (منصفانه)',
data: {
template: 'راهنمای بارگذاری پرونده در ویکیفا'
}
});
this.buttons.Noobs.CommonsGuide = new OO.ui.ButtonOptionWidget({
label: 'بارگذاری در ویکیانبار (آزاد)',
data: {
template: 'راهنمای بارگذاری پرونده در ویکیانبار'
}
});
this.buttons.Noobs.Keyboard = new OO.ui.ButtonOptionWidget({
label: 'صفحه کلید فارسی',
data: {
template: 'استفاده از صفحه کلید فارسی'
}
});
this.buttons.Noobs.Preview = new OO.ui.ButtonOptionWidget({
label: 'عدم ذخیره متعدد',
data: {
template: 'از پیشنمایش استفاده کنید',
params: [
{
id: '1',
label: 'عنوان مقاله (اختیاری)'
}
]
}
});
this.buttons.Noobs.SisterProjects = new OO.ui.ButtonOptionWidget({
label: 'ویکی خواهر',
data: {
template: 'ویرایش در ویکیهای خواهر',
params: [
{
id: '1',
label: 'نام پروژهٔ خواهر (اختیاری)'
}
]
}
});
this.buttons.Noobs.EditSummary = new OO.ui.ButtonOptionWidget({
label: 'خلاصه ویرایش',
data: {
template: 'تذکر خلاصه ویرایش'
}
});
this.buttons.Noobs.Sandbox = new OO.ui.ButtonOptionWidget({
label: 'صفحه تمرین',
data: {
template: 'صفحه تمرین'
}
});
this.buttons.Noobs.FakeArticle = new OO.ui.ButtonOptionWidget({
label: 'صفحهٔ کاربری مقالهنما',
data: {
template: 'هشدار مقالهنما',
params: [
{
id: '1',
label: 'نام صفحه (اختیاری)'
}
]
}
});
this.buttons.Noobs.SeggestedLinks = new OO.ui.ButtonOptionWidget({
label: 'پیوندهای پیشنهادی',
data: {
template: 'راهنمای پیوندهای پیشنهادی',
params: [
{
id: '1',
label: 'نام صفحه (اختیاری)'
}
]
}
});
this.buttons.Warnings.Vandalism = new OO.ui.ButtonOptionWidget({
label: 'هشدار خرابکاری',
data: {
template: 'تذکر خرابکاری'
}
});
this.buttons.Warnings.VandalismFinal = new OO.ui.ButtonOptionWidget({
label: 'آخرین هشدار خرابکاری',
data: {
template: 'تذکر خرابکاری (آخرین)'
}
});
this.buttons.Warnings.Disruption = new OO.ui.ButtonOptionWidget({
label: 'هشدار اخلالگری',
data: {
template: 'هشدار ویرایش اخلالگرانه',
params: [
{
id: '1',
label: 'نام صفحه (اختیاری)'
}
]
}
});
this.buttons.Warnings.Responsiveness = new OO.ui.ButtonOptionWidget({
label: 'هشدار پاسخگویی',
data: {
template: 'پاسخ به بحث'
}
});
this.buttons.Warnings.SockPupptery = new OO.ui.ButtonOptionWidget({
label: 'هشدار زاپاسبازی',
data: {
template: 'تذکر زاپاس'
}
});
this.buttons.Tools.VE = new OO.ui.ButtonOptionWidget({
label: 'ویرایشگر دیداری',
data: {
template: 'کار با ویرایشگر دیداری'
}
});
this.buttons.Tools.ToWikifa = new OO.ui.ButtonOptionWidget({
label: 'به ویکیفا',
data: {
template: 'به ویکیفا'
}
});
this.buttons.Tools.Translator = new OO.ui.ButtonOptionWidget({
label: 'کمکمترجم',
data: {
template: 'ابزار کمکمترجم'
}
});
this.buttons.Tools.ExtraEditTools = new OO.ui.ButtonOptionWidget({
label: 'ابزارهای ویرایشی',
data: {
template: 'ابزارهای ویرایشی'
}
});
this.buttons.Tools.Abar = new OO.ui.ButtonOptionWidget({
label: 'ابرابزار',
data: {
template: 'ابرابزار'
}
});
this.buttons.Tools.Applications = new OO.ui.ButtonOptionWidget({
label: 'ابزارهای کاربردی',
data: {
template: 'ابزارهای کاربردی'
}
});
this.buttons.Tools.ProveIt = new OO.ui.ButtonOptionWidget({
label: 'ابزار اثباتش کن',
data: {
template: 'اثباتش کن'
}
});
this.buttons.Tools.AWD = new OO.ui.ButtonOptionWidget({
label: 'ویرایشگر خودکار',
data: {
template: 'ویرایشگر خودکار'
}
});
this.buttons.Tools.Patrol = new OO.ui.ButtonOptionWidget({
label: 'ابزار گشت سریع',
data: {
template: 'ابزار گشتزنی سریع'
}
});
this.buttons.Tools.CheckDictation = new OO.ui.ButtonOptionWidget({
label: 'اشتباهیاب',
data: {
template: 'ابزار اشتباهیاب'
}
});
this.buttons.Article.Featured = new OO.ui.ButtonOptionWidget({
label: 'برگزیده/خوبیده',
data: {
template: 'تذکر محتوای برگزیده'
}
});
this.buttons.Article.Tutorial = new OO.ui.ButtonOptionWidget({
label: 'آموزش ویکینویسی',
data: {
template: 'ویکینویسی'
}
});
this.buttons.Article.Student = new OO.ui.ButtonOptionWidget({
label: 'ویرایش دانشجویی',
data: {
template: 'ویرایش دانشجویی'
}
});
this.buttons.Article.Incomplete = new OO.ui.ButtonOptionWidget({
label: 'نوشتار نامناسب',
data: {
template: 'نوشتار نامناسب',
params: [
{
id: '1',
label: 'عنوان مقاله (اختیاری)'
}
]
}
});
this.buttons.Article.TooShort = new OO.ui.ButtonOptionWidget({
label: 'زیادی کوتاه',
data: {
template: 'بیش از حد کوتاه',
params: [
{
id: '1',
label: 'عنوان مقاله (اختیاری)'
}
]
}
});
this.buttons.Article.Minima = new OO.ui.ButtonOptionWidget({
label: 'حداقلها',
data: {
template: 'حداقلهای مقاله'
}
});
this.buttons.Article.Deleted = new OO.ui.ButtonOptionWidget({
label: 'حذف شده',
data: {
template: 'مقاله حذف شده',
params: [
{
id: '1',
label: 'پیام تکمیلی (اختیاری)'
}
]
}
});
this.buttons.Article.Redirect = new OO.ui.ButtonOptionWidget({
label: 'تغییرمسیر',
data: {
template: 'از تغییرمسیر استفاده کنید'
}
});
this.buttons.Article.Move = new OO.ui.ButtonOptionWidget({
label: 'انتقال',
data: {
template: 'از انتقال استفاده کنید'
}
});
this.buttons.Article.Titles = new OO.ui.ButtonOptionWidget({
label: 'القاب ممنوع',
data: {
template: 'هشدار القاب ممنوع'
}
});
this.buttons.Article.Spoiler = new OO.ui.ButtonOptionWidget({
label: 'مخدوشکردن داستان فیلم',
data: {
template: 'خلاصه داستان را مخدوش نکنید'
}
});
this.buttons.Article.MachineTranslation = new OO.ui.ButtonOptionWidget({
label: 'ترجمه ماشینی',
data: {
template: 'ترجمه ماشینی ممنوع',
params: [
{
id: '1',
label: 'عنوان صفحه (اختیاری)'
}
]
}
});
this.buttons.Article.NoFlag = new OO.ui.ButtonOptionWidget({
label: 'پرچم نزنید',
data: {
template: 'پرچم نزنید'
}
});
this.buttons.Copyright.DoNotCopy = new OO.ui.ButtonOptionWidget({
label: 'کپی مکنید',
data: {
template: 'کپی مکنید',
params: [
{
id: '1',
label: 'عنوان مقاله (اختیاری)'
}
]
}
});
this.buttons.Copyright.UseCitation = new OO.ui.ButtonOptionWidget({
label: 'یادکرد دقیق',
data: {
template: 'یادکرد دقیق منبع',
params: [
{
id: '1',
label: 'عنوان مقاله (اختیاری)'
}
]
}
});
this.buttons.Copyright.CiteNotCopy = new OO.ui.ButtonOptionWidget({
label: 'ارجاع به جای کپی',
data: {
template: 'نحوه استفاده از مقالات علمی'
}
});
this.buttons.Copyright.ReliableSources = new OO.ui.ButtonOptionWidget({
label: 'منابع معتبر',
data: {
template: 'منابع معتبر'
}
});
this.buttons.Copyright.CitationTutorial = new OO.ui.ButtonOptionWidget({
label: 'آموزش یادکرد',
data: {
template: 'ارجاع صحیح'
}
});
this.buttons.Copyright.License = new OO.ui.ButtonOptionWidget({
label: 'مجوز نگاره',
data: {
template: 'مجوز نگاره'
}
});
this.buttons.Copyright.Copyvio = new OO.ui.ButtonOptionWidget({
label: 'هشدار نگاره',
data: {
template: 'هشدار نقض حق تکثیر'
}
});
this.buttons.Copyright.Ownership = new OO.ui.ButtonOptionWidget({
label: 'قانون مالکیت',
data: {
template: 'هشدار نقض قانون مالکیت محتوا'
}
});
this.buttons.Advanced.Coord = new OO.ui.ButtonOptionWidget({
label: 'مختصات',
data: {
template: 'مختصاتدهی'
}
});
this.buttons.Advanced.Categories = new OO.ui.ButtonOptionWidget({
label: 'ردهبندی',
data: {
template: 'ردهدهی'
}
});
this.buttons.Advanced.Interwiki = new OO.ui.ButtonOptionWidget({
label: 'میانویکی',
data: {
template: 'افزودن میانویکی'
}
});
this.buttons.Spam.Advertisement = new OO.ui.ButtonOptionWidget({
label: 'تبلیغ',
data: {
template: 'تبلیغ مکنید',
params: [
{
id: '1',
label: 'عنوان مقاله (اختیاری)'
}
]
}
});
this.buttons.Spam.Notability = new OO.ui.ButtonOptionWidget({
label: 'سرشناسی',
data: {
template: 'پیام سرشناسی',
params: [
{
id: '1',
label: 'عنوان مقاله (اختیاری)'
},
{
id: '2',
label: 'پیام تکمیلی (اختیاری)'
}
]
}
});
this.buttons.Spam.Sereh = new OO.ui.ButtonOptionWidget({
label: 'سرهنویسی',
data: {
template: 'سره ننویسید',
params: [
{
id: '1',
label: 'عنوان مقاله (اختیاری)'
}
]
}
});
this.buttons.Spam.WP_3RR = new OO.ui.ButtonOptionWidget({
label: 'سهبرگردان',
data: {
template: 'هشدار نقض قانون سهبرگردان',
params: [
{
id: '1',
label: 'عنوان مقاله (اختیاری)'
}
]
}
});
this.buttons.Spam.Autobiography = new OO.ui.ButtonOptionWidget({
label: 'خودنوشته',
data: {
template: 'خودنوشته'
}
});
this.buttons.Spam.WP_NOT = new OO.ui.ButtonOptionWidget({
label: 'اشتباه گرفتهاید',
data: {
template: 'اشتباه گرفتهاید',
params: [
{
id: '1',
label: 'با چه اشتباه گرفته؟ (اختیاری)'
}
]
}
});
this.buttons.Spam.Username = new OO.ui.ButtonOptionWidget({
label: 'نام کاربری',
data: {
template: 'نام کاربری نامناسب',
params: [
{
id: '1',
label: 'دلیل (اختیاری)'
}
]
}
});
this.buttons.Spam.Canvassing = new OO.ui.ButtonOptionWidget({
label: 'جارزنی',
data: {
template: 'جارزنی'
}
});
this.buttons.Block.Username = new OO.ui.ButtonOptionWidget({
label: 'نام کاربری نامناسب',
data: {
template: 'بستن نام تبلیغی'
}
});
this.buttons.Block.OneDay = new OO.ui.ButtonOptionWidget({
label: 'یکروزه',
data: {
template: 'قطع دسترسی موقت',
params: [
{
id: 'دلیل',
label: 'دلیل (اختیاری)'
}
]
}
});
this.buttons.Block.Indefinite = new OO.ui.ButtonOptionWidget({
label: 'بیپایان',
data: {
template: 'قطع دسترسی بیپایان',
params: [
{
id: 'دلیل',
label: 'دلیل (اختیاری)'
}
]
}
});
this.buttons.Block.Detailed = new OO.ui.ButtonOptionWidget({
label: 'با ذکر مدت و دلیل',
data: {
template: 'قطع دسترسی',
params: [
{
id: 'مدت',
label: 'مدت (اختیاری)'
},
{
id: 'دلیل',
label: 'دلیل (اختیاری)'
}
]
}
});
this.buttons.Block.Partial = new OO.ui.ButtonOptionWidget({
label: 'موردی',
data: {
template: 'قطع دسترسی موردی',
params: [
{
id: 'صفحات',
label: 'صفحهها (مثل [[فلان]] و [[بهمان]])'
},
{
id: 'فضای نام',
label: 'فضای نام (بین موارد «و» بگذارید)'
},
{
id: 'مدت',
label: 'مدت (اختیاری)'
},
{
id: 'دلیل',
label: 'دلیل (اختیاری)'
}
]
}
});
this.buttons.Block.AbuseFilter = new OO.ui.ButtonOptionWidget({
label: 'اشتباه پالایه',
data: {
template: 'پوزش پالایه'
}
});
this.buttons.Rights.Autopatrol = new OO.ui.ButtonOptionWidget({
label: 'گشت خودکار',
data: {
template: 'اعطای گشت خودکار'
}
});
this.buttons.Rights.Revert = new OO.ui.ButtonOptionWidget({
label: 'واگردان',
data: {
template: 'اعطای واگردان'
}
});
this.buttons.Rights.Patroller = new OO.ui.ButtonOptionWidget({
label: 'گشتزن',
data: {
template: 'اعطای گشتزن'
}
});
this.buttons.Rights.TemplateEditor = new OO.ui.ButtonOptionWidget({
label: 'ویرایشگر الگو',
data: {
template: 'اعطای ویرایشگر الگو'
}
});
this.buttons.Rights.Eliminator = new OO.ui.ButtonOptionWidget({
label: 'ویکیبان',
data: {
template: 'اعطای ویکیبان'
}
});
this.buttons.Rights.Sysop = new OO.ui.ButtonOptionWidget({
label: 'مدیر',
data: {
template: 'اعطای مدیریت'
}
});
this.buttons.Rights.ReinstateEliminator = new OO.ui.ButtonOptionWidget({
label: 'تمدید ویکیبانی',
data: {
template: 'تمدید ویکیبانی'
}
});
this.buttonSelectChoicesItems = [];
this.buttonSelectChoicesItems.Noobs = [
this.buttons.Noobs.WelcomeUser,
this.buttons.Noobs.WelcomeIP,
this.buttons.Noobs.Sign,
this.buttons.Noobs.DoNotSign,
this.buttons.Noobs.Ping,
this.buttons.Noobs.UploadGuide,
this.buttons.Noobs.CommonsGuide,
this.buttons.Noobs.Keyboard,
this.buttons.Noobs.Preview,
this.buttons.Noobs.Sandbox,
this.buttons.Noobs.SisterProjects,
this.buttons.Noobs.EditSummary,
this.buttons.Noobs.FakeArticle,
this.buttons.Noobs.SeggestedLinks
];
this.buttonSelectChoicesItems.Warnings = [
this.buttons.Warnings.Vandalism,
this.buttons.Warnings.VandalismFinal,
this.buttons.Warnings.Disruption,
this.buttons.Warnings.Responsiveness,
this.buttons.Warnings.SockPupptery
];
this.buttonSelectChoicesItems.Tools = [
this.buttons.Tools.VE,
this.buttons.Tools.ToWikifa,
this.buttons.Tools.Translator,
this.buttons.Tools.ExtraEditTools,
this.buttons.Tools.Abar,
this.buttons.Tools.Applications,
this.buttons.Tools.ProveIt,
this.buttons.Tools.AWD,
this.buttons.Tools.Patrol,
this.buttons.Tools.CheckDictation
];
this.buttonSelectChoicesItems.Article = [
this.buttons.Article.Featured,
this.buttons.Article.Tutorial,
this.buttons.Article.Student,
this.buttons.Article.Incomplete,
this.buttons.Article.TooShort,
this.buttons.Article.Minima,
this.buttons.Article.Deleted,
this.buttons.Article.Redirect,
this.buttons.Article.Move,
this.buttons.Article.Titles,
this.buttons.Article.Spoiler,
this.buttons.Article.MachineTranslation,
this.buttons.Article.NoFlag
];
this.buttonSelectChoicesItems.Copyright = [
this.buttons.Copyright.DoNotCopy,
this.buttons.Copyright.UseCitation,
this.buttons.Copyright.CiteNotCopy,
this.buttons.Copyright.ReliableSources,
this.buttons.Copyright.CitationTutorial,
this.buttons.Copyright.License,
this.buttons.Copyright.Copyvio,
this.buttons.Copyright.Ownership
];
this.buttonSelectChoicesItems.Advanced = [
this.buttons.Advanced.Coord,
this.buttons.Advanced.Categories,
this.buttons.Advanced.Interwiki
];
this.buttonSelectChoicesItems.Spam = [
this.buttons.Spam.Advertisement,
this.buttons.Spam.Notability,
this.buttons.Spam.Sereh,
this.buttons.Spam.WP_3RR,
this.buttons.Spam.Autobiography,
this.buttons.Spam.WP_NOT,
this.buttons.Spam.Username,
this.buttons.Spam.Canvassing
];
this.buttonSelectChoicesItems.Block = [
this.buttons.Block.Username,
this.buttons.Block.OneDay,
this.buttons.Block.Indefinite,
this.buttons.Block.Detailed,
this.buttons.Block.Partial,
this.buttons.Block.AbuseFilter
];
this.buttonSelectChoicesItems.Rights = [
this.buttons.Rights.Autopatrol,
this.buttons.Rights.Revert,
this.buttons.Rights.Patroller,
this.buttons.Rights.TemplateEditor,
this.buttons.Rights.Eliminator,
this.buttons.Rights.Sysop,
this.buttons.Rights.ReinstateEliminator
];
// The default choice
this.buttonSelectChoices = new OO.ui.ButtonSelectWidget({
items: this.buttonSelectChoicesItems.Noobs
});
this.setChooseAction = function() {
dialog.buttonSelectChoices.on('choose', function(item) {
dialog.previewResult.toggle(false);
if (item.data !== undefined & item.data.params !== undefined) {
dialog.panelParams.toggle(true);
dialog.buttonPreview.toggle(true);
dialog.buttonReset.toggle(true);
for (var i = 0; i < item.data.params.length; i++) {
dialog.textParamLayouts[i].toggle(true);
dialog.textParamLayouts[i].setLabel(item.data.params[i].label);
dialog.textParamLayouts[i].setData(item.data.params[i].id);
}
for (i = item.data.params.length; i < 4; i++) {
dialog.textParamLayouts[i].toggle(false);
}
} else {
for (var k = 0; k < 4; k++) {
dialog.textParamLayouts[k].toggle(false);
}
dialog.panelParams.toggle(true);
dialog.buttonPreview.toggle(true);
dialog.buttonReset.toggle(true);
}
windowManager.getCurrentWindow().updateSize();
});
};
this.setChooseAction();
// The parameters
this.textParams = [];
this.textParamLayouts = [];
this.textParams[0] = new OO.ui.TextInputWidget({
placeholder: 'متنی وارد کنید'
});
this.textParams[1] = new OO.ui.TextInputWidget({
placeholder: 'متنی وارد کنید'
});
this.textParams[2] = new OO.ui.TextInputWidget({
placeholder: 'متنی وارد کنید'
});
this.textParams[3] = new OO.ui.TextInputWidget({
placeholder: 'متنی وارد کنید'
});
this.textParamLayouts[0] = new OO.ui.FieldLayout( this.textParams[0], {
label: 'پارامتر اول'
});
this.textParamLayouts[1] = new OO.ui.FieldLayout( this.textParams[1], {
label: 'پارامتر دوم'
});
this.textParamLayouts[2] = new OO.ui.FieldLayout( this.textParams[2], {
label: 'پارامتر سوم'
});
this.textParamLayouts[3] = new OO.ui.FieldLayout( this.textParams[3], {
label: 'پارامتر چهارم'
});
this.paramFieldset = new OO.ui.FieldsetLayout({
items: this.textParamLayouts
});
this.buttonPreview = new OO.ui.ButtonWidget({
label: 'پیشنمایش',
icon: 'check',
title: 'پیشنمایش',
flags: 'progressive'
});
this.buttonPreview.on('click', function() {
dialog.previewResult.toggle(true);
dialog.previewResult.setContent(''); // Makes any previous preview results go away, so the user notices the change
windowManager.getCurrentWindow().updateSize();
var wikitext = UserMessages.prepareWikitext(dialog);
var api = new mw.Api();
api.get({
action: 'parse',
text: wikitext,
pst: true
}).done(function( data ) {
dialog.previewResult.setContent($(data.parse.text['*']));
});
});
this.buttonReset = new OO.ui.ButtonWidget({
label: 'پاک کردن',
icon: 'clear',
title: 'پاک کردن',
flags: 'destructive'
});
this.buttonReset.on('click', function() {
for (var i = 0; i < 4; i++) {
dialog.textParams[i].setValue('');
}
dialog.previewResult.toggle(false);
dialog.buttonPreview.toggle(true);
dialog.buttonReset.toggle(true);
windowManager.getCurrentWindow().updateSize();
});
this.panelParams = new OO.ui.PanelLayout({
expanded: true,
padded: true
});
this.previewResult = new PreviewPanel({
expanded: true,
padded: true,
$content: ''
});
this.previewResult.toggle(false);
this.panelParams.$element.append(this.paramFieldset.$element);
this.panelParams.$element.append(this.buttonPreview.$element);
this.panelParams.$element.append(this.buttonReset.$element);
for (var i = 0; i < 4; i++) {
this.textParamLayouts[i].toggle(false);
}
this.buttonPreview.toggle(false);
this.buttonReset.toggle(false);
this.panelGroups = new OO.ui.PanelLayout({
expanded: true,
padded: true,
classes: ['panelGroups']
});
this.panelGroups.$element.append(this.buttonSelectGroups.$element);
this.panelChoices = new OO.ui.PanelLayout({
expanded: true,
padded: true,
classes: ['panelChoices']
});
this.panelChoices.$element.append(this.buttonSelectChoices.$element);
this.panelPreview = new OO.ui.PanelLayout({
expanded: true,
padded: true
});
this.panelPreview.$element.append(this.previewResult.$element);
this.stackLayout = new OO.ui.StackLayout({
items: [
this.panelGroups,
this.panelChoices,
this.panelParams,
this.panelPreview
],
continuous: true,
scrollable: false
});
this.$body.append(this.stackLayout.$element);
};
UserMessages.prepareWikitext = function(dialog) {
var paramNames = [];
var paramValues = [];
var btn = dialog.buttonSelectChoices.findSelectedItem().getData();
var wikitext = '{{subst:' + btn.template;
for (var i = 0; i < 4; i ++) {
paramNames[i] = dialog.textParamLayouts[i].getData();
paramValues[i] = dialog.textParams[i].getValue();
if (dialog.textParamLayouts[i].isVisible()) {
wikitext += '|' + paramNames[i] + '=' + paramValues[i];
}
}
wikitext += '}}';
return wikitext;
};
UserMessages.prototype.getSetupProcess = function(data) {
data = data || {};
return UserMessages.super.prototype.getSetupProcess.call( this, data )
.next( function () {
// Do something
}, this );
};
UserMessages.prototype.getActionProcess = function(action) {
var dialog = this;
if (action === 'warn') {
var wikitext = UserMessages.prepareWikitext(dialog);
wikitext += '\n~~' + '~~';
var summary = 'افزودن «[[الگو:' + dialog.buttonSelectChoices.findSelectedItem().getData().template + ']]» به کمک [[ویکیپدیا:ابزار اعلان به کاربران|ابزار اعلان به کاربران]]';
return new OO.ui.Process(function() {
UMOptions.savePage(mw.config.get('wgPageName'), wikitext, summary, function() {
location.reload();
});
dialog.close({
action: action
}).done(function() {
// Page will be reloaded once saved
});
});
}
return UserMessages.super.prototype.getActionProcess.call(this, action);
};
if (!windowManager) {
windowManager = new OO.ui.WindowManager();
$('body').append(windowManager.$element);
}
UM = new UserMessages({
size: 'large'
});
windowManager.addWindows([UM]);
windowManager.openWindow(UM);
},
savePage: function(title, text, summary, callback) {
(new mw.Api()).post({
action: 'edit',
title: title,
summary: summary,
appendtext: '\n' + text,
token: mw.user.tokens.get('csrfToken')
}).done(function(data) {
if (data.error && data.error.info) {
if (data.error.info == 'missingtitle') {
mw.notify('صفحه ' + title + ' موجود نیست!', {
type: 'error'
});
} else {
mw.notify(data.error.info, {
type: 'error'
});
}
} else {
callback();
}
}).fail(function(data) {
mw.notify(data);
});
},
};
if (mw.config.get('wgNamespaceNumber') === 3 | mw.config.get('wgPageName') === 'ویکیپدیا:صفحه_تمرین') {
$(UMOptions.install);
}
})(jQuery, mediaWiki);