Merge branch 'master' of github.com:mozilla/send into testpilotGA
This commit is contained in:
commit
76a6f02eb7
5 changed files with 23 additions and 12 deletions
|
@ -39,7 +39,6 @@ $(document).ready(function() {
|
|||
$('#link').attr('disabled', false);
|
||||
$copyBtn.attr('data-l10n-id', 'copyUrlFormButton');
|
||||
|
||||
|
||||
if (localStorage.length === 0) {
|
||||
toggleHeader();
|
||||
} else {
|
||||
|
@ -94,18 +93,26 @@ $(document).ready(function() {
|
|||
// on file upload by browse or drag & drop
|
||||
function onUpload(event) {
|
||||
event.preventDefault();
|
||||
let file = '';
|
||||
if (event.type === 'drop') {
|
||||
if (event.originalEvent.dataTransfer.files.length > 1 || event.originalEvent.dataTransfer.files[0].size === 0){
|
||||
$('.upload-window').removeClass('ondrag');
|
||||
document.l10n.formatValue('uploadPageMultipleFilesAlert')
|
||||
.then(str => {
|
||||
alert(str);
|
||||
});
|
||||
return;
|
||||
}
|
||||
file = event.originalEvent.dataTransfer.files[0];
|
||||
} else {
|
||||
file = event.target.files[0];
|
||||
}
|
||||
|
||||
$('#page-one').attr('hidden', true);
|
||||
$('#upload-error').attr('hidden', true);
|
||||
$('#upload-progress').removeAttr('hidden');
|
||||
//don't allow drag and drop when not on page-one
|
||||
$('body').off('drop', onUpload);
|
||||
|
||||
let file = '';
|
||||
if (event.type === 'drop') {
|
||||
file = event.originalEvent.dataTransfer.files[0];
|
||||
} else {
|
||||
file = event.target.files[0];
|
||||
}
|
||||
const expiration = 24 * 60 * 60 * 1000; //will eventually come from a field
|
||||
|
||||
const fileSender = new FileSender(file);
|
||||
|
@ -186,7 +193,7 @@ $(document).ready(function() {
|
|||
$('#upload-progress').attr('hidden', true);
|
||||
$('#upload-error').attr('hidden', true);
|
||||
$('#share-link').removeAttr('hidden');
|
||||
}, 2000);
|
||||
}, 1000);
|
||||
|
||||
populateFileList(JSON.stringify(fileData));
|
||||
document.l10n.formatValue('notifyUploadDone')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue