Improve status-messages of ajax uploader (#126)
This commit is contained in:
@ -4,6 +4,8 @@
|
|||||||
Version 2.0-beta3 ()
|
Version 2.0-beta3 ()
|
||||||
------------------------------------------------------------------------
|
------------------------------------------------------------------------
|
||||||
|
|
||||||
|
* Show upload-success or error with the ajax image uploader
|
||||||
|
|
||||||
* Fix preview entry exception (issue #119)
|
* Fix preview entry exception (issue #119)
|
||||||
|
|
||||||
* Add serendipity.toggle_collapsible as a reusable JS function
|
* Add serendipity.toggle_collapsible as a reusable JS function
|
||||||
|
@ -340,6 +340,8 @@ switch ($serendipity['GET']['adminAction']) {
|
|||||||
'created_thumbnail' => $created_thumbnail
|
'created_thumbnail' => $created_thumbnail
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
|
// necessary for the ajax-uplaoder to show upload errors
|
||||||
|
header("Internal Server Error", true, 500);
|
||||||
$messages[] = ERROR_UNKNOWN_NOUPLOAD;
|
$messages[] = ERROR_UNKNOWN_NOUPLOAD;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1307,7 +1307,11 @@ $(function() {
|
|||||||
if ($('#uploadform').length > 0) {
|
if ($('#uploadform').length > 0) {
|
||||||
$('input[name="go_properties"]').hide();
|
$('input[name="go_properties"]').hide();
|
||||||
var progressIcon = document.createElement('span');
|
var progressIcon = document.createElement('span');
|
||||||
progressIcon.className = 'icon-info-circled'
|
progressIcon.className = 'uploadIcon icon-info-circled';
|
||||||
|
errorIcon = document.createElement('span');
|
||||||
|
errorIcon.className = 'uploadIcon icon-attention-circled';
|
||||||
|
successIcon = document.createElement('span');
|
||||||
|
successIcon.className = 'uploadIcon icon-ok-circled';
|
||||||
$('#uploadform').submit(function(event) {
|
$('#uploadform').submit(function(event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
$('.uploadform_userfile').each(function() {
|
$('.uploadform_userfile').each(function() {
|
||||||
@ -1376,8 +1380,13 @@ $(function() {
|
|||||||
}
|
}
|
||||||
}).done(function(data) {
|
}).done(function(data) {
|
||||||
progress.value = 100;
|
progress.value = 100;
|
||||||
|
progressContainer.className = "msg_success";
|
||||||
|
$(progressContainer).find('.uploadIcon').replaceWith(successIcon.cloneNode(true));
|
||||||
}).fail(function(data) {
|
}).fail(function(data) {
|
||||||
alert("fail:" + data.statusText);
|
progressContainer.className = "msg_error";
|
||||||
|
progress.disabled = true;
|
||||||
|
progressContainer.innerHTML += "{$CONST.ERROR_UNKNOWN_NOUPLOAD}";
|
||||||
|
$(progressContainer).find('.uploadIcon').replaceWith(errorIcon.cloneNode(true));
|
||||||
})
|
})
|
||||||
}, type);
|
}, type);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user