Commit Graph
46 Commits
Author SHA1 Message Date
john-okeefe 6b39eb3e27 style: reformat epub.js with consistent 2-space indentation, semicolons, and double quotes
No functional changes. Normalizes epub.js to match the formatting style
used throughout the rest of the codebase (2-space indentation, ASI
semicolons, double-quoted strings, trailing commas in multiline).
2026-04-18 23:04:35 -04:00
Francesco Martini ab5abb9dd4 EPUB: Add pageBreakSource metadata property (#109) 2026-03-05 06:05:25 +00:00
John Factotum a70ad3a10f EPUB: support multiple publishers
This also fixes https://github.com/johnfactotum/foliate/issues/1633
2026-03-05 05:52:35 +08:00
John Factotum c49ded0cc4 Fix indentation 2025-09-24 14:05:30 +08:00
John Factotum 26788cdae9 EPUB: support srcset
Closes #98
2025-09-24 14:01:27 +08:00
Huang Xin bdae473012 Add custom event for loading manifest item (#76) 2025-08-01 23:44:52 +00:00
Huang Xin d7affcf969 Create ID lookup cache for manifest (#75) 2025-06-10 12:09:54 +00:00
John Factotum 052123beaf Add an EventTarget for transforming the book
And use it to do paginator-specific CSS replacements.

And use it to catch loading errors in reader.js.

Fixes #14
Closes #18
2025-03-29 15:09:23 +08:00
John Factotum 24187b79f9 EPUB: fix opf:file-as
Fixes #39
2024-11-03 11:19:14 +08:00
John Factotum 7cbc36b489 Media Overlay: fix skipping
- Fix not seeking when skipping to another section when paused
- Fix not playing when skipping when not paused in WebKit
2024-10-07 11:00:57 +08:00
John Factotum fa85f135df EPUB: fix metadata 2024-10-06 11:29:32 +08:00
John Factotum e384aaf6dd Media Overlay: add stop() method
And don't remove highlight when pausing
2024-09-30 19:31:14 +08:00
John Factotum 357c129b5d Media Overlay: don't seek in canplaythrough
So this is what was causing the `canplaythrough` loop in Chromium and
Firefox.
2024-09-26 12:56:09 +08:00
John Factotum 22189f184e EPUB: fix media overlay playback
For some reason `canplaythrough` is firing more than once
2024-09-26 12:37:06 +08:00
Kian-Meng Ang 42ebb0aec4 Fix typos (#34)
Found via `typos --hidden --format brief`
2024-09-23 08:29:28 +00:00
John Factotum 541bc07b6f EPUB: redo metadata parsing
- Support the `prefix` attribute (for the `property` attr on `<meta>`)
- Localized titles, names (including `sortAs`)
- `belongsTo`, including `calibre:series`
- `altIdentifier`, converted to URN where possible
- Remove `producer`. It's now `contributor` with `role: 'bkp'`.

NOTE: this is a breaking change if you assumed that `title` will always
be a string, `author` will always be an array, etc.
2024-09-18 11:28:08 +08:00
John Factotum 9ff893f3e7 Treat XHTML without xmlns as HTML
The XHTML 1.1 spec says

    The start tag of the root element of the document MUST explicitly
    contain an xmlns declaration for the XHTML namespace

There doesn't seem to be such a requirement in the WHATWG spec. But at
any rate browsers won't render it properly without the XHTML namespace.
2024-07-27 09:46:04 +08:00
John Factotum 51c02bf594 EPUB: support display-options.xml 2024-06-22 01:42:47 +08:00
Pablo C. Vergara Castroandpvergara 239af2437a Close the "not" function (#25)
Co-authored-by: pvergara <ecos.logic.org@gmail.com>
2024-06-03 05:54:44 +00:00
John Factotum 449842fd0a Fix argument 2023-12-04 03:48:41 +08:00
John Factotum 0d09ca12a2 EPUB: fix subjects
Also update README
2023-10-24 17:25:46 +08:00
John Factotum 7c3b7447f6 EPUB: add narrator 2023-10-24 16:38:31 +08:00
John Factotum 6d55d3e6b1 Convert break-*: page to break-*: column
`break-*` is the newer standard that replaced the legacy `page-break-*`
properties.

Note that setting it to `always` or `all` does not work. There seems to
be no way of telling browsers to break in both paged media and multicol.
2023-10-24 13:29:36 +08:00
John Factotum 969f4c1850 EPUB: improve metadata 2023-10-24 13:14:40 +08:00
John Factotum d44e8d6d64 EPUB: ignore query strings when resolving URLs 2023-10-11 01:49:20 +08:00
John Factotum 7a31359cd4 Media Overlay: add volume setting 2023-10-08 10:16:33 +08:00
John Factotum f0aa16113f EPUB: fix media: properties 2023-10-08 05:33:56 +08:00
John Factotum 08c2ba0b24 EPUB: add prev/next for media overlay playback 2023-10-07 01:37:30 +08:00
John Factotum 1ff15bdc26 EPUB: add support for media overlay playback 2023-10-06 01:23:44 +08:00
John Factotum 9b366ad1c4 EPUB: throw on XML errors 2023-08-03 18:38:11 +08:00
John Factotum 5da3be5200 Add destroy method
Which revokes all blob URLs and removes the element from document.
2023-05-09 14:02:07 +08:00
John Factotum 649ffa93b8 EPUB: add support for subtitle 2023-04-26 17:31:59 +08:00
John Factotum 45bfe6ee71 Fix whitespace normalization
- Normalize ASCII whitespace only
- Collapse sequence of *one* or more consecutive whitespace characters
2023-03-21 12:03:39 +08:00
John Factotum c510d83ea2 Use special scheme https when resolving URLs
Fixes #8
2023-03-19 04:29:37 +00:00
John Factotum 15aa43bd42 Warn about parsing error
Falling back to HTML is good, but probably don't do it silently.
2023-03-05 11:39:47 +00:00
John Factotum b8049952bf Fix page breaks
Replace `page-break-*` with `-webkit-column-break-*`.

See https://github.com/johnfactotum/foliate/issues/962#issuecomment-1437982082
2023-02-21 07:51:34 +00:00
John Factotum a9805d3e63 EPUB: preliminary work on Media Overlays 2022-11-04 11:47:27 +00:00
John Factotum 6b553eb89c Fix method definition 2022-11-04 10:49:22 +00:00
John Factotum bc22699bab EPUB: add a method for getting Calibre bookmarks
See https://github.com/johnfactotum/foliate/issues/849
2022-11-04 10:43:30 +00:00
John Factotum 3aad499696 FXL: page-spread-center and spread none 2022-10-29 16:10:56 +00:00
John Factotum 602c8381c2 Add support for <object>
It's sometimes used for SVGs
2022-10-27 18:11:21 +00:00
John Factotum 2a5ccb93d9 Reader: allow opening unzipped EPUBs 2022-10-27 17:41:26 +00:00
John Factotum 37ccb74238 Replace viewport units in CSS
In theory it could do something much more complicated. But it seems
better to just say "vh and vw are not supported", and this would just
be failing more gracefully.

I mean, the spec itself says,

> Keep in mind that some Reading Systems will not support all desired
> features of CSS. In particular, the following are known to be
> problematic [...] Pagination is sometimes done using columns, which
> can result in incorrect values for viewport sizes.

Fixes #1
2022-10-22 21:50:47 +00:00
John Factotum 9250f47058 EPUB: set content type for cover blob
Although the type can often be auto-detected, it's better to set it
explicitly, especially for SVGs.
2022-10-21 10:20:23 +00:00
John Factotum 6348ca4a9d EPUB: fixed unload func not added to section
Missed it for some reason
2022-10-20 17:00:00 +00:00
John Factotum 5fc72d121c Add files via upload 2022-10-18 18:55:54 +00:00