Commit Graph

41135 Commits

Author SHA1 Message Date
Kovid Goyal 607fc44919 Bump versions of openssl and glib 2020-08-22 18:48:36 +05:30
Kovid Goyal 9e91907268 Start work on highlights panel for browser viewer 2020-08-22 18:48:36 +05:30
Kovid Goyal 8343e8165a Selection bar: Allow customizing to add quick highlight buttons with specific styles 2020-08-22 18:48:36 +05:30
Kovid Goyal 1ef9d7b7da Give custom highlight styles a name 2020-08-22 18:48:36 +05:30
Kovid Goyal c290f4e1cb Sync annots from browser to server when using the sync button 2020-08-22 18:48:36 +05:30
Kovid Goyal f2e7f3e924 UI to remove bookmarks 2020-08-22 18:48:36 +05:30
Kovid Goyal 3f30103802 Content server viewer: Add user interface for bookmarking 2020-08-22 18:48:36 +05:30
Kovid Goyal 7edad3048e When focusing iframe if the selection bar is visible focus that instead 2020-08-22 18:48:36 +05:30
Kovid Goyal 9eea78f092 Allow adding a create bookmark button to the selection bar 2020-08-22 18:48:35 +05:30
Kovid Goyal f228431fb9 Minor fixes from merge to viewport
Also remove an unused function
2020-08-22 18:48:35 +05:30
Kovid Goyal 5da5d527c4 brackets for clarity 2020-08-22 18:48:35 +05:30
Kovid Goyal 7359b314b3 Fix incorrect single screen detection
This detection runs on first layout, before columns are created,
therefore, the block direction is the appropriate thing to check
2020-08-22 18:48:35 +05:30
Kovid Goyal 448651d2fc Fix next_screen_location()
The change to column_at() to consider points on the boundary as
belonging to the left column broke next_screen_location()
2020-08-22 18:48:35 +05:30
Kovid Goyal 3818b5e1c4 Use block and inline rather than X and Y for anchor_funcs in flow mode 2020-08-22 18:48:35 +05:30
Kovid Goyal 9a9f35ae43 Fix visibility() which was broken similar to pos_for_elem() 2020-08-22 18:48:35 +05:30
Kovid Goyal d7259dd2e2 Fix pos_for_elem() in flow mode changed to return only one co-ordinate 2020-08-22 18:48:35 +05:30
Kovid Goyal 2076c92ab5 misc cleanups, mostly whitespace 2020-08-22 18:48:35 +05:30
Kovid Goyal 6141113d5b Fix points at the right edge of the column being identified as belonging to the next column in paged mode 2020-08-22 18:48:34 +05:30
Kovid Goyal 603b9b70ff Adjust limits used for at_current() loop 2020-08-22 18:48:34 +05:30
Kovid Goyal bca1ef5767 Hoist variable definition outside loop since it is used outside loop 2020-08-22 18:48:34 +05:30
Kovid Goyal ed21a72eae Ensure at_point() does not raise exceptions 2020-08-22 18:48:34 +05:30
Kovid Goyal 3a05d2b2ad Micro-optimizations 2020-08-22 18:48:34 +05:30
Kovid Goyal 53c0c3fb68 Allow for offsets larger than text length in decode_with_range()
This can happen if the book is edited, for example. And rather than fail
in such cases, better to use a close but not perfect match.
2020-08-22 18:48:34 +05:30
Kovid Goyal 120107e9d2 spacial -> spatial 2020-08-22 18:48:34 +05:30
Kovid Goyal 200a3cba71 fixes from static checking 2020-08-22 18:48:34 +05:30
Mark W. Gabby-Li 8b39fea8f8 Vertical RTL Book Reading Support
Added a variety of functions to viewport to allow working based on block and inline direction rather than X and Y.

Changed paged mode and flow mode to be based on block and inline directions, making them agnostic to writing direction.

Added jump_to_cfi function to flow mode code, and use this in iframe. This fixes some issues with CFI jumping in flow mode.

Use self.jump_to_cfi in iframe so that it is based on the current mode.

Removed a redundant self.onscroll call that was causing CFIs to be queried twice on load, doubling the time they took.

Fixed some bugs related to scrolling in flow mode related to a decorator not working with keyword arguments, by removing the keyword arguments.

Fixed some bugs with flow mode visibility anchor function.

CFI changes:
 Renamed some functions and variables to clarify meaning.

 Remove use of exceptions, since they were causing CFI calculation to run about six times more slowly in benchmarks. (Worst-case went from ~6 to ~1 second.)

 Remove forward flag and allow text offset to be equal to node length, and correct for this by adding a flag to the decoded CFI to indicate this.

 Added comments clarifying the results of decoding a CFI.

 Fix bugs in the point (now decode_with_range) function and simplified it.

 Added new functions that get CFI position from decoded CFIs, to replace places where this was being done in slightly different ways.

 Fixed some issues with cfi.pyj's scroll_to that were exposed by vertical writing support, mainly caching and using span's parent to create the start and end ranges, which causes re-creating the range to succeed. Also, don't store the span's bounding rect, since it's not needed anymore.

 Rewrote at_current to do a simplified scan of the viewport in the inline and then block direction.
2020-08-22 18:48:34 +05:30
Kovid Goyal c5b9677809 Select highlight in panel when it is selected in text 2020-08-22 18:48:34 +05:30
Kovid Goyal 74644b31ae Use an <iframe> rather than a new window for editing metadata from the viewer 2020-08-22 18:48:33 +05:30
Kovid Goyal 4154c3be14 Fix multiple dots for highlights with notes that have multiple internal ranges 2020-08-22 18:48:33 +05:30
Kovid Goyal 10f3414426 ... 2020-08-22 18:48:33 +05:30
Kovid Goyal 140ef318ce Fix accidental re-execing for calibre_parallel as well on macOS 2020-08-22 18:48:33 +05:30
Kovid Goyal 4b0622e6d9 Bump beta version 2020-08-22 18:48:33 +05:30
Kovid Goyal e79a765ac6 Content server viewer: Allow easily jumping back to either the book details page or the book list page for the current book. Fixes #1890483 2020-08-22 18:48:33 +05:30
Kovid Goyal 1867cadd5c Content server viewer: Allow editing metadata from the view metadata panel
Fixes #1890755
2020-08-22 18:48:33 +05:30
Kovid Goyal e304300fc6 Increase the threshold for swipe detection to 64px 2020-08-22 18:48:33 +05:30
Kovid Goyal 054a7e374f Micro-optimization 2020-08-22 18:48:33 +05:30
Kovid Goyal 41717d5eca Use caret position from point rahter than range from point as the former is standards compliant 2020-08-22 18:48:32 +05:30
Kovid Goyal 6d0cc73d93 Remove unused code 2020-08-22 18:48:32 +05:30
Kovid Goyal 640ca33197 py3ize some shebangs 2020-08-22 18:48:32 +05:30
Kovid Goyal 5de7f24814 Use a standard delete confirmation for deleting annotations fromthe browse tool 2020-08-22 18:48:32 +05:30
Kovid Goyal 31acd459a9 Use a standard delete confirmation for deleting highlights 2020-08-22 18:48:32 +05:30
Kovid Goyal 4bf48d8d99 Better error message when clipboard is not available 2020-08-22 18:48:32 +05:30
Kovid Goyal 34375f5891 Make drag scrolling semantics read mode dependant 2020-08-22 18:48:32 +05:30
Kovid Goyal aca602c118 Use Yes/No for confirm_delete dialogs 2020-08-22 18:48:32 +05:30
Kovid Goyal 2bedd3bfb2 Fix undragged handle position not being updated during drag scroll 2020-08-22 18:48:32 +05:30
Kovid Goyal 08105adbc8 Fix triple clicking of start and end paragraphs in paged mode 2020-08-22 18:48:32 +05:30
Kovid Goyal 1911ec41b4 Simply adjusting selection on handle move
Also re-enable drag scrollign with handles though it does not really
work yet
2020-08-22 18:48:31 +05:30
Kovid Goyal 1e24b66dad Simplify the selection extents function 2020-08-22 18:48:31 +05:30
Kovid Goyal 72fcbbc93a Restore triple-click to select paragraphs 2020-08-22 18:48:31 +05:30
Kovid Goyal 3af812813c Make the details panel buttons clickable links instead
Looks nicer and no longer any need for a delete button
2020-08-22 18:48:31 +05:30