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
displaying font information in a virtual message will be helpful. #4908
Comments
Comment 2 by briang1 on 2015-02-13 08:54 |
Comment 3 by dineshkaushal on 2015-02-20 10:46 In the current implementation, there is a problem that i am unable to fix. Escape does not work unless you move away from the dialog and come back with alt plus tab. Checkout branch in_t4908 |
Comment 4 by nvdakor (in reply to comment 3) on 2015-02-20 11:10
Hi, |
Comment 5 by leonarddr on 2015-02-20 14:48 |
Comment 6 by dineshkaushal on 2015-04-09 13:54 I have updated the fix. Checkout branch in_t4908 |
Comment 7 by dineshkaushal on 2015-08-27 13:16 now using os.path.realpath to find the full path of the htmlMessage.html file which is a template. |
Comment 8 by dineshkaushal on 2015-09-30 13:07 ==== General ==== I have renamed the file to message.html There is commented out code/junk in several parts of this work, as well as some unnecessary blank lines at the start/end of files. This should be removed. Please make sure you're reviewing your own diffs before submission; this would have been caught in your own review. Removed The documentation needs to be updated in both the docstring for the script and the User Guide to specify that pressing report formatting twice displays the information in browse mode. Updated the docstring. Once it is accepted, will update the user guide as well. ==== HTMlMessage.html ==== Removed The focus_away function just contains commented out code and should be removed. Removed Please use camel case for the function names; e.g. escapeKeyPress. Corrected Indentation of the js code is inconsistent and/or non-existent in various places. Fixed To be consistent with the rest of the NVDA code, braces should be on the same line as the statement the block is associated with. Done In window_onload, you split the args at semi-colons. What if the message contains a semi-colon? The split should only be done for the first semi- colon. Fixed by adding second arguement as 2 to ensure semicolon is only used once. message_id should probably be a div (block) instead of a span (inline). Changed ==== globalCommands.py ==== Fixed I don't think it's useful to display "No formatting information" in a dialog. I realise you're trying to be consistent here--pressing twice should always pop up a dialog--but I think this is going to be more annoying than helpful. Now pressing nvda + f twice is showing message only when format information is available. For HTML, I wonder if we should display each bit of the formatting info on a separate line to make it easier to consume; i.e. join with line feed instead of space for HTML. Thoughts? I tried, but it is not working as it seems that there is only 1 element for format information. I added etc during join operation. ==== ui.py ==== Fixed The docstring for HTMLMessage isn't useful to developers wanting to know what the function actually does. It should explain that it displays the message in an HTML document so that the user can read it with browse mode. Corrected The function is called HTMLMessage, but it takes a text string. This is incongruous. Should we perhaps rename this to "browseableMessage"? Changed There should perhaps be the option of providing HTML input; e.g. isHtml=False keyword argument. Changed innerText to innerHTML, now html text should work The title "NVDA Message" needs to be made translatable. Also, although this should be the default, I think it would be good if this could be customised; e.g. title=_("NVDA Message") keyword argument. Added additional parameter to provide dialog title. I am using font as title for nvda + f, but may be it can be "format". Please check in_t4908_fresh on https://manish_agrawal@bitbucket.org/manish_agrawal/nvda.git I have created a new branch from master as earlier branch is 7 month old. |
Comment 9 by dineshkaushal on 2015-10-07 10:08 |
Comment 10 by jteh on 2015-10-26 05:08 GlobalCommands.script_reportFormatting
message.html
ui.browseableMessage
User Guide
|
Comment 11 by jteh on 2015-10-26 11:14 |
…ation in browse mode so it can be reviewed. You can now present a text or HTML message to the user in browse mode using ui.browseableMessage. Fixes #4908.
Incubated in cd5ba70. |
Pull request: #5593. |
Incubated in 92a1bcd. |
It slightly puzzles me why this functionality is implemented this way with a HTMl template. Honestly, I prefer an implementation as proposed by Joseph in comment 4 |
Also found a little bug in here: STR:
|
Using HTML allows for content other than just text; e.g. links, headings, etc. I don't see a disadvantage with this approach using plain text; you can still just press escape to close it. |
I found the cause of the problem. I had set tabindex=-1 for body in message.html, so the focus was not getting there. The fix is to set tabindex=0. I tried to checkout branch t4908, but could not find it. Making changes in in_t4908 is difficult as you made some changes after taking code from there. Please suggest what should be done? |
The branch is called i4908 in the nvaccess/nvda repository. We use "i"
for issue now instead of "t" for ticket.
|
I tested with the test build given with the fix. the issue is with tab and alt key is not present now and is fixed. |
Incubated in 0feb4fe. |
Just a thought. Should we hash and store the hash of the message.html file in the python code? This way it is resistant to tampering. Otherwise, could it be somehow packaged somewhere where someone couldn't mess with the HTML document as easily? My concern (not that big of a deal really) is that someone could replace the message.html file on the fly in someones NVDA install, and then they could cause the message to present interesting things. For a proof of concept, go to NVDA's installation directory, (bad if it is on an external usb drive because this isn't admin privlages required), and add this code. <script> function windowOnLoad(e){document.body.innerHTML = "proof of concept self distructing evil file.";}
function escapeKeyPress(e){document.location = "http://nvaccess.org";}
</script> It is not a huge vonerability though. |
Someone could certainly do this, yes. However, they could also just replace a dll, executable or some other file. Unless I'm missing something, there's nothing particularly special about this file. If we're worrying about someone replacing this, one must equally worry about any file being replaced anywhere for any app.
|
Yeah. That's a good point. |
Also, the virtual message only uses internet explorer when a link is pressed. Is this known behavior? |
Found another little bug. When rpessing nvda+f more than twice, multiple formatting windows are opened. Hold instert and press f four times, for example. |
In that case, it turns out that NVDA is opening a font window to display On 3/14/2016 9:30 AM, Leonard de Ruijter wrote:
Websites: email me at derek.riemer@colorado.edu mailto:derek.riemer@colorado.edu |
Ug. That's kind of annoying. I suppose it makes sense; this function actually uses IE behind the scenes to render the HTML. The question is whether there's any way we can force it to use the shell to open external URLs. @dineshkaushal, can you look into this?
The code displays the window if there was more than 1 press. We should instead explicitly make this 2 presses. |
@jcsteh
On 3/15/2016 5:00 PM, James Teh wrote:
Websites: email me at derek.riemer@colorado.edu mailto:derek.riemer@colorado.edu |
Sure, but I don't consider this to be a bug. If you want formatting info
for your formatting info, that's your business. It's a valid (if stupid)
use case. Unless you can give me some reason it isn't valid...
On the other hand, opening another dialog when you press it three times
is not valid, since it's only documented to do it when you press it
twice. It's also more likely to be accidentally triggered due to a
finger slip or the like.
|
I was just mentioning the fact that it exists because I'm pretty sure that's what you were referencing when you were quoting it. It had looked like you had misquoted it but maybe I misunderstood what you wrote. Sorry Sent from my heavily encrypted iPhone.
|
Shouldn't we actually just block people from opening multiple formatting
information windows in a simlar way we do with configuration dialogs?
|
Well, stuff other than formatting dialogs could use browseable messages,
so that question has to be broadened to any browseable message.
Honestly, I don't know if there's scope for allowing multiple messages
to be open at once. It doesn't seem like we should block it just for the
sake of it.
Multiple settings dialogs are only prevented because settings can depend
on each other. For example, if you open both Voice Settings and
Synthesizer, change your synthesizer and then try to use the Voice
Settings dialog, things will be broken because Voice Settings doesn't
know about the synth change (#603).
|
I see your point. However, multiple formatting windows create confusion
about what window is for what formatting. Couldn't multiple formatting
windows be disabled regardless of other browsable messages?
|
Because the formatting dialog is (and must be) modeless, it isn't
trivial to prevent more than one dialog. In fact, I'm not even sure
whether there's a way to get a callback from that dialog when it closes.
|
… presses; i.e. don't allow the third press, etc. to open another dialog. Re #4908.
Why does this say formatting 2 or 3 times?
|
The 'center' option for HTML dialog is specified, however, the actual dialog position is not center on screen.
|
Reported by sumandogra on 2015-02-12 07:16
NVDA needs to have A virtual message window displaying all the font information.
With NVDA+F, NVDA gives information about font but there is no way one can read through the font information. This information is helpful for those who have a lot of information related to font important for them during proofreading and formatting a document.
Suggestion: this can be introduced in the form of a dialog that can be closed by just ESC.
The text was updated successfully, but these errors were encountered: