Skip to content

Implement web #15

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 29 commits into
base: main
Choose a base branch
from
Open

Implement web #15

wants to merge 29 commits into from

Conversation

SifAa
Copy link
Collaborator

@SifAa SifAa commented Jun 27, 2025

No description provided.

SifAa added 24 commits June 13, 2025 11:43
- Added package.json for dependency management and build scripts.
- Created pubspec.yaml to define package metadata and dependencies.
- Implemented Peripherals class for keyboard navigation.
- Developed preferences management functions for user settings.
- Built ReadiumReader class to handle publication loading and navigation.
- Added CSS styles for the web interface.
- Configured TypeScript and Webpack for module bundling.
- Created index.html as the entry point for the web application.
…ation method and managing publications in a static map
- Renamed the method `updatePreferences` to `setEPUBPreferences` to better match naming convention in FlutterReadium
- Modified the logic for handling null or undefined preferences to ensure a default empty object is used.
- Changed the default theme in preferences from 'day' to 'custom' as day has been removed.
- Cleaned up the preferences module by renaming the original `setPreferencesFromString` to `initializePreferencesFromString` and `updatePreferences` to `setPreferencesFromString` for clarity.
@SifAa SifAa requested a review from ddfreiling June 27, 2025 12:02
@@ -63,10 +63,12 @@ abstract class Locator with _$Locator {
// Only set id fragments to less confusing readium.
final selector = locations?.cssSelector ?? locations?.domRange?.start.cssSelector;
final idFragment = selector?.startsWith('#') == true ? selector!.substring(1) : null;
// Make sure href only contains path.
final locationHref = hrefPath.startsWith('/') ? hrefPath.substring(1) : hrefPath;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only contains path? This would make /some/path/to/file.json into some/path/to/file.json, but keep https://domain.dk/some/path/to/file.json as is.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if it starts with / we get issues because readium itself already has it

@@ -64,7 +73,9 @@ class BookshelfPageState extends State<BookshelfPage> {

Future<Publication?> openPublicationFromUrl(String pubUrl) async {
try {
Publication pub = await _flutterReadiumPlugin.openPublication(pubUrl);
Publication pub = kIsWeb
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we could generalize this, so all platforms use the same function here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What @ddfreiling has written for native uses openPublication, but that is not possible with ts-toolkit. We need to make another PR with implements getPublication in native and then we can generalize it. Until then this should stay

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants