mirror of
https://gitlab.com/timvisee/send.git
synced 2025-12-07 06:30:53 +03:00
Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0bf8481fd0 | ||
|
|
ae0758ac14 | ||
|
|
e9405f49ee | ||
|
|
a1d0eef8a5 | ||
|
|
254b806fb4 | ||
|
|
a7aee1450f | ||
|
|
fa5573a5ff |
@@ -38,14 +38,13 @@ export default class FileReceiver extends EventEmitter {
|
||||
}
|
||||
|
||||
const blob = new Blob([this.response]);
|
||||
const type = xhr.getResponseHeader('Content-Type');
|
||||
const meta = JSON.parse(xhr.getResponseHeader('X-File-Metadata'));
|
||||
const fileReader = new FileReader();
|
||||
fileReader.onload = function() {
|
||||
resolve({
|
||||
data: this.result,
|
||||
name: meta.filename,
|
||||
type,
|
||||
type: meta.mimeType,
|
||||
iv: meta.id
|
||||
});
|
||||
};
|
||||
|
||||
@@ -13,6 +13,7 @@ import Storage from './storage';
|
||||
import * as metrics from './metrics';
|
||||
import * as progress from './progress';
|
||||
import * as fileList from './fileList';
|
||||
import checkImg from '../../public/resources/check-16.svg';
|
||||
|
||||
const storage = new Storage();
|
||||
|
||||
@@ -117,6 +118,13 @@ async function upload(event) {
|
||||
|
||||
link.setAttribute('value', `${info.url}#${info.secretKey}`);
|
||||
|
||||
const copyText = document.getElementById('copy-text');
|
||||
copyText.setAttribute(
|
||||
'data-l10n-args',
|
||||
JSON.stringify({ filename: file.name })
|
||||
);
|
||||
copyText.setAttribute('data-l10n-id', 'copyUrlFormLabelWithName');
|
||||
|
||||
metrics.completedUpload({
|
||||
size: file.size,
|
||||
time,
|
||||
@@ -219,8 +227,7 @@ document.addEventListener('DOMContentLoaded', function() {
|
||||
//disable button for 3s
|
||||
copyBtn.disabled = true;
|
||||
link.disabled = true;
|
||||
copyBtn.innerHtml =
|
||||
'<img src="/resources/check-16.svg" class="icon-check"></img>';
|
||||
copyBtn.innerHTML = `<img src="${checkImg}" class="icon-check"></img>`;
|
||||
setTimeout(() => {
|
||||
copyBtn.disabled = !allowedCopy();
|
||||
copyBtn.setAttribute('data-l10n-id', 'copyUrlFormButton');
|
||||
|
||||
2
package-lock.json
generated
2
package-lock.json
generated
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "firefox-send",
|
||||
"version": "1.1.1",
|
||||
"version": "1.1.2",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "firefox-send",
|
||||
"description": "File Sharing Experiment",
|
||||
"version": "1.1.1",
|
||||
"version": "1.1.2",
|
||||
"author": "Mozilla (https://mozilla.org)",
|
||||
"dependencies": {
|
||||
"aws-sdk": "^2.98.0",
|
||||
|
||||
@@ -7,8 +7,10 @@ uploadPageDropMessage = ఎగుమతిని ప్రారంభించ
|
||||
uploadPageSizeMessage = అత్యంత నమ్మకమైన కార్యం కోసం, మీ ఫైలును 1GB కంటే తక్కువగా ఉంచడం ఉత్తమం
|
||||
uploadPageBrowseButton = మీ కంప్యూటర్లో ఒక ఫైలును ఎంచుకోండి
|
||||
.title = మీ కంప్యూటర్లో ఒక ఫైలును ఎంచుకోండి
|
||||
uploadPageBrowseButton1 = ఎక్కించటానికి ఒక ఫైలును ఎంచుకోండి
|
||||
.title = ఎక్కించటానికి ఒక ఫైలును ఎంచుకోండి
|
||||
uploadPageBrowseButtonTitle = ఫైలును ఎగుమతి చేయండి
|
||||
uploadingPageHeader = మీ ఫైలు ఎగుమతి అవుతుంది
|
||||
uploadingPageProgress = { $filename } ({ $size }) ఎక్కుతోంది
|
||||
importingFile = దిగుమతవుతోంది...
|
||||
verifyingFile = పరిశీలిస్తున్నది…
|
||||
encryptingFile = గుప్తీకరిస్తోంది...
|
||||
@@ -45,6 +47,8 @@ downloadButtonLabel = దిగుమతి
|
||||
.title = దిగుమతి
|
||||
downloadNotification = మీ దిగుమతి పూర్తయ్యింది.
|
||||
downloadFinish = దిగుమతి పూర్తయింది
|
||||
// This message is displayed when uploading or downloading a file, e.g. "(1,3 MB of 10 MB)".
|
||||
fileSizeProgress = { $totalSize }) యొక్క ({ $partialSize }
|
||||
// Firefox Send is a brand name and should not be localized. Title text for button should be the same.
|
||||
sendYourFilesLink = Firefox sendను ప్రయత్నించండి
|
||||
.title = Firefox sendను ప్రయత్నించండి
|
||||
|
||||
@@ -194,7 +194,7 @@ app.get('/assets/download/:id', async (req, res) => {
|
||||
const contentLength = await storage.length(id);
|
||||
res.writeHead(200, {
|
||||
'Content-Disposition': `attachment; filename=${meta.filename}`,
|
||||
'Content-Type': meta.mimeType,
|
||||
'Content-Type': 'application/octet-stream',
|
||||
'Content-Length': contentLength,
|
||||
'X-File-Metadata': JSON.stringify(meta)
|
||||
});
|
||||
|
||||
@@ -163,7 +163,7 @@ describe('Server integration tests', function() {
|
||||
res.header['content-disposition'],
|
||||
'attachment; filename=test_upload.txt'
|
||||
);
|
||||
assert.equal(res.header['content-type'], 'text/plain');
|
||||
assert.equal(res.header['content-type'], 'application/octet-stream');
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user