Add a "Select" button in the highlight dialog to initiate
text selection; on the next text selection, the text between
these 2 points will be selected.
Limited to a single page with non-CRE documents.
Also move "Search" button at end, so it's the one that
will be wide in case of an odd number of buttons.
I've found that some OPDS catalogs have multiple downloads of the same filetype, but optimized or formatted in different ways. The Title of the download is much more descriptive in this case, so I thought it would be better to display the title if available.
The OPDS catalog at https://standardebooks.org/opds is a good example. Note how entries in https://standardebooks.org/opds/new-releases have three different epub downloads, titled "Recommended compatible epub", "Advanced epub", and "Kobo Kepub epub".
Previously getTextFromBoxes would just pass the first and last three
bytes of the current and previous words when trying to detect CJK
characters (which shouldn't have spaces inserted).
However, this handling was not correct because CJK characters can be
longer than 3 bytes, and internally BaseUtil.utf8charcode doesn't ensure
that it was only given a single utf8 character (it blindly does the bit
operations on whatever length code you give it).
As a result, before this patch selections in PDF documents would have
lots of spaces stripped because getTextFromBoxes would think that almost
all characters were CJK characters.
Fixes: 6f1b70e5eb ("util.utf8: improve CJK character detection")
Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
This layout is far more commonly used on mobile devices, and allows for
much easier typing. The keyboard primarily functions through gestures in
the four cardinal directions to select which vowel kana to select. In
addition, users can cycle through each kana row by tapping the key
within a 2-second window (this is the equivalent to T9 input for
Japanese phone keyboards).
This also resolves the long-standing issue that the old keyboard did not
correctly handle dakuten (there was a standalone dakuten key which added
a stray dakuten mark, and the umlat mode which added dakuten to all of
the keys it could) and could not input handakuten characters at all.
In order to allow adding dakuten and cycling through the various
modifiers for the previous kana, we need to wrap the input-box (similar
to korean) but luckily we don't need any state machine magic since we
just need to modify the last character in the character buffer. However
because the tap timeout for T9-like-cycling needs to be reset after any
non-tap key we need to add some basic wrappers around a few other
input-box methods.
Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
A layout might want to make some specific feature configurable, so
create an addToMainMenu-like system for allowing layouts to add their
own configuration sub-menu to the keyboard configuration menu.
Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
This allows for InputText wrappers (namely the Japanese keyboard which
needs to be able to apply modifiers to the character before the cursor)
to nicely access the character list.
Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
In some cases, it's useful to be able to wrap a function and either
replace its contents entirely or have some callback be run before
calling the underlying function.
The most obvious users for this feature are the Japanese and Korean
keyboards (both of which need to wrap the inputbox methods with either
their own versions or have basic callbacks be run before the method is
executed).
This is loosely based on how busted/luassert spies work.
Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
It's possible for the user to have selected nothing, and trying to
operate on the nil highlight can cause confusion or crashes. This
restores the behaviour before commit 7a0e3d5e68 ("readerhighlight:
remove selected_word and use selected_text everywhere"), which missed
this case.
In addition, add some debug guards to ReaderHighlight methods which
cannot handle selected_text being nil (or at least, shouldn't be called
with selected_text being nil).
Fixes: 7a0e3d5e68 ("readerhighlight: remove selected_word and use selected_text everywhere")
Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
The previous version of JMdict comes from 2009 and doesn't appear to
work at all when trying to do basic lookups (likely due to some kind of
encoding problem). In addition, the license information and sourcing was
not really in line with the requirements specified by the JMdict
license. This version is far more up-to-date and also includes synonym-based
deinflection (though because KOReader has a Japanese plugin now, this is
technically not necessary).
Since there didn't exist a nicely-maintained place to download these
dictionaries (because StarDict is not widely used for Japanese
dictionaries), I've set up a personal GitHub repository where I've
hosted them. Note that we're intentionally not pinning the commit hash
because GitHub only recommends we use gh-pages for CDN purposes, and one
of the requirements of the JMdict license is that you need to be able to
update to later versions.
Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
If we had a local prefered AP with a higher RSSI,
we attempted to associate with it over wpa_supplicant
being already attempting to associate with its own preferred AP.
That... failed horribly.
Also adapt to the new lj-wpaclient API, fixing a few other edge-cases,
and making the whole thing slightly faster because we no longer
uselessly sleep.
And more reliable because we now actually wait for replies to our
requests.
Bump base
https://github.com/koreader/koreader-base/pull/1424
screen.
Otherwise, on the Sage, weird flash glitches may happen, depending on
what was on screen...
(e.g., there's some weird update merging shenanigans going on
despite those updates being flagged NO_MERGE...).
Switch to flashing GC16, because the screen is so fast that using GL16
simply leaves us with an unreadable mess of ghosting.
I'm halfway considering rewriting this in Lua so that I can do a proper
batched update...
The second argument is a ddjvu_render_mode_t
Try to actually honor the user settings instead of enforcing COLOR
while we're there.
Fix#8376
Regression since #8250
Now that FileManager registers its UI modules in the same way as Reader,
this shouldn't be necessary but this protects us against some other app
creating a ReaderDictionary instance without having ui.languagesupport
registered properly.
Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
With the addition of the language support module, ReaderDictionary
tries to use modules registered with the UI instance, but the
FileManager doesn't provide key-based registration of its UI modules.
In order to allow the same code to be used by both FileManager and
Reader seamlessly, copy the :registerPlugin() method from Reader and use
it with FileManager. This will ensure any other hidden assumptions about
UI module registration are handled properly.
Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
- Add an icon to distinguish between page bookmarks, plain
highlights, and highlights with an added note
- Bookmark details: show both highlighted text and added note
- Bookmark list: allow filtering by type and/or by keyword
- New bookmark selection mode, to allow multiple removals
- New option: show separator line