Uploads: prevent submission of unfinished uploads
This commit is contained in:
@@ -42,9 +42,12 @@ Upload.initialize_submit = function() {
|
||||
|
||||
Upload.validate_upload = function (e) {
|
||||
var error_messages = [];
|
||||
if (($("#upload_file").val() === "") && !/^https?:\/\//i.test($("#upload_source").val()) && $("#upload_md5_confirmation").val() === "") {
|
||||
if (($("#upload_file").val() === undefined) && !/^https?:\/\/.+/i.test($("#upload_source").val()) && $("#upload_md5_confirmation").val() === "") {
|
||||
error_messages.push("Must choose file or specify source");
|
||||
}
|
||||
else if ($(".dz-progress:visible").length) {
|
||||
error_messages.push("File has not finished uploading yet")
|
||||
}
|
||||
if (!$("#upload_rating_s").prop("checked") && !$("#upload_rating_q").prop("checked") && !$("#upload_rating_e").prop("checked") &&
|
||||
($("#upload_tag_string").val().search(/\brating:[sqe]/i) < 0)) {
|
||||
error_messages.push("Must specify a rating");
|
||||
|
||||
Reference in New Issue
Block a user