MediaWiki:NewUploadForm.js

function aceNewSubmit{ if($("#wpDestFile").val.trim.length==0){ alert("Please provide a destination filename!"); return; }	if($("#aceSource").val.trim.length==0){ alert("Please provide an original source!"); return; }	if($("#aceDescText").val.trim.length==0){ alert("Please provide a description!"); return; }	if(!$('input[name="ace7Check"]:checked').val){ alert("Please specify if this file relates to Ace Combat 7!"); return; }	if($("#wpLicense").val.length==0){ alert("Please select a copyright license!"); return; }	var aceSum = $("#wpUploadDescription"); aceSum.val(""); if($('input[name="ace7Check"]:checked').val==1){ aceSum.val(aceSum.val + "\n"); }	$("#wpLicense").val("").attr("disabled", "disabled"); $("#wpLicense > option:first").attr("selected", "selected").text(""); $(".mw-htmlform-submit").click; }

function aceMoreLines(i){ var elem = $("#" + i); var textSoFar = elem.val; elem.after("" + textSoFar + " "); elem.remove; $("#" + i + "More").remove; }

function aceOldForm{ $("#aceSwitchForms").html("Click here for the new form. You will lose most of your work!"); $("#aceNewSubmit").remove; $(".mw-htmlform-submit").show.attr("accesskey", "s"); $("#mw-upload-form fieldset:eq(1) legend").text("File description"); $(".mw-htmlform-field-UploadSourceField td.mw-label").show; $(".mw-htmlform-field-UploadSourceField td.mw-input").attr("colspan", "1"); $(".mw-htmlform-field-HTMLInfoField td.mw-label").show; $(".mw-htmlform-field-HTMLInfoField td.mw-input").attr("colspan", "1"); $("tr.mw-htmlform-field-HTMLTextAreaField").show; $("label[for='wpDestFile'] .fa-asterisk").remove; $("#wpDestFile-warning").removeAttr("style"); $("#wpLicense").removeAttr("style").val(""); $("#wpLicense > option:first").attr("selected", "selected"); $("#mw-license-preview").html(""); $(".mw-htmlform-field-Licenses .mw-label label").removeAttr("style"); $(".aceFile").each(function{		$(this).remove;	}); }

function aceNewForm{ $("#aceSwitchForms").html("Advanced users, click here for the old form. You will lose most of your work! Are you sure you want to use the old form? Yes, I'm sure. Cancel."); $(".mw-htmlform-submit").hide.removeAttr("accesskey").after(' Upload File '); $("#mw-upload-form fieldset:eq(1) legend").text("File information"); $(".mw-htmlform-field-UploadSourceField td.mw-label").hide; $(".mw-htmlform-field-UploadSourceField td.mw-input").attr("colspan", "2"); $(".mw-htmlform-field-HTMLInfoField td.mw-label").hide; $(".mw-htmlform-field-HTMLInfoField td.mw-input").attr("colspan", "2"); $("tr.mw-htmlform-field-HTMLTextAreaField").hide; $("label[for='wpDestFile']").prepend(" "); $("#wpDestFile-warning").attr("style", "color:yellow");

$(".mw-htmlform-field-HTMLTextField").next.after(" Original source:  <input id='aceSource' name='aceSource' size='80'><span id='aceSourceMore' class='fa fa-plus' style='margin:0 5px;cursor:pointer' title='Click here for more lines' onclick='aceMoreLines(\"aceSource\", true);'>   \ \ <tr id='aceSourceHelp' class='aceFile' style='display:none;'>  <td style='padding-bottom:3em'>The source can be as simple as a URL to the source website or video. Do not link to the image file itself, as it's no use when it's being uploaded.  If this is an in-game screenshot, specify the source as such:  If this file comes from another file on this wiki, specify the source as such:   If you need more than one line, click the plus icon to the right. \ \ <tr class='aceFile'><td class='mw-label'><label for='aceAuthor'>Author(s): <span class='fa fa-question-circle' style='margin:0 5px;cursor:pointer' title='Click here for help' onclick='$(\"#aceAuthorsHelp\").toggle;'> <td class='mw-input'><input id='aceAuthors' name='aceAuthors' size='80'><span id='aceAuthorsMore' class='fa fa-plus' style='margin:0 5px;cursor:pointer' title='Click here for more lines' onclick='aceMoreLines(\"aceAuthors\")'>   \ \ <tr id='aceAuthorsHelp' class='aceFile' style='display:none;'> <td style='padding-bottom:3em'>Usually, this field is unnecessary. If this file was created by someone in particular, credit them here. If this is an in-game screenshot, credit the person who took it, whether that's yourself or another player. If you need more than one line, click the plus icon to the right. \ \ <tr class='aceFile'><td class='mw-label'><label for='aceVersions'>Other versions: <span class='fa fa-question-circle' style='margin:0 5px;cursor:pointer' title='Click here for help' onclick='$(\"#aceVersionsHelp\").toggle;'> <td class='mw-input'><input id='aceVersions' name='aceVersions' size='80'><span id='aceVersionsMore' class='fa fa-plus' style='margin:0 5px;cursor:pointer' title='Click here for more lines' onclick='aceMoreLines(\"aceVersions\")'>   \ \ <tr id='aceVersionsHelp' class='aceFile' style='display:none;'> <td style='padding-bottom:3em'>This is typically used for wallpapers. If you know there are other files on the wiki similar to this one, link them in this field as such: etc. If you need more than one line, click the plus icon to the right. \ \ <tr class='aceFile'><td class='mw-label'><label for='aceDescText'> Description: <span class='fa fa-question-circle' style='margin:0 5px;cursor:pointer' title='Click here for help' onclick='$(\"#aceDescHelp\").toggle;'> <td class='mw-input'><textarea rows='2' style='width:100%;' id='aceDescText' name='aceDescText'>  \ \ <tr id='aceDescHelp' class='aceFile' style='display:none;'> <td style='padding-bottom:3em'>Describe the contents of the file you're uploading. Be as descriptive as possible, and include  to relevant articles. \ \ <tr class='aceFile'>   Does this file relate in any way to Ace Combat 7: Skies Unknown ? \ <tr class='aceFile'> <td class='mw-input'> <input type='radio' name='ace7Check' value='1' style='top:0;height:13px;'> Yes  <input type='radio' name='ace7Check' value='0' style='top:0;height:13px;'> No  ");

$("#wpLicense").val(""); $("#wpLicense > option:first").attr("selected", "selected");

$(".mw-htmlform-field-Licenses .mw-label label").attr("style","display:inline!important;").html(" Copyright license: <span class='fa fa-question-circle' style='margin:0 5px;cursor:pointer' title='Click here for help' onclick='$(\"#aceCopyHelp\").toggle;'> ");

$("#wpLicense").attr("style","display:inline!important;");

$("#mw-license-preview").attr("style","width:790px;").parent("tr").after("<tr id='aceCopyHelp' class='aceFile' style='display:none;'> <td style='padding-bottom:3em'>If you're not sure which license to use, \" Fair use \" covers 99% of files on this wiki. Other licenses are only used for files that are explicitly protected under those licenses.  "); }

if($(".page-Special_Upload").length){ $("#mw-upload-form fieldset:eq(1)").before(" "); aceNewForm; $(document).on("keypress", ":input:not(textarea)", function(event) {		return event.keyCode != 13;	}); }

if($(".page-Special_Images").length){ $("#page-header-add-new-photo").click(function{ window.location=$(this).attr('href'); }); }