lint
This commit is contained in:
parent
b673fad703
commit
aa8c1afa9d
|
@ -4,7 +4,6 @@ const $ = require('jquery');
|
|||
|
||||
const Raven = window.Raven;
|
||||
|
||||
|
||||
$(document).ready(function() {
|
||||
$('#download-progress').hide();
|
||||
$('#send-file').click(() => {
|
||||
|
|
|
@ -67,7 +67,7 @@ class FileSender extends EventEmitter {
|
|||
]);
|
||||
})
|
||||
.catch(err => {
|
||||
Raven.captureException(err)
|
||||
Raven.captureException(err);
|
||||
return Promise.reject(err);
|
||||
})
|
||||
.then(([encrypted, keydata]) => {
|
||||
|
@ -107,7 +107,7 @@ class FileSender extends EventEmitter {
|
|||
});
|
||||
})
|
||||
.catch(err => {
|
||||
Raven.captureException(err)
|
||||
Raven.captureException(err);
|
||||
return Promise.reject(err);
|
||||
});
|
||||
}
|
||||
|
|
|
@ -68,7 +68,6 @@ $(document).ready(function() {
|
|||
.querySelector('#progress-bar')
|
||||
.style.setProperty('--progress', percentComplete + '%');
|
||||
$('#progress-text').html(`${percentComplete}%`);
|
||||
|
||||
});
|
||||
fileSender.upload().then(info => {
|
||||
const url = info.url.trim() + `#${info.secretKey}`.trim();
|
||||
|
@ -103,8 +102,7 @@ $(document).ready(function() {
|
|||
xhr.onreadystatechange = () => {
|
||||
if (xhr.readyState == 4 && xhr.status == 200) {
|
||||
resolve(xhr.response);
|
||||
}
|
||||
else if (xhr.readyState == 4 && xhr.status == 404) {
|
||||
} else if (xhr.readyState == 4 && xhr.status == 404) {
|
||||
reject('error code: ' + xhr.status);
|
||||
}
|
||||
};
|
||||
|
@ -113,11 +111,14 @@ $(document).ready(function() {
|
|||
};
|
||||
xhr.open('get', '/file/' + id, true);
|
||||
xhr.send();
|
||||
}).then (response => {
|
||||
}).then(
|
||||
response => {
|
||||
populateFileList(response, url);
|
||||
}, error => {
|
||||
},
|
||||
error => {
|
||||
console.log(error);
|
||||
});
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
//update file table with current files in localStorage
|
||||
|
@ -142,7 +143,7 @@ $(document).ready(function() {
|
|||
// create delete button
|
||||
btn.innerHTML = 'x';
|
||||
btn.classList.add('delete-btn');
|
||||
link.innerHTML = file.url.trim() + `#${file.secretKey}`.trim();;
|
||||
link.innerHTML = file.url.trim() + `#${file.secretKey}`.trim();
|
||||
|
||||
// create popup
|
||||
popupDiv.classList.add('popup');
|
||||
|
@ -152,10 +153,7 @@ $(document).ready(function() {
|
|||
|
||||
// delete file
|
||||
$popupText.find('.del-file').click(e => {
|
||||
FileSender.delete(
|
||||
file.fileId,
|
||||
file.deleteToken
|
||||
).then(() => {
|
||||
FileSender.delete(file.fileId, file.deleteToken).then(() => {
|
||||
$(e.target).parents('tr').remove();
|
||||
localStorage.removeItem(file.fileId);
|
||||
});
|
||||
|
@ -187,5 +185,4 @@ $(document).ready(function() {
|
|||
$popupText.toggleClass('show');
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
|
|
@ -60,11 +60,12 @@ app.get('/file/:id', (req, res) => {
|
|||
name: filename,
|
||||
filesize: bytes(contentLength),
|
||||
fileId: id
|
||||
})
|
||||
}).catch(() => {
|
||||
console.log('error retrieving id ' + id);
|
||||
});
|
||||
})
|
||||
.catch(() => {
|
||||
console.log('error retrieving id ' + id);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
app.get('/download/:id', (req, res) => {
|
||||
|
|
Loading…
Reference in New Issue