Merge branch 'staging' of github.com:xwiki-labs/cryptpad into staging
commit
67a04a16ec
|
@ -18,7 +18,7 @@
|
|||
"scripts": {
|
||||
"lint": "jshint --config .jshintrc --exclude-path .jshintignore .",
|
||||
"test": "node TestSelenium.js",
|
||||
"style": "lessc ./customize.dist/src/less/cryptpad.less > ./customize.dist/main.css && lessc ./customize.dist/src/less/toolbar.less > ./customize.dist/toolbar.css && lessc ./www/drive/file.less > ./www/drive/file.css && lessc ./www/settings/main.less > ./www/settings/main.css && lessc ./www/slide/slide.less > ./www/slide/slide.css && lessc ./www/whiteboard/whiteboard.less > ./www/whiteboard/whiteboard.css && lessc ./www/poll/poll.less > ./www/poll/poll.css",
|
||||
"style": "lessc ./customize.dist/src/less/cryptpad.less > ./customize.dist/main.css && lessc ./customize.dist/src/less/toolbar.less > ./customize.dist/toolbar.css && lessc ./www/drive/file.less > ./www/drive/file.css && lessc ./www/settings/main.less > ./www/settings/main.css && lessc ./www/slide/slide.less > ./www/slide/slide.css && lessc ./www/whiteboard/whiteboard.less > ./www/whiteboard/whiteboard.css && lessc ./www/poll/poll.less > ./www/poll/poll.css && lessc ./www/file/file.less > ./www/file/file.css",
|
||||
"template": "cd customize.dist/src && node build.js"
|
||||
}
|
||||
}
|
||||
|
|
45
rpc.js
45
rpc.js
|
@ -286,7 +286,10 @@ var getFileSize = function (Env, channel, cb) {
|
|||
}
|
||||
|
||||
return void Env.msgStore.getChannelSize(channel, function (e, size) {
|
||||
if (e) { return void cb(e.code); }
|
||||
if (e) {
|
||||
if (e === 'ENOENT') { return void cb(void 0, 0); }
|
||||
return void cb(e.code);
|
||||
}
|
||||
cb(void 0, size);
|
||||
});
|
||||
}
|
||||
|
@ -331,7 +334,7 @@ var getTotalSize = function (Env, publicKey, cb) {
|
|||
//var msgStore = Env.msgStore;
|
||||
|
||||
return void getChannelList(Env, publicKey, function (channels) {
|
||||
if (!channels) { cb('NO_ARRAY'); } // unexpected
|
||||
if (!channels) { return cb('NO_ARRAY'); } // unexpected
|
||||
|
||||
var count = channels.length;
|
||||
if (!count) { cb(void 0, 0); }
|
||||
|
@ -755,6 +758,12 @@ RPC.create = function (config /*:typeof(ConfigType)*/, cb /*:(?Error, ?Function)
|
|||
// load pin-store...
|
||||
console.log('loading rpc module...');
|
||||
|
||||
var warn = function (e, output) {
|
||||
if (e && !config.suppressRPCErrors) {
|
||||
console.error('[' + e + ']', output);
|
||||
}
|
||||
};
|
||||
|
||||
var keyOrDefaultString = function (key, def) {
|
||||
return typeof(config[key]) === 'string'? config[key]: def;
|
||||
};
|
||||
|
@ -848,40 +857,59 @@ RPC.create = function (config /*:typeof(ConfigType)*/, cb /*:(?Error, ?Function)
|
|||
case 'COOKIE': return void Respond(void 0);
|
||||
case 'RESET':
|
||||
return resetUserPins(Env, safeKey, msg[1], function (e, hash) {
|
||||
//warn(e, hash);
|
||||
return void Respond(e, hash);
|
||||
});
|
||||
case 'PIN':
|
||||
return pinChannel(Env, safeKey, msg[1], function (e, hash) {
|
||||
warn(e, hash);
|
||||
Respond(e, hash);
|
||||
});
|
||||
case 'UNPIN':
|
||||
return unpinChannel(Env, safeKey, msg[1], function (e, hash) {
|
||||
warn(e, hash);
|
||||
Respond(e, hash);
|
||||
});
|
||||
case 'GET_HASH':
|
||||
return void getHash(Env, safeKey, function (e, hash) {
|
||||
warn(e, hash);
|
||||
Respond(e, hash);
|
||||
});
|
||||
case 'GET_TOTAL_SIZE': // TODO cache this, since it will get called quite a bit
|
||||
return getTotalSize(Env, safeKey, function (e, size) {
|
||||
if (e) { return void Respond(e); }
|
||||
if (e) {
|
||||
warn(e, safeKey);
|
||||
return void Respond(e);
|
||||
}
|
||||
Respond(e, size);
|
||||
});
|
||||
case 'GET_FILE_SIZE':
|
||||
return void getFileSize(Env, msg[1], Respond);
|
||||
return void getFileSize(Env, msg[2], function (e, size) {
|
||||
warn(e, msg[2]);
|
||||
Respond(e, size);
|
||||
});
|
||||
case 'UPDATE_LIMITS':
|
||||
return void updateLimits(config, safeKey, function (e, limit) {
|
||||
if (e) { return void Respond(e); }
|
||||
if (e) {
|
||||
warn(e, limit);
|
||||
return void Respond(e);
|
||||
}
|
||||
Respond(void 0, limit);
|
||||
});
|
||||
case 'GET_LIMIT':
|
||||
return void getLimit(Env, safeKey, function (e, limit) {
|
||||
if (e) { return void Respond(e); }
|
||||
if (e) {
|
||||
warn(e, limit);
|
||||
return void Respond(e);
|
||||
}
|
||||
Respond(void 0, limit);
|
||||
});
|
||||
case 'GET_MULTIPLE_FILE_SIZE':
|
||||
return void getMultipleFileSize(Env, msg[1], function (e, dict) {
|
||||
if (e) { return void Respond(e); }
|
||||
if (e) {
|
||||
warn(e, dict);
|
||||
return void Respond(e);
|
||||
}
|
||||
Respond(void 0, dict);
|
||||
});
|
||||
|
||||
|
@ -889,6 +917,7 @@ RPC.create = function (config /*:typeof(ConfigType)*/, cb /*:(?Error, ?Function)
|
|||
case 'UPLOAD':
|
||||
if (!privileged) { return deny(); }
|
||||
return void upload(Env, safeKey, msg[1], function (e, len) {
|
||||
warn(e, len);
|
||||
Respond(e, len);
|
||||
});
|
||||
case 'UPLOAD_STATUS':
|
||||
|
@ -906,11 +935,13 @@ RPC.create = function (config /*:typeof(ConfigType)*/, cb /*:(?Error, ?Function)
|
|||
case 'UPLOAD_COMPLETE':
|
||||
if (!privileged) { return deny(); }
|
||||
return void upload_complete(Env, safeKey, function (e, hash) {
|
||||
warn(e, hash);
|
||||
Respond(e, hash);
|
||||
});
|
||||
case 'UPLOAD_CANCEL':
|
||||
if (!privileged) { return deny(); }
|
||||
return void upload_cancel(Env, safeKey, function (e) {
|
||||
warn(e);
|
||||
Respond(e);
|
||||
});
|
||||
default:
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,109 @@
|
|||
html,
|
||||
body {
|
||||
margin: 0px;
|
||||
}
|
||||
.cryptpad-toolbar {
|
||||
margin-bottom: 1px;
|
||||
padding: 0px;
|
||||
display: inline-block;
|
||||
}
|
||||
#file {
|
||||
display: block;
|
||||
height: 300px;
|
||||
width: 300px;
|
||||
border: 2px solid black;
|
||||
margin: 50px;
|
||||
}
|
||||
.inputfile {
|
||||
width: 0.1px;
|
||||
height: 0.1px;
|
||||
opacity: 0;
|
||||
overflow: hidden;
|
||||
position: absolute;
|
||||
z-index: -1;
|
||||
}
|
||||
#upload-form {
|
||||
padding: 0px;
|
||||
margin: 0px;
|
||||
position: relative;
|
||||
width: 50vh;
|
||||
height: 50vh;
|
||||
display: block;
|
||||
margin: auto;
|
||||
}
|
||||
#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;
|
||||
}
|
||||
.inputfile + label {
|
||||
border: 2px solid black;
|
||||
background-color: rgba(50, 50, 50, 0.1);
|
||||
margin: 50px;
|
||||
display: block;
|
||||
}
|
||||
.inputfile:focus + label,
|
||||
.inputfile + label:hover {
|
||||
background-color: rgba(50, 50, 50, 0.3);
|
||||
}
|
||||
#progress {
|
||||
position: absolute;
|
||||
top: 0px;
|
||||
left: 0px;
|
||||
height: 100%;
|
||||
transition: width 500ms;
|
||||
width: 0%;
|
||||
max-width: 100%;
|
||||
max-height: 100%;
|
||||
background-color: rgba(255, 0, 115, 0.75);
|
||||
z-index: 10000;
|
||||
display: block;
|
||||
}
|
||||
#status {
|
||||
display: none;
|
||||
width: 80vw;
|
||||
margin-top: 50px;
|
||||
margin-left: 10vw;
|
||||
border: 1px solid black;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
#status tr:nth-child(1) {
|
||||
background-color: #ccc;
|
||||
border: 1px solid #999;
|
||||
}
|
||||
#status tr:nth-child(1) td {
|
||||
text-align: center;
|
||||
}
|
||||
#status td {
|
||||
border-left: 1px solid #BBB;
|
||||
border-right: 1px solid #BBB;
|
||||
padding: 0 10px;
|
||||
}
|
||||
#status .upProgress {
|
||||
width: 200px;
|
||||
position: relative;
|
||||
text-align: center;
|
||||
}
|
||||
#status .progressContainer {
|
||||
position: absolute;
|
||||
width: 0px;
|
||||
left: 5px;
|
||||
top: 1px;
|
||||
bottom: 1px;
|
||||
background-color: rgba(0, 0, 255, 0.3);
|
||||
}
|
||||
#status .upCancel {
|
||||
text-align: center;
|
||||
}
|
||||
#status .fa.cancel {
|
||||
color: #ff0073;
|
||||
}
|
|
@ -0,0 +1,117 @@
|
|||
@import "../../customize.dist/src/less/variables.less";
|
||||
@import "../../customize.dist/src/less/mixins.less";
|
||||
|
||||
html, body {
|
||||
margin: 0px;
|
||||
}
|
||||
.cryptpad-toolbar {
|
||||
margin-bottom: 1px;
|
||||
padding: 0px;
|
||||
display: inline-block;
|
||||
}
|
||||
#file {
|
||||
display: block;
|
||||
height: 300px;
|
||||
width: 300px;
|
||||
border: 2px solid black;
|
||||
margin: 50px;
|
||||
}
|
||||
|
||||
.inputfile {
|
||||
width: 0.1px;
|
||||
height: 0.1px;
|
||||
opacity: 0;
|
||||
overflow: hidden;
|
||||
position: absolute;
|
||||
z-index: -1;
|
||||
}
|
||||
|
||||
#upload-form {
|
||||
padding: 0px;
|
||||
margin: 0px;
|
||||
|
||||
position: relative;
|
||||
width: 50vh;
|
||||
height: 50vh;
|
||||
display: block;
|
||||
margin: auto;
|
||||
}
|
||||
#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;
|
||||
}
|
||||
.inputfile + label {
|
||||
border: 2px solid black;
|
||||
background-color: rgba(50, 50, 50, .10);
|
||||
margin: 50px;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.inputfile:focus + label,
|
||||
.inputfile + label:hover {
|
||||
background-color: rgba(50, 50, 50, 0.30);
|
||||
}
|
||||
|
||||
#progress {
|
||||
position: absolute;
|
||||
top: 0px;
|
||||
left: 0px;
|
||||
height: 100%;
|
||||
|
||||
|
||||
transition: width 500ms;
|
||||
width: 0%;
|
||||
max-width: 100%;
|
||||
max-height: 100%;
|
||||
background-color: rgba(255, 0, 115, 0.75);
|
||||
z-index: 10000;
|
||||
display: block;
|
||||
}
|
||||
|
||||
#status {
|
||||
display: none;
|
||||
width: 80vw;
|
||||
margin-top: 50px;
|
||||
margin-left: 10vw;
|
||||
border: 1px solid black;
|
||||
border-collapse: collapse;
|
||||
tr:nth-child(1) {
|
||||
background-color: #ccc;
|
||||
border: 1px solid #999;
|
||||
td { text-align: center; }
|
||||
}
|
||||
td {
|
||||
border-left: 1px solid #BBB;
|
||||
border-right: 1px solid #BBB;
|
||||
padding: 0 10px;
|
||||
}
|
||||
.upProgress {
|
||||
width: 200px;
|
||||
position: relative;
|
||||
text-align: center;
|
||||
}
|
||||
.progressContainer {
|
||||
position: absolute;
|
||||
width: 0px;
|
||||
left: 5px;
|
||||
top: 1px; bottom: 1px;
|
||||
background-color: rgba(0,0,255,0.3);
|
||||
}
|
||||
.upCancel { text-align: center; }
|
||||
.fa.cancel {
|
||||
color: rgb(255, 0, 115);
|
||||
}
|
||||
}
|
||||
|
|
@ -5,120 +5,7 @@
|
|||
<link rel="stylesheet" href="/bower_components/components-font-awesome/css/font-awesome.min.css">
|
||||
<script src="/bower_components/jquery/dist/jquery.min.js"></script>
|
||||
<link rel="stylesheet" href="/bower_components/bootstrap/dist/css/bootstrap.min.css">
|
||||
<style>
|
||||
html, body {
|
||||
margin: 0px;
|
||||
}
|
||||
.cryptpad-toolbar {
|
||||
margin-bottom: 1px;
|
||||
padding: 0px;
|
||||
display: inline-block;
|
||||
}
|
||||
#file {
|
||||
display: block;
|
||||
height: 300px;
|
||||
width: 300px;
|
||||
border: 2px solid black;
|
||||
margin: 50px;
|
||||
}
|
||||
|
||||
.inputfile {
|
||||
width: 0.1px;
|
||||
height: 0.1px;
|
||||
opacity: 0;
|
||||
overflow: hidden;
|
||||
position: absolute;
|
||||
z-index: -1;
|
||||
}
|
||||
|
||||
#upload-form {
|
||||
padding: 0px;
|
||||
margin: 0px;
|
||||
|
||||
position: relative;
|
||||
width: 50vh;
|
||||
height: 50vh;
|
||||
display: block;
|
||||
margin: auto;
|
||||
}
|
||||
#upload-form label{
|
||||
text-align: center;
|
||||
line-height: 50vh;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.hovering {
|
||||
background-color: rgba(255, 0, 115, 0.5) !important;
|
||||
}
|
||||
|
||||
.block {
|
||||
display: block;
|
||||
height: 50vh;
|
||||
width: 50vh;
|
||||
}
|
||||
.hidden {
|
||||
display: none;
|
||||
}
|
||||
.inputfile + label {
|
||||
border: 2px solid black;
|
||||
background-color: rgba(50, 50, 50, .10);
|
||||
margin: 50px;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.inputfile:focus + label,
|
||||
.inputfile + label:hover {
|
||||
background-color: rgba(50, 50, 50, 0.30);
|
||||
}
|
||||
|
||||
#progress {
|
||||
position: absolute;
|
||||
top: 0px;
|
||||
left: 0px;
|
||||
height: 100%;
|
||||
width: 0%;
|
||||
max-width: 100%;
|
||||
max-height: 100%;
|
||||
background-color: rgba(255, 0, 115, 0.75);
|
||||
z-index: 10000;
|
||||
display: block;
|
||||
}
|
||||
|
||||
#status {
|
||||
display: none;
|
||||
width: 80vw;
|
||||
margin-top: 50px;
|
||||
margin-left: 10vw;
|
||||
border: 1px solid black;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
#status tr:nth-child(1) {
|
||||
background-color: #ccc;
|
||||
border: 1px solid #999;
|
||||
}
|
||||
#status tr:nth-child(1) td { text-align: center; }
|
||||
#status td {
|
||||
border-left: 1px solid #BBB;
|
||||
border-right: 1px solid #BBB;
|
||||
padding: 0 10px;
|
||||
}
|
||||
#status .upProgress {
|
||||
width: 200px;
|
||||
position: relative;
|
||||
text-align: center;
|
||||
}
|
||||
#status .progressContainer {
|
||||
position: absolute;
|
||||
width: 0px;
|
||||
left: 5px;
|
||||
top: 1px; bottom: 1px;
|
||||
background-color: rgba(0,0,255,0.3);
|
||||
}
|
||||
#status .upCancel { text-align: center; }
|
||||
#status .fa.cancel {
|
||||
color: rgb(255, 0, 115);
|
||||
}
|
||||
</style>
|
||||
<link rel="stylesheet" href="/file/file.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="toolbar" class="toolbar-container"></div>
|
||||
|
|
|
@ -80,6 +80,10 @@ define([
|
|||
.on('decryptionError', function (e) {
|
||||
var error = e.originalEvent;
|
||||
Cryptpad.alert(error.message);
|
||||
})
|
||||
.on('decryptionProgress', function (e) {
|
||||
var progress = e.originalEvent;
|
||||
console.log(progress.percent);
|
||||
});
|
||||
|
||||
require(['/common/media-tag.js'], function (MediaTag) {
|
||||
|
|
Loading…
Reference in New Issue