fix merge conflicts
This commit is contained in:
@@ -7,12 +7,12 @@ body {
|
||||
padding: 0px;
|
||||
display: inline-block;
|
||||
}
|
||||
#file {
|
||||
#file,
|
||||
#dl {
|
||||
display: block;
|
||||
height: 300px;
|
||||
width: 300px;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
border: 2px solid black;
|
||||
margin: 50px;
|
||||
}
|
||||
.inputfile {
|
||||
width: 0.1px;
|
||||
@@ -22,25 +22,32 @@ body {
|
||||
position: absolute;
|
||||
z-index: -1;
|
||||
}
|
||||
#upload-form {
|
||||
#upload-form,
|
||||
#download-form {
|
||||
padding: 0px;
|
||||
margin: 0px;
|
||||
position: relative;
|
||||
width: 50vh;
|
||||
height: 50vh;
|
||||
display: block;
|
||||
margin: auto;
|
||||
margin: 50px auto;
|
||||
max-width: 80vw;
|
||||
}
|
||||
#upload-form label {
|
||||
#upload-form label,
|
||||
#download-form label {
|
||||
line-height: 50vh;
|
||||
text-align: center;
|
||||
position: relative;
|
||||
padding: 10px;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
.hovering {
|
||||
background-color: rgba(255, 0, 115, 0.5) !important;
|
||||
}
|
||||
.block {
|
||||
display: block;
|
||||
height: 50vh;
|
||||
width: 50vh;
|
||||
}
|
||||
.hidden {
|
||||
display: none;
|
||||
@@ -48,7 +55,6 @@ body {
|
||||
.inputfile + label {
|
||||
border: 2px solid black;
|
||||
background-color: rgba(50, 50, 50, 0.1);
|
||||
margin: 50px;
|
||||
display: block;
|
||||
}
|
||||
.inputfile:focus + label,
|
||||
|
||||
@@ -9,12 +9,11 @@ html, body {
|
||||
padding: 0px;
|
||||
display: inline-block;
|
||||
}
|
||||
#file {
|
||||
#file, #dl {
|
||||
display: block;
|
||||
height: 300px;
|
||||
width: 300px;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
border: 2px solid black;
|
||||
margin: 50px;
|
||||
}
|
||||
|
||||
.inputfile {
|
||||
@@ -26,7 +25,7 @@ html, body {
|
||||
z-index: -1;
|
||||
}
|
||||
|
||||
#upload-form {
|
||||
#upload-form, #download-form {
|
||||
padding: 0px;
|
||||
margin: 0px;
|
||||
|
||||
@@ -34,20 +33,24 @@ html, body {
|
||||
width: 50vh;
|
||||
height: 50vh;
|
||||
display: block;
|
||||
margin: auto;
|
||||
margin: 50px auto;
|
||||
max-width: 80vw;
|
||||
label {
|
||||
line-height: 50vh;
|
||||
text-align: center;
|
||||
position: relative;
|
||||
padding: 10px;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
}
|
||||
#upload-form label{
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.hovering {
|
||||
background-color: rgba(255, 0, 115, 0.5) !important;
|
||||
}
|
||||
|
||||
.block {
|
||||
display: block;
|
||||
height: 50vh;
|
||||
width: 50vh;
|
||||
}
|
||||
.hidden {
|
||||
display: none;
|
||||
@@ -55,7 +58,6 @@ html, body {
|
||||
.inputfile + label {
|
||||
border: 2px solid black;
|
||||
background-color: rgba(50, 50, 50, .10);
|
||||
margin: 50px;
|
||||
display: block;
|
||||
}
|
||||
|
||||
|
||||
@@ -6,14 +6,21 @@
|
||||
<script src="/bower_components/jquery/dist/jquery.min.js"></script>
|
||||
<link rel="stylesheet" href="/bower_components/bootstrap/dist/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="/file/file.css">
|
||||
<link rel="stylesheet" href="/customize/main.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="toolbar" class="toolbar-container"></div>
|
||||
<div id="upload-form" style="display: none;">
|
||||
<input type="file" name="file" id="file" class="inputfile" />
|
||||
<label for="file" class="block" data-localization="upload_choose">Choose a file<span class="block" id="progress"> </span></label>
|
||||
<label for="file" class="block unselectable" data-localization-title="upload_choose"
|
||||
data-localization="upload_choose"></label>
|
||||
</div>
|
||||
<table id="status">
|
||||
<div id="download-form" style="display: none;">
|
||||
<input type="button" name="dl" id="dl" class="inputfile" />
|
||||
<label for="dl" class="block unselectable" data-localization-title="download_button"
|
||||
data-localization="download_button"></label>
|
||||
</div>
|
||||
<table id="status" style="display: none;">
|
||||
<tr>
|
||||
<td data-localization="upload_name">File name</td>
|
||||
<td data-localization="upload_size">Size</td>
|
||||
|
||||
@@ -21,8 +21,9 @@ define([
|
||||
var ifrw = $('#pad-iframe')[0].contentWindow;
|
||||
var $iframe = $('#pad-iframe').contents();
|
||||
var $form = $iframe.find('#upload-form');
|
||||
//var $progress = $form.find('#progress');
|
||||
var $dlform = $iframe.find('#download-form');
|
||||
var $label = $form.find('label');
|
||||
var $dllabel = $dlform.find('label');
|
||||
var $table = $iframe.find('#status');
|
||||
|
||||
Cryptpad.addLoadingScreen();
|
||||
@@ -100,8 +101,6 @@ define([
|
||||
var b64Key = Nacl.util.encodeBase64(key);
|
||||
Cryptpad.replaceHash(Cryptpad.getFileHashFromKeys(id, b64Key));
|
||||
|
||||
//$form.hide();
|
||||
|
||||
APP.toolbar.addElement(['fileshare'], {});
|
||||
|
||||
var title = document.title = metadata.name;
|
||||
@@ -181,11 +180,10 @@ define([
|
||||
$tr.find('.progressValue').text(Messages.upload_cancelled);
|
||||
});
|
||||
|
||||
var $tr2 = $('<tr>', {id: id}).appendTo($table);
|
||||
$('<td>').text(obj.metadata.name).appendTo($tr2);
|
||||
$('<td>').text(prettySize(estimate)).appendTo($tr2);
|
||||
$('<td>', {'class': 'upProgress'}).append($progressBar).append($progressValue).appendTo($tr2);
|
||||
$('<td>', {'class': 'upCancel'}).append($cancel).appendTo($tr2);
|
||||
$('<td>').text(obj.metadata.name).appendTo($tr);
|
||||
$('<td>').text(prettySize(estimate)).appendTo($tr);
|
||||
$('<td>', {'class': 'upProgress'}).append($progressBar).append($progressValue).appendTo($tr);
|
||||
$('<td>', {'class': 'upCancel'}).append($cancel).appendTo($tr);
|
||||
|
||||
queue.next();
|
||||
};
|
||||
@@ -251,32 +249,38 @@ define([
|
||||
Title.updateTitle(Cryptpad.initialName || getTitle() || Title.defaultTitle);
|
||||
|
||||
if (!uploadMode) {
|
||||
var src = Cryptpad.getBlobPathFromHex(hexFileName);
|
||||
return Cryptpad.fetch(src, function (e, u8) {
|
||||
if (e) { return void Cryptpad.alert(e); }
|
||||
// now decrypt the u8
|
||||
var cryptKey = secret.keys && secret.keys.fileKeyStr;
|
||||
var key = Nacl.util.decodeBase64(cryptKey);
|
||||
$dlform.show();
|
||||
Cryptpad.removeLoadingScreen();
|
||||
$dlform.find('#dl').click(function (e) {
|
||||
if (myFile) { return void exportFile(); }
|
||||
|
||||
if (!u8 || !u8.length) {
|
||||
return void Cryptpad.errorLoadingScreen(e);
|
||||
}
|
||||
var src = Cryptpad.getBlobPathFromHex(hexFileName);
|
||||
return Cryptpad.fetch(src, function (e, u8) {
|
||||
if (e) { return void Cryptpad.alert(e); }
|
||||
// now decrypt the u8
|
||||
var cryptKey = secret.keys && secret.keys.fileKeyStr;
|
||||
var key = Nacl.util.decodeBase64(cryptKey);
|
||||
|
||||
FileCrypto.decrypt(u8, key, function (e, data) {
|
||||
if (e) {
|
||||
Cryptpad.removeLoadingScreen();
|
||||
return console.error(e);
|
||||
if (!u8 || !u8.length) {
|
||||
return void Cryptpad.errorLoadingScreen(e);
|
||||
}
|
||||
console.log(data);
|
||||
var title = document.title = data.metadata.name;
|
||||
myFile = data.content;
|
||||
myDataType = data.metadata.type;
|
||||
Title.updateTitle(title || Title.defaultTitle);
|
||||
Cryptpad.removeLoadingScreen();
|
||||
}, function (progress) {
|
||||
console.error(progress);
|
||||
|
||||
FileCrypto.decrypt(u8, key, function (e, data) {
|
||||
if (e) {
|
||||
return console.error(e);
|
||||
}
|
||||
console.log(data);
|
||||
var title = document.title = data.metadata.name;
|
||||
myFile = data.content;
|
||||
myDataType = data.metadata.type;
|
||||
Title.updateTitle(title || Title.defaultTitle);
|
||||
exportFile();
|
||||
}, function (progress) {
|
||||
console.error(progress);
|
||||
});
|
||||
});
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
if (!Cryptpad.isLoggedIn()) {
|
||||
|
||||
Reference in New Issue
Block a user