|
|
@ -29,6 +29,7 @@ define([], function () {
|
|
|
|
var readOnly = conf.readOnly || false;
|
|
|
|
var readOnly = conf.readOnly || false;
|
|
|
|
var network = conf.network;
|
|
|
|
var network = conf.network;
|
|
|
|
var sframeChan = conf.sframeChan;
|
|
|
|
var sframeChan = conf.sframeChan;
|
|
|
|
|
|
|
|
var onConnect = conf.onConnect || function () { };
|
|
|
|
conf = undefined;
|
|
|
|
conf = undefined;
|
|
|
|
|
|
|
|
|
|
|
|
var initializing = true;
|
|
|
|
var initializing = true;
|
|
|
@ -40,7 +41,7 @@ define([], function () {
|
|
|
|
messageFromInner(message, cb);
|
|
|
|
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
|
|
|
|
// 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.
|
|
|
|
// message through "network" when it is synced, and it triggers onReady for each channel joined.
|
|
|
|
if (!initializing) { return; }
|
|
|
|
if (!initializing) { return; }
|
|
|
@ -131,6 +132,9 @@ define([], function () {
|
|
|
|
wcObject.wc = wc;
|
|
|
|
wcObject.wc = wc;
|
|
|
|
channel = wc.id;
|
|
|
|
channel = wc.id;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
onConnect(wc);
|
|
|
|
|
|
|
|
onConnect = function () { };
|
|
|
|
|
|
|
|
|
|
|
|
// Add the existing peers in the userList
|
|
|
|
// Add the existing peers in the userList
|
|
|
|
sframeChan.event('EV_RT_CONNECT', { myID: wc.myID, members: wc.members, readOnly: readOnly });
|
|
|
|
sframeChan.event('EV_RT_CONNECT', { myID: wc.myID, members: wc.members, readOnly: readOnly });
|
|
|
|
|
|
|
|
|
|
|
|