One of the calls was obviously a typo dup, and the other
call is already covered by clear_box().
(imported from commit 448dc4c0f265cc7260ea08f0468a7d1440903e3c)
Due to the code removed in this diff, we would put you
back to your original reply stream/topic/sendee
(imported from commit 6e1f4666e3b32b057e692e015782780f7c734445)
The flag has been set to true for a while, so we removed
the flag and a bit of dead code associated with it. This
change should not affect any functionality on any realm.
(imported from commit 8d457f52584173994d0e5e83ca326f892cd90057)
Use information from the server to figure out if we should prompt for
bankruptcy, rather than trying repeatedly inside load_more.
(imported from commit ccb8cb1ce482b8bf3d343e7324fef7981880282d)
We instead implemented the ~desired functionality here using the
API and a bot to make a totally read-only, static, slowly-updating
view into the Zuliverse.
This is the moral equivalent of reverting deb035b4c702fcdb0e660ed549fe74c682abb6d9
(imported from commit 9d743fe82f197b37f005e5a038f77cc4b8566024)
1) The class Filter now lives in its own module.
2) The function canonicalized_operators() is now a class method on Filter.
3) The function message_in_home moved to filter.js and became private.
4) Various calling code had to change, of course.
5) Splitting out Filter helped simplify a few tests.
(imported from commit e41d792b46d3d6a30d3bd03db0419f129d0a2a7b)
* We now clear the validation errors when the input box is de-focused
* We make the left sidebar height accommodate the validation error messages
(imported from commit 4b39bfd3e8e8dd707722492a3f98967ee4ccf0ab)
To get to the bottom of the too-much-fading regression,
it was necessary to clean up the code, which was overly
complicated by multi-purposed functions.
The API for compose_fade now has these functions:
set_focused_recipient
start_compose
clear_compose
update_message_list
update_faded_messages
Internally there is now a notion of "normal display",
so e.g. when you want a normal display, we call
_diplay_messages_normally() internally, which removes the
faded/unfaded classes from all messages.
(imported from commit 7eb2b0a163f29d9ebae26661f432fecc7c331e4c)
Previously we would just discard the results of get_old_messages,
which meant that any messages sent either while you were doing the
tutorial or that you started out with (as in the case of the CUSTOMER3
experiment) would be lost until you reloaded.
(imported from commit f5280c091ab6ed7c2af6eb8fe49c0fa6b997ac97)
This makes fade/unfade start sooner (good), but it might
re-introduce some typing sluggishness (bad).
(imported from commit 4e3112ed1ac931f2931182f91b60567ef2d72695)
When starting a compose, call compose_fade.set_faded_messages,
which will immediately do fade/unfade logic, whereas before
the code path went thru debouncing logic.
(imported from commit 7d0b30435be32a7132dbf05bf064b03b925a2d42)
Move code from compose.update_fade() into
compose_fade.set_focused_recipient(), which makes it
so that we only have to send the msg_type.
(imported from commit c17665d9f34f525bdedcd36d39d3a112fa36a914)
The code in unfade_messages() is O(N) over the number of
messages, but a simple flag allows us to track the fact that
all messages are unfaded, so we can short circuit the O(N)
logic in many cases.
A typical scenario now would be that you start typing a
stream while the topic is still empty. Modulo debouncing,
every keystroke now leads to a call to unfade_messages(),
but this change only does real work the first time.
(imported from commit da07cf408bbdbf5b381ff3ec33a5e05e34eef5b5)
The compose_fade has three public exports:
set_focused_recipient
unfade_messages
update_faded_messages
All code was pulled directly from compose.js, except for the
one-line setter of set_focused_recipient. The focused_recipients
variable that used to be in compose.js was moved to compose_fade.js,
hence the need for the setter.
(imported from commit 462ca5d0d0bd58612d0197f3734a8c78de8c6d30)
"Kiosk mode" is a "read-only" Zulip suitable for embedding into
an iframe on another site. I say "read-only" in quotation marks,
because the account is still a fully-fledged active account on
the server, and we just tear out a bunch of stuff in Javascript
(that a malicious user could easily re-enable).
So in that sense, it's not actually safe in security-sensitive
environments -- malicious users logged in via kiosk mode
can do anything the kiosk-mode user can do.
(We need this functionality for the customer3 realm specifically;
we'll possibly just tear this code back out once that experiment
has run its course.)
(imported from commit deb035b4c702fcdb0e660ed549fe74c682abb6d9)
This fixes Trac #1567.
This is kind of a big hammer approach, though. If we did support
spellcheck on other platforms (without doing more work), this might
actually potentially disable it.
But we don't, so this is mostly a non-issue for now.
(imported from commit 74dcb42b19c37e1e8d1e9a2b265e1e6ae0cc2c67)
There are also one or two places we don't need to use it for security
purposes, but we do so for consistencey.
(imported from commit aa111f5a22a0e8597ec3cf8504adae66d5fb6768)
util.enforce_arity takes a function and returns a new version which
throws an error if an incorrect number of arguments (as determined by
the function prototype) are passed.
(imported from commit 20e69a6dc7b6f8455726ab4fae8d5b7b04dc4103)
This fixes trac #1357, which says that some users get annoyed
when the system keeps generating the same color for them, which
would happen if they didn't like #76ce90 and kept picking a
new color for their streams.
(imported from commit 0fdb726aad4009332cc056a5e98bb39e01ef414c)
Instead of splicing up a cloned copy of stream_assignment_colors
every time somebody uses a color, we just rebuild a hash
of used_colors from our subscribed streams when we need to assign
a color, and we avoid calling into stream_color.pick_color() when
a stream already has a color.
This change has a slight functional impact in the situation where
a user unsubscribes some streams during their session, because
we weren't "reclaiming" colors before on unsubscription, but the
simple approach gets that for free.
(imported from commit adf360365bdf1ae9db99c533a0bde62d91f5dfe8)
This is a pure refactoring that mostly just moves code from
subs.js to the new stream_color.js and updates module references
accordingly. In order to prevent introducing some exports,
update_stream_color was given an additional "sub" parameter
and update_stream_sidebar_swatch_color was given an "id"
parameter.
Killed off unused initial_color_fetch var.
(imported from commit b7644ce67f50d31fb46f564d758d661eea776aa6)
Fixes the blueslip error on "i" in empty narrow.
Also removes a then-uncessary check from do_narrow_action as suggested
by acrefoot.
(imported from commit 10b1f702b535b4eef54e500ccef93b6a5280e953)
Summarized messages are not shown and cannot be selected. If
`opts.use_closest === false` and you try to select a summarized
message, we still have to use the closest instead of failing.
Eventually, we'll make summary rows selectable, but that would be
rather involved since selections are managed by ID, summaries exist only
in the DOM, and many parts of the code get the selection and expect
it to be a message.
(imported from commit 998c4f24aece84528cc9da53a47f9e4f5391702d)
On a page load or reload, the browser will, at an idle time, scroll to
the top of the page. We can't intercept this browser-induced scroll,
so to make sure it doesn't in interfere with our scrolling to the
correct place in your message feed, we let the browser scroll happen
before the work we do on page load.
(imported from commit f5f441ab90bcdb8404e05caea3c6da81a3a6fc1e)
This commit makes keep_pointer_in_view() less aggressive when
the pointer is toward the top of the screen. If the pointer is toward
the top of the screen, then as long as it's fully on the screen, we
don't pull the rug out from under the user and change the pointer.
An important benefit of this change is that we fix trac #1608,
which was a bug where autoscrolling interacted with
keep_pointer_in_view() to push messages past the top of the screen
before they were read.
(imported from commit e39926df99bfaedd5c0757f1241887ccd9b93fab)
The helper functions now return true when a message is on
screen, not when it's off screen, and the names have been
changed accordingly. I also eliminated the at_end parameter,
which was kind of abstract, by having message_is_far_enough_up
and message_is_far_enough_down handle those details.
(imported from commit cdb1543e430f49f23eb1b3a88d9aaff95ce7ca74)
* Move the state into a closure to duplicate it for multiple queues
* Use _.debounce instead of manual setTimeout fiddling
* Have it handle manipulating the message flags
(imported from commit 938f51fd666131a3cec5901d3f3fdd39e203b462)
Functions were supposed to check that messages were unread before
passing them to process_read_messages, but some didn't.
The `mark_messages_as_read` function was essentially that, so
take that name.
(imported from commit 2917fe30d2defb8a047ec32e1bc70d379779276b)
When you read messages in a narrow and then un-narrow, collapse
adjacent messages read in the narrow into a summary row that can
be clicked to expand those messages.
Scoped to staging with feature flags.
The implementation of this within our current MessageList is rather ugly.
(imported from commit bcb3a39d8c0c334136fe86318f18ead03f0f50bf)
Adding a span for CSS reasons in the presence list indicator
broke the click handler if you clicked the presence circle directly.
(imported from commit 1aa28755d849a1f2a5a06aeb4cc27ca368730c35)
If you entered "stream:Denmark " in the search box, we would show
you two suggestions for "stream Denmark", despite our duplicate
detection, because we didn't canonicalize the suggestion that is
literally based off the user typed query, and so the other way
of generating the "stream Denmark" suggestion created a duplicate.
Now all the suggestions we generate are canonicalized, so the
generalized duplicate detection can work.
(imported from commit 52bf08ccf9bb2e2260ca8c20690169aead3732ab)
This was introduced in a71867c2435790, intended to fix#1287.
Very subtle bug. The problem was that we were attaching a click handler
to two selectors, a link, and a div that the link is inside of.
Since the link was a descendant of the other selector, clicking the link
created TWO click events, and the second click on a stream box while
already narrowed to that stream jumped you to the end.
We should be careful of this in the future — never attach an event
handler to two selectors, one of which is contained in the other.
(imported from commit f428f593280e80c90b2665d1dfbff1df8a39bd35)
When you are narrowed and hit "New stream message", the topic
will autofill. This broke during the subject-to-topic
transition.
(imported from commit a9b471884c5cdae449e02ce7aa782add4a178077)
For now, we just get emails about referrals that we have to follow up
on manually.
I don't love using the name "referral" in some places and "invite" in
others, but we already use the verb "invite" to mean something else
and "invite" is a canonical noun.
(imported from commit 0814c18395952fcdef234c1584984f71ca1b6f37)
This restores the feature that hitting down when you are at the
last message automatically centers the last message. This is not
a pure revert, because some additional code now goes through
navigate.down.
(imported from commit 2db1f247692ba068613a2d6c93f18ca7c13a16b8)
We now only suggest "Home" if you have an empty search box (suggestion #1),
or if you are typing "Home". Before we'd show it as a way to get back
from various narrows. This is trac #1596.
(imported from commit 9228bf45e9aaf9912d83efdf70338abb4b7e054f)
We always intended to move the pointer up when you were at the
top of the viewport and scrolling up, and we always intended to
move the pointer down when you were at the bottom of the viewport
and scrolling down. We didn't intend to move the pointer up
when you were at the bottom, or vice versa. This commit fixes
that bug, simplifies the code, and inlines the code into ui.js.
(imported from commit 77e2ace9d2fc1025e1349e3be13c76c3a397fd38)
We had a feature that if you hit the down arrow key when you
were at the last message, it would recenter you. Waseem has bought
into temporarily removing this feature. Justifications:
1) We can always put it back.
2) Autoscrolling makes it less relevant.
3) The feature complicated the code a bit.
4) The feature worked different for End than down arrow, due to
a FIXME.
5) It might have been a misfeature for users that want more
control over their own scrolling.
6) You can achieve the same essential effect by using PgDn
or space.
(imported from commit fa6874bb5d29d7057bb1601f0b6d577bac1272c7)
Moved 400+ lines out of search.js into search_suggestion.js. This
leaves search.js primarily responsible for lots of little DOM
interactions, whereas search_suggestion is more about data.
(imported from commit 53d08b29367c0172e483064f213538d45098279e)
1. Change code comment in search.get_suggestion.
2. Remove side effects from search.get_suggestions.
The function get_suggestions() was updating a module-scoped variable
called search_object, but now it returns a dictionary to its caller.
3. Greatly reduce the scope of the search_object var in search.js.
I also clarified the comment around it a bit. We could squeeze
the scope of search_object even further by using a function wrapper, but
this is a big enough win for now.
(imported from commit 4b633dd30ab45d24b85ea1d10df27df5aaa0c959)
For legacy reasons this function used to have convert item to
search_string via the search_object hash, because we used to
have an overly convoluted data model. The mid-July-2013
refactoring on search.js made the data model simple, and this
little bit of cleanup follows up on that.
(imported from commit aeea629862e4307897f24eaa5fc364f2b12a7c52)
This is a bit wasteful on most systems, but will result in their
looking pretty sharp on Retina displays.
(I also go and actually fix up the size we request for a bunch of
these so that they actually match the size of the gravatar in the
document -- previously we were requesting a size 30 gravatar when we
were displaying it in a size 25 space, which leads to unnecessary
ugliness upon resize.)
(imported from commit 9152e6e128e0ac38d97d893cb8243e3b9185351b)
This reverts a prior commit, but the earlier commit is fine
functionally; the earlier commit was a temporary measure.
Revert "Use POST, not PATCH, for patching bots."
This reverts commit c3146b23d5d7d134c2b80507eb87033ca375a4db.
(imported from commit ebfcb2bae72c11767f9750412440d40b7a2a4995)
* Only pop up on mouseover if you haven't completed the step previously,
and only on the first mouseover.
* Dismiss the popover if you click anywhere but the link
Trac #1471
(imported from commit 08904be59c15526f88a2633ebd6f2a046ec62197)
Now the @ has to follow a space, newline or certain punctuation, or be
at the beginning of the message. This addresses the frequent complaint
that typing an email address e.g. scott@zulip.com is hard, because after
the @, it would try to autocomplete.
(imported from commit 043953be3928b0acf2a4ab2b4dd1a80e1a1aa882)
Mark messages as read when with the pointer, but mark all messages
read if the last message is visible.
(imported from commit 4c1a928bd6966111f0f34c5207723656b5f193b9)
In the future, this could come from the server to enable individual
experiments on a per-realm basis.
(imported from commit 8fd1ba1910b3cfd131f58bab8efbd11a42053bc3)
The close() method will let you release handlers, as well as
doing everything clear() does.
(imported from commit 3a67c3f2226918cee10cf43598e0408fb186408a)
The set_up_file_input() function now returns an object to the user
with a clear field. This object will grow soon.
(imported from commit 7b3761eafddb392bd2c84a1685aa8d1811028a0f)
This is a temporary expedient measure to work around our
PATCH not supporting file uploads in our current Django setup.
(imported from commit c3146b23d5d7d134c2b80507eb87033ca375a4db)
Code prior to this commit was functionally working, but semantically
flawed — returning false does not short-circuit _.each like it does with
$.each. It now uses _.every, as suggested by Steve.
In addition I renamed the function to be more descriptive, added a
comment, and eliminated needless double negation.
(imported from commit b0666dfa01b2677b4eaf577fe9ced90ed0db2438)
They are synonyms, and Zukeeper consensus is that _.any makes it clearer
what the function does.
(imported from commit 847383e27ccefeaff1ecff15f4cb4177c9e40c25)
The previous regex didn't escape the period in '.d' and was doing a
case-sensitive match to find the base stream name.
(imported from commit 43ef13733987e50dcead06b7bd3e768cb4395998)
In a few cases the $.each was doing something imperatively that was
terser and easier to understand by using a different Underscore method,
so a few of these I rewrote.
Some code was using the fact that jQuery sets `this` in the callback to
be the item; I rewrote those to use an explicit parameter.
Some code was using $(some selector).each(callback). I converted these
to _.each($(some selector), callback).
One function, ui.process_condensing, was written to be a jQuery $.each
callback despite being in a totally different module from code using it.
I noticed this and updated the function's args.
(imported from commit bf5922a35f257c168cc09ec1d077415d6ef19a03)
Extract some local variables to set up the next refactoring, where
we can parameterize the function.
(imported from commit 1c2801131c19a54713a0d5c2cc26c419412339b0)