mirror of
https://framagit.org/fiat-tux/hat-softwares/lutim.git
synced 2026-08-07 09:22:46 +02:00
Fix #105 — ✨ Add a "select all" checkbox on /myfiles
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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 ""
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -117,7 +117,7 @@
|
||||
<table class="table table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-center"></th>
|
||||
<th class="text-center"><span class="checkbox"><label><input type="checkbox" id="check-all"><label></span></th>
|
||||
<th class="text-center"><%= l('File name') %></th>
|
||||
<th class="text-center"><%= l('View link') %></th>
|
||||
<th class="text-center"><%= l('Counter') %></th>
|
||||
|
||||
@@ -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) ? '<span class="icon icon-ok"></span>' : '<span class="icon icon-cancel"></span>';
|
||||
}
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user