Show users editing and lag, properly send message to indicate that all users have left channel and show basic error box if disconnected.
This commit is contained in:
21
www/main.js
21
www/main.js
@@ -1,29 +1,15 @@
|
||||
define([
|
||||
'api/config?cb=' + Math.random().toString(16).substring(2),
|
||||
'realtime-wysiwyg',
|
||||
'messages',
|
||||
'bower/jquery/dist/jquery.min',
|
||||
'bower/ckeditor/ckeditor',
|
||||
'bower/tweetnacl/nacl-fast.min',
|
||||
], function (Config, RTWysiwyg) {
|
||||
], function (Config, RTWysiwyg, Messages) {
|
||||
var Ckeditor = window.CKEDITOR;
|
||||
var Nacl = window.nacl;
|
||||
var $ = jQuery;
|
||||
|
||||
var INITIAL_STATE = [
|
||||
'<p>',
|
||||
'This is <strong>CryptPad</strong>, the zero knowledge realtime collaborative editor.',
|
||||
'<br>',
|
||||
'What you type here is encrypted so only people who have the link can access it.',
|
||||
'<br>',
|
||||
'Even the server cannot see what you type.',
|
||||
'</p>',
|
||||
'<p>',
|
||||
'<small>',
|
||||
'<i>What you see here, what you hear here, when you leave here, let it stay here</i>',
|
||||
'</small>',
|
||||
'</p>',
|
||||
].join('');
|
||||
|
||||
var module = { exports: {} };
|
||||
|
||||
var parseKey = function (str) {
|
||||
@@ -54,12 +40,11 @@ define([
|
||||
editor.on('instanceReady', function () {
|
||||
editor.execCommand('maximize');
|
||||
var ifr = window.ifr = $('iframe')[0];
|
||||
ifr.contentDocument.body.innerHTML = INITIAL_STATE;
|
||||
ifr.contentDocument.body.innerHTML = Messages.initialState;
|
||||
|
||||
var rtw =
|
||||
RTWysiwyg.start(Config.websocketURL,
|
||||
userName(),
|
||||
{},
|
||||
Nacl.util.encodeBase64(key.lookupKey).substring(0,10),
|
||||
key.cryptKey);
|
||||
editor.on('change', function () { rtw.onEvent(); });
|
||||
|
||||
Reference in New Issue
Block a user