66 lines
1.6 KiB
Smarty
66 lines
1.6 KiB
Smarty
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
<head>
|
|
<title>''</title>
|
|
<link rel="stylesheet" type="text/css" href="{$urlStatic}/css/Admin/styleUP.css" />
|
|
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
<meta http-equiv="Content-Language" content="pl" />
|
|
|
|
<script src="{$urlStatic}/script/jQuery/jquery-1.4.2.js" type="text/javascript" charset="utf-8"></script>
|
|
<script src="{$urlStatic}/script/ajaxupload.3.5.js" type="text/javascript" charset="utf-8"></script>
|
|
|
|
|
|
|
|
|
|
|
|
<script language="javascript" type="text/javascript">
|
|
urlStatic = '{$urlStatic}';
|
|
urlActionUpload = '{url Image=Upload}';
|
|
{literal}
|
|
$(function(){
|
|
var btnUpload=$('#upload');
|
|
var status=$('#status');
|
|
new AjaxUpload(btnUpload, {
|
|
action: urlActionUpload,
|
|
name: 'uploadfile',
|
|
onSubmit: function(file, ext){
|
|
if (! (ext && /^(jpg|png|jpeg|gif|zip)$/.test(ext))){
|
|
// extension is not allowed
|
|
status.text('tylko JPG, PNG oraz GIF lub zip');
|
|
return false;
|
|
}
|
|
//alert(urlActionUpload);
|
|
status.text('Uploading...');
|
|
},
|
|
onComplete: function(file, response){
|
|
//On completion clear the status
|
|
status.text('');
|
|
//Add uploaded file to list
|
|
//alert(response);
|
|
|
|
$('#PhotoDisplay', window.parent.document).html(response);
|
|
|
|
}
|
|
});
|
|
|
|
});
|
|
{/literal}
|
|
</script>
|
|
|
|
|
|
|
|
</head>
|
|
<body>
|
|
|
|
|
|
|
|
|
|
<!-- Upload Button, use any id you wish-->
|
|
<div id="upload" ><span>Dodaj zdjęcie<span></div><span id="status" ></span>
|
|
|
|
<ul id="files" ></ul>
|
|
|
|
</body>
|
|
</html>
|