mirror of
https://gitlab.com/timvisee/send.git
synced 2025-12-08 15:10:54 +03:00
Compare commits
16 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
82fe65ada2 | ||
|
|
ce79d7b745 | ||
|
|
755cc4f5ec | ||
|
|
fde4d311e3 | ||
|
|
b08f40aaa3 | ||
|
|
e12ade6b31 | ||
|
|
43fc80ef41 | ||
|
|
6ca96157f6 | ||
|
|
856181ea54 | ||
|
|
f84bd46cdc | ||
|
|
0b43924ee2 | ||
|
|
16d3fd3828 | ||
|
|
cf5defa6a9 | ||
|
|
3de760db12 | ||
|
|
1366f0b68e | ||
|
|
be498e0bd3 |
@@ -1,3 +1,6 @@
|
|||||||
|
/* global MAXFILESIZE */
|
||||||
|
const { bytes } = require('./utils');
|
||||||
|
|
||||||
export default function(state, emitter) {
|
export default function(state, emitter) {
|
||||||
emitter.on('DOMContentLoaded', () => {
|
emitter.on('DOMContentLoaded', () => {
|
||||||
document.body.addEventListener('dragover', event => {
|
document.body.addEventListener('dragover', event => {
|
||||||
@@ -13,10 +16,19 @@ export default function(state, emitter) {
|
|||||||
if (target.files.length === 0) {
|
if (target.files.length === 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (target.files.length > 1 || target.files[0].size === 0) {
|
if (target.files.length > 1) {
|
||||||
return alert(state.translate('uploadPageMultipleFilesAlert'));
|
return alert(state.translate('uploadPageMultipleFilesAlert'));
|
||||||
}
|
}
|
||||||
const file = target.files[0];
|
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' });
|
emitter.emit('upload', { file, type: 'drop' });
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -100,6 +100,7 @@ export default function(state, emitter) {
|
|||||||
try {
|
try {
|
||||||
metrics.startedUpload({ size, type });
|
metrics.startedUpload({ size, type });
|
||||||
const ownedFile = await sender.upload();
|
const ownedFile = await sender.upload();
|
||||||
|
ownedFile.type = type;
|
||||||
state.storage.totalUploads += 1;
|
state.storage.totalUploads += 1;
|
||||||
metrics.completedUpload(ownedFile);
|
metrics.completedUpload(ownedFile);
|
||||||
|
|
||||||
@@ -172,14 +173,17 @@ export default function(state, emitter) {
|
|||||||
await fadeOut('download-progress');
|
await fadeOut('download-progress');
|
||||||
saveFile(f);
|
saveFile(f);
|
||||||
state.storage.totalDownloads += 1;
|
state.storage.totalDownloads += 1;
|
||||||
|
state.transfer.reset();
|
||||||
metrics.completedDownload({ size, time, speed });
|
metrics.completedDownload({ size, time, speed });
|
||||||
emitter.emit('pushState', '/completed');
|
emitter.emit('pushState', '/completed');
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
if (err.message === '0') {
|
if (err.message === '0') {
|
||||||
// download cancelled
|
// download cancelled
|
||||||
|
state.transfer.reset();
|
||||||
return render();
|
return render();
|
||||||
}
|
}
|
||||||
console.error(err);
|
console.error(err);
|
||||||
|
state.transfer = null;
|
||||||
const location = err.message === 'notfound' ? '/404' : '/error';
|
const location = err.message === 'notfound' ? '/404' : '/error';
|
||||||
if (location === '/error') {
|
if (location === '/error') {
|
||||||
state.raven.captureException(err);
|
state.raven.captureException(err);
|
||||||
@@ -187,7 +191,6 @@ export default function(state, emitter) {
|
|||||||
}
|
}
|
||||||
emitter.emit('pushState', location);
|
emitter.emit('pushState', location);
|
||||||
} finally {
|
} finally {
|
||||||
state.transfer = null;
|
|
||||||
openLinksInNewTab(links, false);
|
openLinksInNewTab(links, false);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -11,11 +11,7 @@ export default class FileReceiver extends Nanobus {
|
|||||||
this.keychain.setPassword(fileInfo.password, fileInfo.url);
|
this.keychain.setPassword(fileInfo.password, fileInfo.url);
|
||||||
}
|
}
|
||||||
this.fileInfo = fileInfo;
|
this.fileInfo = fileInfo;
|
||||||
this.fileDownload = null;
|
this.reset();
|
||||||
this.msg = 'fileSizeProgress';
|
|
||||||
this.state = 'initialized';
|
|
||||||
this.progress = [0, 1];
|
|
||||||
this.cancelled = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
get progressRatio() {
|
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() {
|
async getMetadata() {
|
||||||
const meta = await metadata(this.fileInfo.id, this.keychain);
|
const meta = await metadata(this.fileInfo.id, this.keychain);
|
||||||
if (meta) {
|
if (meta) {
|
||||||
|
|||||||
@@ -86,7 +86,6 @@ export default class FileSender extends Nanobus {
|
|||||||
url: `${result.url}#${secretKey}`,
|
url: `${result.url}#${secretKey}`,
|
||||||
name: this.file.name,
|
name: this.file.name,
|
||||||
size: this.file.size,
|
size: this.file.size,
|
||||||
type: this.file.type, //TODO 'click' ?
|
|
||||||
time: time,
|
time: time,
|
||||||
speed: this.file.size / (time / 1000),
|
speed: this.file.size / (time / 1000),
|
||||||
createdAt: Date.now(),
|
createdAt: Date.now(),
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ module.exports = function(file, state, emit) {
|
|||||||
${state.translate('copiedUrl')}
|
${state.translate('copiedUrl')}
|
||||||
</span>
|
</span>
|
||||||
</td>
|
</td>
|
||||||
<td>${remainingTime}</td>
|
<td class="overflow-col">${remainingTime}</td>
|
||||||
<td class="center-col">${totalDownloads} / ${downloadLimit}</td>
|
<td class="center-col">${totalDownloads} / ${downloadLimit}</td>
|
||||||
<td class="center-col">
|
<td class="center-col">
|
||||||
<img
|
<img
|
||||||
|
|||||||
@@ -343,7 +343,7 @@ tbody {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#expiry-time-file-list {
|
#expiry-time-file-list {
|
||||||
width: 21%;
|
width: 25%;
|
||||||
}
|
}
|
||||||
|
|
||||||
#expiry-downloads-file-list {
|
#expiry-downloads-file-list {
|
||||||
@@ -351,7 +351,7 @@ tbody {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#delete-file-list {
|
#delete-file-list {
|
||||||
width: 12%;
|
width: 7%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.overflow-col {
|
.overflow-col {
|
||||||
|
|||||||
2
package-lock.json
generated
2
package-lock.json
generated
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "firefox-send",
|
"name": "firefox-send",
|
||||||
"version": "2.3.0",
|
"version": "2.3.1",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "firefox-send",
|
"name": "firefox-send",
|
||||||
"description": "File Sharing Experiment",
|
"description": "File Sharing Experiment",
|
||||||
"version": "2.3.0",
|
"version": "2.3.1",
|
||||||
"author": "Mozilla (https://mozilla.org)",
|
"author": "Mozilla (https://mozilla.org)",
|
||||||
"repository": "mozilla/send",
|
"repository": "mozilla/send",
|
||||||
"homepage": "https://github.com/mozilla/send/",
|
"homepage": "https://github.com/mozilla/send/",
|
||||||
|
|||||||
@@ -46,7 +46,11 @@ sendAnotherFileLink = Anfon ffeil arall
|
|||||||
// Alternative text used on the download link/button (indicates an action).
|
// Alternative text used on the download link/button (indicates an action).
|
||||||
downloadAltText = Llwytho i lawr
|
downloadAltText = Llwytho i lawr
|
||||||
downloadsFileList = Llwythi
|
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
|
timeFileList = Amser
|
||||||
|
// Used as header in a column indicating the number of times a file has been
|
||||||
|
// downloaded
|
||||||
downloadFileName = Llwytho i lawr { $filename }
|
downloadFileName = Llwytho i lawr { $filename }
|
||||||
downloadFileSize = ({ $size })
|
downloadFileSize = ({ $size })
|
||||||
unlockInputLabel = Rhowch Gyfrinair
|
unlockInputLabel = Rhowch Gyfrinair
|
||||||
@@ -106,3 +110,10 @@ passwordTryAgain = Cyfrinair anghywir. Ceisiwch eto.
|
|||||||
// This label is followed by the password needed to download a file
|
// This label is followed by the password needed to download a file
|
||||||
passwordResult = Cyfrinair: { $password }
|
passwordResult = Cyfrinair: { $password }
|
||||||
reportIPInfringement = Adrodd ar Gamddefnydd o'r IP
|
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
|
||||||
|
|||||||
@@ -106,3 +106,10 @@ passwordTryAgain = Contraseña incorrecta. Inténtelo de nuevo.
|
|||||||
// This label is followed by the password needed to download a file
|
// This label is followed by the password needed to download a file
|
||||||
passwordResult = Contraseña: { $password }
|
passwordResult = Contraseña: { $password }
|
||||||
reportIPInfringement = Denunciar vulneración de propiedad intelectual
|
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
|
||||||
|
|||||||
@@ -42,7 +42,11 @@ sendAnotherFileLink = Invia un altro file
|
|||||||
// Alternative text used on the download link/button (indicates an action).
|
// Alternative text used on the download link/button (indicates an action).
|
||||||
downloadAltText = Scarica
|
downloadAltText = Scarica
|
||||||
downloadsFileList = Download
|
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
|
timeFileList = Scadenza
|
||||||
|
// Used as header in a column indicating the number of times a file has been
|
||||||
|
// downloaded
|
||||||
downloadFileName = Scarica { $filename }
|
downloadFileName = Scarica { $filename }
|
||||||
downloadFileSize = ({ $size })
|
downloadFileSize = ({ $size })
|
||||||
unlockInputLabel = Inserire la password
|
unlockInputLabel = Inserire la password
|
||||||
@@ -102,3 +106,10 @@ passwordTryAgain = Password errata, riprovare.
|
|||||||
// This label is followed by the password needed to download a file
|
// This label is followed by the password needed to download a file
|
||||||
passwordResult = Password: { $password }
|
passwordResult = Password: { $password }
|
||||||
reportIPInfringement = Segnala violazione della proprietà intellettuale
|
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
|
||||||
|
|||||||
@@ -40,7 +40,11 @@ sendAnotherFileLink = სხვა ფაილის გაგზავნა
|
|||||||
// Alternative text used on the download link/button (indicates an action).
|
// Alternative text used on the download link/button (indicates an action).
|
||||||
downloadAltText = ჩამოტვირთვა
|
downloadAltText = ჩამოტვირთვა
|
||||||
downloadsFileList = ჩამოტვირთვები
|
downloadsFileList = ჩამოტვირთვები
|
||||||
|
// Used as header in a column indicating the amount of time left before a
|
||||||
|
// download link expires (e.g. "10h 5m")
|
||||||
timeFileList = დრო
|
timeFileList = დრო
|
||||||
|
// Used as header in a column indicating the number of times a file has been
|
||||||
|
// downloaded
|
||||||
downloadFileName = { $filename } ჩამოტვირთვა
|
downloadFileName = { $filename } ჩამოტვირთვა
|
||||||
downloadFileSize = ({ $size })
|
downloadFileSize = ({ $size })
|
||||||
unlockInputLabel = შეიყვანეთ პაროლი
|
unlockInputLabel = შეიყვანეთ პაროლი
|
||||||
@@ -100,3 +104,10 @@ passwordTryAgain = პაროლი არასწორია. სცად
|
|||||||
// This label is followed by the password needed to download a file
|
// This label is followed by the password needed to download a file
|
||||||
passwordResult = პაროლი: { $password }
|
passwordResult = პაროლი: { $password }
|
||||||
reportIPInfringement = მოხსენება დარღვევაზე
|
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 }წთ
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ downloadFileTitle = Загрузить зашифрованный файл
|
|||||||
// Firefox Send is a brand name and should not be localized.
|
// Firefox Send is a brand name and should not be localized.
|
||||||
downloadMessage = Ваш друг отправил вам файл с помощью Firefox Send, сервиса, который позволяет вам делиться файлами, используя безопасные, приватные и зашифрованные ссылки, по истечении срока действия которых ваши файлы не остаются в сети навсегда.
|
downloadMessage = Ваш друг отправил вам файл с помощью Firefox Send, сервиса, который позволяет вам делиться файлами, используя безопасные, приватные и зашифрованные ссылки, по истечении срока действия которых ваши файлы не остаются в сети навсегда.
|
||||||
// Text and title used on the download link/button (indicates an action).
|
// Text and title used on the download link/button (indicates an action).
|
||||||
downloadButtonLabel = Скачать
|
downloadButtonLabel = Загрузить
|
||||||
downloadNotification = Ваша загрузка завершена.
|
downloadNotification = Ваша загрузка завершена.
|
||||||
downloadFinish = Загрузка завершена
|
downloadFinish = Загрузка завершена
|
||||||
// This message is displayed when uploading or downloading a file, e.g. "(1,3 MB of 10 MB)".
|
// 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
|
// This label is followed by the password needed to download a file
|
||||||
passwordResult = Пароль: { $password }
|
passwordResult = Пароль: { $password }
|
||||||
reportIPInfringement = Сообщить о нарушении прав на интеллектуальную собственность
|
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 } мин.
|
||||||
|
|||||||
@@ -102,3 +102,10 @@ passwordTryAgain = Yanlış parola. Yeniden deneyin.
|
|||||||
// This label is followed by the password needed to download a file
|
// This label is followed by the password needed to download a file
|
||||||
passwordResult = Parola: { $password }
|
passwordResult = Parola: { $password }
|
||||||
reportIPInfringement = Telif hakkı ihlali bildir
|
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
|
||||||
|
|||||||
@@ -21,8 +21,8 @@ module.exports = async function(req, res) {
|
|||||||
}
|
}
|
||||||
const ttl = await storage.ttl(id);
|
const ttl = await storage.ttl(id);
|
||||||
return res.send({
|
return res.send({
|
||||||
dlimit: meta.dlimit,
|
dlimit: +meta.dlimit,
|
||||||
dtotal: meta.dl,
|
dtotal: +meta.dl,
|
||||||
ttl
|
ttl
|
||||||
});
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|||||||
Reference in New Issue
Block a user