مدیاویکی:Common.js: تفاوت میان نسخهها
بدون خلاصۀ ویرایش |
برچسب: خنثیسازی |
||
(۴ نسخهٔ میانیِ ایجادشده توسط همین کاربر نشان داده نشد) | |||
خط ۶: | خط ۶: | ||
}); | }); | ||
/* تنظیمات پاپ آپ ها | /* تنظیمات پاپ آپ ها | ||
mw.loader.using( [ 'ext.popups' ], function() { // wait for popups to be loaded | mw.loader.using( [ 'ext.popups' ], function() { // wait for popups to be loaded | ||
خط ۲۴: | خط ۲۴: | ||
var scrollto = offset.top - 100; // minus fixed header height | var scrollto = offset.top - 100; // minus fixed header height | ||
$('html, body').animate({scrollTop:scrollto}, 0); | $('html, body').animate({scrollTop:scrollto}, 0); | ||
*/ | |||
/* global mw, $ */ | /* global mw, $ */ | ||
// Editing-related javascripts | // Editing-related javascripts | ||
خط ۳۸۲: | خط ۳۸۲: | ||
*/ | */ | ||
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'). | $('#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' } | |||
); | |||
}; | |||
} |