Skip to content

Commit

Permalink
fixes sample reader toc for inactive elements
Browse files Browse the repository at this point in the history
  • Loading branch information
aferditamuriqi committed Sep 22, 2023
1 parent 9a220c8 commit 6f1aa08
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 6 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@d-i-t-a/reader",
"version": "2.3.13",
"version": "2.3.14",
"description": "A viewer application for EPUB files.",
"repository": "https://github.com/d-i-t-a/R2D2BC",
"license": "Apache-2.0",
Expand Down
4 changes: 3 additions & 1 deletion src/model/Link.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ export function convertAndCamel(o) {
value = o[origKey];
if (
value instanceof Array ||
(value !== null && value.constructor === Object)
(value !== null &&
value !== undefined &&
value.constructor === Object)
) {
value = convertAndCamel(value);
}
Expand Down
4 changes: 2 additions & 2 deletions src/model/Publication.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ export class Publication extends R2Publication {
if (positions?.length > 0) {
const locator = positions[0];
let progress = Math.round(
locator.locations.totalProgression
(locator.locations.totalProgression
? locator.locations.totalProgression
: 0 * 100
: 0) * 100
);
if (this.sample?.limit) {
let valid = progress <= this.sample?.limit;
Expand Down
6 changes: 6 additions & 0 deletions viewer/index_api.html
Original file line number Diff line number Diff line change
Expand Up @@ -563,6 +563,12 @@
annotations: {
initialAnnotationColor: "var(--RS__highlightColor)",
},
// sample: {
// isSampleRead: true,
// limit: 10, // in percent e.g. 5%
// minimum: 5, // in pages
// popup: "You can borrow the book to continue reading."
// },
protection: {
enforceSupportedBrowsers: true,
enableEncryption: true, // does nothing right now
Expand Down
8 changes: 8 additions & 0 deletions viewer/index_dita.html
Original file line number Diff line number Diff line change
Expand Up @@ -755,6 +755,14 @@
{ type: 'style', url: '/viewer/injectables/style/popup.css' },
{ type: 'style', url: '/viewer/injectables/style/popover.css' },
{ type: 'style', url: '/viewer/injectables/style/style.css' },
{
type: 'script',
url: 'https://polyfill.io/v3/polyfill.min.js?features=es6',
}, {
async: true,
type: 'script',
url: 'https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js',
},
]
let userSettings = {
// appearance: "readium-sepia-on", //readium-default-on, readium-night-on, readium-sepia-on
Expand Down

0 comments on commit 6f1aa08

Please sign in to comment.