Skip to content

Commit

Permalink
OPDS: add support for OPDS 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
johnfactotum committed Dec 7, 2023
1 parent 2c011bf commit ceb153a
Show file tree
Hide file tree
Showing 3 changed files with 347 additions and 256 deletions.
8 changes: 5 additions & 3 deletions src/library.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ const uiText = {
publisher: _('Publisher'),
published: _('Published'),
language: _('Language'),
format: _('Format'),
identifier: _('Identifier'),
},
}
Expand Down Expand Up @@ -467,7 +466,8 @@ GObject.registerClass({
case WebKit.PolicyDecisionType.NAVIGATION_ACTION:
case WebKit.PolicyDecisionType.NEW_WINDOW_ACTION: {
const { uri } = decision.navigation_action.get_request()
if (!uri.startsWith('foliate-opds:') && !uri.startsWith('blob:')) {
if (!uri.startsWith('foliate-opds:') && !uri.startsWith('blob:')
&& uri !== 'about:blank') {
decision.ignore()
Gtk.show_uri(null, uri, Gdk.CURRENT_TIME)
return true
Expand Down Expand Up @@ -597,7 +597,9 @@ const addCatalogItem = (label, value) => {
label, value,
}))
}
addCatalogItem('Feedbooks', 'https://catalog.feedbooks.com/publicdomain/browse/top.atom?lang=en')
addCatalogItem('Standard Ebooks', 'https://standardebooks.org/feeds/opds/new-releases')
addCatalogItem('Feedbooks', 'https://catalog.feedbooks.com/catalog/index.json')
addCatalogItem('Feedbooks (OPDS 1)', 'https://catalog.feedbooks.com/publicdomain/browse/top.atom?lang=en')
addCatalogItem('Project Gutenberg', 'https://m.gutenberg.org/ebooks.opds/')
addCatalogItem('Manybooks', 'http://manybooks.net/opds/')
addCatalogItem('unglue.it', 'https://unglue.it/api/opds/')
Expand Down
15 changes: 8 additions & 7 deletions src/opds/opds.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,15 @@
}
.container {
display: grid;
gap: 24px;
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr))
gap: 18px;
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
margin-bottom: 24px;
}
.container:has(opds-pub) {
gap: 24px;
row-gap: 0;
grid-template-columns: repeat(auto-fill, minmax(120px, 1fr))
grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
margin-bottom: 0;
}
.carousel:has(opds-pub) {
gap: 18px;
Expand Down Expand Up @@ -240,10 +242,6 @@
margin-inline-end: 2em;
font-size: smaller;
}
opds-pub-full > [slot="details"] footer {
font-size: smaller;
color: graytext;
}
button, foliate-menubutton::part(button) {
display: inline-flex;
justify-content: center;
Expand Down Expand Up @@ -427,6 +425,9 @@ <h1><a></a></h1>
width: 100%;
margin-top: 24px;
}
:host(:not([description])) iframe {
display: none;
}
#actions, #actions > * {
display: flex;
align-items: end;
Expand Down
Loading

0 comments on commit ceb153a

Please sign in to comment.