Remove Crypto from the modules loaded with RequireJS in realtime-input
It now has to be passed in the config in the main JS file
This commit is contained in:
@@ -87,7 +87,6 @@ define([
|
||||
}
|
||||
|
||||
var fixThings = false;
|
||||
// var key = Crypto.parseKey(window.location.hash.substring(1));
|
||||
var editor = window.editor = Ckeditor.replace('editor1', {
|
||||
// https://dev.ckeditor.com/ticket/10907
|
||||
needsBrFiller: fixThings,
|
||||
@@ -184,7 +183,6 @@ define([
|
||||
}
|
||||
};
|
||||
|
||||
var now = function () { return new Date().getTime(); };
|
||||
|
||||
var initializing = true;
|
||||
var userList = {}; // List of pretty name of all users (mapped with their server ID)
|
||||
@@ -250,12 +248,29 @@ define([
|
||||
// our encryption key
|
||||
cryptKey: key,
|
||||
|
||||
// method which allows us to get the id of the user
|
||||
setMyID: setMyID,
|
||||
|
||||
// Crypto object to avoid loading it twice in Cryptpad
|
||||
crypto: Crypto,
|
||||
|
||||
// really basic operational transform
|
||||
transformFunction : JsonOT.validate
|
||||
};
|
||||
|
||||
var updateUserList = function(shjson) {
|
||||
// Extract the user list (metadata) from the hyperjson
|
||||
var hjson = JSON.parse(shjson);
|
||||
var peerUserList = hjson[hjson.length-1];
|
||||
if(peerUserList.metadata) {
|
||||
var userData = peerUserList.metadata;
|
||||
// Update the local user data
|
||||
addToUserList(userData);
|
||||
hjson.pop();
|
||||
}
|
||||
return hjson;
|
||||
}
|
||||
|
||||
var onRemote = realtimeOptions.onRemote = function (info) {
|
||||
if (initializing) { return; }
|
||||
|
||||
@@ -265,18 +280,7 @@ define([
|
||||
cursor.update();
|
||||
|
||||
// Extract the user list (metadata) from the hyperjson
|
||||
var hjson = JSON.parse(shjson);
|
||||
var peerUserList = hjson[hjson.length-1];
|
||||
if(peerUserList.metadata) {
|
||||
var userData = peerUserList.metadata;
|
||||
// Update the local user data
|
||||
userList = userData;
|
||||
// Send the new data to the toolbar
|
||||
if(toolbarList && typeof toolbarList.onChange === "function") {
|
||||
toolbarList.onChange(userList);
|
||||
}
|
||||
hjson.pop();
|
||||
}
|
||||
var hjson = updateUserList(shjson);
|
||||
|
||||
// build a dom from HJSON, diff, and patch the editor
|
||||
applyHjson(shjson);
|
||||
|
||||
Reference in New Issue
Block a user