Commit Graph

195 Commits

Author SHA1 Message Date
Tim Abbott 063d11b139 js: Standardize indentation of switch/case statements.
This gets my current draft eslint indentation configuration passing
cleaning on static/js.
2018-05-06 19:35:18 -07:00
Tim Abbott df98fd5cd9 hotkey: Make it possible to use ctrl+K from inside compose.
This works for other text boxes as well, but compose is the main one
that one would want to do a search from.

It's possible we'll find after doing this that "getting back into
compose" becomes a problem, but I guess we can handle that when the
time comes.
2018-05-06 19:30:31 -07:00
Aastha Gupta 66edc003ca hotkey: Make 'Ctrl' hotkeys work with 'CMD' on MacOS.
We only have a couple hotkeys with this model, but they should both
do the correct corresponding thing on MacOS.
2018-05-06 19:21:36 -07:00
Aastha Gupta 19806a0283 keyboard UI: Add Ctrl + k hotkey.
Fixes #8216
This commit binds the Ctrl + k to go to the search bar.
2018-05-06 19:19:00 -07:00
Tim Abbott 7ab8a8e820 js: Fix a bunch of indentation issues found by eslint.
This is preparation for enabling an eslint indentation configuration.
90% of these changes are just fixes for indentation errors that have
snuck into the codebase over the years; the others are more
significant reformatting to make eslint happy (that are not otherwise
actually improvements).

The one area that we do not attempt to work on here is the
"switch/case" indentation.
2018-05-06 16:25:02 -07:00
Steve Howell c63f2db25b hotkeys: Remove call to activity.blur_search().
The blur_search() function was removed in this commit:

See da06832837

We now no longer attempt to call it.  It's not completely clear
to me what this did before, but we are rewriting a lot of the
keyboard navigation for search anyway.
2018-04-28 11:15:14 -07:00
Tim Abbott e4c50ff4fd narrow: Remove unnecessary select_first_unread option.
We consistently either pass a `then_select_id` into narrow.activate,
or were using the select_first_unread option.  Now, we just compute
select_first_unread based on the value of then_select_id.
2018-04-22 21:33:33 -07:00
Anurag Sharma 1227857de6 hotkeys: Replace C with x for composing PM.
Pressing the 'x' key can now be used to compose a PM.
Pressing the 'C' key displays a modal that shows a deprecation notice.

Fixes #6548.
2018-04-01 16:13:05 -07:00
Steve Howell 9ce9c2f9db Extract info_overlay.js.
There are several ways we open help for keyboard shortcuts,
markdown help, and search operators.

    - from the gear menu
    - from the compose box
    - from the search box
    - hitting ? for keyboard help
    - arrowing/clicking through the tabs

This just moves the relevant code into a module and changes a
bunch of one-line calls in various places.
2018-03-30 09:07:23 -07:00
Tim Abbott 1e7dc70c7f reactions: Fix the hotkey for adding an emoji reaction.
This was incorrectly migrated in
a49655e0d4a868d3973e53cf8482b91aa2df1bb1; the toggle_emoji_reaction
function didn't expect this type.
2018-03-21 13:26:24 -07:00
Harshit Bansal a49655e0d4 emoji: Migrate realm emoji to be addressed by `id` rather than `name`.
This commit migrates realm emoji to be addressed by their `id` rather
than their name. This fixes a long standing issue which was causing
an error on uploading an emoji with same name as a deactivated realm
emoji.

Fixes: #6977.
2018-03-20 22:24:44 -07:00
Shubham Dhama 3b92f6115a hotkey: Add 'delete' to delete focused draft. 2018-03-09 13:30:09 -08:00
Abhigyan Khaund a75f0aa594 hotkeys: Add "p" to narrow to next unread PM thread.
This works simimlar to the "n" key for next topics.

This commit does a few things:

    * It wires up the hotkey to an existing function
      that could change narrows.
    * It adds documentation.
    * It adds logic to make sure the compose box does
      not open.

@showell helped a bit with the wording of comments here.

Fixes #4874
2018-02-27 07:20:31 -05:00
Tim Abbott 118dfb9690 hotkey: Document message_view_only with a comment.
fixes #8323.
2018-02-14 09:34:32 -08:00
Balaji2198 f49d9d016f hotkeys: Add '>' as a hotkey for quote and reply to message.
Tweaked by tabbott to fix a few minor issues.

Fixes #8146.
2018-02-02 17:37:53 -08:00
Steve Howell d5d11ff181 Disable message menu for locally echoed messages.
Wait until the server acks a message before we enable
the message popover menu.  This prevents a whole class
of bugs related to re-drawing the message and changing
the message id, and it also makes room for a little
spinner in the future.

Users with decent internet connections will generally
get server responses before they can click on the
chevron or hit esc/i, anyway.
2017-12-26 09:01:21 -05:00
Utkarsh Patil 1093d88fa0 hotkey.js: Navigate using page up / page down
Using page up / page down, go to the top / bottom of compose textarea

Fixes https://github.com/zulip/zulip/issues/7097
2017-12-12 09:55:50 -06:00
Brock Whittaker 2252d7e5f6 Revert "dark-mode: Add "T" hotkey for dark mode theme."
This reverts commit ce62abce73.

Fixes #7678.
2017-12-11 15:59:02 -06:00
synicalsyntax 6e353a0550 hotkeys: Clear compose box warnings with escape key.
Fixes #7531.
2017-11-30 11:55:50 -08:00
Tommy Ip 6e22847548 refactor: new message content -> compose textarea. 2017-11-28 12:53:40 -08:00
Brock Whittaker ce62abce73 dark-mode: Add "T" hotkey for dark mode theme. 2017-11-15 16:45:34 -08:00
Brock Whittaker 1bb45dd946 hotkey: Prevent hotkey interactions with pills.
This prevents hotkeys from firing when any of the pills or pill
input sections are focused.
2017-11-10 14:14:03 -08:00
Brock Whittaker d27882325c hotkeys: Refactor text selectors to be array.
This makes it easier in the future to see diffs and to add/remove text
selectors for hotkey prevention.
2017-11-10 14:14:03 -08:00
Cynthia Lin f63585bd6d hotkeys: Ensure navigation hotkeys do not work while overlay is open.
Fixes #7123.
2017-11-03 15:38:10 -07:00
Cynthia Lin e7de4f5d74 hotkeys: Modify draft toggle behavior. 2017-11-03 15:38:10 -07:00
Catherine Kleimeier fe2adeeee1 hotkeys: Fix ESC removing message feed focus in Firefox.
We correct a bug on Firefox where using the ESC key to close an edit
box that was opened by the left arrow key caused the message feed to
lose focus, making it difficult to navigate the message feed by
keyboard afterwards.

We fix this bug by changing the function that handles the ESC key
during an edit to pass the correct object to the message_edit.end
function.

Fixes #7072.
2017-10-27 17:11:12 -07:00
Harshit Bansal 1e50ec4039 hotkey: Rename `:` from 'open_reactions' to 'toggle_reactions_popover'. 2017-10-05 19:05:27 +05:30
Cynthia Lin c87ecf0f63 hotkeys: Prevent drafts overlay from showing while lightbox is open.
Fixes #6757.
2017-10-03 08:36:54 -07:00
Cynthia Lin c99f3d585d hotkeys: Prevent lightbox closing when message view hotkey is pressed.
Fixes #6757.
2017-10-03 08:36:54 -07:00
Harshit Bansal ef4337edcb hotkey: Remap `+` key to use canonical name for thumbs up emoji. 2017-09-26 16:50:00 -07:00
Joshua Pan 178f5080cf hotkey.js: Switch 'q' and 'w' hotkeys.
On a standard keyboard, 'q' is to the left of 'w', so it makes sense
for the hotkeys for the left and right sidebars to be `q` and `w`,
respectively, not the other way around.
2017-09-25 12:14:07 -07:00
Joshua Pan b201e2c311 hotkey.js: Simplify ctrl+[ hotkey logic. 2017-09-19 19:07:30 -07:00
Joshua Pan d387291b6c reactions.js: Extract open_reactions_popover().
Added tests for open_reactions_popover() also.
2017-09-19 19:07:30 -07:00
Joshua Pan 67064a46e5 compose_state.js: Extract focus_in_empty_compose().
Wrote some tests for the function also.
2017-09-19 19:07:30 -07:00
Cynthia Lin bd7d9da668 hotkeys: Disable 'n' stream creation if user cannot create streams.
Tweaked by tabbott to handle a corner case and add test coverage.
2017-09-16 09:12:38 -07:00
Harshit Bansal afba03f84e emoji_picker: Change reaction popover's base element.
Change the reaction popover to be based off the container elements
for the various message control icons. This will enable us to easily
control the visibility of the base element when the popover is opened
or closed. Also removes redundant `reactions_hover` class.
2017-09-16 08:17:41 -07:00
Joshua Pan 0fd9f0bcc9 hotkeys: Make 'v' hotkey toggle. 2017-09-14 05:56:55 -07:00
Joshua Pan 42b05912f8 hotkeys: Make '?' hotkey toggle. 2017-09-14 05:56:55 -07:00
Cynthia Lin f697e6bb0e modals: Implement new modal methods. 2017-09-06 09:35:16 -07:00
Cynthia Lin 1a0a29c41d hotkeys: Fix modal and overlay hiding on user settings.
Fixes #4811
2017-08-28 12:03:16 -07:00
Tim Abbott 3e1bf86ced hotkey: Make enter checks more strict.
This should hopefully fix an obscure traceback we were seeing.
2017-08-27 16:35:17 -07:00
Steve Howell 29c05c82f0 Fix A/D hotkeys for cycling through stream narrows.
We now use similar code for A/D hotkeys as we do for the "n"
key.

The old code was using jQuery operations that got tripped up
by our splitters between active and inactive streams.

Fixes #4569
2017-08-16 15:45:47 -07:00
Harshit Bansal 99d3668523 emoji_picker: Change emoji picker to be category based. 2017-08-14 12:52:35 -07:00
Jack Zhang c69b5d7d65 hotkey: Add support for hotspots on enter. 2017-08-05 18:32:37 -07:00
Joshua Pan ac64ee355d compose_actions.js: Allow compose to empty narrow.
This allows r/enter hotkeys to compose to
an empty narrow (no messages).

Fixes #4500.
2017-06-27 14:06:59 -04:00
Cynthia Lin e832ebdc98 hotkeys: Add collapse/show message hotkey.
Fixes #4540
2017-06-21 15:54:09 -04:00
Cynthia Lin a9afe43735 hotkeys: Add `u` hotkey for opening message sender profile.
Fixes #4873
2017-06-21 10:38:05 -04:00
Steve Howell d2b710b307 Add maybe_show_keyboard_shortcuts().
This prevents some strange UI experiences and some blueslip
errors by not opening keyboard help when other overlays or
popovers are open.
2017-06-15 10:15:29 -04:00
Tejas Kasetty dd7e27815f hotkeys: Disable navigation in background when overlays are active.
Fixes #5326.
2017-06-13 09:17:56 -07:00
Tim Abbott f724c0fbd3 hotkey: Fix 'P' hotkey narrowing to use first unread message.
Previously, this hotkey was not correctly using the use_first_unread
option, and thus would take you to the close to your pointer, not your
first unread private message.

Fixes #5238.
2017-06-05 15:21:47 -07:00