— Ask for confirmation before deleting image on index page (#92)

This commit is contained in:
Luc Didry
2023-12-30 08:03:58 +01:00
parent 82f57fc72d
commit 81701b6f60
7 changed files with 83 additions and 57 deletions
+1
View File
@@ -3,6 +3,7 @@ Revision history for Lutim
0.17.0 ????-??-??
- 🐛 — AVIF format support (#139)
- ✨ — Allow to configure the directory where to store the images (#125)
- ✨ — Ask for confirmation before deleting image on index page (#92)
0.16.0 2023-12-29
- ⬆️ Update jQuery
+28 -24
View File
@@ -31,15 +31,15 @@ msgstr "%1 sent images on this instance from beginning."
msgid "-or-"
msgstr "-or-"
#: lib/Lutim.pm:342 lib/Lutim/Command/cron/stats.pm:158 lib/Lutim/Command/cron/stats.pm:172 lib/Lutim/Command/cron/stats.pm:189 themes/default/templates/index.html.ep:5 themes/default/templates/myfiles.html.ep:5 themes/default/templates/partial/raw.js.ep:25 themes/default/templates/partial/raw.js.ep:8 themes/default/templates/raw.html.ep:10
#: lib/Lutim.pm:346 lib/Lutim/Command/cron/stats.pm:158 lib/Lutim/Command/cron/stats.pm:172 lib/Lutim/Command/cron/stats.pm:189 themes/default/templates/index.html.ep:5 themes/default/templates/myfiles.html.ep:5 themes/default/templates/partial/raw.js.ep:25 themes/default/templates/partial/raw.js.ep:8 themes/default/templates/raw.html.ep:10
msgid "1 year"
msgstr "1 year"
#: lib/Lutim.pm:341 lib/Lutim/Command/cron/stats.pm:155 lib/Lutim/Command/cron/stats.pm:169 lib/Lutim/Command/cron/stats.pm:186 themes/default/templates/index.html.ep:4 themes/default/templates/myfiles.html.ep:33 themes/default/templates/myfiles.html.ep:4 themes/default/templates/partial/for_my_delay.html.ep:13 themes/default/templates/partial/lutim.js.ep:138 themes/default/templates/partial/raw.js.ep:22 themes/default/templates/partial/raw.js.ep:5 themes/default/templates/raw.html.ep:7
#: lib/Lutim.pm:345 lib/Lutim/Command/cron/stats.pm:155 lib/Lutim/Command/cron/stats.pm:169 lib/Lutim/Command/cron/stats.pm:186 themes/default/templates/index.html.ep:4 themes/default/templates/myfiles.html.ep:33 themes/default/templates/myfiles.html.ep:4 themes/default/templates/partial/for_my_delay.html.ep:13 themes/default/templates/partial/lutim.js.ep:138 themes/default/templates/partial/raw.js.ep:22 themes/default/templates/partial/raw.js.ep:5 themes/default/templates/raw.html.ep:7
msgid "24 hours"
msgstr "24 hours"
#: themes/default/templates/partial/myfiles.js.ep:237
#: themes/default/templates/partial/myfiles.js.ep:244
msgid ": Error while trying to get the counter."
msgstr ": Error while trying to get the counter."
@@ -51,7 +51,7 @@ msgstr "About"
msgid "Active images"
msgstr "Active images"
#: lib/Lutim/Controller/Image.pm:345
#: lib/Lutim/Controller/Image.pm:346
msgid "An error occured while downloading the image."
msgstr "An error occured while downloading the image."
@@ -59,6 +59,10 @@ msgstr "An error occured while downloading the image."
msgid "Archives download"
msgstr "Archives download"
#: themes/default/templates/partial/common.js.ep:145
msgid "Are you sure you want to delete the image ${short}?"
msgstr "Are you sure you want to delete the image ${short}?"
#: themes/default/templates/about.html.ep:44 themes/default/templates/myfiles.html.ep:129 themes/default/templates/stats.html.ep:25
msgid "Back to homepage"
msgstr "Back to homepage"
@@ -83,11 +87,11 @@ msgstr "Contributors"
msgid "Copied to clipboard"
msgstr "Copied to clipboard"
#: themes/default/templates/partial/lutim.js.ep:206 themes/default/templates/partial/lutim.js.ep:273 themes/default/templates/partial/lutim.js.ep:360
#: themes/default/templates/partial/lutim.js.ep:206 themes/default/templates/partial/lutim.js.ep:267 themes/default/templates/partial/lutim.js.ep:354
msgid "Copy all view links to clipboard"
msgstr "Copy all view links to clipboard"
#: themes/default/templates/index.html.ep:104 themes/default/templates/index.html.ep:16 themes/default/templates/index.html.ep:32 themes/default/templates/index.html.ep:48 themes/default/templates/index.html.ep:80 themes/default/templates/index.html.ep:88 themes/default/templates/index.html.ep:96 themes/default/templates/myfiles.html.ep:66 themes/default/templates/myfiles.html.ep:82 themes/default/templates/myfiles.html.ep:98 themes/default/templates/partial/common.js.ep:190 themes/default/templates/partial/lutim.js.ep:110 themes/default/templates/partial/lutim.js.ep:70 themes/default/templates/partial/lutim.js.ep:82 themes/default/templates/partial/lutim.js.ep:96 themes/default/templates/partial/myfiles.js.ep:182
#: themes/default/templates/index.html.ep:104 themes/default/templates/index.html.ep:16 themes/default/templates/index.html.ep:32 themes/default/templates/index.html.ep:48 themes/default/templates/index.html.ep:80 themes/default/templates/index.html.ep:88 themes/default/templates/index.html.ep:96 themes/default/templates/myfiles.html.ep:66 themes/default/templates/myfiles.html.ep:82 themes/default/templates/myfiles.html.ep:98 themes/default/templates/partial/common.js.ep:206 themes/default/templates/partial/lutim.js.ep:110 themes/default/templates/partial/lutim.js.ep:70 themes/default/templates/partial/lutim.js.ep:82 themes/default/templates/partial/lutim.js.ep:96 themes/default/templates/partial/myfiles.js.ep:182
msgid "Copy to clipboard"
msgstr "Copy to clipboard"
@@ -115,7 +119,7 @@ msgstr "Deleted images"
msgid "Deleted images in 30 days"
msgstr "Deleted images in 30 days"
#: themes/default/templates/index.html.ep:109 themes/default/templates/myfiles.html.ep:121 themes/default/templates/partial/common.js.ep:177 themes/default/templates/partial/common.js.ep:182
#: themes/default/templates/index.html.ep:109 themes/default/templates/myfiles.html.ep:121 themes/default/templates/partial/common.js.ep:192 themes/default/templates/partial/common.js.ep:197
msgid "Deletion link"
msgstr "Deletion link"
@@ -207,11 +211,11 @@ msgstr "Image URL"
msgid "Image delay"
msgstr "Image delay"
#: themes/default/templates/partial/common.js.ep:157
#: themes/default/templates/partial/common.js.ep:172
msgid "Image deleted"
msgstr "Image deleted"
#: lib/Lutim/Controller/Image.pm:817
#: lib/Lutim/Controller/Image.pm:815
msgid "Image not found."
msgstr "Image not found."
@@ -365,13 +369,13 @@ msgid "Something bad happened"
msgstr "Something bad happened"
#. ($c->config('contact')
#: lib/Lutim/Controller/Image.pm:824
#: lib/Lutim/Controller/Image.pm:822
msgid "Something went wrong when creating the zip file. Try again later or contact the administrator (%1)."
msgstr "Something went wrong when creating the zip file. Try again later or contact the administrator (%1)."
#: lib/Lutim/Controller/Image.pm:293
#: lib/Lutim/Controller/Image.pm:294
msgid "Sorry, the API is disabled"
msgstr ""
msgstr "Sorry, the API is disabled"
#: themes/default/templates/about.html.ep:13
msgid "The IP address of the image's sender is retained for a delay which depends of the administrator's choice (for the official instance, which is located in France, it's one year)."
@@ -381,7 +385,7 @@ msgstr "The IP address of the image's sender is retained for a delay which depen
msgid "The Lutim software is a <a href=\"http://en.wikipedia.org/wiki/Free_software\">free software</a>, which allows you to download and install it on you own server. Have a look at the <a href=\"https://www.gnu.org/licenses/agpl-3.0.html\">AGPL</a> to see what you can do."
msgstr "The Lutim software is a <a href=\"http://en.wikipedia.org/wiki/Free_software\">free software</a>, which allows you to download and install it on you own server. Have a look at the <a href=\"https://www.gnu.org/licenses/agpl-3.0.html\">AGPL</a> to see what you can do."
#: lib/Lutim/Controller/Image.pm:364
#: lib/Lutim/Controller/Image.pm:365
msgid "The URL is not valid."
msgstr "The URL is not valid."
@@ -393,19 +397,19 @@ msgstr "The automatic download process will open a tab in your browser for each
msgid "The data has been successfully imported."
msgstr "The data has been successfully imported."
#: lib/Lutim/Controller/Image.pm:160 lib/Lutim/Controller/Image.pm:228
#: lib/Lutim/Controller/Image.pm:161 lib/Lutim/Controller/Image.pm:229
msgid "The delete token is invalid."
msgstr "The delete token is invalid."
#. ($upload->filename)
#: lib/Lutim/Controller/Image.pm:549
#: lib/Lutim/Controller/Image.pm:547
msgid "The file %1 is not an image."
msgstr "The file %1 is not an image."
#. ($tx->res->max_message_size)
#. ($c->req->max_message_size)
#. (config('max_file_size')
#: lib/Lutim/Controller/Image.pm:328 lib/Lutim/Controller/Image.pm:397 themes/default/templates/partial/lutim.js.ep:245
#: lib/Lutim/Controller/Image.pm:329 lib/Lutim/Controller/Image.pm:395 themes/default/templates/partial/lutim.js.ep:239
msgid "The file exceed the size limit (%1)"
msgstr "The file exceed the size limit (%1)"
@@ -414,12 +418,12 @@ msgid "The graph's datas are not updated in real-time."
msgstr "The graph's datas are not updated in real-time."
#. ($image->filename)
#: lib/Lutim/Controller/Image.pm:230
#: lib/Lutim/Controller/Image.pm:231
msgid "The image %1 has already been deleted."
msgstr "The image %1 has already been deleted."
#. ($image->filename)
#: lib/Lutim/Controller/Image.pm:239 lib/Lutim/Controller/Image.pm:244
#: lib/Lutim/Controller/Image.pm:240 lib/Lutim/Controller/Image.pm:245
msgid "The image %1 has been successfully deleted"
msgstr "The image %1 has been successfully deleted"
@@ -431,7 +435,7 @@ msgstr "The images are encrypted on the server (Lutim does not keep the key)."
msgid "The images you post on Lutim can be stored indefinitely or be deleted at first view or after a delay selected from those proposed."
msgstr "The images you post on Lutim can be stored indefinitely or be deleted at first view or after a delay selected from those proposed."
#: lib/Lutim/Controller/Image.pm:168
#: lib/Lutim/Controller/Image.pm:169
msgid "The images delay has been successfully modified"
msgstr "The images delay has been successfully modified"
@@ -445,7 +449,7 @@ msgid "There is XXXX image(s) in the gallery"
msgstr "There is XXXX image(s) in the gallery"
#. ($c->config->{contact})
#: lib/Lutim/Controller/Image.pm:546
#: lib/Lutim/Controller/Image.pm:544
msgid "There is no more available URL. Retry or contact the administrator. %1"
msgstr "There is no more available URL. Retry or contact the administrator. %1"
@@ -474,15 +478,15 @@ msgid "Unable to copy to clipboard"
msgstr "Unable to copy to clipboard"
#. ($short)
#: lib/Lutim/Controller/Image.pm:108 lib/Lutim/Controller/Image.pm:202 lib/Lutim/Controller/Image.pm:273
#: lib/Lutim/Controller/Image.pm:109 lib/Lutim/Controller/Image.pm:203 lib/Lutim/Controller/Image.pm:274
msgid "Unable to find the image %1."
msgstr "Unable to find the image %1."
#: lib/Lutim/Controller/Image.pm:635 lib/Lutim/Controller/Image.pm:680 lib/Lutim/Controller/Image.pm:721 lib/Lutim/Controller/Image.pm:764 lib/Lutim/Controller/Image.pm:776 lib/Lutim/Controller/Image.pm:787 lib/Lutim/Controller/Image.pm:814 lib/Lutim/Plugin/Helpers.pm:90
#: lib/Lutim/Controller/Image.pm:633 lib/Lutim/Controller/Image.pm:678 lib/Lutim/Controller/Image.pm:719 lib/Lutim/Controller/Image.pm:762 lib/Lutim/Controller/Image.pm:774 lib/Lutim/Controller/Image.pm:785 lib/Lutim/Controller/Image.pm:812 lib/Lutim/Plugin/Helpers.pm:90
msgid "Unable to find the image: it has been deleted."
msgstr "Unable to find the image: it has been deleted."
#: lib/Lutim/Controller/Image.pm:145
#: lib/Lutim/Controller/Image.pm:146
msgid "Unable to get counter"
msgstr "Unable to get counter"
@@ -563,7 +567,7 @@ msgstr "arabic translation"
msgid "core developer"
msgstr "core developer"
#: lib/Lutim.pm:340 lib/Lutim/Command/cron/stats.pm:154 lib/Lutim/Command/cron/stats.pm:168 lib/Lutim/Command/cron/stats.pm:185 themes/default/templates/index.html.ep:3 themes/default/templates/myfiles.html.ep:3 themes/default/templates/partial/raw.js.ep:21 themes/default/templates/partial/raw.js.ep:4 themes/default/templates/raw.html.ep:6
#: lib/Lutim.pm:344 lib/Lutim/Command/cron/stats.pm:154 lib/Lutim/Command/cron/stats.pm:168 lib/Lutim/Command/cron/stats.pm:185 themes/default/templates/index.html.ep:3 themes/default/templates/myfiles.html.ep:3 themes/default/templates/partial/raw.js.ep:21 themes/default/templates/partial/raw.js.ep:4 themes/default/templates/raw.html.ep:6
msgid "no time limit"
msgstr "no time limit"
+27 -23
View File
@@ -32,15 +32,15 @@ msgstr ""
msgid "-or-"
msgstr ""
#: lib/Lutim.pm:342 lib/Lutim/Command/cron/stats.pm:158 lib/Lutim/Command/cron/stats.pm:172 lib/Lutim/Command/cron/stats.pm:189 themes/default/templates/index.html.ep:5 themes/default/templates/myfiles.html.ep:5 themes/default/templates/partial/raw.js.ep:25 themes/default/templates/partial/raw.js.ep:8 themes/default/templates/raw.html.ep:10
#: lib/Lutim.pm:346 lib/Lutim/Command/cron/stats.pm:158 lib/Lutim/Command/cron/stats.pm:172 lib/Lutim/Command/cron/stats.pm:189 themes/default/templates/index.html.ep:5 themes/default/templates/myfiles.html.ep:5 themes/default/templates/partial/raw.js.ep:25 themes/default/templates/partial/raw.js.ep:8 themes/default/templates/raw.html.ep:10
msgid "1 year"
msgstr ""
#: lib/Lutim.pm:341 lib/Lutim/Command/cron/stats.pm:155 lib/Lutim/Command/cron/stats.pm:169 lib/Lutim/Command/cron/stats.pm:186 themes/default/templates/index.html.ep:4 themes/default/templates/myfiles.html.ep:33 themes/default/templates/myfiles.html.ep:4 themes/default/templates/partial/for_my_delay.html.ep:13 themes/default/templates/partial/lutim.js.ep:138 themes/default/templates/partial/raw.js.ep:22 themes/default/templates/partial/raw.js.ep:5 themes/default/templates/raw.html.ep:7
#: lib/Lutim.pm:345 lib/Lutim/Command/cron/stats.pm:155 lib/Lutim/Command/cron/stats.pm:169 lib/Lutim/Command/cron/stats.pm:186 themes/default/templates/index.html.ep:4 themes/default/templates/myfiles.html.ep:33 themes/default/templates/myfiles.html.ep:4 themes/default/templates/partial/for_my_delay.html.ep:13 themes/default/templates/partial/lutim.js.ep:138 themes/default/templates/partial/raw.js.ep:22 themes/default/templates/partial/raw.js.ep:5 themes/default/templates/raw.html.ep:7
msgid "24 hours"
msgstr ""
#: themes/default/templates/partial/myfiles.js.ep:237
#: themes/default/templates/partial/myfiles.js.ep:244
msgid ": Error while trying to get the counter."
msgstr ""
@@ -52,7 +52,7 @@ msgstr ""
msgid "Active images"
msgstr ""
#: lib/Lutim/Controller/Image.pm:345
#: lib/Lutim/Controller/Image.pm:346
msgid "An error occured while downloading the image."
msgstr ""
@@ -60,6 +60,10 @@ msgstr ""
msgid "Archives download"
msgstr ""
#: themes/default/templates/partial/common.js.ep:145
msgid "Are you sure you want to delete the image ${short}?"
msgstr ""
#: themes/default/templates/about.html.ep:44 themes/default/templates/myfiles.html.ep:129 themes/default/templates/stats.html.ep:25
msgid "Back to homepage"
msgstr ""
@@ -84,11 +88,11 @@ msgstr ""
msgid "Copied to clipboard"
msgstr ""
#: themes/default/templates/partial/lutim.js.ep:206 themes/default/templates/partial/lutim.js.ep:273 themes/default/templates/partial/lutim.js.ep:360
#: themes/default/templates/partial/lutim.js.ep:206 themes/default/templates/partial/lutim.js.ep:267 themes/default/templates/partial/lutim.js.ep:354
msgid "Copy all view links to clipboard"
msgstr ""
#: themes/default/templates/index.html.ep:104 themes/default/templates/index.html.ep:16 themes/default/templates/index.html.ep:32 themes/default/templates/index.html.ep:48 themes/default/templates/index.html.ep:80 themes/default/templates/index.html.ep:88 themes/default/templates/index.html.ep:96 themes/default/templates/myfiles.html.ep:66 themes/default/templates/myfiles.html.ep:82 themes/default/templates/myfiles.html.ep:98 themes/default/templates/partial/common.js.ep:190 themes/default/templates/partial/lutim.js.ep:110 themes/default/templates/partial/lutim.js.ep:70 themes/default/templates/partial/lutim.js.ep:82 themes/default/templates/partial/lutim.js.ep:96 themes/default/templates/partial/myfiles.js.ep:182
#: themes/default/templates/index.html.ep:104 themes/default/templates/index.html.ep:16 themes/default/templates/index.html.ep:32 themes/default/templates/index.html.ep:48 themes/default/templates/index.html.ep:80 themes/default/templates/index.html.ep:88 themes/default/templates/index.html.ep:96 themes/default/templates/myfiles.html.ep:66 themes/default/templates/myfiles.html.ep:82 themes/default/templates/myfiles.html.ep:98 themes/default/templates/partial/common.js.ep:206 themes/default/templates/partial/lutim.js.ep:110 themes/default/templates/partial/lutim.js.ep:70 themes/default/templates/partial/lutim.js.ep:82 themes/default/templates/partial/lutim.js.ep:96 themes/default/templates/partial/myfiles.js.ep:182
msgid "Copy to clipboard"
msgstr ""
@@ -116,7 +120,7 @@ msgstr ""
msgid "Deleted images in 30 days"
msgstr ""
#: themes/default/templates/index.html.ep:109 themes/default/templates/myfiles.html.ep:121 themes/default/templates/partial/common.js.ep:177 themes/default/templates/partial/common.js.ep:182
#: themes/default/templates/index.html.ep:109 themes/default/templates/myfiles.html.ep:121 themes/default/templates/partial/common.js.ep:192 themes/default/templates/partial/common.js.ep:197
msgid "Deletion link"
msgstr ""
@@ -208,11 +212,11 @@ msgstr ""
msgid "Image delay"
msgstr ""
#: themes/default/templates/partial/common.js.ep:157
#: themes/default/templates/partial/common.js.ep:172
msgid "Image deleted"
msgstr ""
#: lib/Lutim/Controller/Image.pm:817
#: lib/Lutim/Controller/Image.pm:815
msgid "Image not found."
msgstr ""
@@ -366,11 +370,11 @@ msgid "Something bad happened"
msgstr ""
#. ($c->config('contact')
#: lib/Lutim/Controller/Image.pm:824
#: lib/Lutim/Controller/Image.pm:822
msgid "Something went wrong when creating the zip file. Try again later or contact the administrator (%1)."
msgstr ""
#: lib/Lutim/Controller/Image.pm:293
#: lib/Lutim/Controller/Image.pm:294
msgid "Sorry, the API is disabled"
msgstr ""
@@ -382,7 +386,7 @@ msgstr ""
msgid "The Lutim software is a <a href=\"http://en.wikipedia.org/wiki/Free_software\">free software</a>, which allows you to download and install it on you own server. Have a look at the <a href=\"https://www.gnu.org/licenses/agpl-3.0.html\">AGPL</a> to see what you can do."
msgstr ""
#: lib/Lutim/Controller/Image.pm:364
#: lib/Lutim/Controller/Image.pm:365
msgid "The URL is not valid."
msgstr ""
@@ -394,19 +398,19 @@ msgstr ""
msgid "The data has been successfully imported."
msgstr ""
#: lib/Lutim/Controller/Image.pm:160 lib/Lutim/Controller/Image.pm:228
#: lib/Lutim/Controller/Image.pm:161 lib/Lutim/Controller/Image.pm:229
msgid "The delete token is invalid."
msgstr ""
#. ($upload->filename)
#: lib/Lutim/Controller/Image.pm:549
#: lib/Lutim/Controller/Image.pm:547
msgid "The file %1 is not an image."
msgstr ""
#. ($tx->res->max_message_size)
#. ($c->req->max_message_size)
#. (config('max_file_size')
#: lib/Lutim/Controller/Image.pm:328 lib/Lutim/Controller/Image.pm:397 themes/default/templates/partial/lutim.js.ep:245
#: lib/Lutim/Controller/Image.pm:329 lib/Lutim/Controller/Image.pm:395 themes/default/templates/partial/lutim.js.ep:239
msgid "The file exceed the size limit (%1)"
msgstr ""
@@ -415,12 +419,12 @@ msgid "The graph's datas are not updated in real-time."
msgstr ""
#. ($image->filename)
#: lib/Lutim/Controller/Image.pm:230
#: lib/Lutim/Controller/Image.pm:231
msgid "The image %1 has already been deleted."
msgstr ""
#. ($image->filename)
#: lib/Lutim/Controller/Image.pm:239 lib/Lutim/Controller/Image.pm:244
#: lib/Lutim/Controller/Image.pm:240 lib/Lutim/Controller/Image.pm:245
msgid "The image %1 has been successfully deleted"
msgstr ""
@@ -432,7 +436,7 @@ msgstr ""
msgid "The images you post on Lutim can be stored indefinitely or be deleted at first view or after a delay selected from those proposed."
msgstr ""
#: lib/Lutim/Controller/Image.pm:168
#: lib/Lutim/Controller/Image.pm:169
msgid "The images delay has been successfully modified"
msgstr ""
@@ -446,7 +450,7 @@ msgid "There is XXXX image(s) in the gallery"
msgstr ""
#. ($c->config->{contact})
#: lib/Lutim/Controller/Image.pm:546
#: lib/Lutim/Controller/Image.pm:544
msgid "There is no more available URL. Retry or contact the administrator. %1"
msgstr ""
@@ -471,15 +475,15 @@ msgid "Unable to copy to clipboard"
msgstr ""
#. ($short)
#: lib/Lutim/Controller/Image.pm:108 lib/Lutim/Controller/Image.pm:202 lib/Lutim/Controller/Image.pm:273
#: lib/Lutim/Controller/Image.pm:109 lib/Lutim/Controller/Image.pm:203 lib/Lutim/Controller/Image.pm:274
msgid "Unable to find the image %1."
msgstr ""
#: lib/Lutim/Controller/Image.pm:635 lib/Lutim/Controller/Image.pm:680 lib/Lutim/Controller/Image.pm:721 lib/Lutim/Controller/Image.pm:764 lib/Lutim/Controller/Image.pm:776 lib/Lutim/Controller/Image.pm:787 lib/Lutim/Controller/Image.pm:814 lib/Lutim/Plugin/Helpers.pm:90
#: lib/Lutim/Controller/Image.pm:633 lib/Lutim/Controller/Image.pm:678 lib/Lutim/Controller/Image.pm:719 lib/Lutim/Controller/Image.pm:762 lib/Lutim/Controller/Image.pm:774 lib/Lutim/Controller/Image.pm:785 lib/Lutim/Controller/Image.pm:812 lib/Lutim/Plugin/Helpers.pm:90
msgid "Unable to find the image: it has been deleted."
msgstr ""
#: lib/Lutim/Controller/Image.pm:145
#: lib/Lutim/Controller/Image.pm:146
msgid "Unable to get counter"
msgstr ""
@@ -560,7 +564,7 @@ msgstr ""
msgid "core developer"
msgstr ""
#: lib/Lutim.pm:340 lib/Lutim/Command/cron/stats.pm:154 lib/Lutim/Command/cron/stats.pm:168 lib/Lutim/Command/cron/stats.pm:185 themes/default/templates/index.html.ep:3 themes/default/templates/myfiles.html.ep:3 themes/default/templates/partial/raw.js.ep:21 themes/default/templates/partial/raw.js.ep:4 themes/default/templates/raw.html.ep:6
#: lib/Lutim.pm:344 lib/Lutim/Command/cron/stats.pm:154 lib/Lutim/Command/cron/stats.pm:168 lib/Lutim/Command/cron/stats.pm:185 themes/default/templates/index.html.ep:3 themes/default/templates/myfiles.html.ep:3 themes/default/templates/partial/raw.js.ep:21 themes/default/templates/partial/raw.js.ep:4 themes/default/templates/raw.html.ep:6
msgid "no time limit"
msgstr ""
+17 -1
View File
@@ -139,10 +139,25 @@ function clickOnCopyLink(e) {
e.preventDefault();
copyToClipboard($(this));
}
function delImageConfirm(e) {
e.preventDefault();
var short = $(this).attr('data-short');
if (confirm(`<%= l('Are you sure you want to delete the image ${short}?') %>`)) {
var token = $(this).attr('data-token');
var ext = $(this).attr('data-ext');
delImageRequest(short, token);
rmFromShortHash(`${short}.${ext}`);
rmFromZipHash(short);
rmFromRandomHash(short);
}
}
function delImage(e) {
e.preventDefault();
var short = $(this).attr('data-short');
var token = $(this).attr('data-token');
delImageRequest(short, token);
}
function delImageRequest(short, token) {
$.ajax({
url: `<%= url_for('/') %>d/${short}/${token}`,
method: 'GET',
@@ -165,7 +180,7 @@ function delImage(e) {
}
});
}
function link(url, dl, token, modify, only_url) {
function link(url, dl, token, modify, only_url, ext) {
if (token !== undefined) {
if (modify !== undefined && modify === true) {
return `<%== url_for('/m/')->to_abs() %>${url}/${token}`;
@@ -182,6 +197,7 @@ function link(url, dl, token, modify, only_url) {
title="<%= l('Deletion link') %>"
id="del-${url}"
data-short="${url}"
data-ext="${ext}"
data-token="${token}">
<span class="icon icon-trash"></span>
</a>
+2 -8
View File
@@ -114,7 +114,7 @@ function buildMessage(success, msg) {
</div>
<div class="form-group">
<div class="input-group col-sm-6 col-xs-12">
<span class="form-control-static">${link(msg.real_short, '', msg.token)}</span>
<span class="form-control-static">${link(msg.real_short, '', msg.token, false, false, msg.ext)}</span>
</div>
</div>
</form>
@@ -214,13 +214,7 @@ function bindddz(firstview, deleteday) {
rmFromZipHash(data.msg.short);
rmFromRandomHash(data.msg.short);
});
$(`#del-${data.msg.real_short}`).on('click', function(e) {
e.preventDefault();
rmFromShortHash(`${data.msg.short}.${data.msg.ext}`);
rmFromZipHash(data.msg.short);
rmFromRandomHash(data.msg.short);
});
$(`#del-${data.msg.real_short}`).on('click', delImage);
$(`#del-${data.msg.real_short}`).on('click', delImageConfirm);
if (data.success) {
addToShortHash(`${data.msg.short}.${data.msg.ext}`);
addToZipHash(data.msg.short);
@@ -212,6 +212,13 @@ function populateFilesTable() {
</tr>`;
$('#myfiles').append(tr);
$(`#del-${real_short}`).on('click', delImage);
$(`#del-${real_short}`).on('click', function(e) {
e.preventDefault();
rmFromShortHash(`${element.short}.${element.ext}`);
rmFromZipHash(element.short);
rmFromRandomHash(element.short);
});
$(`#edit-${real_short}`).on('click', editImage);
$.ajax({
@@ -73,7 +73,7 @@ function buildMessage(success, msg) {
</div>
<div class="form-group">
<div class="input-group">
<span class="form-control-static">${link(msg.real_short, '', msg.token)}</span>
<span class="form-control-static">${link(msg.real_short, '', msg.token, false, false, msg.ext)}</span>
</div>
</div>
</form>