پرش به محتوا

مدیاویکی:Common.js: تفاوت میان نسخه‌ها

۱٬۰۱۷ بایت اضافه‌شده ،  ‏۶ فوریهٔ ۲۰۲۲
بدون خلاصۀ ویرایش
بدون خلاصۀ ویرایش
بدون خلاصۀ ویرایش
خط ۳۸۲: خط ۳۸۲:
  */
  */
mw.loader.using(["mediawiki.util"], function() {
mw.loader.using(["mediawiki.util"], function() {
/**
  * Extract a URL parameter from the current URL
  * @deprecated: Use mw.util.getParamValue with proper escaping
  */
  mw.log.deprecate( window, 'addPortletLink', mw.util.addPortletLink, 'Use mw.util.addPortletLink instead' );
   if (["صفحهٔ_اصلی", "بحث:صفحه_اصلی"].indexOf(mw.config.get("wgPageName")) !== -1) {
   if (["صفحهٔ_اصلی", "بحث:صفحه_اصلی"].indexOf(mw.config.get("wgPageName")) !== -1) {
     $(function() {
     $(function() {
خط ۴۶۸: خط ۴۷۳:
// Hide the FileExporter portlet link if the file is not free content
// Hide the FileExporter portlet link if the file is not free content
$(function() {
$(function() {
   if ($('#ca-fileExporter').length == 1 & $(mw.config.get('wgCategories')).filter(['محتویات غیر آزاد', 'تصویرهای با منبع نامعلوم', 'تصویرهای با پدیدآور نامشخص']).length > 0) {
   if ($('#ca-fileExporter').length == 1 & $(mw.config.get('wgCategories')).filter(['محتویات غیر آزاد', 'تصویرهای با منبع نامعلوم', 'تصویرهای با پدیدآور نامشخص', 'پرونده‌های بدون مجوز قابل خواندن برای ماشین']).length > 0) {
   $('#ca-fileExporter').hide();
   $('#ca-fileExporter').find('a').css('color', 'grey').attr('title', 'غیرفعال برای محتوای غیر آزاد');
   }
   }
});
});
function updateUserScriptWarning( msg, newMsg ) {
return function () {
var userScript = '/wiki/Special:MyPage/' + mw.config.get('skin') + '.js';
var commonScript = '/wiki/Special:MyPage/common.js';
mw.notify(
$('<div>').html(
// please translate to Farsi
'One of the scripts you are running is broken and using a deprecated function <strong>' + msg + '</strong>. Please check your <a href="' + userScript + '">skin scripts</a> and <a href="' + commonScript + '">common scripts</a>, to update the reference to' + newMsg + 'to restore your script.'
),
{ type: 'error' }
);
};
}