|
|
@ -22,6 +22,7 @@ define([
|
|
|
|
console.log('xxx');
|
|
|
|
console.log('xxx');
|
|
|
|
var sframeChan;
|
|
|
|
var sframeChan;
|
|
|
|
var hashes;
|
|
|
|
var hashes;
|
|
|
|
|
|
|
|
var secret;
|
|
|
|
nThen(function (waitFor) {
|
|
|
|
nThen(function (waitFor) {
|
|
|
|
$(waitFor());
|
|
|
|
$(waitFor());
|
|
|
|
}).nThen(function (waitFor) {
|
|
|
|
}).nThen(function (waitFor) {
|
|
|
@ -31,12 +32,15 @@ define([
|
|
|
|
}));
|
|
|
|
}));
|
|
|
|
Cryptpad.ready(waitFor());
|
|
|
|
Cryptpad.ready(waitFor());
|
|
|
|
}).nThen(function (waitFor) {
|
|
|
|
}).nThen(function (waitFor) {
|
|
|
|
Cryptpad.getShareHashes(waitFor(function (err, h) { hashes = h; }));
|
|
|
|
secret = Cryptpad.getSecrets();
|
|
|
|
|
|
|
|
if (!secret.channel) {
|
|
|
|
|
|
|
|
// New pad: create a new random channel id
|
|
|
|
|
|
|
|
secret.channel = Cryptpad.createChannelId();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
Cryptpad.getShareHashes(secret, waitFor(function (err, h) { hashes = h; }));
|
|
|
|
}).nThen(function (waitFor) {
|
|
|
|
}).nThen(function (waitFor) {
|
|
|
|
var secret = Cryptpad.getSecrets();
|
|
|
|
|
|
|
|
var readOnly = secret.keys && !secret.keys.editKeyStr;
|
|
|
|
var readOnly = secret.keys && !secret.keys.editKeyStr;
|
|
|
|
if (!secret.keys) { secret.keys = secret.key; }
|
|
|
|
if (!secret.keys) { secret.keys = secret.key; }
|
|
|
|
|
|
|
|
|
|
|
|
var parsed = Cryptpad.parsePadUrl(window.location.href);
|
|
|
|
var parsed = Cryptpad.parsePadUrl(window.location.href);
|
|
|
|
parsed.type = parsed.type.replace('pad2', 'pad');
|
|
|
|
parsed.type = parsed.type.replace('pad2', 'pad');
|
|
|
|
if (!parsed.type) { throw new Error(); }
|
|
|
|
if (!parsed.type) { throw new Error(); }
|
|
|
|