Move drop HTML to a file instead of inlining.
This commit is contained in:
parent
2ca2d9eaea
commit
096bcb6284
2 changed files with 30 additions and 31 deletions
32
index.php
32
index.php
|
@ -18,36 +18,6 @@
|
|||
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
|
||||
<script src="js/jquery.filedrop.js"></script>
|
||||
<script>
|
||||
$('#drop').filedrop({
|
||||
url: 'upload.php',
|
||||
paramname: 'file',
|
||||
maxfiles: 4,
|
||||
maxfilesize: 1,
|
||||
|
||||
uploadFinished: function(i, file, response, time) {
|
||||
|
||||
},
|
||||
beforeEach: function(file) {
|
||||
alert('temp attempting upload') ;
|
||||
},
|
||||
|
||||
error: function(type, file) {
|
||||
switch(type) {
|
||||
case 'BrowserNotSupported':
|
||||
alert('temp no html5 drag and drop');
|
||||
break;
|
||||
case 'TooManyFiles':
|
||||
alert('temp too many files (max:4)');
|
||||
break;
|
||||
case 'FileTooLarge':
|
||||
alert('temp' + file.name + ' too large (max:1mb');
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
},
|
||||
});
|
||||
</script>
|
||||
<script src="js/upload.js"></script>
|
||||
</body>
|
||||
</html>
|
29
js/upload.js
Normal file
29
js/upload.js
Normal file
|
@ -0,0 +1,29 @@
|
|||
$('#drop').filedrop({
|
||||
url: 'upload.php',
|
||||
paramname: 'file',
|
||||
maxfiles: 4,
|
||||
maxfilesize: 1,
|
||||
|
||||
uploadFinished: function(i, file, response, time) {
|
||||
|
||||
},
|
||||
beforeEach: function(file) {
|
||||
alert('temp attempting upload') ;
|
||||
},
|
||||
|
||||
error: function(type, file) {
|
||||
switch(type) {
|
||||
case 'BrowserNotSupported':
|
||||
alert('temp no html5 drag and drop');
|
||||
break;
|
||||
case 'TooManyFiles':
|
||||
alert('temp too many files (max:4)');
|
||||
break;
|
||||
case 'FileTooLarge':
|
||||
alert('temp' + file.name + ' too large (max:1mb');
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
},
|
||||
});
|
Loading…
Reference in a new issue