mirror of
https://github.com/futurepress/epub.js.git
synced 2025-10-02 14:49:16 +02:00
modified: package-lock.json
modified: package.json modified: src/annotations.js
This commit is contained in:
parent
73ad6da5a5
commit
7f04a1b4a1
3 changed files with 18 additions and 4 deletions
4
package-lock.json
generated
4
package-lock.json
generated
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
"name": "@victorsoares96/epubjs",
|
||||
"version": "0.3.96",
|
||||
"version": "0.3.98",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@victorsoares96/epubjs",
|
||||
"version": "0.3.96",
|
||||
"version": "0.3.98",
|
||||
"license": "BSD-2-Clause",
|
||||
"dependencies": {
|
||||
"@types/localforage": "0.0.34",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@victorsoares96/epubjs",
|
||||
"version": "0.3.97",
|
||||
"version": "0.3.98",
|
||||
"description": "Parse and Render Epubs",
|
||||
"main": "lib/index.js",
|
||||
"module": "src/index.js",
|
||||
|
|
|
@ -47,6 +47,18 @@ class Annotations {
|
|||
|
||||
this._annotations[hash] = annotation;
|
||||
|
||||
if (type === "highlight") {
|
||||
this.highlights.push(annotation);
|
||||
}
|
||||
|
||||
if (type === "underline") {
|
||||
this.underlines.push(annotation);
|
||||
}
|
||||
|
||||
if (type === "mark") {
|
||||
this.marks.push(annotation);
|
||||
}
|
||||
|
||||
if (sectionIndex in this._annotationsBySectionIndex) {
|
||||
this._annotationsBySectionIndex[sectionIndex].push(hash);
|
||||
} else {
|
||||
|
@ -146,7 +158,9 @@ class Annotations {
|
|||
* iterate over annotations in the store
|
||||
*/
|
||||
each () {
|
||||
return this._annotations.forEach.apply(this._annotations, arguments);
|
||||
const annotations = [...this.highlights, ...this.underlines, ...this.marks];
|
||||
|
||||
return annotations;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue