Commit Graph

3636 Commits

Author SHA1 Message Date
Steve Howell 6f73b7953f Have "n" key skip muted topics. 2017-05-17 11:28:33 -07:00
Harshit Bansal d827cc878b emoji.js: Remove unnecessary indirection.
Remove unnecessary function `emoji_name_to_css_class()` called while
populating `emojis_name_to_css_class` dict.
2017-05-17 08:09:50 -07:00
Harshit Bansal bf97734c57 reactions: Fix broken rendering of flag emojis in reactions.
Use the patched css classes for rendering flag emojis in reactions.
2017-05-17 08:09:50 -07:00
Harshit Bansal a549013c50 emoji_pickers: Fix broken flag emojis.
Due to differences between the codepoints of flag emojis in
`emoji_map.json` and iamcal's dataset, we need to patch the
css classes for the flag emojis temporarily until the migration
to iamcal's dataset is complete inorder to render them properly.
There is a difference between the images of flag emojis in our
old emoji farm and iamcal's spritesheets and since we have not
yet switched to using spritesheets for displaying emojis in
messages, there is a difference between the flag emojis as
rendered in messages and in emoji pickers.
2017-05-17 08:09:50 -07:00
Steve Howell 7d153c9f8a Revert "muting.js: Track muted streams using stream id."
This reverts commit c7f710b8d4.

Because the back end still stores muted topics fundamentally using
stream name as a key, trying to cut over the client to use stream
id was just making things more brittle.  Mutes would work after
renaming the stream, which was progress in the change that we
revert here, but only until page load.  The other problem, which
is more severe, is that the order of page loading functions would
cause no mutes to happen at page load time.  This could be fixed
to some degree, but we should do a deeper fix on the back end.
2017-05-17 07:06:32 -07:00
Tim Abbott a6af57e90d css: Fix floating recipient bar border appearing when bar hidden.
It's the .recipient_row, not the .floating_recipient element, that
gets `display: none` added when the floating recipient bar is hidden.
2017-05-16 23:50:38 -07:00
Rishi Gupta 8b9929e771 alerts: Restyle alert banners.
Changes the background to be white, among other things.
2017-05-16 23:34:45 -07:00
Cory Lynch 24cbd61131 css: Fix KaTeX summation alignment and line wrapping.
Previously, the sum (capital sigma) operator would become
misaligned so that the lower and upper bounds are placed in
the wrong location. Changing the line height fixes this alignment.

Also, previously, wrapping long lines of TeX did not work, as often,
the different lines of math would overlap with each other.

Fixes #4657.
2017-05-16 23:29:36 -07:00
Tim Abbott 34a8e6c3a2 gear_menu: Eliminate scrollTop for non-home tabs.
We should be able to eventually further clean this up to do nothing,
since we now don't have tabs over than the home tab.  But I'm leaving
that for a future issue.
2017-05-16 20:37:00 -07:00
Tim Abbott 72720fcf2e settings: Remove obsolete message_viewport.scrollTop() calls.
These date from long before the settings UI was restructured as an
overlay.  Now, instead of ensuring that error messages are visible,
they just scroll the message feed incorrectly.

Fixes #4810.
2017-05-16 20:33:52 -07:00
Tim Abbott cab908b664 api: Move notifications_stream into the register_ret API.
While we're at it, we at least fix the API to use a stream ID, not a
stream name, to refer to the notifications stream.
2017-05-16 18:57:14 -07:00
Tim Abbott 8c172063e0 message_fetch: Increase batch size for message backfill to 1000.
There's no advantage to doing a small batch size towards current here,
since latency isn't an issue at this point, and performance on the
server side generally favors larger batch sizes.

This also will make it significantly harder to start getting 429 rate
limiting errors when loading when far behind current.
2017-05-16 18:32:48 -07:00
David 942520123c message view: Render formal date string as tooltip on recipient row
A formal date string will be assigned to the title attribute of the
recipient_row_date and date_row elements.
e.g. Wednesday, April 5, 2017.

Fixes #4663.
2017-05-16 16:58:22 -07:00
Tim Abbott feda8cd012 css: Fix missing top border in PM recipient bars.
Technically, they were also missing on stream message recipient bars,
but the difference was invisible.
2017-05-16 14:48:37 -07:00
Tim Abbott d1fb4aa130 css: Fix missing right border in PM recipient bars. 2017-05-16 14:48:37 -07:00
Tim Abbott 5048edc25c css: Decrease vertical space at top of feed.
This is system unfortunately has a rather complicated calculation to
compute the offsets correctly, but the net effect here is that the top
section of the Zulip window is much more space-efficient.

Shrinking the tab bar underpadding, part of this change, fixes #4444.

We only need the underpadding to be as tall as the space above the
floating recipient bar, which is definitely less than 10px, so I don't
anticipate regressions caused by this.
2017-05-16 14:48:34 -07:00
Tim Abbott 00c7f7d42f Remove date separators from the top of the message feed.
Now that we have the date visible in the recipient rows, we no longer
need a top-of-feed date separator.

Fixes #4581.
2017-05-16 14:47:04 -07:00
Steve Howell b9cc3a16a4 minor css: Add margin above "Announce stream".
The margin makes it slightly more clear that "Anyone can join"
vs. "People must be invited" is the main decision to make here.
2017-05-16 10:43:27 -07:00
Steve Howell 22c1231222 Hide "Announce stream" if realm has no "announce" stream.
When you create a stream, there was always an "Announce stream"
option that would be enabled for public streams.

We are about to make it so that we never send PMs to announce
new streams to folks, so the only mechanism will be sending a message
to the realm's notification stream.  If a realm has no notifications
stream, the decision is moot, so we hide the option.
2017-05-16 10:43:27 -07:00
Harshit Bansal c549dea9ac bugdown: Fix the regex used for unicode emoji matching.
The regex we were using didn't cover all the unicode blocks
to which our emojis belong. This commit fixes the regex to
include all the unicode blocks and also updates the
corresponding JS regex in marked.js.

Fixes: #3460.
2017-05-16 09:05:42 -07:00
Tim Abbott 8f488eb4d6 compare: Lower font weight for Xs. 2017-05-15 23:23:26 -07:00
Tim Abbott 5c745bf72a landing: Fixup styling of /compare/ page. 2017-05-15 22:21:04 -07:00
Tim Abbott f4a049110f navigate: Fix incorrect reference to narrow.stream().
This was renamed to narrow_state.stream() recently.
2017-05-15 21:07:00 -07:00
Tim Abbott 2007144c23 css: Fix arrangement of streams in new user invitations.
Previously, they were line-wrapped in an ugly fashion.
2017-05-15 20:43:24 -07:00
digi0ps 729bd6af12 settings: Enter now submits the data in Default stream settings.
Fixes #4232.
2017-05-15 20:36:18 -07:00
digi0ps 6f7b973d3b settings: Fix error handler for Default Streams.
Updates the error handler code to be consistent with how errors
are displayed everywhere else.
2017-05-15 20:34:45 -07:00
digi0ps 63587d6b70 settings: Add submit button for Default Stream form. 2017-05-15 20:34:17 -07:00
Tim Abbott df5a0e7c92 hotkeys: Simplify logic for checking for subscriptions page. 2017-05-15 20:28:56 -07:00
Cynthia Lin 4cc33b6173 hotkeys: Disable enter hotkey while Streams menu is open.
Prevents compose box from opening and potentially sending a message.
Fixes #2412
2017-05-15 20:28:56 -07:00
Steve Howell c7f710b8d4 muting.js: Track muted streams using stream id.
This should prevent some glitches with stream rename events.
2017-05-15 14:47:41 -07:00
Steve Howell 8eb9723283 stream_list: Call update_streams_sidebar() on renames.
If you rename a stream, call update_streams_sidebar() to
make sure we redraw the active stream correctly.
2017-05-15 14:47:41 -07:00
Steve Howell 76f68e9836 Fix buggy update_streams_sidebar().
If you were narrowed to an unpinned stream, and then pinned it,
we were mostly redrawing the sidebar correctly, but we weren't
setting the active-filter class.  Now we accomplish this by
calling maybe_activate_stream_item(), which also reduces some
code duplication.  (The new code introduces a bit of extra logic
to do `stream_li.addClass('active-filter')`.
2017-05-15 14:47:41 -07:00
Steve Howell 5b6bd6767b refactor: Extract stream_list.maybe_activate_stream_item(). 2017-05-15 14:47:41 -07:00
Steve Howell 1a11042fdf refactor: Use stream id more in topic_list.js. 2017-05-15 14:47:41 -07:00
Steve Howell 2e39d48626 Add stream_data.get_recent_topics_for_id(). 2017-05-15 14:47:41 -07:00
Steve Howell 762194f98d Add stream_data.id_is_subscribed().
We use this function in stream_list.js.
2017-05-15 14:47:41 -07:00
Steve Howell efb35afeb7 Track recent topics (and active streams) using stream id.
This commit changes the key for recent_topics to be a
stream id.  For streams that have been renamed, we will now
get accurate data on recent topics and active streams as
long as stream_data.get_stream_id(stream_name) returns a
valid value.
2017-05-15 14:47:41 -07:00
Steve Howell 5d33d02235 Track unread counts using stream_id. 2017-05-15 14:47:41 -07:00
Steve Howell c125ba1d08 Fix how we find if streams are muted.
This commit changes stream_data.in_home_view() to
take a stream_id parameter, which will make it more
robust to stream name changes.

This fixes a bug.  Now when an admin renames a stream
you are looking at, it will correctly show itself to
be un-muted. (Even with this fix, though, the stream
appears to be inactive.)

Some callers still do lookups by name, and they will
call name_in_home_view() for now, which we can
hopefully deprecate over time.
2017-05-15 14:47:41 -07:00
Steve Howell d3a7aa3a37 Have get_stream_li() take a stream_id.
Rather than having get_stream_li() look up stream id using
stream name, we force the callers to pass in the stream id.

This adds an extra line to most of the callers for now, but
this will eventually change as we fix some of the callers to
have their callers pass in stream_id.

In places where we now call stream_data.get_stream_id() to
get the stream id, we will be more resilient toward stream
renamings, at least until the next reload, since
stream_data.get_stream_id() can resolve old names that
are stored when we process stream-rename events.
2017-05-15 14:47:41 -07:00
Steve Howell a48419310e Simplify get_filter_li() and get_stream_li().
We no longer have get_stream_li() delegate to get_filter_li(),
which simplifies the logic in get_filter_li() and makes
get_stream_li() more direct.

We also move the two functions closer to each other in the file.
2017-05-15 14:47:41 -07:00
Steve Howell 292b0ac64d Extract set_stream_unread_count. 2017-05-15 14:47:41 -07:00
Steve Howell cfdf256c62 refactor: Call get_stream_li() in a few places.
This is a step toward simplifying get_filter_li().
2017-05-15 14:47:41 -07:00
Cynthia Lin 934bae5232 user docs: Add user guide for *View and edit your message drafts*.
Fixes #4335.
2017-05-15 13:32:18 -07:00
Aditya Bansal debcf507bd Clean organization-settings-admin to use 4 space indents. 2017-05-15 11:51:21 -07:00
Aditya Bansal 8530997542 Clean default-streams-list-admin to use 4 space indents. 2017-05-15 11:51:21 -07:00
Cynthia Lin 1bea4da0f4 org settings: Fix minor styling inconsistencies.
Fixes #4789.
2017-05-15 11:35:58 -07:00
Tim Abbott 157e0623f8 5xx: Remove hardcoded twitter/email contacts from nginx 500 page.
There's no correct contact that we can list here unconditionally;
previously, we had people emailing zulip-devel@ because their server
was misconfigured.

Addresses #696 enough that it's no longer a priority issue.
2017-05-13 22:44:34 -07:00
Steve Howell 252d0a6e15 Use stream_data.get_name() in narrow_state.stream().
Using get_name() is more robust for stream name changes.  This
fixes, for example, the situation where you narrow to a stream,
edit it via the sidebar, and then close the modal, and the message
redraw logic thinks you have unsubscribed.

Fixes #4686.
2017-05-13 21:59:08 -07:00
Steve Howell 8b78f3f133 Look up old stream names in stream_data.get_name().
This change fixes a few small things related to stream
renames, such as what happens if you hit the back button
to go to a narrow where the stream had been renamed.  You
will now get the correct behavior in terms of filtering
and searching.  Unfortunately, this will only last until
you reload.
2017-05-13 21:59:08 -07:00
Steve Howell 191741a382 Use stream ids to filter messages in client-side narrows.
We now use stream ids to filter messages in narrowing
situations, instead of doing stream name comparisons.

This partially fixes certain stream-renaming scenarios, since
we will be able to match the stream id for an out-of-date
stream operand, but it doesn't fix some other stuff, such
as the query that the server gets.
2017-05-13 21:59:07 -07:00
Steve Howell 8ecfda9344 stream_data: Remember old stream names.
This is not a user-facing change, but it starts us down the
path to having the JS client be able to look up old stream
names for situations like people clicking old external links
or for live-update scenarios.
2017-05-13 21:58:37 -07:00
Tim Abbott 286bbff800 left-sidebar: Change color of STREAMS label on hover. 2017-05-13 14:41:58 -07:00
derAnfaenger 45a9b657c7 Refactor left sidebar topic cursor css.
This commit addresses to issues with the left sidebar:
The cursor flickering when hovering over topics, and
the cursor not becoming a pointer when resting just right
of a topic's name (in a clickable area).

This is a follow-up to #4675.
2017-05-13 14:41:48 -07:00
Tim Abbott d6059d0d9a landing: Add template containing comparison checkmarks.
Can be added to the landing pages via:
+    {% include 'zerver/compare.html' %}
+

I'm avoiding adding that include into the landing pages until we have
time to do a bit of tweaking of the styling to integrate better into
/hello/ (primarily color-wise).

Most of the work for this was done by Brock, huge thanks to him!
2017-05-13 14:32:24 -07:00
Tim Abbott 4d2bb0dec8 templates: Clean up visuals for account-not-found SSO flow.
Also, clarify that the account that isn't found is your Zulip account,
not a GitHub/Google Oauth account.
2017-05-13 12:46:05 -07:00
hackerkid cf15a7b561 presence.js: Make get_status return active for logged in user. 2017-05-12 14:28:23 -07:00
Abhijeet Kaur 0b7d138871 settings: Make description textarea readonly for non-admin users.
Fixes #4754.
2017-05-12 14:16:43 -07:00
Tim Abbott f25d7dd721 settings: Fix spelled of muted topics message. 2017-05-12 12:38:29 -07:00
Steve Howell a0fab6842c Improve error handling in get_action_menu_menu_items(). 2017-05-12 12:25:03 -07:00
Aditya Bansal 33f3d773b0 Clean user-list-admin to use 4 space indents. 2017-05-12 12:23:01 -07:00
Aditya Bansal 0c39a45d72 Clean bot-list-admin to use 4 space indents. 2017-05-12 12:23:01 -07:00
Steve Howell f0b30b57ca modals: Make error reports more specific.
We now give a more specific error message when something goes
wrong in closing a modal.
2017-05-12 08:27:25 -07:00
Cory Lynch 08f1c86041 Make reaction picker case-insensitive.
The search bar for picking message reactions now is case-insensitive,
since that's a better user experience, and there isn't a clear use
case for capital letters in emoji names.

Fixes #4666.
2017-05-11 19:10:21 -07:00
Tejas Kasetty 9b9c323314 emoji picker: Move cursor to end of filter string when focusing.
This is a much less annoying behavior than the Chrome browser default.

Explanatory comment added by tabbott, thanks to Steve Howell for the
research.

Fixes #4604.
2017-05-11 18:54:44 -07:00
Brock Whittaker f1a7db2503 Add placeholders to all empty lists.
This adds placeholders that state that the lists are empty.
2017-05-11 17:49:27 -07:00
Brock Whittaker e294035c93 Fix table display.
This fixes the way that tables display across the settings page,
so that the buttons shouldn't collapse to the second line anymore.
2017-05-11 17:49:26 -07:00
Brock Whittaker 8559acec1d Clean up settings overlay "Your Account" tab display.
This enforces a max-width of 1024px on the #settings overlay.

This commit also cleans up the "Your Account" tab to display
correctly without the avatar bleeding over to the next line.
2017-05-11 17:49:26 -07:00
Brock Whittaker 478011c0af Remove headers from templates. 2017-05-11 17:49:26 -07:00
Brock Whittaker f95021d419 Add settings sections to header.
This adds the settings section that you are in to the page header.
2017-05-11 17:49:26 -07:00
Brock Whittaker 6e7305f784 js: Implement DynamicText class.
This implements the DynamicText class for resizing of text to fit the
parent node.
2017-05-11 17:23:53 -07:00
Rishi Gupta 0ce04556bf CSS: Change color of PMs from yellow to blue-grey. 2017-05-11 16:18:39 -07:00
Steve Howell d415d4cf11 Add error handling in watch_manual_resize().
We now explicitly complain if a caller passes in a bad
selector to this function and return undefined.
2017-05-11 15:45:47 -07:00
Tim Abbott 35a5ca411a emoji: Fix scaling of realm emoji in reactions.
Fixes #4762.
2017-05-11 14:40:05 -07:00
Tim Abbott eb6af282fb login: Shrink font size of organization name. 2017-05-11 14:26:06 -07:00
Tim Abbott 223624be25 settings: Add support for longer, markdown-powered realm descriptions.
This makes it possible to create much prettier login pages.

Further work on styling may be necessary.
2017-05-11 13:59:46 -07:00
Tim Abbott 2c64626e7a mobile: Disable tutorial on mobile clients. 2017-05-11 11:01:56 -07:00
Steve Howell d7813ee6b3 reactions: Remove unneeded message_store.get() calls.
Both callers to get_user_list_for_message_reactions() already
had a message object, so there was no need to pass in an id
just to fetch it from message_store again, so now the first
parameter is message, not message_id.
2017-05-11 09:39:17 -07:00
Steve Howell 87f5c22593 Simplify how we find the current user's emoji reactions.
This adds the current_user_has_reacted_to_emoji() helper.

This new helper is easier to use and slightly more efficient
than calling get_user_list_for_message_reaction() and then
indexOf().

This also replaces one call to get_user_list_for_message_reaction()
with a list of user_ids that we already had locally.

The node tests were improved a bit here, including a minor
whitespace fixup.
2017-05-11 09:39:17 -07:00
Tim Abbott 3bf5c647d9 css: Remove black background for signin logo. 2017-05-11 09:00:23 -07:00
Steve Howell 958ed20a0f Only render one stream at a time for editing.
We used to render the subscriptions_settings template for every
stream when you loaded "Manage Streams," which can be very slow
for a big realm.  Now we only render the right pane on demand.
2017-05-11 08:46:52 -07:00
Steve Howell a9031fe7b3 Fix some bugs for changing stream privacy.
The function stream_data.add_admin_options() got removed as
part of a somewhat recent fix.  This caused a console error, and
the modal would not go away.

We now call the new stream_data.update_calculated_fields().

This commit only addresses the recent regression.  We still have
the known issue that public/private changes do not get
live-updated for other users.
2017-05-11 08:46:52 -07:00
hackerkid 9aaf175ec6 Move add new default stream box to top.
Fixes #4734.
2017-05-10 16:56:30 -07:00
Brock Whittaker f651c7fb18 user-profile: Add mobile-responsive styling.
This changes the styling of the user profile popup to be responsive
to mobile devices. In this case it is converted to a modal form using
flex to center it on devices with screen sizes under 768px in width.

Fixes #4669.
2017-05-10 16:49:42 -07:00
Tejas Kasetty 5dd5c84854 Add support for emoji picker hotkeys in compose context.
This is a follow-up to merging the compose and reactions emoji
pickers.  The logic for what happens when the user picks an emoji via
the hotkeys (i.e. hits `enter`) was still attempting to add a reaction
to the currently selected message unconditionally.

This commit adds a check in the two `enter` key code paths, and does
the correct thing in each case.

Fixes #4736.
2017-05-10 16:26:58 -07:00
Brock Whittaker 52059d21a4 product-pages: Fix broken click target on .hamburger.
The click target was still for #hamburger even though it has since
been changed to .hamburger. This fixes the selectors to make it work
with the new className declaration over ID.
2017-05-10 14:56:36 -07:00
Steve Howell f60a829b4d Remove lightbox.is_open property.
Outside of lightbox.js, we now use modals.lightbox_open() to
detect that the lightbox modal is open.
2017-05-10 09:46:21 -07:00
Steve Howell 1d7f93e550 Avoid re-opening the lightbox.
If the lightbox is already open, don't re-open it.
2017-05-10 09:46:21 -07:00
Tim Abbott c2a11655ef css: Decrease stream padding in left sidebar. 2017-05-10 09:45:40 -07:00
Tim Abbott 3d5350408b css: Fix vertical alignment of global filter counts.. 2017-05-09 19:17:33 -07:00
Tim Abbott 60a81fef43 design: Restore font color in left sidebar to #333.
This fixes a major complaint with the left sidebar styling.
2017-05-09 19:00:46 -07:00
Brock Whittaker 7dbf0c8811 Normalize left and right sidebar font size.
This normalizes the left and right sidebar font size to be 0.89rem.
2017-05-09 18:54:10 -07:00
Brock Whittaker 242eb9b346 portico-sidebar: Fix sidebar logo to be current logo.
This fixes the sidebar logo to be the current zulip logo rather
than a mockup of a potential logo that was from the redesign.
2017-05-09 18:48:33 -07:00
Steve Howell 5c52495b64 Use modals.settings_open().
We now uses modals.settings_open() to check for the settings
modal being open, rather than doing a regex check on
windows.location.hash.
2017-05-09 18:44:08 -07:00
Steve Howell 37254c9031 Simplify ESC handling for modals.
Rather than checking every modal individually in hotkey.js for
handing the escape key, we now use the modals API:

    is_active: says whether any modal is open
    close_active: closes the active modal
2017-05-09 18:44:08 -07:00
Steve Howell 23b7be90c2 Fix console errors with closing settings.
We were mapping the escape key to fake-click a redundant
click handler when the settings pages were open.  This fix
lets the actual click handling work via modals.js, and it
lets keyboard handling directly calls modals.close_settings().
2017-05-09 18:44:08 -07:00
Brock Whittaker 3fd3ae4199 Restyle /hello/ page.
This restyles the /hello/ page to be the new portico branding.
2017-05-09 16:31:57 -07:00
Brock Whittaker a82a0d16d5 Add landing page assets.
This adds the required logos and other assets for the /hello/ page.
2017-05-09 15:26:45 -07:00
kunall17 e087bc24f8 streams: Migrate stream property changes to new REST endpoint.
This is one of the last major endpoints that were still done in the
pre-REST style.

While we're at it, we change the endpoint to expect a stream ID, not a
stream name.
2017-05-09 13:39:23 -07:00
Rishi Gupta a75af36039 stats: Change sort order of client labels to match default view. 2017-05-09 11:32:35 -07:00