* 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
Use "message" as the default for screensaver (instead of "disable") (https://github.com/koreader/koreader/pull/3535#issuecomment-353337143)
On Kobo
Fix: display message on poweroff or reboot (https://github.com/koreader/koreader/pull/3535#issuecomment-352355865)
Allows for overwritting these default messages with the classic screensaver settings, by just prepending "poweroff_" or "reboot_" to them. (https://github.com/koreader/koreader/pull/3535#issuecomment-352498497)
So one can manually add to its settings.reader.lua:
```
"poweroff_screensaver_type" = "random_image" or "message", "cover", "bookstatus", "readingprogress", "disable",
"poweroff_screensaver_dir" = "path to same as screensaver_dir or alternate dir for poweroff image(s)",
"poweroff_screensaver_message" = "message to use instead of Powered off",
```
```
"reboot_screensaver_type" = "random_image" or "message", "cover", "bookstatus", "readingprogress", "disable",
"reboot_screensaver_dir" = "path to same as screensaver_dir or alternate dir for reboot image(s)",
"reboot_screensaver_message" = "message to use instead of Rebooting...",
```
Partial, as it will safe the state when suspending the reader by pressing the power-button.
However, it will still not safe the state when Pocketbooks autoPowerOff-Feature kicks in, as this does not create an event (e.g. no EVT_BACKGROUND) of any kind.
* Clean up device.lua
* Save state on suspend
* 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.
- Fix links to wikipedia pages containing '?oldid=123', that
wouldn't work when used back thru the API.
- Make external links to other wikipedias with a different langage
work (they didn't work when non-ascii page titles)
- Speedup download of images by using a newly added 'fast_refresh'
option to Trapper:info() to bypass UIManager.
* Prevent open screensaver more than one in the same time
* Add option to enable/disable background in message screensaver
* fallback to random images if this book cover is excluded feature + fix Disabled (leave screen/page as it is)
* Autostretch disable by default, more fallback options, leave screen as it is
This feature, introduced some days ago, was actually
doing 2 updateItems calls: the initial one, and a second
to switch to focused_file page (cheap with classic display mode,
less cheap with CoverBrowser modes).
This change allows doing that in a single call.
To make it more alike bottom menu:
- left and right border not displayed
- line below icons extends to screen borders
- same bottom border size
And make separator lines have same padding on both sides
When going from reader to filemanager, we are in the directory
containing the last_file. With this, we will also be on the page
showing this file.
When in filemanager and going up (".."), we will also be on the
page containing the directory we came from.
Rationalize horizontal construction of Menu items (TOC,
Bookmarks, Classic file views) for more even padding.
Align "x" close button diagonaly with top right border and title.
Also add forgotten scale_for_dpi to MultiConfirmBox
This makes button heights similar in all uses of ButtonTable.
It depended on how the ButtonTable was used in each widget
(previously, first and last row may have different sizes than
the others).
buttontable.lua: more even buttons height whether zero_sep or not
framecontainer.lua: added padding_top/bottom/left/right (similar to
what was done for iconbutton)
The following widgets have been adapted for this, with some
additional fixes:
buttondialog.lua
buttondialogtitle.lua: wider title with adequate padding
confirmbox.lua + multiconfirmbox.lua: dismissable via tap outside
inputdialog.lua + multiinputdialog.lua: more even vertical padding between elements
imageviewer.lua
textviewer.lua
datewidget.lua
timewidget.lua
Additionaly: frontlightwidget.lua: fixed width of progress bar that
was exceeding window width since the Size scaling adjustements
Decide baseline vertical position according to font metrics, instead
of the hardcoded 0.7 (in textwidget, which made the text a little
bit up in its box), and 0.75 (in toggleswitch, which made the text a
little bit down in its box). This usually gives a value around 0.72
or 0.73 with our ui fonts, which looks about right.
ReaderFooter: add bottom padding, now that our text goes a few pixels lower
"partial" refresh causes a full (without black flash) refresh on
Kindle (which uses REAGL mode for partial refresh). This causes a
full redraw of widgets, which is a bit distracting with some of them:
- dictquicklookup: when showing next definition
- infomessage: when displaying a new one (Wikipedia Save as epub)
Also fix bottom menu, that even when closed, would still register
bottom area as dirty: this would cause top menu navigation to
cause a full partial refresh, only noticable on Kindle.
* Fix crash with keyboard navigation of onHold buttontables
Would crash when encountering a separator or when the number
of buttons in a row changes.
* Reset previous selected item on new buttontable
For years they've been smaller on higher DPI devices and likely very few people realized it was technically a bug. These values round up on lower DPI and smaller screen devices.
References https://github.com/koreader/koreader/issues/3265
Closes: #3236 and #3235
Details:
> Also, when looking in days, we see info how many hours we read. It would be great if we could tap a day, it opens info on book(s) we read that day with info pertaining to that day, and if we tap on book, we receive book info for that book.
> Statistics plugin is really great, I started to look in my reading statistics now much more, but all the time I can go only in one way. And I need to exit at lowest level of info. It would be great if I can use statistics plugin like part of menu, to go up and down within statistics data and exit at my wish, not when I have to.
Also added:
* new statistics book by week
* new statistics book by month
* last year by week now we can see days in selected week
* Cache scaled images with scale_for_dpi
* Don't update original self.scale_for_dpi
A same ImageWidget object can be free()'d and re-render()ed,
and we would then lose scale_for_dpi on next renderings
Made the onHold buttons table similar to the one of File browser.
Added "Purge .sdr" and "Delete" to these buttons.
Moved the purgeSettings and removeFileFromHistoryIfWanted
logic into filemanagerutil functions.
Stay on the same page when manipulating history (previously, we were
always put back on first page).
Really keep deleted files in history (unless setting says otherwise).
Show deleted files in grey or dimmed in classic History and all
CoverBrowser display modes.
This module provides methods for simple interaction with UI, without
the need for explicit callbacks, for use by linear jobs between
their steps.
Uses coroutines, but their usage is hidden by a simple API.
Factored out of Wikipedia:createEpubWithUI().
* frontlight on kobo: a few fixes
Rewritten to not update NickelConf on every change, and never
if KOBO_SYNC_BRIGHTNESS_WITH_NICKEL = false.
Reintroduce global settings frontlight_intensity and
is_frontlight_on to keep level and state across koreader
sessions.
Fix a few of the remaining issues on kobo light.
Ensure settings are saved when rebooting/powering off from
File browser.
* Ensure untoggle works when starting with light off
* fixes#2898 (prevents accidentally triggering reboot or poweroff)
Add ConfirmBox before reboot/power off
* increases clarity by preventing second page
* add "sleep" menu entry
* Add exit menu hold callback
Just under the existing "Embedded Styles". Support for this
was already there in crengine, and interfacing is similar to
what is done with Embedded Styles.
* Put back fl_min=0 as it is for all other devices (the idea
fl_min should be 1 and toggling managed some other way is
not implemented in current code).
* Fix a few frontlightwidget issues
* CoverBrowser plugin: alt views for File Browser and History
* Added Prune cache and Compact cache menu actions
* Support for book descriptions, and settings stored in db
- 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).
* Use PluginShare to exchange data between plugins
* Remove legacy code in reader.lua and kobo/device.lua, and move KOBO_LIGHT_ON_START to kobo/powerd.lua
* A better sync config logic
* Consider kobo without hardware frontlight toggle
* update frontlight widget once toggle is tapped.
* Force refresh when kindle is out of screensaver or usb is unpluged.
* Improve AutoFrontlight
* More plugins sub menu
* Last brightness should always be updated
* Finish autofrontlight improvement and enable it by default.
* More tets
* onFlushSettings
* MenuSorter can now correctly sort sub menus
* [fix] stop propagation of tap events
when triggering reader menu
And also get rid of unnecessary screen refreshes on Kindle Voyage.
The "progress" window for dict lookup is also eliminated as most of the time dict lookup is an instant process, and the "progress" window is preserved for wikipedia lookup as it may take longer time to show the result window.
* [up] add an option to disable dictionary fuzzy search
* [fix] tidy up require
* [fix] fix read settings
* Add a basic Japanese keyboard layout
Allow for entring Japanese text into text boxes. Only supports kana
and latin letters due to limitations of current VirtualKeyboard
implementation (complex text input with conversion is not possible).
* Allow keyboard layouts to declare custom modifiers
Refactor modifier key setup code and existing keyboard layouts so
that each layout can declare custom modifier key labels. This
allows for greater extensibility and for future keyboard layouts.
* newsDownloader - atom support initial version
* NewsDownloader: update example feed config (use Reuters atom source)
* NewsDownloader: InfoMessage when unsupported urls
* NewsDownloader: update menu_item id
* NewsDownloader: change text label
* translation text fix
* quickstart(fix): go back to home dir after document close
* quickstart(fix): purge old quick start files
* spec: fix quickstart tests
* Simple News (RSS/Atom) downloader plugin
* Limit news from sources
* new News Downloader menu entry - goto news dir
* Initial configuration logic
* Download each feed source to separate folder
* 2 feed sources in example config
* Swipe for menu and quickstart guide
Because swiping for the menu is a big change from what we're used to, this commit includes a new quickstart guide.
Fixes#2608.
* add some dev docs
* add FileConverter spec
* add QuickStart spec
* add Version module
* add Version spec
* footer(optimize): remove dead code
* footer(fix): disable auto refresh time option when current time is not checked
* fix: support disable progress bar again
Makes it easier to comply with UX style.
* Change "OK" to "Search dictionary" in Dictionary lookup to comply with UX style
* Change "OK" to "Search all text" in Fulltext search to comply with UX style
Tacked on but highly related:
* change "OK" to "Search Wikipedia" in Wikipedia lookup to comply with UX style
* change "OK" to "Set default" in ConfigDialog to comply with UX style
Chore:
* fixed up order of requires
* lang: changed `...` in CloudStorage to real ellipses
* chore: reordered requires in CloudStorage per coding style
* UX: switched "Close" and "Stay alive" in KeepAlive per UX style
* lang: improved message in CloudStorage
* chore: reordered requires in OTAManager per coding style
* lang: removed "your" from "Your KOReader is up to date" in OTAManager
* plugin loader(feat): support loading plugins from user defined directories
Extra plugin lookup paths can be set in global reader setting via key
`extra_plugin_paths`. Value of the key can either be a string or an array
of strings.
* build(fix): also purge non-exist plugins on build
* plugin: migrate debug plugin to menu sorter
This commit seeks to improve the paltry help menu item. It breaks the "try to have at least three items in a submenu" rule in anticipation of an upcoming quickstart guide and show quickstart guide setting. This guide will explain that (soon) you will have to swipe south at the top of the screen to activate the menu.
Also see the somewhat related #1371, which would also go in the submenu.
"frontend/ui/menusorter.lua:110:13: value assigned to variable 'sub_menu_content' is unused"
Kind of the point, I'm assigning it nil after all. This way it probably shouldn't complain.
Without this change, the device resumed randomly. With this change, the device had not resumed randomly anymore. (Technically speaking, it still randomly resumed, but got suspended immediately.)
MenuSorter: forgot to add plugin style change
MenuSorter: worked out the final quirks
* Menu always compressed into tables without missing indexes for ipairs compatibility
* Orphans attached
* Separators no longer count as items