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: Unatratnag (http://imagecomics.wikia.com/wiki/User:Unatratnag) // 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(' Universe:  '); tbody2.append(' Subject 1:  '); tbody2.append(' Subject 2:  '); tbody2.append(' <td class="mw-label" style="width: 125px;">Subject 3: <td class="mw-input"><textarea id="subject3Box" placeholder="[OPTIONAL] Subject in media. Ex: Albert Simmons, Invincible (Mark Grayson)." cols="60" rows="2" style="overflow: auto;"> '); tbody2.append(' <td class="mw-label" style="width: 125px;">Subject 4: <td class="mw-input"><textarea id="subject4Box" placeholder="[OPTIONAL] Subject in media. Ex: Albert Simmons, Invincible (Mark Grayson). " cols="60" rows="2" style="overflow: auto;"> ');

tbody2.append(' <td class="mw-label" style="width: 125px;">Cover Artist: <td class="mw-input"><textarea id="coverArtist1Box" placeholder="[IF APPLICABLE] Cover Artist." cols="60" rows="2" style="overflow: auto;"> '); tbody2.append(' <td class="mw-label" style="width: 125px;">Penciler: <td class="mw-input"><textarea id="penciler1Box" placeholder="[IF APPLICABLE] Penciler" cols="60" rows="2" style="overflow: auto;"> '); tbody2.append(' <td class="mw-label" style="width: 125px;">Inker: <td class="mw-input"><textarea id="inker1Box" placeholder="[IF APPLICABLE] Inker" cols="60" rows="2" style="overflow: auto;"> '); tbody2.append(' <td class="mw-label" style="width: 125px;">Colourist: <td class="mw-input"><textarea id="colourist1Box" placeholder="[IF APPLICABLE] Colourist. " cols="60" rows="2" style="overflow: auto;"> '); tbody2.append(' <td class="mw-label" style="width: 125px;">Letterer: <td class="mw-input"><textarea id="letterer1Box" placeholder="[IF APPLICABLE] Letterer. " 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; }    }); }