Commit Graph

44 Commits (d163f8281d1d43d8321e954bd6519375c825c624)

Author SHA1 Message Date
TnS-hun 06a8a33d39 HTML dictionary support (#3573)
* Adds a generic HTML widget modeled after the text widget, and HTML dictionary support. HTML dictionaries can have their own CSS (for X.ifo it must be X.css). The base CSS just resets the margin and sets the font.

Note that the widget doesn't handle links, that wasn't needed for the dictionary.

Closes <https://github.com/koreader/koreader/issues/1776>.

* Show tag stripped HTML if the dictionary entry isn't valid HTML

* Simulate the normal <br/> behavior

* Bump base
6 years ago
Ben Kelly f9ac8b138b Basic fixes to calibre-sync (#3558)
* Properly create intermediate directories when receiving books from Calibre.

This fixes an issue where you can't receive books except into directories that
already exist on the Kobo, which, in particular, causes problems when your
configuration in Calibre is something like "put books in $Author/$Title.epub"
and you haven't previously synced any books by that author.

* Wake up periodically to process ZMQs if any are registered.

This fixes an issue where if there are any timed events (such as the suspend
timer) in the queue, ZMQ events may not get processed until the timed event
fires, which is a problem when (for example) the suspend timer goes off in
an hour and you have something trying to send a book to the kobo over wifi
*right now*.

With this change, the event loop will wake up every 50ms to check for ZMQ
events and process them if necessary. If there are no ZMQs registered (which
is typical), it uses the original behaviour -- so this won't affect battery
life under normal usage.
6 years ago
poire-z ecaeb4b6d7 Added util.getFormattedSize() (#3383) 7 years ago
poire-z c15915a4ee Added util.getFriendlySize() (#3381)
* Added util.getFriendlySize()

* Allow for GB
7 years ago
Robert 605df50fbd [fix] util.secondsToClock 00:60 should be 01:00 (#3371) 7 years ago
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)`.
7 years ago
Frans de Jonge c8c4df2f31 [fix] util.isEmptyDir() crashes on non-existent dir
lfs.dir will crash rather than return nil if directory doesn't exist

Proper fix for 9f5e446701 which is nothing but a workaround. However, I do think creating more of those data dirs automatically is more user-friendly because otherwise Android users will have to look it up or guess.
7 years ago
Frans de Jonge 16f8f7226e [chore] util: deprecated string.gfind to string.gmatch 7 years ago
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).
7 years ago
Frans de Jonge ea9fa95a54 util.lua: fix lfs require in isEmptyDir()
Pointed out by @poire-z ed7937f65d (commitcomment-21956632)
7 years ago
Frans de Jonge ed7937f65d ReaderDictionary: add info message about installing dictionaries
Fixes #2816.
7 years ago
Hzj_jie 999898fa69 Merge various information into systemstat (#2764)
* Merge various information to systemstat
7 years ago
Frans de Jonge e9df73f6dc Developer documentation improvements
* Fixed up all of util and added when absent
* Updated widget examples to new coding style
7 years ago
Robert a3c4254809 Added util.fixUtf8 (#2704)
* Remove invalid UTF-8 chars from OPDS
* add unit tests
7 years ago
Robert dccbf4cf96 Fix crash when downloading books with unknown characters in title (#2628) 7 years ago
Frans de Jonge 47a40eb414 util: add some LDoc descriptions 7 years ago
Hzj_jie 726b15ad01 More sorting orders in file manager (#2535) 7 years ago
Frans de Jonge bec5f46245 Merge pull request #2524 from Hzj-jie/master2
Add characters in menu items to indicate sub menus
7 years ago
Hzj_jie 65e2d6630f Use small triangle 7 years ago
Hzj_jie 18117584c0 Resolve review comments 7 years ago
Hzj_jie f91ad679d9 swithItemTable -> switchItemTable 7 years ago
Hzj_jie 529d1b3d33 evernote: ReadHistory integration and text file output (#2498) 7 years ago
Robert 7bfbc9f06a Sanitize filename for vfat, fix #2433 (#2464) 7 years ago
poire-z 359c1ae265 textboxwidget: enhanced CJK text wrapping
(changes only in util.isSplitable(), but used by textboxwidget)
Implemented line breaking rules from :
https://en.wikipedia.org/wiki/Line_breaking_rules_in_East_Asian_languages
7 years ago
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
7 years ago
Frans de Jonge ba7377065e Doc: miscellaneous improvements. 7 years ago
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
7 years ago
Hzj_jie 9efc723388 PR #2356 breaks CJK character splitting 8 years ago
robert00s fc5ba9b862 Fix hyphenation words with unicode character in texboxwidget (#2356) 8 years ago
chrox 71bf9efc7c split accient greek words with spacing character
This should fix #1705.
8 years ago
Qingping Hou 301925e34a textboxwidget(fix): handle onHoldWord event 8 years ago
union2find a7f24b6eaf fix function util.splitToChars in frontend/util.lua 8 years ago
union2find f8943efdbf fix indent sytle 8 years ago
union2find 3d89b27e59 remove debug output 8 years ago
union2find d6fcc9adf9 add cursor functionality 8 years ago
Alex Pletnev fbf98ed920 #1710 FR: Add support of statistics plugin for pdf 8 years ago
Qingping Hou e2096ed8d9 doc: add documentation build infrastructure 8 years ago
Qingping Hou 5cca28fabc feat(util): add array.Append helper 8 years ago
Qingping Hou e19f73bdba style(util): rename tablelength to tableSize 8 years ago
Qingping Hou 2dc5eb8586 minor: no need to override function arg with local 8 years ago
Qingping Hou 4759def09c chore: fix static-check errors 8 years ago
Alex Pletnev ce4e32e01c #1723 Add time to read into the status bar
Add new statuses:
TB - book time to read
TC - chapter time to read

Fix backward compatible in statistics plugin
9 years ago
chrox 932df2a2f9 Refactor out string.gsplit to util.gsplit 9 years ago
chrox 07586cea71 strip punctuations around word before searching
This should fix #1337.
9 years ago