مدیاویکی:Gadget-censorship.js: تفاوت میان نسخهها
ظاهر
imported>Yamaha5 صفحهای تازه حاوی «// For description, see User:Mr.Z-man/badimages if(wgAction == 'view') preemptImages(); function preemptImages() { appendCSS('#bodyC...» ایجاد کرد |
imported>Yamaha5 بدون خلاصۀ ویرایش |
||
| خط ۱: | خط ۱: | ||
( function ( mw, $ ){ | |||
var hide_regex = new RegExp (['Lake_India\.jpg', | |||
'Shalimar_gardens\.jpg' | |||
].join('|')); | |||
function clickHandler ( e ) { | |||
function | e.stopPropagation(); | ||
e.preventDefault(); | |||
$( this.firstChild ).unwrap(); | |||
}; | |||
function | function makeWrapper () { | ||
return $( '<span>', { | |||
'class': 'hide-images-wrapper', | |||
'click': clickHandler | |||
} ); | |||
}; | |||
$( 'img' ).each( function () { | |||
if ( hide_regex.test( this.src ) ) { | |||
$( this ).wrap( makeWrapper ); | |||
} | |||
$( this ).addClass( 'hide-images-handled' ); | |||
} ); | |||
function | }( mediaWiki, jQuery ) ); | ||
} | |||
} | |||
نسخهٔ ۲۹ اوت ۲۰۱۵، ساعت ۰۵:۵۲
( function ( mw, $ ){
var hide_regex = new RegExp (['Lake_India\.jpg',
'Shalimar_gardens\.jpg'
].join('|'));
function clickHandler ( e ) {
e.stopPropagation();
e.preventDefault();
$( this.firstChild ).unwrap();
};
function makeWrapper () {
return $( '<span>', {
'class': 'hide-images-wrapper',
'click': clickHandler
} );
};
$( 'img' ).each( function () {
if ( hide_regex.test( this.src ) ) {
$( this ).wrap( makeWrapper );
}
$( this ).addClass( 'hide-images-handled' );
} );
}( mediaWiki, jQuery ) );