-
Notifications
You must be signed in to change notification settings - Fork 34
Modules
Aferdita Muriqi edited this page May 25, 2020
·
2 revisions
<script>
D2Reader.load({
url: new URL("http....."),
rights: {
enableBookmarks: true
},
api: {
addBookmark: function (bookmark) {
return new Promise(function (resolve, reject) {
bookmark.id = Math.random()
resolve(
bookmark
)
})
},
deleteBookmark: function (bookmark) {
return new Promise(function (resolve, reject) {
resolve(
bookmark
)
})
}
}
}).then(instance => {
console.log("D2Reader loaded ", instance);
}).catch(error => {
console.error("error.message ", error.message);
});
</script>
D2Reader.saveBookmark()
<button onclick="javascript:D2Reader.saveBookmark()">add bookmark</button>
D2Reader.deleteBookmark(<#json#>)
<button onclick="javascript:D2Reader.deleteBookmark({id:123})">delete bookmark</button>
<script>
D2Reader.load({
url: new URL("http....."),
rights: {
enableAnnotations: true
},
api: {
addAnnotation: function (highlight) {
return new Promise(function (resolve, reject) {
highlight.id = Math.random()
resolve(
highlight
)
})
},
deleteAnnotation: function (highlight) {
return new Promise(function (resolve, reject) {
resolve()
})
},
selectedAnnotation: function (highlight) {
return new Promise(function (resolve, reject) {
resolve()
})
}
}
}).then(instance => {
console.log("D2Reader loaded ", instance);
}).catch(error => {
console.error("error.message ", error.message);
});
</script>
D2Reader.deleteAnnotation(<#json#>)
<button onclick="javascript:D2Reader.deleteAnnotation({id:123})">delete annotation</button>
- GitHub Package
- Initialize Reader
-
Injectables
- Readium CSS
- Footnotes
- Glossary
- Fonts
- Pagebreak
- Injectable Context Menu
-
Reader API
- User Settings API
- Navigator API
- Bookmark API
- Annotation API
- TTS API
- Search API
- Callback API
-
Modules
- Bookmarks
- Annotations
- Search
- TTS