diff options
Diffstat (limited to 'public')
| -rw-r--r-- | public/index.php | 13 | ||||
| -rwxr-xr-x | public/static/img/icons/cross.png | bin | 0 -> 655 bytes | |||
| -rw-r--r-- | public/static/style.css | 5 |
3 files changed, 15 insertions, 3 deletions
diff --git a/public/index.php b/public/index.php index 6f58fe8..393940d 100644 --- a/public/index.php +++ b/public/index.php @@ -511,6 +511,9 @@ $privacy_exists = is_file($_SERVER['DOCUMENT_ROOT'] . '/static/PRIVACY.txt'); return ` <div class="box item column gap-4 pad-4"> + <button class="delete-btn" onclick="deleteFileLocally('${file.id}');loadUploadedFiles();" title="Delete locally"> + <img src="/static/img/icons/cross.png" alt="X"> + </button> <?php if (FILE_THUMBNAILS): ?> <div class="column align-center justify-center grow"> <div style="max-width: 128px; max-height:128px;"> @@ -546,9 +549,7 @@ $privacy_exists = is_file($_SERVER['DOCUMENT_ROOT'] . '/static/PRIVACY.txt'); return; } - let files = getUploadedFiles(); - files = files.filter((x) => x.id !== id); - localStorage.setItem('uploaded_files', JSON.stringify(files)); + deleteFileLocally(id); loadUploadedFiles(); }) .catch((err) => { @@ -557,6 +558,12 @@ $privacy_exists = is_file($_SERVER['DOCUMENT_ROOT'] . '/static/PRIVACY.txt'); }); } + function deleteFileLocally(id) { + let files = getUploadedFiles(); + files = files.filter((x) => x.id !== id); + localStorage.setItem('uploaded_files', JSON.stringify(files)); + } + // loading already existing uploaded files function loadUploadedFiles() { let files = getUploadedFiles(); diff --git a/public/static/img/icons/cross.png b/public/static/img/icons/cross.png Binary files differnew file mode 100755 index 0000000..1514d51 --- /dev/null +++ b/public/static/img/icons/cross.png diff --git a/public/static/style.css b/public/static/style.css index 1eb29dc..c5302c8 100644 --- a/public/static/style.css +++ b/public/static/style.css @@ -242,6 +242,11 @@ button[type=submit]:hover { overflow-x: scroll; } +.item .delete-btn { + position: absolute; + align-self: flex-end; +} + /** SHORTCUTS */ .column { display: flex; |
