Add a script to browse mode to toggle inclusion of layout tables#7634
Merged
Conversation
Collaborator
|
Nice work! |
derekriemer
approved these changes
Sep 30, 2017
| def script_toggleIncludeLayoutTables(self,gesture): | ||
| if config.conf["documentFormatting"]["includeLayoutTables"]: | ||
| # Translators: The message announced when toggling the include layout tables document formatting setting. | ||
| state = _("include layout tables off") |
Collaborator
There was a problem hiding this comment.
Maybe "layout tables off" or "layout tables disabled" might be more easy to understand.
Collaborator
Author
There was a problem hiding this comment.
I went the layout tables off route. Also fixed the translator comments in the process.
| config.conf["documentFormatting"]["includeLayoutTables"]=True | ||
| ui.message(state) | ||
| # Translators: Input help mode message for include layout tables command. | ||
| script_toggleIncludeLayoutTables.__doc__=_("Toggles on and off the inclusion of layout tables in browse mode") |
Collaborator
There was a problem hiding this comment.
Do you need a category attribute here? I'm not familiar with this code.
Collaborator
Author
There was a problem hiding this comment.
Nope, the category is set on the class itself, so all the scripts have the category that the class prescribes.
michaelDCurran
approved these changes
Oct 17, 2017
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Link to issue number:
None
Summary of the issue:
Some tables on the web, even though they have data, are treated as layout tables as they don't follow the convention that headers are required for a table to be treated as a data table. It is currently not possible to switch inclusion of layout tables on the fly while in browse mode.
Description of how this pull request fixes the issue:
Adds an unbound script to browse mode to toggle layout tables. Even though this is a document formatting setting according to the config spec, I made this browse mode only due to the fact that from a UX perspectieve, this is a browse mode setting.
Testing performed:
Toggled this setting while in a layout table in Firefox browse mode, detection changed on the fly as expected.
Known issues with pull request:
None i'm aware of
Change log entry: