MediaWiki:Common.js/FairUseUpload.js

// 14:24, November 20, 2012 (UTC) /*jshint browser:true jquery:true curly:false smarttabs:true laxbreak:true laxcomma:true */ /*global mediaWiki */ if (mediaWiki.config.get('wgCanonicalSpecialPageName') === 'Upload' && !(/(?:^\?|&)wpForReUpload=(?:[^0&]|0[^&])/).test(window.location.search)  ) $(function($) { "use strict"; // Overlay the summary with a prompt for the image type. var $textarea = $('#wpUploadDescription'), $prompt = $(document.createElement('div'))  ; // We need a position:relative parent to work with so we'll wrap the contents $textarea.wrap(' '); var $container = $textarea.parent; // Textarea has width:100% so spills its borders $textarea.css({ boxSizing: 'border-box', MozBoxSizing: 'border-box' }); $prompt.css({ position: 'absolute', top: 0, left: 0, bottom: 0, right: 0, backgroundColor: 'rgba(0,0,0,0.8)' }).append( ' ' + 'Please donot select any license as it would be entered automatically. ' + ' Anime Image ' + ' Manga Image ' + ' ' ); $container.append($prompt); // Disable the textarea in case we didn't cover it perfectly $textarea.prop('disabled', true); function unlockUI { $prompt.remove; $textarea.prop('disabled', false).css({ boxSizing: , MozBoxSizing:  }).unwrap; // NOTE: If we don't remove prompt then it will be promoted upwards as well } // Default text. "Other Image" button will leave this unmodified. $textarea.val( '' ); // Set up the event handlers $prompt.find('.upload-sd-panel').click(function(evt) { evt.preventDefault; $textarea.val( '' ); unlockUI; }); $prompt.find('.upload-other').click(function(evt) { evt.preventDefault; unlockUI; }); });