مدیاویکی:Gadget-hidebotedits.js: تفاوت میان نسخهها
ظاهر
imported>Ebrahim صفحهای جدید حاوی «←jslint indent: 2: ←global mw, $: mw.hook('wikipage.content').add(function () { 'use strict'; if (mw.config.get('wgAction') !== 'hi...» ایجاد کرد |
imported>Ebrahim بدون خلاصۀ ویرایش |
||
| (۴ نسخهٔ میانیِ ایجادشده توسط همین کاربر نشان داده نشد) | |||
| خط ۱: | خط ۱: | ||
/*global mw, $*/ | /*global mw, $*/ | ||
mw.hook('wikipage.content').add(function () { | mw.hook('wikipage.content').add(function () { | ||
'use strict'; | 'use strict'; | ||
if (mw.config.get('wgAction') !== 'history') { return; } | if (mw.config.get('wgAction') !== 'history') { return; } | ||
var hidedEdits = $('#pagehistory .history-user > a').filter('[href$="bot"], [href$="Bot"], [href$="BOT"]').parent().parent().hide(); | var hidedEdits = $('#pagehistory .history-user > a') | ||
.filter('[href$="bot"], [href$="Bot"], [href$="BOT"], [href*="bot&"], [href*="Bot&"], [href*="BOT&"]').parent().parent() | |||
.filter(':not(:last-child())') | |||
.has('.minoredit').hide(); | |||
if (hidedEdits.length === 0) { return; } | |||
$('<button>', { | $('<button>', { | ||
'text': 'نمایش/نهفتن ویرایش\u200cهای ربات' | 'text': 'نمایش/نهفتن ویرایش\u200cهای ربات' | ||
نسخهٔ کنونی تا ۲۳ آوریل ۲۰۱۶، ساعت ۰۰:۴۵
/*global mw, $*/
mw.hook('wikipage.content').add(function () {
'use strict';
if (mw.config.get('wgAction') !== 'history') { return; }
var hidedEdits = $('#pagehistory .history-user > a')
.filter('[href$="bot"], [href$="Bot"], [href$="BOT"], [href*="bot&"], [href*="Bot&"], [href*="BOT&"]').parent().parent()
.filter(':not(:last-child())')
.has('.minoredit').hide();
if (hidedEdits.length === 0) { return; }
$('<button>', {
'text': 'نمایش/نهفتن ویرایش\u200cهای ربات'
}).click(function (e) {
hidedEdits.toggle();
e.preventDefault();
}).insertAfter('.mw-history-compareselectedversions-button');
});