Shared folders UI

This commit is contained in:
yflory
2018-07-10 14:41:37 +02:00
parent bc7524c134
commit 4b86ed2dec
10 changed files with 142 additions and 37 deletions

View File

@@ -37,10 +37,19 @@ define([
window.addEventListener('message', onMsg);
}).nThen(function (/*waitFor*/) {
var getSecrets = function (Cryptpad, Utils, cb) {
var hash = window.location.hash.slice(1) || Utils.LocalStore.getUserHash() ||
Utils.LocalStore.getFSHash();
var hash = window.location.hash.slice(1);
var secret = Utils.Hash.getSecrets('drive', hash);
if (hash) {
// Add a shared folder!
// XXX password?
Cryptpad.addSharedFolder(secret, function (obj) {
window.location.hash = "";
cb(null, secret);
});
return;
}
// No password for drive
cb(null, Utils.Hash.getSecrets('drive', hash));
cb(null, secret);
};
var addRpc = function (sframeChan, Cryptpad, Utils) {
sframeChan.on('EV_BURN_ANON_DRIVE', function () {
@@ -91,6 +100,7 @@ define([
SFCommonO.start({
getSecrets: getSecrets,
noHash: true,
noRealtime: true,
driveEvents: true,
addRpc: addRpc
});