Commit Graph

116 Commits (039947886fbc1de89f0236837015b1d817db99f5)

Author SHA1 Message Date
poire-z 9971eb8533 Fix untranslatable strings (#4132)
Some problem somewhere with [[...]] strings starting with a
leading newline. Should probably be allowed, but for now
fix the few such cases to allow them being translated.
6 years ago
poire-z 24d4ab43c4
dict: convert htmlentities in non-html text results (#3921) 6 years ago
onde2rock dad7f209fa [CI] Add a check to detect tab in lua files (#3919) 6 years ago
poire-z e7377cd20e Dict & wiki history: use filename when no book title (#3635) 6 years ago
TnS-hun b40bc53fc7 HTML dictionary link support (#3603) 6 years ago
poire-z e389510257 Fix speedup of dictionaries init (#3592)
Revert 338d14edb7 (#3489)
Simply just don't walk into "res/" subdirectories, which is where
resource files should be per startdict specs.
6 years ago
poire-z 8c897a086f HTML dict: enable color rendering and per-dict user fix html func (#3585)
Also fix possibility of crash in HtmlBoxWidget:free()
6 years ago
poire-z 91092c442d Fix negative nb of enabled dictionaries (#3584)
Happened when some dictionaries files have been removed, while
these were still referenced in the 'dicts_disabled' setting.
6 years ago
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
poire-z 70f2aa09ea Adds Wikipedia history (#3549)
Just like Dictionary lookup history.
Also changed Disable to Enable in some menu items to be more positive.
7 years ago
TnS-hun 29b376fdd9 [UX] Option to show dictionary in large window (#3499) 7 years ago
poire-z 338d14edb7 Speedup dictionaries init (#3489)
When looking for .ifo to populate Dictionary settings menu,
avoid walking sub-directories once we found a .ifo, as these
sub-directories may contain a lot of images and other subdirs.
7 years ago
Frans de Jonge 2ddcc7155a [fix] Dictionary no fuzzy search flag (#3433)
Upstream uses `-e` rather than the `-f` that was first introduced in our fork.

References https://github.com/koreader/koreader/issues/3429#issuecomment-339749396
7 years ago
Frans de Jonge d23d01643e Add LuaData and Dictionary Lookup History (#3161)
* Add dictionary history

Fixes #2033, fixes #2998.

* Add LuaData

* table handling in base settings

* Add LuaData spec
7 years ago
poire-z 1a97b4289c [Fix] Show 'Follow Link' even when no dict installed 7 years ago
poire-z 47139266b2 Dict lookup: allow cancelling with tap
base bumped for ffi/util.getNonBlockingReadSize(luafile)
7 years ago
Frans de Jonge f439ca0e8d [UX] Add "Follow Link" in hold/highlight dialog (#3190)
* This way you can disable "tap to follow links" on single tap yet still follow links.
* Change menu as well as per @poire-z's suggestion.
7 years ago
Frans de Jonge ba7fad2cdf [fix] Dict settings NaN in installed dicts submenu (#3173) 7 years ago
poire-z 6efcfce479 Fix "Info on dictionaries ordering" string for translation (#3156) 7 years ago
poire-z d5924f1d3d Use multiple sdcv -u params instead of renaming .ifo 7 years ago
poire-z 6d8d202f3b Dict settings menu: list dicts, and allow disabling them 7 years ago
poire-z 5d2bebcc0b Added Dictionary settings and Wikipedia settings menus (#3121)
Also removed OPDS `download_dir` from the candidates to Wikipedia
"Save as EPUB" dir.
7 years ago
Huang Xin 8938786472 [fix] stop propagation of tap events when triggering reader menu (#2934)
* [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
7 years ago
poire-z 9e346f5559 Allow wikipedia lookup from filemanager
Also allow taking screenshot when on dictionary window.
7 years ago
Qingping Hou bde2139b27 wifi(fix): quote ssid and password for wpa_passphrase 7 years ago
Qingping Hou 23c2955500 chore: style cleanup for infomessage 7 years ago
Frans de Jonge ed7937f65d ReaderDictionary: add info message about installing dictionaries
Fixes #2816.
7 years ago
poire-z 5bc19fa084 clean ReaderDictionary:cleanSelection
crengine now does a much better job at finding word boundaries, so
less cleanup is needed
7 years ago
Frans de Jonge e8721887ba InputContainer: add cancel_text and ok_text
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
7 years ago
Frans de Jonge a970a1f034 MenuSorter: fix outside testability (for potential unit tests) 7 years ago
Frans de Jonge b7b5950e98 MenuSorter: review comments and various bug fixes
* fixed wrongful retention of submenus variable and added return to MenuSorter:findById
* fixed readerfooter_spec.lua error
* fixed review comments
7 years ago
Frans de Jonge 5b20106db7 MenuSorter: initial implementation
* Menus are now sanely configurable
* Custom separator placement for clearer menus
7 years ago
Qingping Hou fc12ee6537 decouple reader footer from dictquicklookup widget & translation fix (#2664)
* chore: fix strings for translations

* dictionary(chore): decouple reader footer from dictquicklookup widget
7 years ago
Frans de Jonge d1785e1863 Reorganize menus
* Replace "home" (exit) menu with hamburger
* Discard pokeball and put items in hamburger
* Introduce search menu in reader

Cf. #2562
7 years ago
Qingping Hou f95ad00b9e feat: add logger module & rewrite kobo suspend script in lua 7 years ago
poire-z 1708fd5e1c Dictionary and wikipedia enhancements (#2393)
Stardict:
- remove duplicate results
- better cleaning of selection
- append results from a 2nd query of a 2nd set of dictionaries
  in data/dict_ext/

Wikipedia:
- use the search API for better results
- allow viewing the full page content of a result in a bigger window
- allow queries for multiple languages
- available languages can be set in settings.reader.lua :
    ["wikipedia_languages"] = {"en", "fr", "it"}
- "Wikipedia lookup" added to Tools menu

For both:
- allow selection of multiple words for a new lookup (so one can
  actually browse wikipedia)
- allow continuous reading with Tap
- display "current result / total number of results"

Details in #2393
8 years ago
Sergey Organov 3800a3077a DictQuickLookup:update(): strip all leading empty lines/spaces
This gets rid of sometimes huge spacing between a word and its
description taken from dictionary, and thus need for scrolling just to
read fisrs few lines of description.
8 years ago
chrox 1c5c7d3a7c fix #1682 by closing all dict windows when holding close icon 8 years ago
Qingping Hou fadad90447 uimanager(fix): handle stack change in close 8 years ago
chrox a60544b1ad Koreader Ubuntu-touch port
Currently only tested on Ubuntu-touch emulator with framework
ubuntu-sdk-14.10 for armhf.
The ubuntu-touch port is binary compatible with the Kobo port
major changes in this PR are:
1. rename the emulator device to sdl device since both the emulator
and the ubuntu-touch target use libsdl to handle input/output.
2. ubuntu-touch app has no write access to the installation dir so
all write-outs should be in a seperate dir definded in `datastorage`.
9 years ago
Qingping Hou 186673587e chore: fix some of the luacheck errors 9 years ago
chrox d345f21c39 Fix sdcv on Android cannot handle morphological changes 9 years ago
chrox 402806d32b Dictionary on Android
Stardict dictionary files should be copied to
/sdcard/koreader/data/dict/ directory.
9 years ago
chrox 82393f0ed3 fix loading frontend/JSON.lua for json.lua on Kindle
The VFAT file system of `/mnt/us` is case insensitive so that
require("json") from Spore which intends to load luajson module in
rock directory actually will load `frontend/JSON.lua`, the two JSON
parser libraries have slightly different APIs.

This patch remove the pure Lua JSON library in favor of `luajson` which
uses LPeg pattern marching backend for better performance.
9 years ago
chrox 07586cea71 strip punctuations around word before searching
This should fix #1337.
9 years ago
chrox c43885b917 show debug info when JSON data cannot be decoded 10 years ago
Hans-Werner Hilse 94ce08937a clean up refreshes
This is a larger clean-up of the refresh situation.
The general shift is that refreshes are now mainly triggered by
the (top-level) widgets when they get shown or closed via UIManager.

All refreshes for the widgets when they are in use were handled by
themselves before. This adds the case of showing/closing.

It is the desired result of not having UIManager:show()/:close()
do (full screen) refreshes on its own.
10 years ago
Hans-Werner Hilse 8376e2f821 dictionary window triggers refresh itself, not via show() 10 years ago
Hans-Werner Hilse f828f6e7e4 show dictionary title in info popup when setting default dictionary 10 years ago
Hans-Werner Hilse 1156bcd057 show a popup upon making a dictionary the default dictionary 10 years ago
Hans-Werner Hilse 48ea442e28 close file descriptor of dictionary lookup pipe 10 years ago
Hans-Werner Hilse 22697adf20 switch from scaleByDPI() to scaleBySize() 10 years ago
chrox 566586619a add unit tests for readerdictionary and readerhighlight 10 years ago
Frans de Jonge 90d3c23030 Enter *a* word to look up. 10 years ago
Frans de Jonge ff4e2f3458 Minor English improvements. 10 years ago
Hans-Werner Hilse 3066c86e38 Refactoring hardware abstraction
This is a major overhaul of the hardware abstraction layer.
A few notes:

General platform distinction happens in
  frontend/device.lua
which will delegate everything else to
  frontend/device/<platform_name>/device.lua
which should extend
  frontend/device/generic/device.lua

Screen handling is implemented in
  frontend/device/screen.lua
which includes the *functionality* to support device specifics.
Actually setting up the device specific functionality, however,
is done in the device specific setup code in the relevant
device.lua file.

The same goes for input handling.
10 years ago
chrox 72f9449de8 ignore more markup tags in dictionary window 10 years ago
chrox 6b2768f801 fix cannot set default dictionary 10 years ago
chrox fea7b93b62 fix #1035 by CDATA tidy 10 years ago
chrox 506bf96379 add menu entry to lookup input word in dictionary
This should close #971.
10 years ago
chrox 9467eab6e1 strip generic punctuation (U+2000 - U+206F) in lookup word
This should fix #921.
10 years ago
chrox f575797b01 use original lookup word in wikipedia lookup 10 years ago
chrox 7b10d66e1b enable Wikipedia support
Since wikipedia server is language specific we should first detect
language of the text by querying Google Translate. Make sure you have
access to both Google Translate and Wikipedia service to use this
function.
10 years ago
chrox d34a7fb355 lookup input word when holding on word in dict lookup window 10 years ago
chrox 59dbe36d57 show 'no definition found' message when no definition found 10 years ago
Qingping Hou 4b357c1466 move reader code into frontend/apps/reader
it makes more sense to completely separate the UI framework and
application code

also move frontend/ui/configurable.lua to frontend/configurable.lua
10 years ago