add travis [ciskip]

This commit is contained in:
Henrique Dias 2016-06-23 08:26:44 +01:00
parent 426b3bbc85
commit 1e3ec14e92
2 changed files with 58 additions and 0 deletions

View File

@ -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)

View File

@ -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;
}