Set the url if there is none

pull/1/head
Caleb James DeLisle 7 years ago
parent 33e73dd5e5
commit 4acd9957a9

@ -40,7 +40,7 @@
"less": "^2.7.2",
"bootstrap": "#v4.0.0-alpha.6",
"diff-dom": "2.1.1",
"nthen": "^0.1.5"
"nthen": "^0.1.5",
"open-sans-fontface": "^1.4.2"
}
}

@ -29,6 +29,7 @@ define([], function () {
var readOnly = conf.readOnly || false;
var network = conf.network;
var sframeChan = conf.sframeChan;
var onConnect = conf.onConnect || function () { };
conf = undefined;
var initializing = true;
@ -40,7 +41,7 @@ define([], function () {
messageFromInner(message, cb);
});
var onReady = function () {
var onReady = function (wc) {
// Trigger onReady only if not ready yet. This is important because the history keeper sends a direct
// message through "network" when it is synced, and it triggers onReady for each channel joined.
if (!initializing) { return; }
@ -131,6 +132,9 @@ define([], function () {
wcObject.wc = wc;
channel = wc.id;
onConnect(wc);
onConnect = function () { };
// Add the existing peers in the userList
sframeChan.event('EV_RT_CONNECT', { myID: wc.myID, members: wc.members, readOnly: readOnly });

@ -641,7 +641,7 @@ define([
}
}
} else {
Title.updateTitle(Cryptpad.initialName || Title.defaultTitle);
//Title.updateTitle(Cryptpad.initialName || Title.defaultTitle);
documentBody.innerHTML = Messages.initialState;
}

@ -18,6 +18,10 @@ define([
}));
Cryptpad.ready(waitFor());
}).nThen(function (waitFor) {
var secret = Cryptpad.getSecrets();
var readOnly = secret.keys && !secret.keys.editKeyStr;
if (!secret.keys) { secret.keys = secret.key; }
var parsed = Cryptpad.parsePadUrl(window.location.href);
parsed.type = parsed.type.replace('pad2', 'pad');
if (!parsed.type) { throw new Error(); }
@ -55,10 +59,6 @@ define([
}
});
var secret = Cryptpad.getSecrets();
var readOnly = secret.keys && !secret.keys.editKeyStr;
if (!secret.keys) { secret.keys = secret.key; }
CpNfOuter.start({
sframeChan: sframeChan,
channel: secret.channel,
@ -66,6 +66,10 @@ define([
validateKey: secret.keys.validateKey || undefined,
readOnly: readOnly,
crypto: Crypto.createEncryptor(secret.keys),
onConnect: function (wc) {
if (readOnly) { return; }
Cryptpad.replaceHash(Cryptpad.getEditHashFromKeys(wc.id, secret.keys));
}
});
});
});
Loading…
Cancel
Save