mirror of
https://github.com/neocities/neocities.git
synced 2025-07-21 18:16:07 +02:00
recursive directory drag-n-drop for chrome
This commit is contained in:
parent
258ef281e0
commit
f00e5d0757
2 changed files with 26 additions and 4 deletions
|
@ -246,8 +246,12 @@
|
|||
|
||||
this.on("error", function(file, errorMessage) {
|
||||
hideUploadProgress()
|
||||
location.href = '/dashboard<%= @dir ? "?dir=#{@dir}" : "" %>'
|
||||
// alert('Failed: '+errorMessage)
|
||||
// Guess a directory upload error
|
||||
if(file.status == 'error' && file.name.match(/.+\..+/) == null && errorMessage == 'Server responded with 0 code.') {
|
||||
alert('Recursive directory upload is only supported by the Chrome web browser.')
|
||||
} else {
|
||||
location.href = '/dashboard<%= @dir ? "?dir=#{@dir}" : "" %>'
|
||||
}
|
||||
})
|
||||
|
||||
this.on("totaluploadprogress", function(progress, totalBytes, totalBytesSent) {
|
||||
|
@ -258,6 +262,10 @@
|
|||
$('#progressBar').css('display', 'block')
|
||||
$('#uploadingProgress').css('width', progress+'%')
|
||||
})
|
||||
|
||||
this.on("sending", function(file) {
|
||||
$('#uploads').append('<input type="hidden" name="file_paths[]" value="'+file.fullPath+'">')
|
||||
})
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue