1
0
Fork 0

Display a different image based on whether or not the file transfer succeeded.

This commit is contained in:
Andrew Tomaka 2011-11-02 16:35:25 -04:00
parent eccd944e31
commit 51f8ed7df7
5 changed files with 17 additions and 4 deletions

View file

@ -148,12 +148,18 @@ h1{
left:0; left:0;
height:100%; height:100%;
width:100%; width:100%;
background: url('../img/done.png') no-repeat center center rgba(255,255,255,0.5);
display: none; display: none;
} }
#dropbox .preview.done .uploaded{ #dropbox .preview.done .uploaded{
display: block; 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 { #dropbox .linkHolder {
position: absolute; position: absolute;
left: 0; left: 0;

BIN
img/error.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

BIN
img/success.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

BIN
img/warning.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

View file

@ -11,8 +11,16 @@ $(function(){
url: 'upload.php', url: 'upload.php',
uploadFinished:function(i,file,response){ uploadFinished:function(i,file,response){
$.data(file).addClass('done'); if(response.type == 'error') {
$.data(file).find('.linkBox').val(response.file); 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 // response is the JSON object that post_file.php returns
}, },