fix merge conflicts
This commit is contained in:
commit
5179252d3b
@ -603,6 +603,14 @@ html.cp,
|
|||||||
font-family: lato, Helvetica, sans-serif;
|
font-family: lato, Helvetica, sans-serif;
|
||||||
font-size: 1.02em;
|
font-size: 1.02em;
|
||||||
}
|
}
|
||||||
|
.cp .unselectable {
|
||||||
|
-webkit-touch-callout: none;
|
||||||
|
-webkit-user-select: none;
|
||||||
|
-khtml-user-select: none;
|
||||||
|
-moz-user-select: none;
|
||||||
|
-ms-user-select: none;
|
||||||
|
user-select: none;
|
||||||
|
}
|
||||||
.cp h1,
|
.cp h1,
|
||||||
.cp h2,
|
.cp h2,
|
||||||
.cp h3,
|
.cp h3,
|
||||||
|
|||||||
@ -43,6 +43,15 @@ a.github-corner > svg {
|
|||||||
font-size: 1.02em;
|
font-size: 1.02em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.unselectable {
|
||||||
|
-webkit-touch-callout: none;
|
||||||
|
-webkit-user-select: none;
|
||||||
|
-khtml-user-select: none;
|
||||||
|
-moz-user-select: none;
|
||||||
|
-ms-user-select: none;
|
||||||
|
user-select: none;
|
||||||
|
}
|
||||||
|
|
||||||
h1,h2,h3,h4,h5,h6 {
|
h1,h2,h3,h4,h5,h6 {
|
||||||
color: @fore;
|
color: @fore;
|
||||||
|
|
||||||
|
|||||||
@ -252,6 +252,7 @@ define(function () {
|
|||||||
'nos raisons pour ces changements et pourquoi vous devriez vraiment <a href="/register/">vous enregistrer</a> et <a href="/login/">vous connecter</a>.';
|
'nos raisons pour ces changements et pourquoi vous devriez vraiment <a href="/register/">vous enregistrer</a> et <a href="/login/">vous connecter</a>.';
|
||||||
out.fm_backup_title = 'Lien de secours';
|
out.fm_backup_title = 'Lien de secours';
|
||||||
out.fm_nameFile = 'Comment souhaitez-vous nommer ce fichier ?';
|
out.fm_nameFile = 'Comment souhaitez-vous nommer ce fichier ?';
|
||||||
|
out.fm_error_cantPin = "Erreur interne du serveur. Veuillez recharger la page et essayer de nouveau.";
|
||||||
// File - Context menu
|
// File - Context menu
|
||||||
out.fc_newfolder = "Nouveau dossier";
|
out.fc_newfolder = "Nouveau dossier";
|
||||||
out.fc_rename = "Renommer";
|
out.fc_rename = "Renommer";
|
||||||
@ -365,6 +366,7 @@ define(function () {
|
|||||||
out.upload_name = "Nom du fichier";
|
out.upload_name = "Nom du fichier";
|
||||||
out.upload_size = "Taille";
|
out.upload_size = "Taille";
|
||||||
out.upload_progress = "État";
|
out.upload_progress = "État";
|
||||||
|
out.download_button = "Déchiffrer et télécharger";
|
||||||
|
|
||||||
// general warnings
|
// general warnings
|
||||||
out.warn_notPinned = "Ce pad n'est stocké dans aucun CryptDrive. Il va expirer après 3 mois d'inactivité. <a href='/about.html#pinning'>En savoir plus...</a>";
|
out.warn_notPinned = "Ce pad n'est stocké dans aucun CryptDrive. Il va expirer après 3 mois d'inactivité. <a href='/about.html#pinning'>En savoir plus...</a>";
|
||||||
|
|||||||
@ -254,6 +254,7 @@ define(function () {
|
|||||||
'why we are doing this and why you really should <a href="/register/">Sign up</a> and <a href="/login/">Log in</a>.';
|
'why we are doing this and why you really should <a href="/register/">Sign up</a> and <a href="/login/">Log in</a>.';
|
||||||
out.fm_backup_title = 'Backup link';
|
out.fm_backup_title = 'Backup link';
|
||||||
out.fm_nameFile = 'How would you like to name that file?';
|
out.fm_nameFile = 'How would you like to name that file?';
|
||||||
|
out.fm_error_cantPin = "Internal server error. Please reload the page and try again.";
|
||||||
// File - Context menu
|
// File - Context menu
|
||||||
out.fc_newfolder = "New folder";
|
out.fc_newfolder = "New folder";
|
||||||
out.fc_rename = "Rename";
|
out.fc_rename = "Rename";
|
||||||
@ -370,6 +371,7 @@ define(function () {
|
|||||||
out.upload_name = "File name";
|
out.upload_name = "File name";
|
||||||
out.upload_size = "Size";
|
out.upload_size = "Size";
|
||||||
out.upload_progress = "Progress";
|
out.upload_progress = "Progress";
|
||||||
|
out.download_button = "Decrypt & Download";
|
||||||
|
|
||||||
// general warnings
|
// general warnings
|
||||||
out.warn_notPinned = "This pad is not in anyone's CryptDrive. It will expire after 3 months. <a href='/about.html#pinning'>Learn more...</a>";
|
out.warn_notPinned = "This pad is not in anyone's CryptDrive. It will expire after 3 months. <a href='/about.html#pinning'>Learn more...</a>";
|
||||||
|
|||||||
2
rpc.js
2
rpc.js
@ -13,7 +13,7 @@ var RPC = module.exports;
|
|||||||
|
|
||||||
var Store = require("./storage/file");
|
var Store = require("./storage/file");
|
||||||
|
|
||||||
var DEFAULT_LIMIT = 150 * 1024 * 1024;
|
var DEFAULT_LIMIT = 50 * 1024 * 1024;
|
||||||
|
|
||||||
var isValidId = function (chan) {
|
var isValidId = function (chan) {
|
||||||
return /^[a-fA-F0-9]/.test(chan) ||
|
return /^[a-fA-F0-9]/.test(chan) ||
|
||||||
|
|||||||
@ -575,7 +575,10 @@ define([
|
|||||||
atime: +new Date(),
|
atime: +new Date(),
|
||||||
ctime: +new Date()
|
ctime: +new Date()
|
||||||
}, function (err) {
|
}, function (err) {
|
||||||
if (err) { return void cb(err); }
|
if (err) {
|
||||||
|
logError(err);
|
||||||
|
return void cb(err);
|
||||||
|
}
|
||||||
parentEl[fileName] = href;
|
parentEl[fileName] = href;
|
||||||
var newPath = filePath.slice();
|
var newPath = filePath.slice();
|
||||||
newPath.push(fileName);
|
newPath.push(fileName);
|
||||||
|
|||||||
@ -1397,8 +1397,11 @@ define([
|
|||||||
// Handlers
|
// Handlers
|
||||||
if (isInRoot) {
|
if (isInRoot) {
|
||||||
var onCreated = function (err, info) {
|
var onCreated = function (err, info) {
|
||||||
if (err && err === E_OVER_LIMIT) {
|
if (err) {
|
||||||
return void Cryptpad.alert(Messages.pinLimitDrive, null, true);
|
if (err === E_OVER_LIMIT) {
|
||||||
|
return void Cryptpad.alert(Messages.pinLimitDrive, null, true);
|
||||||
|
}
|
||||||
|
return void Cryptpad.alert(Messages.fm_error_cantPin);
|
||||||
}
|
}
|
||||||
module.newFolder = info.newPath;
|
module.newFolder = info.newPath;
|
||||||
refresh();
|
refresh();
|
||||||
@ -2361,7 +2364,7 @@ define([
|
|||||||
return void Cryptpad.alert(Messages.pinLimitDrive, null, true);
|
return void Cryptpad.alert(Messages.pinLimitDrive, null, true);
|
||||||
}
|
}
|
||||||
if (err) {
|
if (err) {
|
||||||
return void console.error("Unable to create the file", err);
|
return void Cryptpad.alert(Messages.fm_error_cantPin);
|
||||||
}
|
}
|
||||||
module.newFolder = info.newPath;
|
module.newFolder = info.newPath;
|
||||||
refresh();
|
refresh();
|
||||||
|
|||||||
@ -7,12 +7,12 @@ body {
|
|||||||
padding: 0px;
|
padding: 0px;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
}
|
}
|
||||||
#file {
|
#file,
|
||||||
|
#dl {
|
||||||
display: block;
|
display: block;
|
||||||
height: 300px;
|
height: 100%;
|
||||||
width: 300px;
|
width: 100%;
|
||||||
border: 2px solid black;
|
border: 2px solid black;
|
||||||
margin: 50px;
|
|
||||||
}
|
}
|
||||||
.inputfile {
|
.inputfile {
|
||||||
width: 0.1px;
|
width: 0.1px;
|
||||||
@ -22,25 +22,32 @@ body {
|
|||||||
position: absolute;
|
position: absolute;
|
||||||
z-index: -1;
|
z-index: -1;
|
||||||
}
|
}
|
||||||
#upload-form {
|
#upload-form,
|
||||||
|
#download-form {
|
||||||
padding: 0px;
|
padding: 0px;
|
||||||
margin: 0px;
|
margin: 0px;
|
||||||
position: relative;
|
position: relative;
|
||||||
width: 50vh;
|
width: 50vh;
|
||||||
height: 50vh;
|
height: 50vh;
|
||||||
display: block;
|
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;
|
position: relative;
|
||||||
|
padding: 10px;
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
}
|
}
|
||||||
.hovering {
|
.hovering {
|
||||||
background-color: rgba(255, 0, 115, 0.5) !important;
|
background-color: rgba(255, 0, 115, 0.5) !important;
|
||||||
}
|
}
|
||||||
.block {
|
.block {
|
||||||
display: block;
|
display: block;
|
||||||
height: 50vh;
|
|
||||||
width: 50vh;
|
|
||||||
}
|
}
|
||||||
.hidden {
|
.hidden {
|
||||||
display: none;
|
display: none;
|
||||||
@ -48,7 +55,6 @@ body {
|
|||||||
.inputfile + label {
|
.inputfile + label {
|
||||||
border: 2px solid black;
|
border: 2px solid black;
|
||||||
background-color: rgba(50, 50, 50, 0.1);
|
background-color: rgba(50, 50, 50, 0.1);
|
||||||
margin: 50px;
|
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
.inputfile:focus + label,
|
.inputfile:focus + label,
|
||||||
|
|||||||
@ -9,12 +9,11 @@ html, body {
|
|||||||
padding: 0px;
|
padding: 0px;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
}
|
}
|
||||||
#file {
|
#file, #dl {
|
||||||
display: block;
|
display: block;
|
||||||
height: 300px;
|
height: 100%;
|
||||||
width: 300px;
|
width: 100%;
|
||||||
border: 2px solid black;
|
border: 2px solid black;
|
||||||
margin: 50px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.inputfile {
|
.inputfile {
|
||||||
@ -26,7 +25,7 @@ html, body {
|
|||||||
z-index: -1;
|
z-index: -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#upload-form {
|
#upload-form, #download-form {
|
||||||
padding: 0px;
|
padding: 0px;
|
||||||
margin: 0px;
|
margin: 0px;
|
||||||
|
|
||||||
@ -34,20 +33,24 @@ html, body {
|
|||||||
width: 50vh;
|
width: 50vh;
|
||||||
height: 50vh;
|
height: 50vh;
|
||||||
display: block;
|
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 {
|
.hovering {
|
||||||
background-color: rgba(255, 0, 115, 0.5) !important;
|
background-color: rgba(255, 0, 115, 0.5) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.block {
|
.block {
|
||||||
display: block;
|
display: block;
|
||||||
height: 50vh;
|
|
||||||
width: 50vh;
|
|
||||||
}
|
}
|
||||||
.hidden {
|
.hidden {
|
||||||
display: none;
|
display: none;
|
||||||
@ -55,7 +58,6 @@ html, body {
|
|||||||
.inputfile + label {
|
.inputfile + label {
|
||||||
border: 2px solid black;
|
border: 2px solid black;
|
||||||
background-color: rgba(50, 50, 50, .10);
|
background-color: rgba(50, 50, 50, .10);
|
||||||
margin: 50px;
|
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -6,14 +6,21 @@
|
|||||||
<script src="/bower_components/jquery/dist/jquery.min.js"></script>
|
<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="/bower_components/bootstrap/dist/css/bootstrap.min.css">
|
||||||
<link rel="stylesheet" href="/file/file.css">
|
<link rel="stylesheet" href="/file/file.css">
|
||||||
|
<link rel="stylesheet" href="/customize/main.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="toolbar" class="toolbar-container"></div>
|
<div id="toolbar" class="toolbar-container"></div>
|
||||||
<div id="upload-form" style="display: none;">
|
<div id="upload-form" style="display: none;">
|
||||||
<input type="file" name="file" id="file" class="inputfile" />
|
<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>
|
</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>
|
<tr>
|
||||||
<td data-localization="upload_name">File name</td>
|
<td data-localization="upload_name">File name</td>
|
||||||
<td data-localization="upload_size">Size</td>
|
<td data-localization="upload_size">Size</td>
|
||||||
|
|||||||
@ -21,8 +21,9 @@ define([
|
|||||||
var ifrw = $('#pad-iframe')[0].contentWindow;
|
var ifrw = $('#pad-iframe')[0].contentWindow;
|
||||||
var $iframe = $('#pad-iframe').contents();
|
var $iframe = $('#pad-iframe').contents();
|
||||||
var $form = $iframe.find('#upload-form');
|
var $form = $iframe.find('#upload-form');
|
||||||
//var $progress = $form.find('#progress');
|
var $dlform = $iframe.find('#download-form');
|
||||||
var $label = $form.find('label');
|
var $label = $form.find('label');
|
||||||
|
var $dllabel = $dlform.find('label');
|
||||||
var $table = $iframe.find('#status');
|
var $table = $iframe.find('#status');
|
||||||
|
|
||||||
Cryptpad.addLoadingScreen();
|
Cryptpad.addLoadingScreen();
|
||||||
@ -100,8 +101,6 @@ define([
|
|||||||
var b64Key = Nacl.util.encodeBase64(key);
|
var b64Key = Nacl.util.encodeBase64(key);
|
||||||
Cryptpad.replaceHash(Cryptpad.getFileHashFromKeys(id, b64Key));
|
Cryptpad.replaceHash(Cryptpad.getFileHashFromKeys(id, b64Key));
|
||||||
|
|
||||||
//$form.hide();
|
|
||||||
|
|
||||||
APP.toolbar.addElement(['fileshare'], {});
|
APP.toolbar.addElement(['fileshare'], {});
|
||||||
|
|
||||||
var title = document.title = metadata.name;
|
var title = document.title = metadata.name;
|
||||||
@ -181,11 +180,10 @@ define([
|
|||||||
$tr.find('.progressValue').text(Messages.upload_cancelled);
|
$tr.find('.progressValue').text(Messages.upload_cancelled);
|
||||||
});
|
});
|
||||||
|
|
||||||
var $tr2 = $('<tr>', {id: id}).appendTo($table);
|
$('<td>').text(obj.metadata.name).appendTo($tr);
|
||||||
$('<td>').text(obj.metadata.name).appendTo($tr2);
|
$('<td>').text(prettySize(estimate)).appendTo($tr);
|
||||||
$('<td>').text(prettySize(estimate)).appendTo($tr2);
|
$('<td>', {'class': 'upProgress'}).append($progressBar).append($progressValue).appendTo($tr);
|
||||||
$('<td>', {'class': 'upProgress'}).append($progressBar).append($progressValue).appendTo($tr2);
|
$('<td>', {'class': 'upCancel'}).append($cancel).appendTo($tr);
|
||||||
$('<td>', {'class': 'upCancel'}).append($cancel).appendTo($tr2);
|
|
||||||
|
|
||||||
queue.next();
|
queue.next();
|
||||||
};
|
};
|
||||||
@ -251,32 +249,38 @@ define([
|
|||||||
Title.updateTitle(Cryptpad.initialName || getTitle() || Title.defaultTitle);
|
Title.updateTitle(Cryptpad.initialName || getTitle() || Title.defaultTitle);
|
||||||
|
|
||||||
if (!uploadMode) {
|
if (!uploadMode) {
|
||||||
var src = Cryptpad.getBlobPathFromHex(hexFileName);
|
$dlform.show();
|
||||||
return Cryptpad.fetch(src, function (e, u8) {
|
Cryptpad.removeLoadingScreen();
|
||||||
if (e) { return void Cryptpad.alert(e); }
|
$dlform.find('#dl').click(function (e) {
|
||||||
// now decrypt the u8
|
if (myFile) { return void exportFile(); }
|
||||||
var cryptKey = secret.keys && secret.keys.fileKeyStr;
|
|
||||||
var key = Nacl.util.decodeBase64(cryptKey);
|
|
||||||
|
|
||||||
if (!u8 || !u8.length) {
|
var src = Cryptpad.getBlobPathFromHex(hexFileName);
|
||||||
return void Cryptpad.errorLoadingScreen(e);
|
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 (!u8 || !u8.length) {
|
||||||
if (e) {
|
return void Cryptpad.errorLoadingScreen(e);
|
||||||
Cryptpad.removeLoadingScreen();
|
|
||||||
return console.error(e);
|
|
||||||
}
|
}
|
||||||
console.log(data);
|
|
||||||
var title = document.title = data.metadata.name;
|
FileCrypto.decrypt(u8, key, function (e, data) {
|
||||||
myFile = data.content;
|
if (e) {
|
||||||
myDataType = data.metadata.type;
|
return console.error(e);
|
||||||
Title.updateTitle(title || Title.defaultTitle);
|
}
|
||||||
Cryptpad.removeLoadingScreen();
|
console.log(data);
|
||||||
}, function (progress) {
|
var title = document.title = data.metadata.name;
|
||||||
console.error(progress);
|
myFile = data.content;
|
||||||
|
myDataType = data.metadata.type;
|
||||||
|
Title.updateTitle(title || Title.defaultTitle);
|
||||||
|
exportFile();
|
||||||
|
}, function (progress) {
|
||||||
|
console.error(progress);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!Cryptpad.isLoggedIn()) {
|
if (!Cryptpad.isLoggedIn()) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user