|
|
@ -477,6 +477,8 @@ define([
|
|
|
|
var onRemote = realtimeOptions.onRemote = function (info) {
|
|
|
|
var onRemote = realtimeOptions.onRemote = function (info) {
|
|
|
|
if (initializing) { return; }
|
|
|
|
if (initializing) { return; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var oldShjson = stringifyDOM(inner);
|
|
|
|
|
|
|
|
|
|
|
|
var shjson = info.realtime.getUserDoc();
|
|
|
|
var shjson = info.realtime.getUserDoc();
|
|
|
|
|
|
|
|
|
|
|
|
// remember where the cursor is
|
|
|
|
// remember where the cursor is
|
|
|
@ -485,6 +487,11 @@ define([
|
|
|
|
// Update the user list (metadata) from the hyperjson
|
|
|
|
// Update the user list (metadata) from the hyperjson
|
|
|
|
updateMetadata(shjson);
|
|
|
|
updateMetadata(shjson);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var newInner = JSON.parse(shjson);
|
|
|
|
|
|
|
|
if (newInner.length > 2) {
|
|
|
|
|
|
|
|
var newSInner = stringify(newInner[2]);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// build a dom from HJSON, diff, and patch the editor
|
|
|
|
// build a dom from HJSON, diff, and patch the editor
|
|
|
|
applyHjson(shjson);
|
|
|
|
applyHjson(shjson);
|
|
|
|
|
|
|
|
|
|
|
@ -518,7 +525,12 @@ define([
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
notify();
|
|
|
|
|
|
|
|
|
|
|
|
// Notify only when the content has changed, not when someone has joined/left
|
|
|
|
|
|
|
|
var oldSInner = stringify(JSON.parse(oldShjson)[2]);
|
|
|
|
|
|
|
|
if (newSInner !== oldSInner) {
|
|
|
|
|
|
|
|
notify();
|
|
|
|
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
var getHTML = function (Dom) {
|
|
|
|
var getHTML = function (Dom) {
|
|
|
|