diff --git a/package.json b/package.json index c664f98c..f0742971 100644 --- a/package.json +++ b/package.json @@ -63,7 +63,6 @@ "dependencies": { "classnames": "2.2.5", "clipper-lib": "6.2.1", - "diff-match-patch": "1.0.0", "earcut": "2.1.1", "less": "^3.11.1", "libtess": "1.2.2", diff --git a/web/app/sketcher/history.js b/web/app/sketcher/history.js index 3dcebaa4..9d5b878f 100644 --- a/web/app/sketcher/history.js +++ b/web/app/sketcher/history.js @@ -1,9 +1,8 @@ -import diff_match_patch from 'diff-match-patch'; /** @constructor */ function HistoryManager(viewer) { this.viewer = viewer; - this.dmp = new diff_match_patch(); + // this.dmp = new diff_match_patch(); this.init({}); // this.init(this.viewer.io.serializeSketch()); } @@ -80,9 +79,9 @@ HistoryManager.prototype.redo = function () { }; HistoryManager.prototype.applyDiff = function (text1, diff) { - var dmp = this.dmp; - var results = dmp.patch_apply(diff, text1); - return results[0]; + // var dmp = this.dmp; + // var results = dmp.patch_apply(diff, text1); + // return results[0]; }; HistoryManager.prototype.applyDiffInv = function (text1, diff) { @@ -103,17 +102,17 @@ HistoryManager.prototype.reversePatch = function (plist) { }; HistoryManager.prototype.getDiff = function (text1, text2) { - var dmp = this.dmp; - var diff = dmp.diff_main(text1, text2, true); - - if (diff.length > 2) { - dmp.diff_cleanupSemantic(diff); - } - - var patch_list = dmp.patch_make(text1, text2, diff); - //var patch_text = dmp.patch_toText(patch_list); - //console.log(patch_list); - return patch_list; + // var dmp = this.dmp; + // var diff = dmp.diff_main(text1, text2, true); + // + // if (diff.length > 2) { + // dmp.diff_cleanupSemantic(diff); + // } + // + // var patch_list = dmp.patch_make(text1, text2, diff); + // //var patch_text = dmp.patch_toText(patch_list); + // //console.log(patch_list); + // return patch_list; }; export {HistoryManager} \ No newline at end of file