2
0
mirror of https://github.com/koreader/koreader synced 2024-10-31 21:20:20 +00:00
Commit Graph

33 Commits

Author SHA1 Message Date
zwim
e9ba854ff0
DeviceMenu: Colons and more information (#8435)
Add information to device menu entries
2021-11-23 21:17:07 +01:00
Frans de Jonge
db45881183
[chore] Spaces for indendation, not tabs (#8364)
Overlooked in #8312.
2021-10-23 16:11:47 +02:00
Aleksa Sarai
6f1b70e5eb util.utf8: improve CJK character detection
Previously the CJK character detection defined only characters in the
range U+4000..U+AFFF as "CJK characters". This excludes an incredibly
large number of CJK characters within the BMP, let alone the whole two
planes dedicated to rarer CJK characters (the SIP and TIP). As a result,
a very large number of Chinese, Japanese, and Korean characters were not
detected as being CJK characters.

While slightly less elegant-looking, it is far more accurate to compute
the codepoint from the utf8 character and then see if it falls within
one of the defined CJK blocks. This is not future-proof against future
CJK ideograph extensions in future Unicode versions, but there is no
real way to accurately predict such changes so this is the best we can
do without accidentally treating characters explicitily defined as being
non-CJK in Unicode as CJK.

While we're at it, copy Lua 5.3's utf8.charpattern constant definition
so that we can more easily write utf8 iterators with string.gmatch (at
least in the interim until there is a rework of utf8 handling in
KOReader and everything is rebuilt on top of utf8proc).

Some unit tests are added for Korean and Japanese text, and the existing
unit tests needed a minor adjustment to handle the fact that
isSplittable now correctly detects CJK punctuation as a character to
compare against the forbidden split rules.

Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
2021-10-23 15:49:54 +02:00
yparitcher
8c29b71e45
Tests: emptydir switch from data/dict to history (#8296)
So this test doesn't fail when one has dictionaries locally
(history folder is deprecated and should be empty).
2021-10-10 13:33:57 +02:00
Brian Hughes
ba65dc155b
Adds time left for chapter and document to the screensaver message options (#7897) 2021-06-30 01:45:34 +02:00
Frans de Jonge
5c9dc850e8
Address assorted Weblate comments (#7154)
* Fix typo in dropbox

Reported by @lescheck

* Rephrase text justification explanation more elegantly

* CoverBrowser: fix up some plurals

* Statistics: remove random use of template function

* Use ngettext for minute/minutes and second/seconds

* Change KB/MB/GB to kB/MB/GB SI units
2021-01-16 21:40:00 +01:00
NiLuJe
ec3ec8dc21
Show full ToC entry on hold (#6729)
Fix #6728
2020-09-30 19:56:56 +02:00
poire-z
f488eb2bb3 util.getFriendlySize(): add option to right align
Left align by default, but allow right alignment by
padding left with spaces.
2019-12-17 23:46:35 +01:00
Robert
2161a76ea8 fix util.secondsToHClock when hmsFormat is true (#5640) 2019-11-26 13:28:11 +01:00
NiLuJe
d8e0b1759b
Other minor frontend.util cleanups (#5629)
* Resync fixUtf8 w/ upstream
* Fix lastIndexOf desc
* Drop unichar usage, it's a crappier unicodeCodepointToUtf8 ;).
2019-11-24 00:27:27 +01:00
Robert
5da3312869 More footer options, default to use icons as prefixes (#5203)
- show icons or letters as prefix of items
- various footer separators
- progress percentage format with decimal digits
- time in 12/24 format
- two duration formats (1:30, 1h30')
- move some options into Settings submenu
2019-08-16 23:22:58 +02:00
Frans de Jonge
9300a59a89
[fix] util.getSafeFilename() maximum extension length (#5067)
Strip HTML and do some semi-intelligent detection of faux extensions (i.e., more than 10 characters probably isn't one).

Fixes #5049.
2019-06-10 17:06:13 +02:00
Robert
9e67c5a614 CloudStorage: Allow use reserved characters in FTP username and FTP password (#3924)
Depends on RFC 3986 compliant util.urlEncode() and adds unit tests for the new functions.
2018-05-04 17:06:58 +02:00
Frans de Jonge
90059221db
[spec] util_spec: tests for util.getFriendlySize() (#3650) 2018-01-31 17:22:34 +01:00
Robert
605df50fbd [fix] util.secondsToClock 00:60 should be 01:00 (#3371) 2017-10-18 15:27:27 +00:00
Frans de Jonge
0fa090ee47 [chore] Rework util spec, rework util.secondsToClock: round seconds to minutes in 00:00 mode + spec
Most of the tests in util_spec were the wrong way around.
It's `assert(expected, given)`.
2017-10-12 19:39:52 +02:00
Frans de Jonge
7277059176 add unit test 2017-08-17 11:18:28 +02:00
Frans de Jonge
e3c17aa6d0 Travis: run luacheck on unit tests (#3059)
* Travis: run luacheck on unit tests
2017-08-08 13:35:40 -07:00
poire-z
17656778b1 Book information: refactored and additional features
- Factored out duplicate code from filemanager.lua and filemanagerhistory.lua
to new filemanagerbookinfo.lua (and other common code to filemanagerutil.lua).
- Uses sidecar files' new doc_props and doc_pages settings, or fallback to
old 'stats' settings, or to opening document.
- Shows filename, filetype and directory.
- Shows description (Hold to see whole truncated text), keywords, and
cover image (tap to extract image from document and display it if available).
- Book information now available from reader menu, to display info about
the currently opened book.
- Convert possibly HTML description to plain text via added
util.htmlToPlainTextIfHtml() (for simple HTML conversion).
2017-07-14 16:46:38 +02:00
Frans de Jonge
ed0ba6737e test: add optmath spec stub (#2950)
* test: add optmath spec stub
2017-06-13 09:40:56 -07:00
Hzj_jie
999898fa69 Merge various information into systemstat (#2764)
* Merge various information to systemstat
2017-04-14 21:12:28 +02:00
Frans de Jonge
e9df73f6dc Developer documentation improvements
* Fixed up all of util and added when absent
* Updated widget examples to new coding style
2017-04-04 08:01:15 -07:00
Robert
a3c4254809 Added util.fixUtf8 (#2704)
* Remove invalid UTF-8 chars from OPDS
* add unit tests
2017-04-02 16:17:49 +02:00
Hzj_jie
529d1b3d33 evernote: ReadHistory integration and text file output (#2498) 2017-01-21 01:32:42 -08:00
poire-z
a8dd8c6f30 textboxwidget: even better text wrapping
util.isSplitable() accepts now also the previous char to help
decide if a space can be used to split a line.
TextBoxWidget:_splitCharWidthList() : simplified logic
2016-12-14 11:39:46 -08:00
poire-z
5040bfe4c5 textboxwidget and scrolltextwidget enhancements (#2393)
util: made isSplitable() accept an optional next_char
for wiser decision

textboxwidget: speed up rendering, enhanced text wrapping,
allow selection of multiple words with Hold.

scrolltextwidget: allow scrolling with Tap.

Details in #2393
2016-12-11 14:32:02 -08:00
Hzj_jie
9efc723388 PR #2356 breaks CJK character splitting 2016-11-25 16:46:56 -08:00
robert00s
fc5ba9b862 Fix hyphenation words with unicode character in texboxwidget (#2356) 2016-11-19 12:26:53 -08:00
chrox
71bf9efc7c split accient greek words with spacing character
This should fix #1705.
2016-06-28 23:50:25 +08:00
Qingping Hou
301925e34a textboxwidget(fix): handle onHoldWord event 2016-06-05 00:37:54 -07:00
Frans de Jonge
5638819f25 Removed a bunch of "successfully", replaced an ellipsis, and some deviant spellings of KOReader. 2016-04-16 12:37:08 +02:00
Qingping Hou
eb37d9b8b6 kobo: fix screen probe for touch 2016-04-02 23:06:09 -07:00
chrox
932df2a2f9 Refactor out string.gsplit to util.gsplit 2015-04-22 14:27:33 +08:00