مدیاویکی:Gadget-Extra-Editbuttons.js: تفاوت میان نسخهها
صفحهای تازه حاوی «// <nowiki> // DON'T REMOVE THIS LINE EVER ←global jQuery, mediaWiki, persianWikiTools, persianTools: /** * UI code for Persian tools *...» ایجاد کرد |
بدون خلاصۀ ویرایش |
||
(۳ نسخهٔ میانیِ ایجادشده توسط همین کاربر نشان داده نشد) | |||
خط ۴۲: | خط ۴۲: | ||
* Save a page | * Save a page | ||
*/ | */ | ||
function | |||
function goToEdit() { | |||
window.location="//"+mw.config.get('wgServerName')+"/w/index.php?title="+mw.config.get('wgPageName')+"&action=submit#continueAbar"; | |||
} | } | ||
if (window.location.hash=='#continueAbar'){ | |||
var text=$('#wpTextbox1').val() | |||
setTimeout(function() { | |||
var newText=persianWikiTools.superTool(text) | |||
$('#wpTextbox1').val(newText) | |||
$('#wpSummary').val('ویرایش به وسیله ابرابزار ') | |||
setTimeout(function() { | |||
document.getElementById('wpDiff').click(); | |||
}, 500); | |||
}, 2000); | |||
}; | |||
if (mw.config.get('wgAction') === 'view' && | if (mw.config.get('wgAction') === 'view' && | ||
mw.config.get('wgIsArticle') && | mw.config.get('wgIsArticle') && | ||
mw.config.get('wgUserEditCount')>100&& | |||
mw.config.get('wgPageName') !== 'صفحهٔ_اصلی') { | mw.config.get('wgPageName') !== 'صفحهٔ_اصلی') { | ||
$('#ca-abar-abzar').remove(); | $('#ca-abar-abzar').remove(); | ||
خط ۶۷: | خط ۷۱: | ||
interwikiFix = true; | interwikiFix = true; | ||
} | } | ||
$(mw.util.addPortletLink('p- | $(mw.util.addPortletLink('p-cactions', '#', interwikiFix ? 'ابرابزار+انتقال میانویکی' : 'ابرابزار', 'ca-abar-abzar', interwikiFix ? 'ابزار پیشرفتهٔ ویرایش متن + ابزار انتقال خودکار میانویکی سنتی به ویکیداده' : 'ابزار پیشرفتهٔ ویرایش متن')).click(function (e) { | ||
e.preventDefault(); | e.preventDefault(); | ||
mw.loader.using('oojs-ui').then(function () { | mw.loader.using('oojs-ui').then(function () { | ||
خط ۷۳: | خط ۷۷: | ||
if (!confirmed) return; | if (!confirmed) return; | ||
return loadPage(mw.config.get('wgPageName') | return loadPage(mw.config.get('wgPageName')).then(function (data) { | ||
// افزودن میانویکی سنتی به ویکیداده به صورت خودکار | // افزودن میانویکی سنتی به ویکیداده به صورت خودکار | ||
if (interwikiFix) { | if (interwikiFix) { | ||
$.get('// | $.get('//dexbot.toolforge.org/interwikidata.php', { page: mw.config.get('wgPageName') }) | ||
.then(function () {}, function () {}); | .then(function () {}, function () {}); | ||
} | } | ||
خط ۹۰: | خط ۸۷: | ||
botworks.trigMissedFileUpload(); | botworks.trigMissedFileUpload(); | ||
botworks.trigMissedRef(); | botworks.trigMissedRef(); | ||
}).then(function (text) { | |||
return goToEdit(); | |||
}) | |||
}) | |||
}); | }); | ||
}); | }); | ||
خط ۲۱۲: | خط ۱۹۵: | ||
} | } | ||
} | } | ||
} | |||
/* | |||
* اجازه میدهد که برخی کاربران از دسترسی به ابرابزار محروم شوند | |||
*/ | |||
function superToolAllowed() { | |||
return $.inArray( | |||
mw.config.get('wgUserId'), | |||
[ | |||
707839 // Viera iran | |||
] | |||
) == -1; | |||
} | } | ||
خط ۳۷۹: | خط ۳۷۴: | ||
// Buttons that add tags | // Buttons that add tags | ||
/* برچسب ویکی\u200cسازی */ | /* برچسب ویکی\u200cسازی *//* | ||
tools.wikify = buttonGenerator( | tools.wikify = buttonGenerator( | ||
function () { | function () { | ||
خط ۳۹۲: | خط ۳۸۷: | ||
); | ); | ||
/* بدون منبع */ | /* بدون منبع *//* | ||
tools.noSource = buttonGenerator( | tools.noSource = buttonGenerator( | ||
function () { | function () { | ||
خط ۴۰۵: | خط ۴۰۰: | ||
); | ); | ||
/* حذف سریع */ | /* حذف سریع *//* | ||
tools.speedyDel = buttonGenerator( | tools.speedyDel = buttonGenerator( | ||
function () { | function () { | ||
خط ۴۲۰: | خط ۴۱۵: | ||
); | ); | ||
/* حذف زماندار */ | /* حذف زماندار *//* | ||
tools.prod = buttonGenerator( | tools.prod = buttonGenerator( | ||
function () { | function () { | ||
خط ۴۳۵: | خط ۴۳۰: | ||
); | ); | ||
/* منبع تصویر نامعلوم */ | /* منبع تصویر نامعلوم *//* | ||
tools.picSource = buttonGenerator( | tools.picSource = buttonGenerator( | ||
function () { | function () { | ||
خط ۴۴۸: | خط ۴۴۳: | ||
); | ); | ||
/* حق تکثیر تصویر نامعلوم */ | /* حق تکثیر تصویر نامعلوم *//* | ||
tools.picCopy = buttonGenerator( | tools.picCopy = buttonGenerator( | ||
function () { | function () { | ||
خط ۴۶۱: | خط ۴۵۶: | ||
); | ); | ||
/* تمیزکاری */ | /* تمیزکاری *//* | ||
tools.cleanup = buttonGenerator( | tools.cleanup = buttonGenerator( | ||
function () { | function () { | ||
خط ۴۷۳: | خط ۴۶۸: | ||
'broom' | 'broom' | ||
); | ); | ||
*/ | |||
/* اخطار نگاره */ | /* اخطار نگاره *//* | ||
tools.imgWarn = buttonGenerator( | tools.imgWarn = buttonGenerator( | ||
function () { | function () { | ||
خط ۴۹۱: | خط ۴۸۶: | ||
'aviso' | 'aviso' | ||
); | ); | ||
*/ | |||
/* حق تکثیر مشکوک */ | /* حق تکثیر مشکوک *//* | ||
tools.sus = buttonGenerator( | tools.sus = buttonGenerator( | ||
function () { | function () { | ||
خط ۵۰۴: | خط ۴۹۹: | ||
'sus' | 'sus' | ||
); | ); | ||
*/ | |||
/* نقض حق تکثیر */ | /* نقض حق تکثیر *//* | ||
tools.copyR = buttonGenerator( | tools.copyR = buttonGenerator( | ||
function () { | function () { | ||
خط ۵۲۲: | خط ۵۱۷: | ||
'copyr' | 'copyr' | ||
); | ); | ||
*/ | |||
/* لحن نامناسب */ | /* لحن نامناسب */ | ||
tools.tone = buttonGenerator( | /*tools.tone = buttonGenerator( | ||
function () { | function () { | ||
$('#wpTextbox1').val('{' + '{لحن نامناسب}}\n' + $('#wpTextbox1').val()); | $('#wpTextbox1').val('{' + '{لحن نامناسب}}\n' + $('#wpTextbox1').val()); | ||
خط ۵۳۵: | خط ۵۳۰: | ||
'tone' | 'tone' | ||
); | ); | ||
*/ | |||
// Buttons that help with wiki writing | // Buttons that help with wiki writing | ||
/* تغییر جهت */ | /* تغییر جهت */ | ||
خط ۵۹۲: | خط ۵۸۷: | ||
); | ); | ||
/* ملزومات مقاله */ | /* ملزومات مقاله *//* | ||
tools.addEssentialThings = buttonGenerator( | tools.addEssentialThings = buttonGenerator( | ||
function () { | function () { | ||
خط ۶۰۴: | خط ۵۹۹: | ||
'add-note' | 'add-note' | ||
); | ); | ||
/* خوشامدید */ | /* خوشامدید *//* | ||
tools.welcome = buttonGenerator( | tools.welcome = buttonGenerator( | ||
function () { | function () { |