Closed
Bug 984980
Opened 11 years ago
Closed 6 years ago
Keyboard shortcut to switch between preview mode and edit mode
Categories
(Bugzilla :: Bugzilla-General, enhancement)
Bugzilla
Bugzilla-General
Tracking
()
RESOLVED
FIXED
Bugzilla 6.0
People
(Reporter: rik, Unassigned)
Details
Attachments
(1 file, 3 obsolete files)
2.73 KB,
patch
|
gerv
:
review+
LpSolit
:
review-
|
Details | Diff | Splinter Review |
Github uses Cmd-Shift-P on Mac to do that and it's pretty neat.
Assignee: nobody → general
Component: Sandstone/Mozilla Skin → Bugzilla-General
Product: bugzilla.mozilla.org → Bugzilla
QA Contact: default-qa
Version: Production → unspecified
Updated•11 years ago
|
Severity: normal → enhancement
Updated•11 years ago
|
Assignee: general → acho.arnold
Updated•11 years ago
|
Target Milestone: --- → Bugzilla 5.0
Comment 1•11 years ago
|
||
This patch uses the keyboard shortcut Ctrl + Shift + P to switch between preview mode and edit mode when writing comments
Attachment #8396636 -
Flags: review?(gerv)
Comment 2•11 years ago
|
||
Comment on attachment 8396636 [details] [diff] [review] Patch for bug 984980 I'm fairly sure I remember reading that the a11y team said not to use aria roles for doing things like this. Surely there's a better way to detect whether we are previewing or not? glob: any issues with us watching every key event on these pages? Gerv
Attachment #8396636 -
Flags: review?(gerv) → review-
Reporter | ||
Comment 3•11 years ago
|
||
It would be nice to use Cmd-Shift-P on Mac instead of Ctrl-Shift-P.
Comment 4•11 years ago
|
||
>I'm fairly sure I remember reading that the a11y team said not to use aria roles for doing things like this Okey I didn't know about that fact >It would be nice to use Cmd-Shift-P on Mac instead of Ctrl-Shift-P. I'm sorry I only have access to a linux computer at the moment so I can't test Cmd on Mac. I would be very grateful if you could give me the keycode of Cmd on Mac
Reporter | ||
Comment 5•11 years ago
|
||
Cmd is 224.
Comment 6•11 years ago
|
||
This patch checks whether we are previewing or not without using aria It also enables Cmd-Shift-P to be used on Mac.
Attachment #8396636 -
Attachment is obsolete: true
Attachment #8399149 -
Flags: review?(gerv)
Comment 7•11 years ago
|
||
This patch checks whether we are previewing or not without using aria It also enables Cmd-Shift-P to be used on Mac.
Attachment #8399149 -
Attachment is obsolete: true
Attachment #8399149 -
Flags: review?(gerv)
Attachment #8399150 -
Flags: review?(gerv)
Comment 8•11 years ago
|
||
Comment on attachment 8399150 [details] [diff] [review] Updated patch for bug 984980 r=gerv. We should get someone with a Mac to test it once it is checked in. Gerv
Attachment #8399150 -
Flags: review?(gerv) → review+
Comment on attachment 8399150 [details] [diff] [review] Updated patch for bug 984980 Review of attachment 8399150 [details] [diff] [review]: ----------------------------------------------------------------- there's some minor few style issues with this patch that i'd like to see addressed first. ::: js/field.js @@ +1089,5 @@ > + // Store an entry for every key pressed > + keys[e.keyCode] = true; > + > + // (Ctrl XOR cmd) + Shift + P > + if ( (!keys[17] != !keys[224]) && keys[16] && keys[80]) { remove space between ( ( @@ +1092,5 @@ > + // (Ctrl XOR cmd) + Shift + P > + if ( (!keys[17] != !keys[224]) && keys[16] && keys[80]) { > + // Check if we are already in preview mode > + var Dom = YAHOO.util.Dom; > + if (Dom.hasClass('comment_preview_tab', 'active_comment_tab')){ you're only referencing Dom once, there's no need to create a variable for it @@ +1098,5 @@ > + document.getElementById('comment').focus(); > + YAHOO.util.Event.preventDefault(e); > + } > + > + else{ need a space after else ::: template/en/default/attachment/create.html.tmpl @@ +14,5 @@ > +[% javascript = BLOCK %] > + YAHOO.util.Event.onDOMReady(function() { > + YAHOO.util.Event.addListener(window, 'keydown', keys_pressed, [% bug.id FILTER none %]); > + YAHOO.util.Event.addListener(window, 'keyup', keys_released); > + }); this line is indented one level too much
Attachment #8399150 -
Flags: review-
Comment 10•11 years ago
|
||
This patch solves the issues raised by glob in comment 9 above
Attachment #8399150 -
Attachment is obsolete: true
Attachment #8401683 -
Flags: review?(glob)
Attachment #8401683 -
Flags: review?(glob) → review?(gerv)
Comment 11•11 years ago
|
||
Comment on attachment 8401683 [details] [diff] [review] A revision of my previous patch for Bug 984980 r=gerv. Gerv
Attachment #8401683 -
Flags: review?(gerv) → review+
Updated•11 years ago
|
Flags: approval?
Comment 12•11 years ago
|
||
I guess this gives us a framework for doing more stuff with keys in the future, too. My only question on this is should we do something to make this discoverable? It looks nice but it only works if you know about it.
Flags: approval? → approval+
Comment 13•11 years ago
|
||
Counting objects: 21, done. Delta compression using up to 4 threads. Compressing objects: 100% (9/9), done. Writing objects: 100% (11/11), 1.57 KiB | 0 bytes/s, done. Total 11 (delta 8), reused 0 (delta 0) To ssh://gitolite3@git.mozilla.org/bugzilla/bugzilla.git 23bad39..08f83a7 master -> master Thanks, Acho! Gerv
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Reporter | ||
Comment 14•11 years ago
|
||
\o/ If you can point me to a Bugzilla instance with that patch, I can do the Mac test.
Comment 15•11 years ago
|
||
The patch contained tabs, making Tinderbox to turn orange. To ssh://gitolite3@git.mozilla.org/bugzilla/bugzilla.git 08f83a7..b639a1a master -> master
Comment 16•11 years ago
|
||
Comment on attachment 8401683 [details] [diff] [review] A revision of my previous patch for Bug 984980 >diff --git a/template/en/default/bug/show-header.html.tmpl b/template/en/default/bug/show-header.html.tmpl >++[% javascript = BLOCK %] The extra + before [% javascript = BLOCK %] makes + to be displayed before <!DOCTYPE html>, which breaks the rendering of HMTL pages. Has this patch been tested?? + YAHOO.util.Event.onDOMReady(function() { + YAHOO.util.Event.addListener(window, 'keydown', keys_pressed, [% bug.id FILTER none %]); + YAHOO.util.Event.addListener(window, 'keyup', keys_released); + }); +[% END %] The indentation is wrong. Templates use 2 whitespaces, neither 4 nor 8. To ssh://gitolite3@git.mozilla.org/bugzilla/bugzilla.git 536c249..ae77f29 master -> master
Comment 17•11 years ago
|
||
This broke URL rewrites apparently, need to back it out for now (we just released with this in it and now have a broken release :( about to re-roll for unrelated reasons (wasn't the only regression) and the release will be easier without this, we can fix it and put it back after the release is re-rolled.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Comment 18•11 years ago
|
||
Patch backed out. To ssh://gitolite3@git.mozilla.org/bugzilla/bugzilla.git ae77f29..406dcbb master -> master
Flags: approval+
Comment 19•11 years ago
|
||
Comment on attachment 8401683 [details] [diff] [review] A revision of my previous patch for Bug 984980 See comments 15-17: 3 regressions in a single patch!
Attachment #8401683 -
Flags: review-
Comment 20•11 years ago
|
||
:-( I tested an earlier version but not the very latest one, as I understood it to be only fixing the "minor style issues" from comment 9. :-| So that's how I missed the extra "+". bePolite: can you tell us how you didn't spot that problem? My editor (geany) has very un-useful "show white space" (puts tiny dots in all whitespace) and "show line endings" (ugly "CR" or "LF" black text) options, but not the far more useful "show tab characters, plus any whitespace at end of lines" option that I'd like to see. :-( So I don't have an easy way of detecting patches with tabs. Is it required that reviewers run the tests with all patches they review, or do we expect the patch author to have done that? Gerv
Comment 21•11 years ago
|
||
(In reply to Gervase Markham [:gerv] from comment #20) > an easy way of detecting patches with tabs. Is it required that reviewers > run the tests with all patches they review, or do we expect the patch author > to have done that? The reviewer is supposed to run tests, especially with new contributors who probably don't even know that these tests exist.
Comment 22•11 years ago
|
||
(In reply to Gervase Markham [:gerv] from comment #20) > bePolite: can you tell us how you didn't spot that > problem? It seems i was just focused on solving the problem addressed by this bug that I didn't notice the side effects of my patch. I noticed the broken URL rewrites later but I also had no Idea that it was related to the javascript changes in my patch. I will endevour to be much more careful next time
Updated•11 years ago
|
Status: REOPENED → ASSIGNED
Updated•10 years ago
|
Target Milestone: Bugzilla 5.0 → ---
Updated•10 years ago
|
Assignee: arnold → general
Updated•9 years ago
|
Status: ASSIGNED → NEW
Comment 23•6 years ago
|
||
Bugzilla 6.0 will ship with the new modal UI created for BMO, which offers the keyboard shortcut.
Status: NEW → RESOLVED
Closed: 11 years ago → 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → Bugzilla 6.0
You need to log in
before you can comment on or make changes to this bug.
Description
•