Stub the blueslip module to print a nicely formatted traceback.
Earlier the traceback used to be only a `ReferenceError` because
blueslip was not stubbed.
Fixes: #4021.
This fix prevents us from calling the resize library for nearly
every single keydown event in the app (ouch!). Realistically,
this performance improvement only impacts folks who turned on
the autoscroll_forever feature, but it should be a significant
speed-up for them. We should go further with this fix, but the
main damage is undone.
We simplify hotkey mappings by using different hashes for
keydown and keypress events. There are browser bugs (iOS, for
example) where keypress events have the wrong keyCode values.
This led us, under iOS, to interpret "!" as "page up."
This fix also helps us disinguish escape from shift-escape.
Brock Whittaker helped on figuring out the keypress/keydown
issues that are addressed in this commit.
Fixes#4019
The drafts container was too skinny on mobiles, so the enforced
max-width of 60% should be ignored in favor of expanding to 90%
of the screen width.
This also fixes an issue where the content does not reach the bottom
of the container due to having too short of a height.
Fixes: #3867.
We have a somewhat janky mechanism for rendering message edits,
and before this fix, we were not unblurring the text boxes when
we closed the message editing session with the escape key, which
made it so that the escape key was unusable.
We had some ancient logic for typeaheads that was supposed to be
Firefox-specific, but I can't reproduce the code even running under
Firefox, and even if it did, it was returning true instead of false
for a long time, so I suspect the code has been wrong/irrelevant for
a long time.
The initial version of the tests cover most normal keys, but they
do not cover special keys like enter/tab/escape or arrow keys
or home/end/page-down/page-up yet.
When checking for hotkeys related to popovers, we avoid making
the external call for keys that won't be important for popovers.
This mostly helps testing.
Only check to see if the compose send button is in focus if
we dealing with backspace/shift_tab. As the comment notes here,
these sections of code are somewhat dubious.
The with_overrides() function no longer works at the module
level, so you can temporarily override one function in a module
without breaking more permanent monkey patches.
This makes us slightly more vulnerable to unintentional test
leakages, but it solves the problem where you often need lots
of temporary overrides for writer functions but you want to
keep a more permanent override for some sort of reader function.
The function with_overrides() uses the logic from the old
run() function in dispatch.js to allow you to call a test
function and override parts of the global namespace only
for the duration of when test_function runs.
We now pass in function names as 'foo.bar', which is a bit
easier to type/read/grep, rather than passing the module name
and function name individually.
This was originally introduced in
025b79d98b, which is far back in ancient
history when compose had a different shape (predates enter-sends,
too), and regardless, this code never affected anything but zulip.com.
validate_user_access_to_subscribers_helper never uses
stream_dict['realm__domain']. I imagine it was there originally to do the
is_zephyr_mirror_realm check.
Previously we used the topic "Realm.domain" for new user signups, but topic
"Realm.string_id" for the realm creation. This changes the user signup
messages to be on the same topic thread as the realm creation.