Skip to content

Commit

Permalink
show error if php returns error
Browse files Browse the repository at this point in the history
  • Loading branch information
pekebyte committed Jan 30, 2013
1 parent 7b7444e commit aa26f15
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
4 changes: 3 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
<script type="text/javascript" src="js/jquery-1.9.0.min.js"></script>
<script type="text/javascript" src="js/pekeUpload.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$(document).ready(function(){
$("#file").pekeUpload();
$("#file2").pekeUpload({theme:'bootstrap'});
});
</script>

Expand Down
13 changes: 11 additions & 2 deletions js/pekeUpload.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,15 @@
}
else{
options.onFileError(file,data);
obj.next('a').next('div').find('.file:first').remove();
if((options.theme == "bootstrap")&&(options.showErrorAlerts==true)){
obj.next('a').next('div').prepend('<div class="alert alert-error"><button type="button" class="close" data-dismiss="alert">&times;</button> '+options.sizeError+'</div>');
bootstrapclosenotification();
}
if((options.theme == "custom")&&(options.showErrorAlerts==true)){
obj.next('a').next('div').prepend('<div class="alert-pekeupload"><button type="button" class="close" data-dismiss="alert">&times;</button> '+options.sizeError+'</div>');
customclosenotification();
}
error = false;
}
},
Expand Down Expand Up @@ -199,12 +208,12 @@
function bootstrapclosenotification(){
obj.next('a').next('div').find('.alert-error').click(function(){
$(this).remove();
})
});
}
function customclosenotification(){
obj.next('a').next('div').find('.alert-pekeupload').click(function(){
$(this).remove();
})
});
}
};

Expand Down

0 comments on commit aa26f15

Please sign in to comment.