store annotations in db and sync with peers

This commit is contained in:
j 2019-02-10 17:46:35 +05:30
commit e0cba14d6a
21 changed files with 385 additions and 63 deletions

View file

@ -22,6 +22,12 @@ Ox.load({
} else if (event == 'addAnnotation') {
createAnnotation()
} else if (event == 'addAnnotations') {
if (data.replace) {
annotations.forEach(function(a) {
reader.rendition.annotations.remove(a.cfiRange)
})
annotations = []
}
data.annotations.forEach(function(annotation) {
annotations.push(annotation)
renderAnnotation(annotation)