Merge branch 'NicolasConstant/lufi-development' into development

This commit is contained in:
Luc Didry 2020-03-22 11:23:17 +01:00
commit 4b36910aee
No known key found for this signature in database
GPG Key ID: EA868E12D0257E3C
9 changed files with 73 additions and 29 deletions

View File

@ -1,6 +1,9 @@
Revision history for Lufi
?.??.? ????-??-??
- Notifications when uploading and downloading files (#181)
0.04.6 2019-11-07
- Now can send large files (>2Gio) while using a DB other than SQLite (#165)
- Use customized instance name in <title>

View File

@ -45,7 +45,7 @@ msgstr ""
msgid "%A %d %B %Y at %T"
msgstr ""
#: themes/default/templates/partial/index.js.ep:27
#: themes/default/templates/partial/index.js.ep:28
msgid "(max size: XXX)"
msgstr ""
@ -90,7 +90,7 @@ msgid "As Lufi is a free software licensed under of the terms of the <a href=\"h
msgstr ""
#. (stash('nbslices')
#: themes/default/templates/partial/render.js.ep:9
#: themes/default/templates/partial/render.js.ep:10
msgid "Asking for file part XX1 of %1"
msgstr ""
@ -254,10 +254,18 @@ msgstr ""
msgid "File deleted"
msgstr ""
#: themes/default/templates/partial/render.js.ep:9
msgid "File downloaded"
msgstr ""
#: themes/default/templates/files.html.ep:27
msgid "File name"
msgstr ""
#: themes/default/templates/partial/index.js.ep:24
msgid "File uploaded"
msgstr ""
#: themes/default/templates/invitations/my_invitations.html.ep:61
msgid "Files"
msgstr ""
@ -307,11 +315,11 @@ msgstr ""
msgid "Hide hidden invitations"
msgstr ""
#: themes/default/templates/partial/index.js.ep:25
#: themes/default/templates/partial/index.js.ep:26
msgid "Hit Enter, then Ctrl+C to copy all the download links"
msgstr ""
#: themes/default/templates/partial/index.js.ep:24
#: themes/default/templates/partial/index.js.ep:25
msgid "Hit Enter, then Ctrl+C to copy the download link"
msgstr ""
@ -422,7 +430,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:28
#: themes/default/templates/partial/files.js.ep:10 themes/default/templates/partial/index.js.ep:29
msgid "No expiration delay"
msgstr ""
@ -479,7 +487,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:26
#: themes/default/templates/partial/index.js.ep:27
msgid "Send all links by email"
msgstr ""
@ -495,7 +503,7 @@ msgstr ""
msgid "Send with your own mail software"
msgstr ""
#: themes/default/templates/partial/index.js.ep:29
#: themes/default/templates/partial/index.js.ep:30
msgid "Sending part XX1 of XX2. Please, be patient, the progress bar can take a while to move."
msgstr ""
@ -508,7 +516,7 @@ msgstr ""
msgid "Show hidden invitations"
msgstr ""
#: themes/default/templates/partial/render.js.ep:11
#: themes/default/templates/partial/render.js.ep:12
msgid "Show zip content"
msgstr ""
@ -686,7 +694,7 @@ msgstr ""
msgid "Uploaded files"
msgstr ""
#: themes/default/templates/partial/index.js.ep:30
#: themes/default/templates/partial/index.js.ep:31
msgid "Websocket communication error"
msgstr ""
@ -718,7 +726,7 @@ msgstr ""
msgid "You don't need to register yourself to upload files but be aware that, for legal reasons, your IP address will be stored when you send a file. Don't panic, this is normally the case for all sites on which you send files."
msgstr ""
#: themes/default/templates/partial/render.js.ep:10
#: themes/default/templates/partial/render.js.ep:11
msgid "You don't seem to have a key in your URL. You won't be able to decrypt the file. Download canceled."
msgstr ""
@ -751,7 +759,7 @@ msgstr ""
msgid "Your password is not valid. Please refresh the page to retry."
msgstr ""
#: themes/default/templates/partial/render.js.ep:12
#: themes/default/templates/partial/render.js.ep:13
msgid "Zip content:"
msgstr ""

View File

@ -95,6 +95,7 @@ function spawnWebsocket(pa) {
if (data.part + 1 === data.total) {
var blob = new Blob(a, {type: data.type});
notify(i18n.fileDownloaded, data.name);
$('#please-wait').remove();
$('#loading').remove();

View File

@ -0,0 +1,26 @@
function notify(title, body) {
if (!Notification) {
console.log("This browser does not support desktop notification, cannot send following message: "+title+" "+body);
return;
}
if (Notification.permission !== "granted") {
Notification.requestPermission();
} else {
let options = {
body: body,
icon: '/img/lufi196.png'
};
let n = new Notification(title, options);
}
}
document.addEventListener('DOMContentLoaded', function () {
if (!Notification) {
return;
}
if (Notification.permission !== "granted") {
Notification.requestPermission();
}
});

View File

@ -477,6 +477,8 @@ function updateProgressBar(data) {
console.log('Error on WebSocket connection but file has been fully send, so we don\'t care.');
}
notify(i18n.fileUploaded, data.name);
$('#parts-'+window.fc).remove();
var n = $('#name-'+window.fc);
var s = $('#size-'+window.fc);

View File

@ -165,5 +165,6 @@
%= javascript '/js/moment-with-locales.min.js'
%= javascript '/js/filesize.min.js'
%= javascript '/js/jszip.min.js'
%= javascript '/js/lufi-notifications.js'
%= javascript '/js/lufi-up.js'
% }

View File

@ -10,24 +10,25 @@ var baseURL = '<%= url_for('/')->to_abs() %>';
% }
var actionURL = '<%= url_for('/')->to_abs() %>';
var i18n = {
enqueued: '<%= l('XXX file has been added to upload queue.') %>',
confirmExit: '<%= l('You have attempted to leave this page. The upload will be canceled. Are you sure?') %>',
copyAll: '<%= l('Copy all links to clipboard') %>',
copySuccess: '<%= l('The link(s) has been copied to your clipboard') %>',
copyFail: '<%= l('Unable to copy the link(s) to your clipboard') %>',
cpText: '<%= l('Copy to clipboard') %>',
delText: '<%= l('Deletion link') %>',
dlText: '<%= l('Download link') %>',
download: '<%= l('Download') %>',
encrypting: '<%= l('Encrypting part XX1 of XX2') %>',
expiration: '<%= l('Expiration:') %>',
hit: '<%= l('Hit Enter, then Ctrl+C to copy the download link') %>',
hits: '<%= l('Hit Enter, then Ctrl+C to copy all the download links') %>',
mailTo: '<%= l('Send all links by email') %>',
maxSize: '<%= l('(max size: XXX)') %>',
noLimit: '<%= l('No expiration delay') %>',
sending: '<%= l('Sending part XX1 of XX2. Please, be patient, the progress bar can take a while to move.') %>',
wsProblem: '<%= l('Websocket communication error') %>',
enqueued: '<%= l('XXX file has been added to upload queue.') %>',
confirmExit: '<%= l('You have attempted to leave this page. The upload will be canceled. Are you sure?') %>',
copyAll: '<%= l('Copy all links to clipboard') %>',
copySuccess: '<%= l('The link(s) has been copied to your clipboard') %>',
copyFail: '<%= l('Unable to copy the link(s) to your clipboard') %>',
cpText: '<%= l('Copy to clipboard') %>',
delText: '<%= l('Deletion link') %>',
dlText: '<%= l('Download link') %>',
download: '<%= l('Download') %>',
encrypting: '<%= l('Encrypting part XX1 of XX2') %>',
expiration: '<%= l('Expiration:') %>',
fileUploaded: '<%= l('File uploaded') %>',
hit: '<%= l('Hit Enter, then Ctrl+C to copy the download link') %>',
hits: '<%= l('Hit Enter, then Ctrl+C to copy all the download links') %>',
mailTo: '<%= l('Send all links by email') %>',
maxSize: '<%= l('(max size: XXX)') %>',
noLimit: '<%= l('No expiration delay') %>',
sending: '<%= l('Sending part XX1 of XX2. Please, be patient, the progress bar can take a while to move.') %>',
wsProblem: '<%= l('Websocket communication error') %>',
};
var maxSize = <%= config('max_file_size') || 0 %>;

View File

@ -6,6 +6,7 @@ var i18n = {
badkey: '<%= l('It seems that the key in your URL is incorrect. Please, verify your URL.') %>',
confirmExit: '<%= l('You have attempted to leave this page. The download will be canceled. Are you sure?') %>',
download: '<%= l('Get the file') %>',
fileDownloaded: '<%= l('File downloaded') %>',
loading: '<%= l('Asking for file part XX1 of %1', stash('nbslices')) %>',
nokey: '<%= l('You don\'t seem to have a key in your URL. You won\'t be able to decrypt the file. Download canceled.') %>',
showZipContent: '<%= l('Show zip content') %>',

View File

@ -45,6 +45,7 @@
%= javascript '/js/filesize.min.js'
%= javascript '/js/sjcl.js'
%= javascript '/js/jszip.min.js'
%= javascript '/js/lufi-notifications.js'
%= javascript '/js/lufi-down.js'
% }
% }