Display a different image based on whether or not the file transfer succeeded.
This commit is contained in:
parent
eccd944e31
commit
51f8ed7df7
5 changed files with 17 additions and 4 deletions
|
@ -148,12 +148,18 @@ h1{
|
|||
left:0;
|
||||
height:100%;
|
||||
width:100%;
|
||||
background: url('../img/done.png') no-repeat center center rgba(255,255,255,0.5);
|
||||
|
||||
display: none;
|
||||
}
|
||||
|
||||
#dropbox .preview.done .uploaded{
|
||||
display: block;
|
||||
background: url('../img/success.png') no-repeat center center rgba(255,255,255,0.5);
|
||||
}
|
||||
|
||||
#dropbox .preview.error .uploaded{
|
||||
display: block;
|
||||
background: url('../img/error.png') no-repeat center center rgba(255,255,255,0.5);
|
||||
}
|
||||
|
||||
|
||||
|
@ -202,7 +208,6 @@ h1{
|
|||
|
||||
|
||||
|
||||
|
||||
#dropbox .linkHolder {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
|
|
BIN
img/error.png
Normal file
BIN
img/error.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 7.9 KiB |
BIN
img/success.png
Normal file
BIN
img/success.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 7.9 KiB |
BIN
img/warning.png
Normal file
BIN
img/warning.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.6 KiB |
12
js/upload.js
12
js/upload.js
|
@ -11,8 +11,16 @@ $(function(){
|
|||
url: 'upload.php',
|
||||
|
||||
uploadFinished:function(i,file,response){
|
||||
$.data(file).addClass('done');
|
||||
$.data(file).find('.linkBox').val(response.file);
|
||||
if(response.type == 'error') {
|
||||
alert('There was an error: ' + response.status);
|
||||
$.data(file).addClass('error');
|
||||
$.data(file).find('.linkBox').remove();
|
||||
|
||||
return false;
|
||||
} else {
|
||||
$.data(file).addClass('done');
|
||||
$.data(file).find('.linkBox').val(response.file);
|
||||
}
|
||||
// response is the JSON object that post_file.php returns
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in a new issue