MediaWiki:Common.js/FairUseUpload.js

/* Any JavaScript here will be loaded for all users on every page load. */ // 12:24, July 31, 2013 (UTC) // @Original Author: UltimateSupreme (http://naruto.wikia.com/wiki/User:UltimateSupreme) // @Modified By: SimAnt // if (mw.config.get('wgCanonicalSpecialPageName') === 'Upload') { $(function ($) {               "use strict";		if (!(/(?:^\?|&)wpForReUpload=(?:[^0&]|0[^&])/).test(window.location.search)) {			$('#mw-htmlform-description').css('width', '100%');

// Bind upload button to verify function $('#mw-upload-form').on('submit', verifySummary); var rows = $('#mw-htmlform-description').find('tr'); $('tr.mw-htmlform-field-HTMLTextAreaField').hide; $('tr.mw-htmlform-field-HTMLTextAreaField').next.detach;

rows.eq(1).after(' Source:  '); $('#mw-htmlform-description').append(' '); var tbody1 = $('#mw-htmlform-description').children('tbody').eq(0); tbody1.append(' Description:  ');

// Add new rows var tbody2 = $('#mw-htmlform-description').children('tbody').eq(1); tbody2.append(' Purpose:  '); tbody2.append(' Portion Used:  '); tbody2.append(' Replaceable?:  '); tbody2.append(' <td class="mw-label" style="width: 125px;">Resolution: <td class="mw-input"><textarea id="resolutionBox" placeholder="[OPTIONAL] Resolution of the image." cols="60" rows="2" style="overflow: auto;"> '); tbody2.append(' <td class="mw-label" style="width: 125px;">Other Information: <td class="mw-input"><textarea id="otherinfoBox" placeholder="[OPTIONAL] Any other information about the image." cols="60" rows="2" style="overflow: auto;"> '); }

function verifySummary {

if (!$('#wpLicense').val) { alert('Licensing must be completed.'); return false; }else if ((/^[0-9]+\.(png|gif|jpg|jpeg|ico|pdf|svg)$/).test($('#wpDestFile').val) || $('#wpDestFile').val.length < 8) { alert('Enter a more descriptive filename.'); return false; }else if (!$('#sourceBox').val) { alert('Source must be entered'); return false; }			var strBuilder = '\r\n'; strBuilder += ''; $('#wpUploadDescription').val(strBuilder); return true; }	}); }