|
|
@ -83,12 +83,13 @@ define([
|
|
|
|
}, 450);
|
|
|
|
}, 450);
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
var rts = Realtime.start($textarea[0], // window
|
|
|
|
var config = {
|
|
|
|
Config.websocketURL, // websocketUrl
|
|
|
|
textarea: $textarea[0],
|
|
|
|
Crypto.rand64(8), // userName
|
|
|
|
websocketURL: Config.websocketURL,
|
|
|
|
key.channel, // channel
|
|
|
|
userName: Crypto.rand64(8),
|
|
|
|
key.cryptKey, // cryptkey
|
|
|
|
channel: key.channel,
|
|
|
|
{
|
|
|
|
cryptKey: key.cryptKey,
|
|
|
|
|
|
|
|
|
|
|
|
// when remote editors do things...
|
|
|
|
// when remote editors do things...
|
|
|
|
onRemote: function () {
|
|
|
|
onRemote: function () {
|
|
|
|
lazyDraw($textarea.val());
|
|
|
|
lazyDraw($textarea.val());
|
|
|
@ -99,7 +100,9 @@ define([
|
|
|
|
console.log("Realtime is ready!");
|
|
|
|
console.log("Realtime is ready!");
|
|
|
|
$textarea.trigger('keyup');
|
|
|
|
$textarea.trigger('keyup');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var rts = Realtime.start(config);
|
|
|
|
|
|
|
|
|
|
|
|
$textarea.on('change keyup keydown', function () {
|
|
|
|
$textarea.on('change keyup keydown', function () {
|
|
|
|
if (redrawTimeout) { clearTimeout(redrawTimeout); }
|
|
|
|
if (redrawTimeout) { clearTimeout(redrawTimeout); }
|
|
|
|