Compare commits

...

16 Commits

Author SHA1 Message Date
Danny Coates
82fe65ada2 v2.3.1 2018-02-05 09:34:22 -08:00
Danny Coates
ce79d7b745 reset FileReceiver on cancel. fixes #751 2018-02-05 09:11:42 -08:00
Rhoslyn Prys
755cc4f5ec Pontoon: Update Welsh (cy) localization of Test Pilot: Firefox Send
Localization authors:
- Rhoslyn Prys <rprys@yahoo.com>
2018-02-05 12:12:00 +00:00
Danny Coates
fde4d311e3 added FileReceiver.reset 2018-02-04 18:30:33 -08:00
Sara Todaro
b08f40aaa3 Pontoon: Update Italian (it) localization of Test Pilot: Firefox Send
Localization authors:
- Sara Todaro <sara.todaro@mozillaitalia.org>
2018-02-04 21:11:34 +00:00
Victor Bychek
e12ade6b31 Pontoon: Update Russian (ru) localization of Test Pilot: Firefox Send
Localization authors:
- Victor Bychek <a@bychek.ru>
2018-02-04 11:32:24 +00:00
Sara Todaro
43fc80ef41 Pontoon: Update Italian (it) localization of Test Pilot: Firefox Send
Localization authors:
- Sara Todaro <sara.todaro@mozillaitalia.org>
- Winfox <openlib@email.it>
2018-02-04 10:50:45 +00:00
Georgianizator
6ca96157f6 Pontoon: Update Georgian (ka) localization of Test Pilot: Firefox Send
Localization authors:
- Georgianizator <georgianization@outlook.com>
2018-02-04 10:12:00 +00:00
jlG
856181ea54 Pontoon: Update Spanish (Spain) (es-ES) localization of Test Pilot: Firefox Send
Localization authors:
- jlG <jlg.l10n.es@gmail.com>
- Jordi Cuevas <jordicuevas@gmail.com>
2018-02-03 23:31:26 +00:00
Jordi Cuevas
f84bd46cdc Pontoon: Update Spanish (Spain) (es-ES) localization of Test Pilot: Firefox Send
Localization authors:
- Jordi Cuevas <jordicuevas@gmail.com>
2018-02-03 23:12:07 +00:00
Victor Bychek
0b43924ee2 Pontoon: Update Russian (ru) localization of Test Pilot: Firefox Send
Localization authors:
- Victor Bychek <a@bychek.ru>
2018-02-03 18:32:13 +00:00
Selim Şumlu
16d3fd3828 Pontoon: Update Turkish (tr) localization of Test Pilot: Firefox Send
Localization authors:
- Selim Şumlu <selim@sum.lu>
2018-02-03 17:50:50 +00:00
Danny Coates
cf5defa6a9 fixed file list time wrap. fixes #749 2018-02-02 10:37:28 -08:00
Danny Coates
3de760db12 added fileTooBig alert to drop handler. fixes #578 2018-02-02 10:22:32 -08:00
Danny Coates
1366f0b68e moved ownedFile.type assignment 2018-02-02 10:15:17 -08:00
Danny Coates
be498e0bd3 /api/info values should be numbers. fixes #748 2018-02-02 10:10:51 -08:00
15 changed files with 88 additions and 16 deletions

View File

@@ -1,3 +1,6 @@
/* global MAXFILESIZE */
const { bytes } = require('./utils');
export default function(state, emitter) {
emitter.on('DOMContentLoaded', () => {
document.body.addEventListener('dragover', event => {
@@ -13,10 +16,19 @@ export default function(state, emitter) {
if (target.files.length === 0) {
return;
}
if (target.files.length > 1 || target.files[0].size === 0) {
if (target.files.length > 1) {
return alert(state.translate('uploadPageMultipleFilesAlert'));
}
const file = target.files[0];
if (file.size === 0) {
return;
}
if (file.size > MAXFILESIZE) {
window.alert(
state.translate('fileTooBig', { size: bytes(MAXFILESIZE) })
);
return;
}
emitter.emit('upload', { file, type: 'drop' });
}
});

View File

@@ -100,6 +100,7 @@ export default function(state, emitter) {
try {
metrics.startedUpload({ size, type });
const ownedFile = await sender.upload();
ownedFile.type = type;
state.storage.totalUploads += 1;
metrics.completedUpload(ownedFile);
@@ -172,14 +173,17 @@ export default function(state, emitter) {
await fadeOut('download-progress');
saveFile(f);
state.storage.totalDownloads += 1;
state.transfer.reset();
metrics.completedDownload({ size, time, speed });
emitter.emit('pushState', '/completed');
} catch (err) {
if (err.message === '0') {
// download cancelled
state.transfer.reset();
return render();
}
console.error(err);
state.transfer = null;
const location = err.message === 'notfound' ? '/404' : '/error';
if (location === '/error') {
state.raven.captureException(err);
@@ -187,7 +191,6 @@ export default function(state, emitter) {
}
emitter.emit('pushState', location);
} finally {
state.transfer = null;
openLinksInNewTab(links, false);
}
});

View File

@@ -11,11 +11,7 @@ export default class FileReceiver extends Nanobus {
this.keychain.setPassword(fileInfo.password, fileInfo.url);
}
this.fileInfo = fileInfo;
this.fileDownload = null;
this.msg = 'fileSizeProgress';
this.state = 'initialized';
this.progress = [0, 1];
this.cancelled = false;
this.reset();
}
get progressRatio() {
@@ -36,6 +32,14 @@ export default class FileReceiver extends Nanobus {
}
}
reset() {
this.fileDownload = null;
this.msg = 'fileSizeProgress';
this.state = 'initialized';
this.progress = [0, 1];
this.cancelled = false;
}
async getMetadata() {
const meta = await metadata(this.fileInfo.id, this.keychain);
if (meta) {

View File

@@ -86,7 +86,6 @@ export default class FileSender extends Nanobus {
url: `${result.url}#${secretKey}`,
name: this.file.name,
size: this.file.size,
type: this.file.type, //TODO 'click' ?
time: time,
speed: this.file.size / (time / 1000),
createdAt: Date.now(),

View File

@@ -39,7 +39,7 @@ module.exports = function(file, state, emit) {
${state.translate('copiedUrl')}
</span>
</td>
<td>${remainingTime}</td>
<td class="overflow-col">${remainingTime}</td>
<td class="center-col">${totalDownloads} / ${downloadLimit}</td>
<td class="center-col">
<img

View File

@@ -343,7 +343,7 @@ tbody {
}
#expiry-time-file-list {
width: 21%;
width: 25%;
}
#expiry-downloads-file-list {
@@ -351,7 +351,7 @@ tbody {
}
#delete-file-list {
width: 12%;
width: 7%;
}
.overflow-col {

2
package-lock.json generated
View File

@@ -1,6 +1,6 @@
{
"name": "firefox-send",
"version": "2.3.0",
"version": "2.3.1",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@@ -1,7 +1,7 @@
{
"name": "firefox-send",
"description": "File Sharing Experiment",
"version": "2.3.0",
"version": "2.3.1",
"author": "Mozilla (https://mozilla.org)",
"repository": "mozilla/send",
"homepage": "https://github.com/mozilla/send/",

View File

@@ -46,7 +46,11 @@ sendAnotherFileLink = Anfon ffeil arall
// Alternative text used on the download link/button (indicates an action).
downloadAltText = Llwytho i lawr
downloadsFileList = Llwythi
// Used as header in a column indicating the amount of time left before a
// download link expires (e.g. "10h 5m")
timeFileList = Amser
// Used as header in a column indicating the number of times a file has been
// downloaded
downloadFileName = Llwytho i lawr { $filename }
downloadFileSize = ({ $size })
unlockInputLabel = Rhowch Gyfrinair
@@ -106,3 +110,10 @@ passwordTryAgain = Cyfrinair anghywir. Ceisiwch eto.
// This label is followed by the password needed to download a file
passwordResult = Cyfrinair: { $password }
reportIPInfringement = Adrodd ar Gamddefnydd o'r IP
javascriptRequired = Mae Firefox Send angen JavaScript
whyJavascript = Pam fod Firefox Send angen JavaScript?
enableJavascript = Galluogwch JavaScript a cheisio eto.
// A short representation of a countdown timer containing the number of hours and minutes remaining as digits, example "13h 47m"
expiresHoursMinutes = { $hours }a { $minutes }m
// A short representation of a countdown timer containing the number of minutes remaining as digits, example "56m"
expiresMinutes = { $minutes }m

View File

@@ -106,3 +106,10 @@ passwordTryAgain = Contraseña incorrecta. Inténtelo de nuevo.
// This label is followed by the password needed to download a file
passwordResult = Contraseña: { $password }
reportIPInfringement = Denunciar vulneración de propiedad intelectual
javascriptRequired = Firefox Send requiere JavaScript
whyJavascript = ¿Por qué Firefox Send requiere JavaScript?
enableJavascript = Por favor, activa JavaScript y vuelve a intentarlo.
// A short representation of a countdown timer containing the number of hours and minutes remaining as digits, example "13h 47m"
expiresHoursMinutes = { $hours }h { $minutes }m
// A short representation of a countdown timer containing the number of minutes remaining as digits, example "56m"
expiresMinutes = { $minutes }m

View File

@@ -42,7 +42,11 @@ sendAnotherFileLink = Invia un altro file
// Alternative text used on the download link/button (indicates an action).
downloadAltText = Scarica
downloadsFileList = Download
// Used as header in a column indicating the amount of time left before a
// download link expires (e.g. "10h 5m")
timeFileList = Scadenza
// Used as header in a column indicating the number of times a file has been
// downloaded
downloadFileName = Scarica { $filename }
downloadFileSize = ({ $size })
unlockInputLabel = Inserire la password
@@ -102,3 +106,10 @@ passwordTryAgain = Password errata, riprovare.
// This label is followed by the password needed to download a file
passwordResult = Password: { $password }
reportIPInfringement = Segnala violazione della proprietà intellettuale
javascriptRequired = Firefox Send richiede JavaScript
whyJavascript = Perché Firefox Send richiede JavaScript?
enableJavascript = Attiva JavaScript e riprova.
// A short representation of a countdown timer containing the number of hours and minutes remaining as digits, example "13h 47m"
expiresHoursMinutes = { $hours }h { $minutes }m
// A short representation of a countdown timer containing the number of minutes remaining as digits, example "56m"
expiresMinutes = { $minutes }m

View File

@@ -40,7 +40,11 @@ sendAnotherFileLink = სხვა ფაილის გაგზავნა
// Alternative text used on the download link/button (indicates an action).
downloadAltText = ჩამოტვირთვა
downloadsFileList = ჩამოტვირთვები
// Used as header in a column indicating the amount of time left before a
// download link expires (e.g. "10h 5m")
timeFileList = დრო
// Used as header in a column indicating the number of times a file has been
// downloaded
downloadFileName = { $filename } ჩამოტვირთვა
downloadFileSize = ({ $size })
unlockInputLabel = შეიყვანეთ პაროლი
@@ -100,3 +104,10 @@ passwordTryAgain = პაროლი არასწორია. სცად
// This label is followed by the password needed to download a file
passwordResult = პაროლი: { $password }
reportIPInfringement = მოხსენება დარღვევაზე
javascriptRequired = Firefox Send საჭიროებს JavaScript-ს
whyJavascript = რატომ საჭიროებს Firefox Send JavaScript-ს?
enableJavascript = გთხოვთ ჩართოთ JavaScript და სცადოთ ხელახლა.
// A short representation of a countdown timer containing the number of hours and minutes remaining as digits, example "13h 47m"
expiresHoursMinutes = { $hours }სთ { $minutes }წთ
// A short representation of a countdown timer containing the number of minutes remaining as digits, example "56m"
expiresMinutes = { $minutes }წთ

View File

@@ -58,7 +58,7 @@ downloadFileTitle = Загрузить зашифрованный файл
// Firefox Send is a brand name and should not be localized.
downloadMessage = Ваш друг отправил вам файл с помощью Firefox Send, сервиса, который позволяет вам делиться файлами, используя безопасные, приватные и зашифрованные ссылки, по истечении срока действия которых ваши файлы не остаются в сети навсегда.
// Text and title used on the download link/button (indicates an action).
downloadButtonLabel = Скачать
downloadButtonLabel = Загрузить
downloadNotification = Ваша загрузка завершена.
downloadFinish = Загрузка завершена
// This message is displayed when uploading or downloading a file, e.g. "(1,3 MB of 10 MB)".
@@ -108,3 +108,10 @@ passwordTryAgain = Неверный пароль. Попробуйте снов
// This label is followed by the password needed to download a file
passwordResult = Пароль: { $password }
reportIPInfringement = Сообщить о нарушении прав на интеллектуальную собственность
javascriptRequired = Для Firefox Send необходим JavaScript
whyJavascript = Почему Firefox Send требуется JavaScript?
enableJavascript = Пожалуйста, включите JavaScript и попробуйте снова.
// A short representation of a countdown timer containing the number of hours and minutes remaining as digits, example "13h 47m"
expiresHoursMinutes = { $hours } ч. { $minutes } мин.
// A short representation of a countdown timer containing the number of minutes remaining as digits, example "56m"
expiresMinutes = { $minutes } мин.

View File

@@ -102,3 +102,10 @@ passwordTryAgain = Yanlış parola. Yeniden deneyin.
// This label is followed by the password needed to download a file
passwordResult = Parola: { $password }
reportIPInfringement = Telif hakkı ihlali bildir
javascriptRequired = Firefox Send için JavaScript gerekir
whyJavascript = Firefox Send neden JavaScript kullanıyor?
enableJavascript = Lütfen JavaScript'i etkinleştirip yeniden deneyin.
// A short representation of a countdown timer containing the number of hours and minutes remaining as digits, example "13h 47m"
expiresHoursMinutes = { $hours } sa { $minutes } dk
// A short representation of a countdown timer containing the number of minutes remaining as digits, example "56m"
expiresMinutes = { $minutes } dk

View File

@@ -21,8 +21,8 @@ module.exports = async function(req, res) {
}
const ttl = await storage.ttl(id);
return res.send({
dlimit: meta.dlimit,
dtotal: meta.dl,
dlimit: +meta.dlimit,
dtotal: +meta.dl,
ttl
});
} catch (e) {