MediaWiki:Group-user.js

/* Any JavaScript here will be loaded for registered users only */

/* Fix mobile and new upload cleanup */ $(function {	if (mw.config.get('wgCanonicalSpecialPageName') === 'Upload' && !$('#wpForReUpload').length && !$('.warning').length) {		if (mw.config.get('wgMFMode')) {			$("#wpUploadFile").change(function { var ogFileName = $("#wpUploadFile").val.split('\\').pop; $('#wpDestFile').val(ogFileName); });			$("#wpUploadFileURL").change(function { var ogFileName = $("#wpUploadFileURL").val.split('/').pop; $('#wpDestFile').val(ogFileName); });		}		$('input[name=wpUpload]').click(function { var file = $('#wpDestFile').val.replace(/\.+$/, ''); if (file.includes('.')) { var fileName = file.substr(0, file.lastIndexOf('.')).replace(/\.+$/, ''); var fileExt = file.split('.').pop.toLowerCase; var regex = new RegExp('(\.' + fileExt + ')+$', 'i'); fileName = fileName.replace(regex, '').replace(/[‘’]/g, "'").replace(/[“”]/g, '"');				if (fileExt == 'jpeg' || fileExt == 'jfif')					fileExt = 'jpg';				$('#wpDestFile').val(fileName + '.' + fileExt);			}			$('#wpUploadDescription').val($('#wpUploadDescription').val.replace(/[‘’]/g, "'").replace(/[“”]/g, '"')); });	} });

/* HotCat upload script */ $(function {	if (mw.config.get('wgCanonicalSpecialPageName') === 'Upload' && !$('#wpForReUpload').length && $.inArray('ext.gadget.HotCat', RLPAGEMODULES) === -1) {		mw.loader.load('/MediaWiki:Gadget-HotCat.js?action=raw&ctype=text/javascript');		mw.loader.load('/MediaWiki:Gadget-HotCat.css?action=raw&ctype=text/css', 'text/css');	} });