init
This commit is contained in:
7
static/css/bootstrap.min.css
vendored
Normal file
7
static/css/bootstrap.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
1
static/css/bootstrap.min.css.map
Normal file
1
static/css/bootstrap.min.css.map
Normal file
File diff suppressed because one or more lines are too long
7
static/js/bootstrap.bundle.min.js
vendored
Normal file
7
static/js/bootstrap.bundle.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
static/js/bootstrap.bundle.min.js.map
Normal file
1
static/js/bootstrap.bundle.min.js.map
Normal file
File diff suppressed because one or more lines are too long
7
static/js/bootstrap.min.js
vendored
Normal file
7
static/js/bootstrap.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
static/js/bootstrap.min.js.map
Normal file
1
static/js/bootstrap.min.js.map
Normal file
File diff suppressed because one or more lines are too long
27
static/js/custom.js
Normal file
27
static/js/custom.js
Normal file
@@ -0,0 +1,27 @@
|
||||
$(document).ready(function(){
|
||||
$('#upload-file-btn').click(function(){
|
||||
var input = document.querySelector('input[type="file"]');
|
||||
|
||||
var data = new FormData();
|
||||
data.append('file', input.files[0]);
|
||||
|
||||
fetch('/upload', {
|
||||
method: 'POST',
|
||||
body: data,
|
||||
|
||||
})
|
||||
.then(function(data){
|
||||
switch(data.status) {
|
||||
case 200:
|
||||
window.location = data.url;
|
||||
break;
|
||||
case 400:
|
||||
console.log("Upload failed");
|
||||
break;
|
||||
case 415:
|
||||
console.log("Wrong file format");
|
||||
break;
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
2
static/js/jquery.min.js
vendored
Normal file
2
static/js/jquery.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user