Refactored out TextPatcher and JsonOT and replaced with new ChainPad

This commit is contained in:
Caleb James DeLisle
2017-11-09 15:36:49 +01:00
parent 7f8147b18b
commit 75130150d5
31 changed files with 82 additions and 1447 deletions

View File

@@ -2,10 +2,13 @@ define([
//'/common/cryptpad-common.js',
'jquery',
'/bower_components/hyperjson/hyperjson.js',
'/bower_components/textpatcher/TextPatcher.js',
'/common/text-cursor.js',
'/bower_components/diff-dom/diffDOM.js',
], function ($, Hyperjson, TextPatcher) {
'/bower_components/chainpad/chainpad.dist.js'
], function ($, Hyperjson, TextCursor) {
var DiffDOM = window.diffDOM;
var ChainPad = window.ChainPad;
var Example = {
metadata: {
@@ -400,10 +403,10 @@ var Renderer = function (Cryptpad, APP) {
var o = info.oldValue || '';
var n = info.newValue || '';
var op = TextPatcher.diff(o, n);
var ops = ChainPad.Diff.diff(o, n);
info.selection = ['selectionStart', 'selectionEnd'].map(function (attr) {
return TextPatcher.transformCursor(element[attr], op);
return TextCursor.transformCursor(element[attr], ops);
});
}
};