fix download
This commit is contained in:
parent
13cc37d5a2
commit
61a75c6d36
13 changed files with 198 additions and 27 deletions
BIN
src/public/android-chrome-192x192.png
Normal file
BIN
src/public/android-chrome-192x192.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 8.1 KiB |
BIN
src/public/android-chrome-512x512.png
Normal file
BIN
src/public/android-chrome-512x512.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 23 KiB |
BIN
src/public/apple-touch-icon.png
Normal file
BIN
src/public/apple-touch-icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 7.3 KiB |
BIN
src/public/favicon-16x16.png
Normal file
BIN
src/public/favicon-16x16.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 476 B |
BIN
src/public/favicon-32x32.png
Normal file
BIN
src/public/favicon-32x32.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 960 B |
BIN
src/public/favicon.ico
Normal file
BIN
src/public/favicon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 15 KiB |
|
|
@ -28,9 +28,7 @@ fileInput.addEventListener("change", (e) => {
|
|||
fileType = file.name.split(".").pop();
|
||||
console.log(file.type);
|
||||
fileInput.setAttribute("accept", `.${fileType}`);
|
||||
|
||||
const title = document.querySelector("h1");
|
||||
title.textContent = `Convert .${fileType}`;
|
||||
setTitle();
|
||||
|
||||
fetch("/conversions", {
|
||||
method: "POST",
|
||||
|
|
@ -57,6 +55,11 @@ fileInput.addEventListener("change", (e) => {
|
|||
uploadFiles(files);
|
||||
});
|
||||
|
||||
const setTitle = () => {
|
||||
const title = document.querySelector("h1");
|
||||
title.textContent = `Convert ${fileType ? `.${fileType}` : "___"}`;
|
||||
};
|
||||
|
||||
// Add a onclick for the delete button
|
||||
const deleteRow = (target) => {
|
||||
const filename = target.parentElement.parentElement.children[0].textContent;
|
||||
|
|
@ -67,6 +70,13 @@ const deleteRow = (target) => {
|
|||
const index = fileNames.indexOf(filename);
|
||||
fileNames.splice(index, 1);
|
||||
|
||||
// if fileNames is empty, reset fileType
|
||||
if (fileNames.length === 0) {
|
||||
fileType = null;
|
||||
fileInput.removeAttribute("accept");
|
||||
setTitle();
|
||||
}
|
||||
|
||||
fetch("/delete", {
|
||||
method: "POST",
|
||||
body: JSON.stringify({ filename: filename }),
|
||||
|
|
|
|||
19
src/public/site.webmanifest
Normal file
19
src/public/site.webmanifest
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
"name": "ConvertX | Self Hosted File Converter",
|
||||
"short_name": "ConvertX",
|
||||
"icons": [
|
||||
{
|
||||
"src": "/android-chrome-192x192.png",
|
||||
"sizes": "192x192",
|
||||
"type": "image/png"
|
||||
},
|
||||
{
|
||||
"src": "/android-chrome-512x512.png",
|
||||
"sizes": "512x512",
|
||||
"type": "image/png"
|
||||
}
|
||||
],
|
||||
"theme_color": "#a5d601",
|
||||
"background_color": "#13171f",
|
||||
"display": "standalone"
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue