26 lines
629 B
JavaScript
26 lines
629 B
JavaScript
$(function(){
|
|
var btnUpload=$('#upload');
|
|
var status=$('#status');
|
|
new AjaxUpload(btnUpload, {
|
|
action: urlActionUpload,
|
|
name: 'uploadfile',
|
|
onSubmit: function(file, ext){
|
|
if (! (ext && /^(jpg|png|jpeg|gif)$/.test(ext))){
|
|
// extension is not allowed
|
|
status.text('tylko JPG, PNG oraz GIF');
|
|
return false;
|
|
}
|
|
//alert(urlActionUpload);
|
|
status.text('Wgrywam...');
|
|
},
|
|
onComplete: function(file, response){
|
|
//On completion clear the status
|
|
status.text('');
|
|
//Add uploaded file to list
|
|
//alert(response);
|
|
|
|
$('#PhotoDisplay', window.parent.document).html(response);
|
|
|
|
}
|
|
});
|
|
}); |