From d1627ea997c6b80fa838bc940b85df03a8de84bc Mon Sep 17 00:00:00 2001
From: Luc Didry
URL: %2"
msgstr ""
-#: themes/default/templates/invitations/invite.html.ep:27 themes/default/templates/layouts/default.html.ep:36
+#: themes/default/templates/invitations/invite.html.ep:27 themes/default/templates/layouts/default.html.ep:36 themes/default/templates/layouts/default.html.ep:69
msgid "Invite a guest"
msgstr ""
@@ -377,7 +377,7 @@ msgstr ""
msgid "Javascript is disabled. You won't be able to use Lufi."
msgstr ""
-#: themes/default/templates/layouts/default.html.ep:44 themes/default/templates/layouts/default.html.ep:46 themes/default/templates/layouts/default.html.ep:73 themes/default/templates/layouts/default.html.ep:75
+#: themes/default/templates/layouts/default.html.ep:44 themes/default/templates/layouts/default.html.ep:46 themes/default/templates/layouts/default.html.ep:77 themes/default/templates/layouts/default.html.ep:79
msgid "Language"
msgstr ""
@@ -385,7 +385,7 @@ msgstr ""
msgid "Login"
msgstr ""
-#: themes/default/templates/layouts/default.html.ep:58 themes/default/templates/layouts/default.html.ep:84
+#: themes/default/templates/layouts/default.html.ep:58 themes/default/templates/layouts/default.html.ep:91
msgid "Logout"
msgstr ""
@@ -401,7 +401,7 @@ msgstr ""
msgid "My files"
msgstr ""
-#: themes/default/templates/invitations/my_invitations.html.ep:5 themes/default/templates/layouts/default.html.ep:37
+#: themes/default/templates/invitations/my_invitations.html.ep:5 themes/default/templates/layouts/default.html.ep:37 themes/default/templates/layouts/default.html.ep:70
msgid "My invitations"
msgstr ""
@@ -418,7 +418,7 @@ msgstr ""
msgid "No enough space available on the server for this file (size: %1)."
msgstr ""
-#: themes/default/templates/partial/files.js.ep:10 themes/default/templates/partial/index.js.ep:27
+#: themes/default/templates/partial/files.js.ep:10 themes/default/templates/partial/index.js.ep:28
msgid "No expiration delay"
msgstr ""
@@ -475,7 +475,7 @@ msgstr ""
msgid "Rows in red mean that the files have expired and are no longer available."
msgstr ""
-#: themes/default/templates/partial/index.js.ep:25
+#: themes/default/templates/partial/index.js.ep:26
msgid "Send all links by email"
msgstr ""
@@ -491,7 +491,7 @@ msgstr ""
msgid "Send with your own mail software"
msgstr ""
-#: themes/default/templates/partial/index.js.ep:28
+#: themes/default/templates/partial/index.js.ep:29
msgid "Sending part XX1 of XX2. Please, be patient, the progress bar can take a while to move."
msgstr ""
@@ -508,7 +508,7 @@ msgstr ""
msgid "Show zip content"
msgstr ""
-#: themes/default/templates/layouts/default.html.ep:40 themes/default/templates/layouts/default.html.ep:69 themes/default/templates/login.html.ep:28 themes/default/templates/logout.html.ep:17
+#: themes/default/templates/layouts/default.html.ep:40 themes/default/templates/layouts/default.html.ep:73 themes/default/templates/login.html.ep:28 themes/default/templates/logout.html.ep:17
msgid "Signin"
msgstr ""
@@ -596,7 +596,7 @@ msgstr ""
msgid "The invitation mail will be send from your email address (%1)."
msgstr ""
-#: themes/default/templates/partial/index.js.ep:15
+#: themes/default/templates/partial/index.js.ep:16
msgid "The link(s) has been copied to your clipboard"
msgstr ""
@@ -647,7 +647,7 @@ msgstr ""
msgid "URL"
msgstr ""
-#: themes/default/templates/partial/index.js.ep:16
+#: themes/default/templates/partial/index.js.ep:17
msgid "Unable to copy the link(s) to your clipboard"
msgstr ""
@@ -670,7 +670,7 @@ msgstr ""
msgid "Upload files"
msgstr ""
-#: themes/default/templates/index.html.ep:119
+#: themes/default/templates/index.html.ep:142
msgid "Upload generated zip file"
msgstr ""
@@ -682,7 +682,7 @@ msgstr ""
msgid "Uploaded files"
msgstr ""
-#: themes/default/templates/partial/index.js.ep:29
+#: themes/default/templates/partial/index.js.ep:30
msgid "Websocket communication error"
msgstr ""
@@ -694,6 +694,10 @@ msgstr ""
msgid "Who wrote this software?"
msgstr ""
+#: themes/default/templates/partial/index.js.ep:13
+msgid "XXX file has been added to upload queue."
+msgstr ""
+
#: themes/default/templates/invitations/invite.html.ep:30
msgid "You can invite someone to send you files through this Lufi instance even if they don’t have an account on it."
msgstr ""
@@ -718,7 +722,7 @@ msgstr ""
msgid "You have attempted to leave this page. The download will be canceled. Are you sure?"
msgstr ""
-#: themes/default/templates/partial/index.js.ep:13
+#: themes/default/templates/partial/index.js.ep:14
msgid "You have attempted to leave this page. The upload will be canceled. Are you sure?"
msgstr ""
@@ -775,7 +779,7 @@ msgstr ""
msgid "no time limit"
msgstr ""
-#: themes/default/templates/index.html.ep:126
+#: themes/default/templates/index.html.ep:123
msgid "or"
msgstr ""
diff --git a/themes/default/public/js/lufi-up.js b/themes/default/public/js/lufi-up.js
index 402d8ed..2a80186 100644
--- a/themes/default/public/js/lufi-up.js
+++ b/themes/default/public/js/lufi-up.js
@@ -82,11 +82,9 @@ function addItem(name, url, size, del_at_first_view, created_at, delay, short, t
function destroyBlock(el) {
$(el).parents('li').remove();
- var a = $('.link-input');
- var l = $('#results li');
- if (a.length === 0) {
+ if ($('.link-input').length === 0) {
$('#misc').empty();
- if (l.length === 0 && window.fileList === null) {
+ if ($('#results li').length === 0 && window.fileList === null) {
$('#results').hide();
}
} else {
@@ -136,7 +134,7 @@ function getZipname() {
}
}
- return zipname;
+ return escapeHtml(zipname);
}
// Update the zip name
@@ -150,20 +148,28 @@ function uploadZip(e) {
var delay = $('#delete-day');
var del_at_first_view = $('#first-view');
$('#zip-files').attr('disabled', 'disabled');
+ $('#file-browser-button').attr('disabled', 'disabled');
+ $('#file-browser-span').addClass('disabled');
+ $('#uploadZip').addClass('hide');
+ $('#zip-parts').text('');
$('#zip-compressing').removeClass('hide');
window.zip.generateAsync({type:"blob"})
.then(function(zipFile) {
// if $('#zipping') is hidden, the zipping has been aborted
if (!$('#zipping').hasClass('hide')) {
+ window.zip = null;
$('#zipping').addClass('hide');
$('#zipname-input').addClass('hide');
$('#zip-compressing').addClass('hide');
+ $('#uploadZip').removeClass('hide');
$('#results').show();
+ $('#zip-files').attr('disabled', null);
var zipname = getZipname();
var file = new File([zipFile], zipname, {type: 'application/zip'});
+ Materialize.toast(i18n.enqueued.replace('XXX', zipname), 3000, 'teal accent-3');
if (window.fileList === undefined || window.fileList === null) {
window.fileList = [file];
uploadFile(0, delay.val(), del_at_first_view.is(':checked'));
@@ -171,6 +177,8 @@ function uploadZip(e) {
window.fileList.push(file);
}
}
+ $('#file-browser-button').attr('disabled', null);
+ $('#file-browser-span').removeClass('disabled');
});
}
@@ -245,6 +253,10 @@ function handleFiles(f) {
} else {
if (window.fileList === undefined || window.fileList === null) {
window.fileList = Array.prototype.slice.call(f);
+ for (var i = 0; i < window.fileList.length; i++) {
+ var file = window.fileList[i];
+ Materialize.toast(i18n.enqueued.replace('XXX', escapeHtml(file.name)), 3000, 'teal accent-3');
+ }
window.nbFiles = window.fileList.length;
$('#results').show();
uploadFile(0, delay.val(), del_at_first_view.is(':checked'));
@@ -430,10 +442,13 @@ function updateProgressBar(data) {
window.onbeforeunload = null;
$('#delete-day').attr('disabled', null);
$('#first-view').attr('disabled', null);
- if ($('#zip-files').is(':checked')) {
+ if ($('#zip-files').is(':checked') && window.zip === null) {
$('label[for="zip-files"]').click();
}
}
+ if ($('#results li').length === 0 && window.fileList === null) {
+ $('#results').hide();
+ }
} else {
var i = data.i;
var sent_delay = data.sent_delay;
@@ -537,13 +552,16 @@ function updateProgressBar(data) {
window.onbeforeunload = null;
$('#delete-day').attr('disabled', null);
$('#first-view').attr('disabled', null);
- if ($('#zip-files').is(':checked')) {
+ if ($('#zip-files').is(':checked') && window.zip === null) {
$('label[for="zip-files"]').click();
}
if (isGuest) {
sendFilesURLs();
}
}
+ if ($('#results li').length === 0 && window.fileList === null) {
+ $('#results').hide();
+ }
} else {
j++;
// Update progress bar
@@ -677,5 +695,9 @@ $(document).ready(function() {
$('#reset-zipping').on('click', function() {
window.zip = null;
$('label[for="zip-files"]').click();
+ $('#zip-files').attr('disabled', null);
+ $('#zip-compressing').addClass('hide');
+ $('#file-browser-button').attr('disabled', null);
+ $('#file-browser-span').removeClass('disabled');
});
});
diff --git a/themes/default/templates/index.html.ep b/themes/default/templates/index.html.ep
index 9bd070f..4f9a967 100644
--- a/themes/default/templates/index.html.ep
+++ b/themes/default/templates/index.html.ep
@@ -90,7 +90,6 @@
<%= l('Create a zip archive with the files before uploading?') %>