MediaWiki:Gadget-DeferredDisplay.js

/** * Deferred display of nsfw-tagged images. * jshint validation * @author Dschwen, 2013 */

(function ($, mw) {	var ti = mw.config.get("wgTitle");	if ($.inArray(mw.config.get('wgNamespaceNumber'), [0, 1, 2, 3, 4, 5, 6, 10, 11, 14, 15]) === -1)		return;	// wrap non thumb images first	$('img[alt*=NSFWTAG]').each(function (i, e) { $(e).wrap($(' ').css({ display: 'block', width: $(e).width + 'px', height: $(e).height + 'px', backgroundColor: '#eee' }));	}).parent.add($('.thumbinner,.gallerybox').has('.nsfwelement').find('.image').parent)	.one('click', function (e) { var nImg = $(this); console.log(nImg); $(this).css('background', 'none').find('img').css({			visibility: ''		}); e.preventDefault; })	.css({ backgroundImage: 'url("https://static.jojowiki.com/images/customizations/Dialog-warning-yellow.png")', backgroundRepeat: 'no-repeat', backgroundPosition: 'center' })	.find('img').css({ visibility: 'hidden' }); }(jQuery, mediaWiki));