mirror of
https://github.com/filebrowser/filebrowser.git
synced 2024-06-07 23:00:43 +00:00
add travis [ciskip]
This commit is contained in:
parent
426b3bbc85
commit
1e3ec14e92
@ -1,5 +1,6 @@
|
||||
# filemanager - a caddy plugin
|
||||
|
||||
[![Build](https://img.shields.io/travis/hacdias/caddy-filemanager.svg?style=flat-square)](https://travis-ci.org/hacdias/caddy-filemanager)
|
||||
[![community](https://img.shields.io/badge/community-forum-ff69b4.svg?style=flat-square)](https://forum.caddyserver.com)
|
||||
[![Documentation](https://img.shields.io/badge/godoc-reference-blue.svg?style=flat-square)](http://godoc.org/github.com/hacdias/caddy-filemanager)
|
||||
|
||||
|
@ -264,7 +264,64 @@ var uploadEvent = function (event) {
|
||||
|
||||
let button = document.getElementById("upload-input");
|
||||
button.click();
|
||||
button.addEventListener("change", (event) => {
|
||||
event.preventDefault();
|
||||
|
||||
let html = button.changeToLoading();
|
||||
let files = event.target.files;
|
||||
|
||||
let data = new FormData();
|
||||
|
||||
/*
|
||||
event.preventDefault();
|
||||
files = event.target.files;
|
||||
|
||||
$('#loading').fadeIn();
|
||||
|
||||
// Create a formdata object and add the files
|
||||
var data = new FormData();
|
||||
$.each(files, function(key, value) {
|
||||
data.append(key, value);
|
||||
});
|
||||
|
||||
$.ajax({
|
||||
url: window.location.pathname,
|
||||
type: 'POST',
|
||||
data: data,
|
||||
cache: false,
|
||||
dataType: 'json',
|
||||
headers: {
|
||||
'X-Upload': 'true',
|
||||
},
|
||||
processData: false,
|
||||
contentType: false,
|
||||
}).done(function(data) {
|
||||
notification({
|
||||
text: "File(s) uploaded successfully.",
|
||||
type: 'success',
|
||||
timeout: 5000
|
||||
});
|
||||
|
||||
$('#loading').fadeOut();
|
||||
|
||||
$.pjax({
|
||||
url: window.location.pathname,
|
||||
container: '#content'
|
||||
})
|
||||
}).fail(function(data) {
|
||||
$('#loading').fadeOut();
|
||||
|
||||
notification({
|
||||
text: 'Something went wrong.',
|
||||
type: 'error'
|
||||
});
|
||||
console.log(data);
|
||||
});
|
||||
|
||||
|
||||
return false;
|
||||
*/
|
||||
});
|
||||
|
||||
return false;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user