User:Benjaminthewill123123/image.js

if ({ 'oasis': 1, 'wikia': 1 }[mediaWiki.config.get('skin')] === 1) { jQuery(function ($) {		"use strict";		var LightboxLoader = window.LightboxLoader;		// only run script if LightboxLoader is defined and handleClick hasn't been overwritten yet		// i.e. don't let this script run twice, because it causes problems		if (LightboxLoader && !LightboxLoader.handleClickOverride) {			LightboxLoader.handleClickOverride = LightboxLoader.handleClick;			LightboxLoader.handleClick = function (event) {				// let videos play in the lightbox as intended				if ($(event.target).parent.hasClass('video')) {					LightboxLoader.handleClickOverride.apply(LightboxLoader, arguments);				}			};			// href to File: page, but not for images that have the link= set, e.g. 			$('a[data-image-name]').not('.link-internal').each(function { var $this = $(this), e = encodeURIComponent($this.attr('data-image-name').replace(/ /g, '_')); $this.attr('href', '/wiki/File:' + e); });		}	}); }