1
0
Fork 0

Move drop HTML to a file instead of inlining.

This commit is contained in:
Andrew Tomaka 2011-11-02 10:15:55 -04:00
parent 2ca2d9eaea
commit 096bcb6284
2 changed files with 30 additions and 31 deletions

View File

@ -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
View 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;
}
},
});