diff options
| author | Gubolin <gubolin@fantasymail.de> | 2014-09-14 11:05:57 +0200 |
|---|---|---|
| committer | Gubolin <gubolin@fantasymail.de> | 2014-09-14 11:05:57 +0200 |
| commit | 8e20460fed4f35b624b53f4a1ccb3dd48727d544 (patch) | |
| tree | 421ec17a5845b9a0ac352775cfa1de7531fee3d2 | |
| parent | 0e68efc8026aab552a6e5d36d8d8f49ad5b47e88 (diff) | |
| download | snap-8e20460fed4f35b624b53f4a1ccb3dd48727d544.tar.gz snap-8e20460fed4f35b624b53f4a1ccb3dd48727d544.zip | |
WIP
| -rw-r--r-- | .gitmodules | 3 | ||||
| -rw-r--r-- | github.js | 10 | ||||
| -rwxr-xr-x | snap.html | 1 | ||||
| -rw-r--r-- | store.js | 2 |
4 files changed, 12 insertions, 4 deletions
diff --git a/.gitmodules b/.gitmodules index b3a70fb..a8706a9 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,6 @@ +[submodule "vkBeautify"] + path = vkBeautify + url = https://github.com/vkiryukhin/vkBeautify [submodule "octokat.js"] path = octokat.js url = https://github.com/philschatz/octokat.js @@ -179,10 +179,14 @@ GitHubBackend.prototype.saveProject = function (commitMessage, parentCommitSha, // diff parent <-> local codePatch = dmp.patch_make(parentCode, localCode); notePatch = dmp.patch_make(parentNotes, localNotes); - console.log(dmp.patch_toText(codePatch));//DEBUG + console.log(JSON.stringify(codePatch));//DEBUG // patch (parent<->local) => head - localCode = dmp.patch_apply(codePatch, headCode)[0]; - localNotes = dmp.patch_apply(notePatch, headNotes)[0]; + localCode = dmp.patch_apply(codePatch, headCode); + localNotes = dmp.patch_apply(notePatch, headNotes); + console.log('Code patched successfully? ' + localCode[1]); + console.log('Notes patched successfully? ' + localNotes[1]); + localCode = localCode[0]; + localNotes = localNotes[0]; // perform a `git merge` // TODO TODO TODO 422 Not a fast-forward @@ -21,6 +21,7 @@ <script type="text/javascript" src="octokat.js/dist/octokat.js"></script> <script type="text/javascript" src="github.js"></script> <script type="text/javascript" src="sha512.js"></script> + <script type="text/javascript" src="vkBeautify/vkbeautify.js"></script> <script type="text/javascript" src="google-diff-match-patch-js/diff_match_patch_uncompressed.js"></script> <script type="text/javascript"> var world; @@ -97,7 +97,7 @@ XML_Serializer.prototype.serialize = function (object) { this.flushMedia(); xml = this.store(object); this.flush(); - return xml; + return vkbeautify.xml(xml); }; XML_Serializer.prototype.store = function (object, mediaID) { |
