diff --git a/CHANGELOG b/CHANGELOG index 649a275..eb295fd 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -2,6 +2,7 @@ Revision history for Lutim 0.11.6 ????-??-?? - Remove the "Support the author" dropdown + - Add a "select all" checkbox on /myfiles (#105) 0.11.5 2019-04-19 - Revert catching Image::Magick problems diff --git a/themes/default/lib/Lutim/I18N/lutim.pot b/themes/default/lib/Lutim/I18N/lutim.pot index 97c6cc1..7be1c35 100644 --- a/themes/default/lib/Lutim/I18N/lutim.pot +++ b/themes/default/lib/Lutim/I18N/lutim.pot @@ -40,7 +40,7 @@ msgstr "" msgid "24 hours" msgstr "" -#: themes/default/templates/partial/myfiles.js.ep:180 +#: themes/default/templates/partial/myfiles.js.ep:210 msgid ": Error while trying to get the counter." msgstr "" @@ -88,7 +88,7 @@ msgstr "" msgid "Copy all view links to clipboard" msgstr "" -#: themes/default/templates/index.html.ep:103 themes/default/templates/index.html.ep:111 themes/default/templates/index.html.ep:18 themes/default/templates/index.html.ep:36 themes/default/templates/index.html.ep:54 themes/default/templates/index.html.ep:87 themes/default/templates/index.html.ep:95 themes/default/templates/myfiles.html.ep:104 themes/default/templates/myfiles.html.ep:68 themes/default/templates/myfiles.html.ep:86 themes/default/templates/partial/common.js.ep:186 themes/default/templates/partial/lutim.js.ep:106 themes/default/templates/partial/lutim.js.ep:121 themes/default/templates/partial/lutim.js.ep:80 themes/default/templates/partial/lutim.js.ep:92 themes/default/templates/partial/myfiles.js.ep:142 +#: themes/default/templates/index.html.ep:103 themes/default/templates/index.html.ep:111 themes/default/templates/index.html.ep:18 themes/default/templates/index.html.ep:36 themes/default/templates/index.html.ep:54 themes/default/templates/index.html.ep:87 themes/default/templates/index.html.ep:95 themes/default/templates/myfiles.html.ep:104 themes/default/templates/myfiles.html.ep:68 themes/default/templates/myfiles.html.ep:86 themes/default/templates/partial/common.js.ep:186 themes/default/templates/partial/lutim.js.ep:106 themes/default/templates/partial/lutim.js.ep:121 themes/default/templates/partial/lutim.js.ep:80 themes/default/templates/partial/lutim.js.ep:92 themes/default/templates/partial/myfiles.js.ep:172 msgid "Copy to clipboard" msgstr "" @@ -144,7 +144,7 @@ msgstr "" msgid "Encrypt the image (Lutim does not keep the key)." msgstr "" -#: themes/default/templates/partial/lutim.js.ep:45 themes/default/templates/partial/myfiles.js.ep:113 +#: themes/default/templates/partial/lutim.js.ep:45 themes/default/templates/partial/myfiles.js.ep:128 msgid "Error while trying to modify the image." msgstr "" @@ -288,7 +288,7 @@ msgstr "" msgid "Markdown syntax" msgstr "" -#: themes/default/templates/partial/myfiles.js.ep:149 +#: themes/default/templates/partial/myfiles.js.ep:179 msgid "Modify expiration delay" msgstr "" @@ -300,7 +300,7 @@ msgstr "" msgid "Next (arrow right)" msgstr "" -#: themes/default/templates/partial/myfiles.js.ep:105 themes/default/templates/partial/myfiles.js.ep:132 +#: themes/default/templates/partial/myfiles.js.ep:120 themes/default/templates/partial/myfiles.js.ep:162 msgid "No limit" msgstr "" diff --git a/themes/default/public/js/lutim.js b/themes/default/public/js/lutim.js index 633928c..1fc9f8c 100644 --- a/themes/default/public/js/lutim.js +++ b/themes/default/public/js/lutim.js @@ -109,6 +109,7 @@ $('document').ready(function() { $('#json-import').on('click', function() { $('#import').click(); }); $('#import').on('change', function() { importStorage(this.files); }) $('#mod-delay').on('click', modifyDelay); + $('#check-all').on('click', checkAll) } $('.copy-to-clipboard-link').on('click', clickOnCopyLink); $('.copy-all-to-clipboard-link').on('click', copyAllToClipboard); diff --git a/themes/default/templates/myfiles.html.ep b/themes/default/templates/myfiles.html.ep index eebcecb..dccb204 100644 --- a/themes/default/templates/myfiles.html.ep +++ b/themes/default/templates/myfiles.html.ep @@ -117,7 +117,7 @@ - + diff --git a/themes/default/templates/partial/myfiles.js.ep b/themes/default/templates/partial/myfiles.js.ep index 6a81f61..7fd99c1 100644 --- a/themes/default/templates/partial/myfiles.js.ep +++ b/themes/default/templates/partial/myfiles.js.ep @@ -60,12 +60,27 @@ function onCheck(e) { addToShortHash(short+'.'+ext); addToZipHash(short); addToRandomHash(short); + if (!$('#check-all').is(':checked') && isAllChecked()) { + $('#check-all').prop('checked', true); + } } else { + if ($('#check-all').is(':checked')) { + $('#check-all').prop('checked', false); + } rmFromShortHash(short+'.'+ext); rmFromZipHash(short); rmFromRandomHash(short); } } +function isAllChecked() { + var allChecked = true; + $('.ckbx').each(function(index) { + if (!$(this).is(':checked')) { + allChecked = false; + } + }); + return allChecked; +} function delView(del_at_view) { return (del_at_view) ? '' : ''; } @@ -117,6 +132,21 @@ function modifyDelay() { } }); } +function checkAll(e) { + var checked = $('#check-all').is(':checked'); + $('.ckbx').each(function(index) { + var element = $(this); + if (checked) { + if (!element.is(':checked')) { + element.click(); + } + } else { + if (element.is(':checked')) { + element.click(); + } + } + }); +} function populateFilesTable() { var localImages = localStorage.getItem('images'); if (localImages === null) {
<%= l('File name') %> <%= l('View link') %> <%= l('Counter') %>