The setdefault() and num_items() methods are handy, and it was a
little tough to keep track of which objects were Dicts vs. {}.
(imported from commit 6ca81ac411943c59bef6d6bae39c7641feb5574b)
The click handler for collapsing was too broad, and it overrode
the ability to click to narrow from the recipient bar.
(imported from commit feeaa9becf8e400e319e1a77e5b72a33bb22854c)
Specifically:
* Add and style the sidebar toggle button to the header and remove the
gravatar.
* Add the logic for retracting the left side bar.
* Modify the logic for clicking on the referral pane to prevent it from
closing the sidebar.
* Modify the logic for clicking on the stream filters to prevent them
from closing the sidebar.
* Modify the logic for clicking on the stream settings dropdown and the
user info dropdown to prevent them from closing the sidebars.
(imported from commit 73e00eb834a6e87cb8d659fdcf6c2e06fff3731d)
This is experimental, for staging only. There might be a better
way to model this than dueling force_expand/force_collapse flags,
but it works for now. The code in collapse_recipient_group()
could also be DRYed up relative to expand_summary_row().
(imported from commit 107151d1ecd640970fb7700d41278a003bd1abaa)
This is to set up collapsing, but I think they could be useful
in general, so I'm keeping this is a separate commit.
(imported from commit 0da2b8ef246649f678c7cb6664ee78bf36aca076)
(The approach has been simplified to look for summary_row in
the DOM, which makes muted and summary features work off the
same code.)
(imported from commit 4fa3d6ae5ad7bbac5958e60ecffb368d6ef29d2e)
As part of this commit:
* Add and style a top right button that controls the sidebar
* Add the necessary styles for the right sidebar when it's in that mode.
* Add the logic for controlling the sidebar expansion
* Modify the logic for prevent default click events to generally
hide popovers correctly.
(imported from commit ca8063f6c62b436799f952e88541ff0ae8ba85fe)
This change will allow us to test the muting feature on
staging. Any topic named "muted" will automatically be
muted. You can also mute any other topic on the console:
muting.mute_topic('devel', 'ios');
current_msg_list.rerender();
More UI around this experiment will be coming soon, as well
as support for muting entire streams.
The muting module keeps track of which topics are muted, but a
user can expand muted messages, and once that happens, the
messages are marked with the "force_expand" flag that gets
persisted to the back end.
Muted messages are rendered in similar fashion to the summarized
rows, and as part of unifying some of that code, we have
made it so that expanding a summarized section doesn't remove
individual flags related to summaries; instead, the messages
get the force_expand flag set.
(imported from commit acee4190e63813d46850415c41ff8ebfae4a6953)
The old API took a dictionary; the new function works for one
person at a time, which allowed us to clean up the calling code
in ui.set_presence_list.
(imported from commit 0ae9d01491238d32915572c7efebf476d05fed4b)
I regressed this recently, thinking that all our operators are
strings, but I forgot about the "near:" operator used in the
"Narrow messages around this time" feature. The user facing
symptom was that the search bar showed up empty instead
of saying near:50, which might actually be the better
behavior, but it certainly was not intentional. :)
(imported from commit fcb93cecbe9a052bb9bc1af7fcac5aecaba5aafb)
I'm trying to move well-isolated methods out of narrow.js, so that
narrow.js is more strongly focused on UI/ajax interactions and
big, heavy lifting stuff. The logical home for parse/unparse
seemed to be Filter, and they brought along two private methods
with them. The big code moves involved trivial follow ups
like s/exports/Filter/.
(imported from commit ace0fe5aa1c7abce0334d079ba9eb8d9a57bd10f)
Have ui.set_presence_list() only touch the presence list.
Before this change, it was calling update_unread_counts(), which
has a bunch of side effects unrelated to the presence list.
(imported from commit 690f754d78874a03fa36f8ff8765d5a63e431d28)
This was broken in two ways:
1. Commit ad59d6f78042ce89, "Make the left sidebar and right sidebar
more consistent", pushed last Monday, changed the markup for the right
sidebar without changing a selector in stream_list.js that was looking
for the old markup.
2. Even then, whenever new user presence information came in, we would
rerender the user list and blow away the unread counts. This commit
patches around that by updating unread counts after rendering the user
list. I'm not sure what broke this or how it was working before.
(imported from commit 53ed40139e257e44411e918d1ecdce3a49e9ee51)
Trac #1479
All our typeaheads use this, but I made it an option that must be enabled
explicitly since it is not default bootstrap behavior.
(imported from commit 97852dc407d1f6dbe46b5fdd2c56d3ed8c6718d2)
This is like Python's dict.setdefault. I don't love the name, but
the consistency is nice.
We have lots of places where we do things like:
if (! dict.has('foo')) {
dict.set('foo', []);
}
var arr = dict.get('foo');
arr.push(3);
We can now write:
var arr = dict.setdefault('foo', []);
arr.push(3);
(imported from commit b8933809c69ba47ec346ed51d53966793403e56c)
This helps make our statuses more meaningful and should resolve trac #1534.
As part of this, we lower OFFLINE_THRESHOLD_SECS to 1.1̅6 minutes and
mark the user as idle after 5 minutes.
(imported from commit ee6b1ad203554a84b11e16c4c6195be9df5bcf4f)
This was caused by a branch I was working on conflicting with the
stream_data.js split.
(imported from commit 995dcf1412114bd36404b8c7ef66eb6f1e89648a)
keys() and other methods that implicitly return keys return the
casing used for the most recent set()
(imported from commit 47cac13c2b928fd19b07c44fd1504426fb36e3d8)
This means that we no longer need to unmunge keys at the expense of
having to store the original key.
(imported from commit 958c33c806b8b399e9a9290e4f14ef119d923c14)
This changes the mit.edu access rules from:
* Susbcriber list and inviting users to streams are unavailable
to
* Susbcriber lists and inviting users to streams are only available
for invite-only streams
streams must still be made invite-only manually.
This both cuts down on the amount of code that is different between
the mit.edu user experience and the standard one, as well as paving
the way for us to invite-only streams for zcrypt.
(imported from commit 24e0e85428608c05c89eeea349338dd392e5489a)
The function narrow.unparse() is used in a bunch of places in
the search suggestion code, and now it no longer lower cases
operands. This change contributes to fixing trac #1659.
(imported from commit 6b44b8a818482b5c8b4f9a45bc7d3a9d21e04eba)
Streams are converted to their "official" names now.
Topics are not canonicalized at all.
All other operands continue to be lowercased.
Since we don't lowercase stream/topic at the parsing stage,
we have to modify the predicate function to do the lowercasing
of stream/topic to enable case-insensitive comparisons. This
is slightly more expensive. The server-side predicate
functions are already case-insensitive.
(imported from commit 286f118c6c3ff9d23b37c7f958cab4c0eacd5feb)
This can be squashed with the prior commit or subsequent commit,
or it can just stand on its own, but it's part of transitioning
to a functional change in the next commit.
(imported from commit 155a0cdd28f851810fbedfef1a306e3190bf1c34)
If we have a stream named "Denmark" and we're narrowed to it,
then use "Denmark" as the default stream name in the compose box
even if the narrow operators are lowercase.
(imported from commit e9f06b7307c73231aa887dc95849e0307984e6f0)
This function returns the stream's actual name, if we can get it;
otherwise, it's the identity function.
(imported from commit 7a981adba9632d6c6eba54cb6514a9226d1e83e8)