This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
it.only('can remove element by ID in array', function() { | |
const doc = Document.create('test-col', 'test-doc'); | |
assert.equal('{}', doc.toSortedJSON()); | |
let toDelete; | |
doc.update((root) => { | |
root['list'] = []; | |
root['list'].push(1); | |
root['list'].push(2); | |
toDelete = root['list'].push(3); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* SplayTree is weighted binary search tree which is based on SplayTree. | |
* - https://en.wikipedia.org/wiki/Splay_tree | |
* | |
* Original paper on SplayTree: | |
* - https://www.cs.cmu.edu/~sleator/papers/self-adjusting.pdf | |
*/ | |
export abstract class SplayNode<V> { | |
protected value: V; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Implementation of an SortedMap using Left-leaning Red-Black Tree | |
* | |
* Original paper on Left-leaning Red-Black Trees: | |
* - http://www.cs.princeton.edu/~rs/talks/LLRB/LLRB.pdf | |
* | |
* Invariant 1: No red node has a red child | |
* Invariant 2: Every leaf path has the same number of black nodes | |
* Invariant 3: Only the left child can be red (left leaning) | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('.summernote').summernote({ | |
/** | |
* manipulate link address when user create link | |
* @param {String} url | |
* @return {String} | |
*/ | |
onCreateLink: function (url) { | |
if (url.indexOf('http://') !== 0) { | |
url = 'http://' + url; | |
} |