Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rationalize Links menu items. Supports WTF-8. Internal clipboard #4482

Merged
merged 4 commits into from Jan 15, 2019

Conversation

Projects
None yet
2 participants
@poire-z
Copy link
Contributor

commented Jan 15, 2019

Followup to #4477 (comment):

  • Remove duplicated "Show footnote popup". Have the same setting applied for Tap or 'Swipe to follow nearest link'.
  • Make some menu items enabled or disabled depending on if they would have some effect with the current state of other menu items, as some kind of visual self-documentation of these dependancies.
  • Add menu item to set the footnote popup font size, relative to the book font size.
  • SpinWidget: allow for showing some informative text
  • TouchMenu: show checkboxes in grey for disabled menu items

image

image
(wording corrections welcome :)

Also includes:

  • util.splitToChars(): supports text encoded in WTF-8
    WTF-8 is a superset of UTF-8, that includes UTF-16 surrogates in UTF-8 bytes (forbidden in well-formed UTF-8). https://en.wikipedia.org/wiki/UTF-8#WTF-8 https://simonsapin.github.io/wtf-8/
    We may get UTF-8 with these from bad producers or converters.
    We can get such chars in the text we get from Wikipedia API once their (fully valid) JSON has been decoded by our lpeg-based JSON decoder (which is a defect, hard to fix). (Our other pure-Lua json
    decoder has no problem and do that correctly). More details in koreader/crengine#252 (comment)
    We might also find these WTF-8 in some dictionaries, so let's support them.
  • Implement generic internal clipboard for all devices #4471 (comment)
    Will allow copying selected text from a book in the TextEditor.
    Will be overriden by devices that implement interactions with the system clipboard.

poire-z added some commits Jan 15, 2019

util.splitToChars(): supports text encoded in WTF-8
https://en.wikipedia.org/wiki/UTF-8#WTF-8
WTF-8 is a superset of UTF-8, that includes UTF-16 surrogates
in UTF-8 bytes (forbidden in well-formed UTF-8).
We may get UTF-8 with these from bad producers or converters.

We can get such chars in the text we get from Wikipedia API once
their (fully valid) JSON has been decoded by our lpeg-based JSON
decoder (which is a defect, hard to fix). (Our other pure-Lua json
decoder has no problem and do that correctly).
We might also find these WTF-8 in some dictionaries, so let's
support them.
@poire-z

This comment has been minimized.

Copy link
Contributor Author

commented Jan 15, 2019

My quick clipboard implemenation failed luacheck:

accessing undefined variable '_internal_clipboard_text'
setting non-standard global variable '_internal_clipboard_text'

Should I make them all (in android, sdl, readerhighlight and inputtext.lua) be a method (they are functions), that would accept a self, so we can use self._internal_clipboard_text ?
Or let this commit out till someone has a better idea?

@Frenzie

This comment has been minimized.

Copy link
Member

commented Jan 15, 2019

Just set it as local somewhere higher up?

@poire-z

This comment has been minimized.

Copy link
Contributor Author

commented Jan 15, 2019

Oh, right, as a module local ! Thanks for reminding me the obvious :)

@poire-z poire-z force-pushed the poire-z:links_menu branch from ac0abf0 to ceb6329 Jan 15, 2019

Show resolved Hide resolved frontend/device/input.lua Outdated

@poire-z poire-z force-pushed the poire-z:links_menu branch from ceb6329 to 139c424 Jan 15, 2019

@poire-z poire-z referenced this pull request Jan 15, 2019

Closed

footer font #4458

poire-z added some commits Jan 15, 2019

Rationalize Links> menu items
- Remove duplicated "Show footnote popup". Have the same setting
  applied for Tap or 'Swipe to follow nearest link'.
- Make some menu items enabled or disabled depending on if they would
  have some effect with the current state of other menu items, as
  some kind of visual self-documentation of these dependancies.
- Add menu item to set the footnote popup font size, relative to
  the book font size.
- SpinWidget: allow for showing some informative text
Implement generic internal clipboard for all devices
Will allow copying selected text from a book to the TextEditor.
Will be overriden on devices that implement interactions with
the system clipboard.

@poire-z poire-z force-pushed the poire-z:links_menu branch from 139c424 to 8086416 Jan 15, 2019

@poire-z poire-z merged commit a245630 into koreader:master Jan 15, 2019

1 check passed

ci/circleci Your tests passed on CircleCI!
Details

@poire-z poire-z deleted the poire-z:links_menu branch Jan 15, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.