Commit Graph

69 Commits (ce624be8b83e880b1a81106a143e1440eeda4aab)

Author SHA1 Message Date
NiLuJe 2f9db25969
Unify LuaSocket usage (#7405)
* Add a new socketutil module with a few helper functions that allow us to:
  * Always use a sane User-Agent (previously, only Wikipedia did so)
  * Set timeouts in an almost sane manner. Doing it explicitly prevents an interaction with KOSync that does crazy stuff I don't even want to try to understand.
* Unified said timeouts based on the request's intended usage (except for Wikipedia, which already had meaningful timeout values).
* Stopped using LuaSec directly, LuaSocket defers to LuaSec sanely on its own. Everything now transparently supports HTTPS without code duplication.
3 years ago
Georgelemental 053df60553
Account for result pagination when fetching notes or notebooks from Joplin API (#7162)
The Joplin Web Clipper API now paginates results for the APIs for fetching notes or notebooks

Iterate through Joplin API results in order
3 years ago
NiLuJe 99045b4311
Minor util & ffi/util cleanups (#6657) 4 years ago
NiLuJe 37a01100b7
Various Wi-Fi QoL improvements (#6424)
* Revamped most actions that require an internet connection to a new/fixed backend that allows forwarding the initial action and running it automatically once connected. (i.e., it'll allow you to set "Action when Wi-Fi is off" to "turn_on", and whatch stuff connect and do what you wanted automatically without having to re-click anywhere instead of showing you a Wi-Fi prompt and then not doing anything without any other feedback).
* Speaking of, fixed the "turn_on" beforeWifi action to, well, actually work. It's no longer marked as experimental.
* Consistently use "Wi-Fi" everywhere.
* On Kobo/Cervantes/Sony, implemented a "Kill Wi-Fi connection when inactive" system that will automatically disconnect from Wi-Fi after sustained *network* inactivity (i.e., you can keep reading, it'll eventually turn off on its own). This should be smart and flexible enough not to murder Wi-Fi while you need it, while still not keeping it uselessly on and murdering your battery.
(i.e., enable that + turn Wi-Fi on when off and enjoy never having to bother about Wi-Fi ever again).
* Made sending `NetworkConnected` / `NetworkDisconnected` events consistent (they were only being sent... sometimes, which made relying on 'em somewhat problematic).
* restoreWifiAsync is now only run when really needed (i.e., we no longer stomp on an existing working connection just for the hell of it).
* We no longer attempt to kill a bogus non-existent Wi-Fi connection when going to suspend, we only do it when it's actually needed.
* Every method of enabling Wi-Fi will now properly tear down Wi-Fi on failure, instead of leaving it in an undefined state.
* Fixed an issue in the fancy crash screen on Kobo/reMarkable that could sometime lead to the log excerpt being missing.
* Worked-around a number of sneaky issues related to low-level Wi-Fi/DHCP/DNS handling on Kobo (see the lengthy comments [below](https://github.com/koreader/koreader/pull/6424#issuecomment-663881059) for details). Fix #6421 
Incidentally, this should also fix the inconsistencies experienced re: Wi-Fi behavior in Nickel when toggling between KOReader and Nickel (use NM/KFMon, and run a current FW for best results).
* For developers, this involves various cleanups around NetworkMgr and NetworkListener. Documentation is in-line, above the concerned functions.
4 years ago
Frans de Jonge da507f8607
[chore] Update MD5 calls with new sha2 library (#6411)
Depends on <https://github.com/koreader/koreader-base/pull/1149>.
4 years ago
Martín Fernández 1adea4a497 Add macOS target
Co-authored-by: Jason Benwell <jbenwell@hotmail.com>
4 years ago
Galunid 37cf106fce
EvernoteOAuth set logger (#6308)
evernote-sdk-lua#4 to logger.dbg, instead of default print
4 years ago
Frans de Jonge 1abaa39c27
[plugin] Add menu separators to Evernote menu (#6294)
This makes the menu structure slightly clearer.
See <https://github.com/koreader/koreader/issues/2778#issuecomment-647324742>.
4 years ago
Galunid cd440acdc4
Add chapter title when exporting notes in Evernote (JSON/HTML, remote) (#6146)
closes #4566
closes #6138
4 years ago
NiLuJe 1f994f8ede
Floor dimension computations (mul/div). (#6264)
* floor most every dimension computations involving MUL or DIV
Should avoid passing nonsensical floating point coordinates/dimensions
to the UI code.

* Update base

* https://github.com/koreader/koreader-base/pull/1113
* https://github.com/koreader/koreader-base/pull/1114
* https://github.com/koreader/koreader-base/pull/1115

* Bump android-luajit-launcher

https://github.com/koreader/android-luajit-launcher/pull/230
https://github.com/koreader/android-luajit-launcher/pull/231
4 years ago
Roland Coeurjoly e5b2c2953b
Add support for exporting highlights in JSON format (#6067) 4 years ago
Mustafa Ali Mutlu 2736661bfc [fix, plugin] Evernote exporter only writes one documents clippings when txt export used, rest is ignored (#5774)
fixes #3690
4 years ago
Mustafa Ali Mutlu 1a7fa9f9e4 [fix, plugins] Evernote: confusing info/error message when exporting bookmarks (#5765)
Remove unnecessary all_count == 0 check, because of it no condition holds true.
4 years ago
Rafael Fontenelle 4e5779199d [plugin] fix netsh command (#5744)
The edited `netsh` command line had errors:
1- missing v4tov4 (or v6 variant)
2- should have `=` instead of `:`
3- typo in listen(ing)address and listen(ing)port
4 years ago
poire-z 0599c440cc [RTL UI] Bidi-wrap filenames, paths, urls, metadata
bidi.lua:
- Revert "Alias everything to Bidi.nowrap() when in LTR UI,
  as using LTR isolates seems uneeded when already LTR" (part
  of a628714f) which was a wrong assumption: we need proper
  wrappers for all things paths. Enhance some of these wrappers.
- Fix GetText RTL wrapping which was losing empty lines and
  trailing \n.

- Wrap all paths, directories, filenames in the code with
  these wrappers.
- Wrap all book metadata (title, authors...) with BD.auto(),
  as it helps fixing some edge cases (like open/close quotation
  marks which are not considered as bracket types by FriBiDi).
  (Needed some minor logic changes in CoverBrowser.)

- Tweak hyphenation menu text
- Update forgotten SortWidget for UI mirroring
- KoptConfig: update "justification" index for RTL re-ordering,
  following the recent addition of the page_gap_height option.
4 years ago
Mustafa Ali Mutlu 7b0b5d5ba7 [fix] Crash when exporting notes (#5677)
Fixes https://github.com/koreader/koreader/issues/5609
4 years ago
Frans de Jonge dc4453eb7f
[fix, plugin] Don't show full widget together with isOnline() (#5575)
Fixes https://github.com/koreader/koreader/issues/5415

Cf. https://github.com/koreader/koreader/pull/5452 https://github.com/koreader/koreader/pull/5573 https://github.com/koreader/koreader/pull/5574
5 years ago
Mustafa Ali Mutlu 16d0e380ea [Plugin] Support for exporting annotations/bookmark renames (#5440)
Changes :parseHighlight() to parse renamed bookmarks/highlights

see #5408
5 years ago
Mustafa Ali Mutlu a0e2f02c32 [Plugin] Joplin support (#5431)
Adds joplin support, fixes https://github.com/koreader/koreader/issues/5086

Changes
-adds a submenu to evernote menu 
   - -Joplin
      |-Set IP and port
      |-Set authorization token
      |-Export to Joplin
      |-Help

-adds EvernoteExporter:exportBooknotesToJoplin()
-adds JoplinClient.lua
-modifies html_export, txt_export and joplin_export flags to work with each other. (eg if user selects one others deactivated)
5 years ago
Frans de Jonge 2c555830f9
[feat, i18n] Implement ngettext (#5257)
Fixes <https://github.com/koreader/koreader/issues/5249>.

See https://www.gnu.org/software/gettext/manual/html_node/Plural-forms.html and https://www.gnu.org/software/gettext/manual/html_node/Translating-plural-forms.html for more information.

Usage:
```lua
local T = ffiUtil.template
local _ = require("gettext")
local N_ = _.ngettext

local items_string = T(N_("1 item", "%1 items", num_items), num_items)
```
5 years ago
Frans de Jonge 6ed58346a1
[i18n] Add translator notes (#5250)
Thanks to <https://github.com/koreader/koreader/pull/5237> we can now  extract the knowledge currently embedded in Transifex and put it directly in our source. This positively affects <https://github.com/koreader/koreader/issues/3754>.

Translation instructions and knowledge that comes out of localization-related questions should be preserved in the source, because Transifex is too ephemeral. For example, the links from <https://github.com/koreader/koreader/pull/2290> are no longer accessible. Even when they are, it's quite useful to have this information around while dealing with the code as well, and I also hope it'll be informative to contributors who seldom visit Transifex.

This commit also makes a few minor changes to obviate the need for comments where possible.
5 years ago
Frans de Jonge a2dcfe9aec
[doc] Tag @todo, @fixme and @warning (#5244)
This commit standardizes the various todos around the code a bit in a manner recognized by LDoc.

Besides drawing more attention by being displayed in the developer docs, they're also extractable with LDoc on the command line:

```sh
ldoc --tags todo,fixme *.lua
```

However, whether that particular usage offers any advantage over other search tools is questionable at best.

* and some random beautification
5 years ago
Frans de Jonge 5eff127cf6
[fix, lang] Typo in Evernotes description (#4173) 6 years ago
Robert 5344e0b672 [Fix] Don't load disabled plugins (#4169) 6 years ago
Robert 4428ecb422 Plugin manager (#4159)
Also adds descriptions to all plugins.
6 years ago
onde2rock e502bf04d3 [feat, UX] Support the virtualKeyboard on non touch-device (#3796)
* [VirtualKeyboard] Add support for keynaviguation

Also rename the variable "layout" to "keyboard_layout" because conflict
with the layout from the focusmanager

* Make the goto dialog compatible with key naviguation

My solution is to change the order of the widget. The last one will the
virtualkeybard so it catch all the keybinding, and below it, make the
dialog "is_always_active = true" so it can receive touch event.

* Correctly show the virtual keyboard on dpad devices

* change the order to call the virtualKeyboard so it end up on top

* Handle the multi input dialog

* Support reopening the virtualKeyboard by the Press key

* add check focusmanager

* Fix https://github.com/koreader/koreader/issues/3797

* MultiInputDialog : Now work on non touch-device

* Set the virtualkeyboard to be a modal widget

* Fix the layout in multiinputwidget

* Fix for the various combination of
hasKeys,hasDpad,isTouchDevice

* [Focusmanager] Better handling of malformed layout
6 years ago
Frans de Jonge a970a1f034 MenuSorter: fix outside testability (for potential unit tests) 7 years ago
Frans de Jonge 8f31a81601 MenuSorter: some documentation
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
7 years ago
Frans de Jonge 5b20106db7 MenuSorter: initial implementation
* Menus are now sanely configurable
* Custom separator placement for clearer menus
7 years ago
Hzj_jie e974476099 A crash will be triggered in evernote plugin if a history file is empty (#2604) 7 years ago
Hzj_jie 819952ca54 Several minor improvements of evernote plugin (#2573)
* Several minor improvements of evernote plugin
7 years ago
Frans de Jonge 6257bae77f Language: mostly Wikipedia-related changes 7 years ago
Hzj_jie 529d1b3d33 evernote: ReadHistory integration and text file output (#2498) 7 years ago
Hzj_jie 9b605c95a0 Rename onSaveSettings to saveSettings 7 years ago
Hzj_jie 6b8ff76507 EvernoteExporter plugin can be docless 7 years ago
Hzj_jie c662ca4cc8 Load plugins also in FileManager (#2426)
added is_doc_only plugin attribute
7 years ago
Qingping Hou a6c506dc10 kobolight(refactor): move into plugin & only enable for kobo 8 years ago
Qingping Hou bd43e59fe7 fix: disable network info menu when device is not connected 8 years ago
Qingping Hou 854043e18d chore: fix all luacheck errors for plugins 8 years ago
Qingping Hou 93873bfd69 plugins(chore): fix static check errors 8 years ago
Qingping Hou 20eb36a03d feat: add network management UI for kobo 8 years ago
chrox 41f2fe85b7 fix #2119 by updating libSDL2.so and fix Evernote Plugin 8 years ago
Frans de Jonge 5638819f25 Removed a bunch of "successfully", replaced an ellipsis, and some deviant spellings of KOReader. 8 years ago
Allan Nordhøy bc16ed5035 Spelling of calibre and KOReader. Ellipsis. 8 years ago
Qingping Hou 467199285f minor: rename Koreader to KOReader 8 years ago
Qingping Hou ac9888f106 fix: use ffi/md5 in plugins 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
chrox db064fc009 add toggle wifi status on PocketBook 9 years ago
Frans de Jonge 73a6f71a0b Prevent spaces from being eaten by Transifex
Fixes #1276
10 years ago
Frans de Jonge 6a7e6ed6ca Some English improvements in evernote.koplugin 10 years ago