MediaWiki:Group-user.js

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

/* Upload cleanup and fix mobile */ $(function {	if (mw.config.get('wgCanonicalSpecialPageName') === 'Upload' && !$('#wpForReUpload').length && !$('#uploadtext + h2').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, ''); if (fileExt == 'jpeg' || fileExt == 'jfif') fileExt = 'jpg'; $('#wpDestFile').val(fileName + '.' + fileExt); }			$('#wpDestFile').val($('#wpDestFile').val.replace(/[\u200B-\u200F\uFEFF]/g, ).replace(/[‘’]/g, "'").replace(/[“”]/g, '"'));			$('#wpUploadDescription').val($('#wpUploadDescription').val.replace(/[\u200B-\u200F\uFEFF]/g, ));		});	} });

/* Pikipedia/HotCat upload scripts Edit here: https://www.pikminwiki.com/MediaWiki:Gadget-PikipediaUpload.js */