Commit Graph

4773 Commits

Author SHA1 Message Date
Sampriti Panda e98d7a6ee8 Fix issues with left-sidebar stream search and multiple words.
If you typed in more than one word for a stream with multiple words in
it's name, it would not show up in the search list. This fixes that
and adds some more tests covering the entire functionality of the
filter.
2017-09-15 00:22:59 -07:00
Cynthia Lin 5be0124e0b left sidebar: Add cursor pointer change on hover to Streams icons. 2017-09-14 12:37:27 -07:00
Cynthia Lin d7fbae2410 left-sidebar.css: Remove .brand selector.
This selector is unused (there is no element with class `brand` in element with ID `left-sidebar`).
2017-09-14 10:18:03 -07:00
Brock Whittaker 25304ddeee Fix padding to match new font.
This commit fixes the padding on several things that are now not
vertically centered because the new font has slightly different
heights.
2017-09-14 07:38:44 -07:00
Cory Lynch f4a09b7758 recent_senders: Add sort by stream message recency.
If both users haven't posted in the current topic, then
as a second order sort, check which user has posted first
in the stream as a whole.

Fixes part of #5956; we still need to sort by sending in the
organization.
2017-09-14 07:20:52 -07:00
Vishnu Ks d8f8e29ff5 frontend: Show link to delete files in quota exceeded error. 2017-09-14 06:04:09 -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
Sarah c3a8138f74 user_settings: Add push notifications for all stream messages.
Add setting to enable push notifications for all stream messages.
2017-09-14 05:41:37 -07:00
Umair Khan 1f93c06b76 i18n: Optimize get_language_list().
compilemessages command now does all the heavy lifting by creating a
language_name_map.json file under locale directory. This file is used
by get_language_list to retrieve the require information.

Fixes: #6486
2017-09-14 02:28:58 -07:00
Steve Howell c953759486 Get unread messages from the server in the web app.
The server sends down lists of unread message ids in various
buckets, and we now use those on the client to provide more
complete counts of unread messages.
2017-09-12 06:02:40 -07:00
Sampriti Panda 073bc318cf compose: Fix rendering error with message edit forms.
Fixes #6412
2017-09-11 09:24:11 -07:00
Yusei Tahara 56cb06dc19 lightbox: Fix repeated code in exports.open.
Call display_XXX function after the payload if-clause, don't repeat
the same thing.
2017-09-10 00:40:03 -07:00
Cynthia Lin b2f7c80ed2 click_handlers: Remove duplicate compose state checks. 2017-09-08 23:20:43 -07:00
Cynthia Lin 19e134698e compose: Refocus compose box if message view link is clicked.
Fixes #4331
2017-09-08 11:30:57 -07:00
Cynthia Lin ead2a4c071 left sidebar: Prevent closing in responsive mode.
Fixes #2913
2017-09-08 11:20:36 -07:00
Cynthia Lin 44b514d897 left sidebar: Move Streams header icons out of <a> elements. 2017-09-08 11:20:36 -07:00
Cynthia Lin 99025c8f10 search: Remove search close button when narrowed to home view.
Fixes #6426
2017-09-08 11:13:06 -07:00
Akash Nimare bf470d3d1e updated desktop app to v1.4.0 2017-09-08 07:55:25 -07:00
Brock Whittaker 26f6d708c2 Make plan CTA buttons all line up. 2017-09-07 12:43:47 -07:00
Brock Whittaker f026fc6f0c Add :hover and :active states to button.green.
This now adds these interactive states to the /plans/ page by
proxy of adding them to the `button.green` component.
2017-09-07 12:43:47 -07:00
Brock Whittaker e82cc3f993 Add more margin-top to <h3> tag.
The <h3> default margin of 10px brought it too close vertically to the
the paragraph tag above it, so this increases it to 20px.
2017-09-07 12:40:03 -07:00
Brock Whittaker aac7b3c5eb Increase font size of <p> and <li> to 1.2em.
This increases the font size from 1em => 1.2em.
2017-09-07 12:40:03 -07:00
Brock Whittaker 26281df767 Change line height in <p> and <li>.
This decreases the <p> line height from 1.8em to 1.6em, and increases
the <li> line height from 20px to 1.6.
2017-09-07 12:40:03 -07:00
Greg Price 0986fe700d i18n: Keep markup out of a translated string where we easily can.
Use jQuery DOM construction methods, rather than string concatenation,
to keep things structured and to stay clear of the lint rules introduced
in ee6235d71.
2017-09-07 13:00:54 +09:00
Steve Howell 99f4d420a5 Reduce the font size for search.
Until we get search bubbles, the search text is kind of a
distracting detail for most users.  This just makes the
height 2px smaller for now.  This will also make more text
show up on mobile web.
2017-09-06 18:49:54 -07:00
Steve Howell 8e2d9b8f68 Make recipient bar styling more compact and clean. 2017-09-06 18:49:54 -07:00
Steve Howell ad52ef27ee Make tab styling more compact and clean. 2017-09-06 18:49:54 -07:00
Robert Hönig 910f04af29 bot settings: Properly hide bot_table_error. 2017-09-06 13:44:02 -07:00
Cynthia Lin 23e8582bfd message view: Change PM flag to match PM compose flag.
Fixes #6413
2017-09-06 10:12:13 -07:00
Cynthia Lin ec36382857 settings: Prevent backdrop leak when clicking outside of modal.
Fixes #3791 and closes #3794
2017-09-06 09:35:16 -07:00
Cynthia Lin f697e6bb0e modals: Implement new modal methods. 2017-09-06 09:35:16 -07:00
Cynthia Lin aa21b2bce6 overlays: Create modal helper methods to manage display status. 2017-09-06 09:35:16 -07:00
Shubham Dhama dc49f563eb message view: Fix line-wrapping of empty conversation/feed message. 2017-09-06 09:13:33 -07:00
Shubham Dhama 67abd9d1f7 message view: Center-align text of an empty conversation/feed message.
Fixes: #6150
2017-09-06 09:13:33 -07:00
Cynthia Lin 8bfc11bb98 hotkeys: Add uncondense/collapse/uncollapse message functionality.
Fixes #5914
2017-09-06 08:53:39 -07:00
Umair Khan d52760d2ef i18n: Don't span i18n strings on multiple lines.
If we use string concatenation to span i18n strings across multiple
lines then we end with such strings to be translated by the translators:

```
"This is the first line"\n + "This is the second line"
```
2017-09-06 07:01:43 -07:00
Umair Khan 95fe984de5 i18n: Do not concatenate i18n strings.
We should use variables in i18n strings to give proper context to the
translators. If the pattern is this:

```
i18n.t("Count " + count + " items")
```

Then it will be captured like this:

```
{"Count" + count + "items": ""}
```

Which is not good for the translators.
2017-09-06 07:01:43 -07:00
Greg Price 5045e53d63 i18n: Update Japanese translations.
This comes from, in the dev environment:
  ./manage.py makemessages -l en -l ja
  tx push -s -l ja
  tx pull -f -l ja --mode=developer

The makemessages and `tx push` provide Transifex with the updated set
of strings and metadata.  I'm not entirely sure why that's necessary,
but without it a lone `tx pull` left the server crashing with numerous
zerver.models.DoesNotExist exceptions.

(So to be precise, there was another `tx pull` at the start, just like
the final one.  That shouldn't matter for the result, though.)
2017-09-04 13:29:55 +09:00
Brock Whittaker a3bdde3155 /hello/: Hide the last single row of testimonials.
This responsively hides the last row of testimonials that only has a
single one it the row at certain widths in which the grid is a [4, 4,
1] layout, making it simply [4, 4].
2017-09-02 07:48:44 -07:00
Brock Whittaker 72a7e00986 /hello/: Make gradients extend further on mobile.
This makes the gradients extend further on mobile so that the white
text does not display on an almost-white background.
2017-09-02 07:48:44 -07:00
Brock Whittaker d0128e052e landing-page: Remove underline from logo text on :hover.
This removes the underline on the logo text on :hover on the
product pages.
2017-08-31 18:53:54 -07:00
Brock Whittaker 0737f57ccf Remove question marks from FAQ.
This removes the question mark ::before element and then removes
the margin that pushed over the body text for the answer.
2017-08-30 16:04:30 -07:00
Brock Whittaker 0fb137cfce /help/: Remove unnecessary padding on mobile.
This removes padding that just becomes blank space that pushes the page
over on mobile.
2017-08-30 16:04:30 -07:00
Brock Whittaker c399543d4c Fix odd responsive issue between 720px - 768px.
Not sure what this margin was doing here but it appears to look better
not existing.
2017-08-30 16:04:30 -07:00
Brock Whittaker d7f5f31f6a Change the link to not have the default fade action. 2017-08-30 16:04:30 -07:00
Brock Whittaker 44ace3e062 Remove link :hover animation & remove negating class.
This removes the link :hover underline animation and then also removes
all instances of `.no-style` that negated the effect.
2017-08-30 16:04:30 -07:00
Brock Whittaker 5c637b6452 Remove the scaling and box shadow on hovered price options.
This removes the scaling feature where a plan that a user
hovers over would increase in size and have a box shadow.

This used to be here because there was a clickable region that
would pop open an overlay that would have more plan information,
but that feature no longer exists.
2017-08-30 16:04:30 -07:00
Brock Whittaker 75a011e432 Change the second plans block label to dark grey.
This changes the second plans block label to dark grey responsively
when the width is less than 1390px because the white text does not
appear on that portion of the white background when the block collapses
down a line.
2017-08-30 16:04:30 -07:00
Brock Whittaker a1a4af096f Make responsive on mobile devices.
This makes the page responsive down to widths of 300px.
2017-08-30 16:04:30 -07:00
Brock Whittaker 6ac0e75005 /hello/: Make company logos larger in responsive situations.
The logos would get really small around 1000px wide, so this reduces
the number of columns and makes the logos around 50% larger
horizontally.
2017-08-30 15:56:11 -07:00
Brock Whittaker 841ab828e8 Change `.testimonials` section to be white. 2017-08-30 15:56:11 -07:00
Brock Whittaker 38dc3a28b5 Change "Open Source" to be shorter and lighter.
This changes the background color from dark blue to a light steel blue,
while also removing the unnecessary min-height enforcement.
2017-08-30 15:56:10 -07:00
Brock Whittaker 93b4d8a3f2 Change .testimonials section to green. 2017-08-30 14:16:20 -07:00
Brock Whittaker 2140a4aa01 landing: Add /plans/ describing ways to use Zulip.
Note from tabbott: This isn't yet linked to and will need to go
through significantly more iteration, but it's a start.
2017-08-30 07:56:22 -07:00
Harshit Bansal c864816f64 emoji_picker: Extract `register_popover_events()` function. 2017-08-29 14:09:35 -07:00
Harshit Bansal aebb49b18c emoji_picker: Move some functions to avoid lint errors.
Move `render_emoji_popover()` and `toggle_emoji_popover()` to bottom
to avoid lint errors.
2017-08-29 14:09:35 -07:00
Rishi Gupta 09b4927578 hotspots.js: Fix hotspots not appearing.
The original had two bugs in this line of code that cancelled each other
out. 4d0f304 fixed one, causing hotspots to no longer appear. This commit
fixes the second.
2017-08-29 14:08:45 -07:00
Steve Howell 0501570cd1 Remove POST-based API for setting topic mutes. 2017-08-29 16:53:38 -04:00
Cynthia Lin 0686567e46 settings UI: Make disabled checkboxes darker.
Fixes part of #6331.
2017-08-28 21:14:26 -07:00
Vaida Plankyte 30772a2570 onboarding: Replace turtle in onboarding message.
The one we currently have is the same as the one in the registration
emails, and also very low resolution (doesn't show well in lightbox).
Likely we should replace this with something completely different at
some point, but this is an improvement for now.
2017-08-28 20:46:29 -07:00
Rishi Gupta f88949b043 portico-signin.css: Left-justify moving label.
The moving label is acting like a placeholder here, and should be positioned
as such for consistency with the rest of the site. The two forms with a
moving label are /accounts/find/ and /accounts/password/reset.
2017-08-28 20:44:48 -07:00
Rishi Gupta 75337258a8 accounts-settings: Reassure user if they do not have a password for API key. 2017-08-28 20:39:53 -07:00
Cynthia Lin 5f9cd1f7d2 message view: Set mininum height for embedded tweets.
Fixes #5973.
2017-08-28 20:36:12 -07:00
Tim Abbott aa66d0129a settings: Reorder organization settings.
This makes the situation with the "Save changes" buttons slightly more
reasonable.  We'll want to do more on this front, though.
2017-08-28 17:27:22 -07:00
Brock Whittaker dba09c979c Restructure organization settings and permissions.
This restructures organization settings and permissions to be
more accurately grouped and for the permissions page to not be too
long.

CHANGES:

PROFILE:
    (this was split out)
    organization-profile-admin.handlebars:
        form #1:
            name
            description
            (SUBMIT)
        avatar:
            (UPLOAD)
            (DELETE)

SETTINGS:
    organization-settings-admin.handlebars:
        language (mostly untouched)
        message editing:
            time limit/history/retention
        message feed:
            mandatory-topics
            preview images
            preview websites

PERMISSIONS:
    organization-permissions-admin.handlebars
    (mostly stuff was removed)
    Joining:
        restrict domains
        require invite
    User Identity:
        name changes
        email changes
    Streams/Emoji:
        creating streams:
            waiting period (ADDED)
        adding emojis
    (SUBMIT) for whole panel

The profile group (name, description, avatar) were split into a new
page that did not previously exist, and the permissions was stripped
of message settings (message editing, message feed), but keeping the
"waiting period" input and putting it in the "Streams & custom emoji"
section.

Fixes: #5844.
2017-08-28 17:20:13 -07:00
Tim Abbott e74f509b32 settings_org: Add waiting_period_threshhold to framework. 2017-08-28 17:19:16 -07:00
Tim Abbott 98468101c4 settings_org: Decapitalize Text setting type. 2017-08-28 17:14:45 -07:00
Tim Abbott f67326bb81 css: Rename 'Humbug' font to Source Sans Pro.
That's what the font is actually called, and should help future Zulip
developers save time trying to figure out what's up and why our font
is unrelated to the "Humbug" font on the Internet.
2017-08-28 16:16:08 -07:00
Brock Whittaker 40dfef490d /help/: Remove perfectScrollbar.
This removes perfectScrollbar because it breaks CTRL-F.
2017-08-28 16:09:06 -07:00
Tim Abbott b62ce96dc8 css: Fix outline CSS for informational overlays.
Fixes #6188 for real.
2017-08-28 16:08:30 -07:00
Brock Whittaker 2a7480051f third: Update version of Source Sans Pro font.
Our previous version was several years old.
2017-08-28 16:08:30 -07:00
Brock Whittaker b6feac678b Remove all `font-weight: 500` instances.
Previously, the font-weight for 500 did not exist in our set, so
all of those examples defaulted to 400. This fixes them to stay
as they previously were by migrating them to a font weight of 400.
2017-08-28 15:01:53 -07:00
Harshit Bansal 5a54a143be subscriptions: Fix the rendering of emojis in stream descriptions. 2017-08-28 14:49:40 -07:00
Harshit Bansal 912d4ebd66 reactions.css: Remove the hack used for correctly positioning the emojis. 2017-08-28 14:49:40 -07:00
Rishi Gupta 0519bade1b integrations: Remove box-shadow offset on search box.
It looked a bit odd, since we don't use box-shadow offsets anywhere else on
the page (or the app as a whole).
2017-08-28 14:38:24 -07:00
Tim Abbott 1eead8db2d find_account: Fix problematic line-wrapping. 2017-08-28 14:33:06 -07:00
Tim Abbott ac0d90e533 portico: Rename 'find_my_team' to 'find_account'. 2017-08-28 14:29:29 -07:00
Tim Abbott 126171cb76 api: Remove root_domain_uri from API page links.
These pages should be references the current server's UI anyway.
2017-08-28 14:13:37 -07:00
Tim Abbott a0a1fe1512 settings: Rename SERVER_URI to ROOT_DOMAIN_URI.
This should be a lot less confusing.

See #6013 for discussion.
2017-08-28 14:09:28 -07:00
Brock Whittaker d09db16dcd /integrations/: Fix sidebar overflowing parent container.
The sidebar height was set to shorter than what the sidebar actually
was and so it would overflow the parent. By resetting it, it now
will not overflow.

Fixes: #6315.
2017-08-28 12:20:17 -07:00
Brock Whittaker ecae244898 portico-signup: Clean up confirm continue register page.
This cleans up the styling of the page by adding the white box
around the text content, and by making the header the same
`.get-started` class as other headers in the portico-signup group.
2017-08-28 12:10: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
Brock Whittaker 1f9eac990e footer: Responsively remove extra space and compact footer.
This removes some of the min-height constraint on .flex that would
push the footer down futher than it should have been and would
introduce scrolling to the page.
2017-08-28 11:46:07 -07:00
Brock Whittaker a2fc3d34db settings: Make col-width consistent between tables.
This makes the column width consistent between tables in the
organization users section by making the "Name" section 20%.
2017-08-28 11:38:18 -07:00
Brock Whittaker c8641d49b5 /help/: Remove portico footer.
I don't think we need the footer in here.
2017-08-28 11:07:03 -07:00
Brock Whittaker 8435714bb5 Make page responsive around new footers.
This removes the old flex model for the footer to stay at the bottom
of short pages and instead always just positions the footer below
the portico content and makes the content generally tall enough that
issues don't occur.
2017-08-28 11:07:03 -07:00
Brock Whittaker 04888101e2 Replace old portico footer with new sectioned one.
This replaces the old footer that has one section with a small list of
items. This expands the footer to have multiple sections.

Actual content tweaked and tagged for i18n by tabbott.
2017-08-28 11:07:02 -07:00
Brock Whittaker e616b464eb Fix padding around –– OR –– on register form.
This fixes the padding above the –– OR –– line on the register form.
This also fixes the left-alignment of the form starting at 795px
wide.

Fixes: #6265.
2017-08-28 09:51:33 -07:00
Brock Whittaker 6b80c61712 Allow for scrolling of stream membership table again.
This adds perfectScrollbar to the `.subscriber_list_container` to
allow for the table to scroll naturally again. This was broken
because when perfectScrollbar is put on the parent element, any
naturally scrolling element within it will not scroll naturally
anymore.

Tweaked by tabbott to update the scrollbar on rerender.

Fixes: #6215.
2017-08-28 09:48:34 -07:00
Brock Whittaker db1e8edbc3 settings: <tbody> ::after hack no longer required.
The hack used to make the placeholders in the ::after element
work correctly is no longer needed, so we can revert the width
of 200% back to 100%.

The hack is no longer required because Vaida split these into
two tables, of which in the second table there are no columns,
which means that 100% represents the table width rather than
the width of the first column.

Fixes: #6271.
2017-08-28 09:24:51 -07:00
Tim Abbott bb655e6945 css: Fix selecting of the EDITED notices.
Apparently, the previous approach didn't actually work.
2017-08-27 22:54:34 -07:00
Tim Abbott b988a1c661 css: Fix selecting of EDITED notices and weird whitespace.
This completes the effort to make selecting messages work in a way
consistent with what users might expect to be correct.

Fixes #5328.
2017-08-27 22:18:30 -07:00
Tim Abbott b49448de7d message_edit: Eliminat whitespace in recipient row controls.
This is hacky, but I can't figure out another way to do it that
doesn't cause other problems.

Ideally, we'd add some sort of exclude rule to our HTML template
linter so we can check the rest of the file.
2017-08-27 22:18:29 -07:00
Tim Abbott 3c8eb3c743 message_edit: Create recipient_bar_controls span.
This refactor will facilitate making it possible to set CSS properties
on this controls span; in particular, we're hoping to disable user
selection of the whitespace in this region.

The main side effect of this refactor is that we need to add JS code
to also hide the icon-vector-pencil element, since it's now in a new
span.
2017-08-27 22:18:05 -07:00
Tim Abbott f0d8e22b69 css: Don't allow selecting whitespace between hover controls.
This is inspired by #5486 and fixes part of #5328.
2017-08-27 22:18:03 -07:00
Steve Howell 37bf89292a Fix deleting stream from the sidebar.
When we were deleting a stream from the sidebar using the
stream/delete event, we were getting tracebacks due to this sequence
of operations:

    * remove id from stream_list.stream_sidebar
    * rebuild stream list
    * remove sub from stream_data

This fixes the bug by calling stream_data.delete_sub() first.

Deletions are tricky if you do things out of order.  We can probably
prevent tracebacks by having a deleted flag, but that can just cause
different problems.

Last commit tweaked by tabbott to fix a small bug in handling the case
where the user was not subscribed to the delete stream.
2017-08-27 19:11:43 -07:00
Steve Howell 38664e8cad Remove unused call to /json/streams endpoint.
We no longer need /json/streams in settings_streams.js.
2017-08-27 19:08:04 -07:00
Steve Howell 660854f5ad admin: Use client-side data to populate list of streams.
Fixes #3786
2017-08-27 19:08:04 -07:00
Steve Howell 3846e60a71 Add stream_data.get_streams_for_admin(). 2017-08-27 19:08:04 -07:00
Steve Howell 2c925e3567 stream_settings: Remove all_streams variable.
We no longer need this global variable after the prior commit.
2017-08-27 19:08:04 -07:00
Steve Howell 106d58df47 Add stream_data.get_non_default_stream_names().
This allows us to get the typeahead values for adding a default
stream using client-side data.
2017-08-27 19:08:04 -07:00
Steve Howell b32a9444dd js: Clean up how we track default stream names.
We continue to have page_params.realm_default_streams, but
now we do lookups on whether a stream is a default stream
by using a Dict indexed by stream_id.

We are also careful to update that during live updates.

This fixes a flaw that we weren't updating the list of realms
correctly for events that remove a default stream.
2017-08-27 19:08:04 -07:00
Tim Abbott 5d974b7f57 emoji: Remove :s from emoji popover title attributes. 2017-08-27 17:34:44 -07:00
Harshit Bansal 90d8b0f520 emoji_picker: Fix the two different titles appearing for each emoji.
Fixes: #6286.
2017-08-27 17:22:44 -07:00
Harshit Bansal 923fb7be16 emoji: Fix mis-alignment of realm emoji div with other div in emoji picker.
Tweaked by tabbott to fix the CSS to not break the emoji typeahead.

Fixes: #5229.
2017-08-27 17:21:08 -07:00
Tim Abbott 36fa6fe548 css: Remove duplicate emoji height CSS. 2017-08-27 17:20:37 -07:00
Tim Abbott e68de7ac8d user popover: Don't throw an exception for deactivated target users.
Ideally, we'd fix this at the root cause, via #4322, but this will at
least suppress the exception for now.
2017-08-27 16:41:28 -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
Tim Abbott 478f691792 settings: Remove useless map_initialized. 2017-08-27 16:35:17 -07:00
Tim Abbott a1885c6ffb message_edit: Add debug logging for missing messages.
This is an attempt to more easily debug a traceback we've seen a few
times.  The issue likely has to do with local echo, which would be
confirmed if this reports a local-echo-style message ID.
2017-08-27 16:11:42 -07:00
Harshit Bansal cd2f41dbb1 popovers: Extend the `compute_placement()` function.
This commit extends the `compute_placement()` function in
`popovers.js` to take into account height/width of popover as well as
positioning preference. If vertical positioning is desired and the
popover fits in either 'top/bottom' positions then we don't check for
`left/right' positions. Earlier the behavior was to prefer
'left/right'positions over 'top/bottom' positions, which resulted in
the emoji picker popping incorrectly to the left.
2017-08-27 12:27:53 -07:00
Harshit Bansal f24582576a emoji_picker: Further improve emoji picker navigation.
This further improves the emoji picker by introducing two new behaviors:

1: If the cursor is at the end of the input box then pressing `right_arrow`
moves the focus down into `emoji_catalog.

2: If the currently focused emoji is the first emoji in the `emoji_catalog`
then pressing `left_arrow` moves focus back to search filter.
2017-08-27 12:04:10 -07:00
Tim Abbott eb4635804f compose: Fix previews of /me messages.
Previously, we didn't do anything special when previewing /me messages.

Fixes #2115.
2017-08-27 09:48:27 -07:00
Tim Abbott e80f93dc42 markdown: Set is_me_message in apply_markdown.
This should make the variable available to things like drafts and
previews.
2017-08-27 09:34:24 -07:00
Tim Abbott 133f005530 markdown: Remove is_me_message UserMessage flags.
This never made sense to be a flag on the UserMessage table, since
it's not per-user state.  And in fact it doesn't need to be in a
database at all, since it's easily computed from content anyway.

Fixes #1099.
2017-08-27 09:34:24 -07:00
Tim Abbott 0f1768d0d1 compose: Fix confusing variable name in preview code path.
This seems to be the root cause of the bug fixed in the last commit.
2017-08-27 09:34:06 -07:00
Tim Abbott eb6d736df3 compose: Fix local rendering of previews.
Apparently, local rendering of previews had broken sometime in the
last few months in a refactoring that resulted in us passing a string,
rather than an object, into markdown.js.
2017-08-27 09:33:52 -07:00
rht 437b2a3146 Update "MacOS" text to "macOS" 2017-08-26 09:00:42 -07:00
Vaida Plankyte a492fc80ed hello.html: Change feature images to SVGs. 2017-08-25 10:30:22 -07:00
Tim Abbott 8df7deac9d deactivation: Add some styling to make boxes smaller. 2017-08-25 00:16:35 -07:00
Tim Abbott 07a156c400 notifications: Fix desktop/sound notifications for @all.
It appears that previously, these weren't being triggered.
2017-08-24 23:56:10 -07:00
Tim Abbott a2c21543bc mentions: Fix mention state being lost after reload.
This fixes a regression introduced in
bc2069aec2, which caused @-all mentions
to not be displayed properly.

Fixes #5317.
2017-08-24 23:47:55 -07:00
Cynthia Lin 8addc9b97e message view: Maintain stream color border on @-mention messages.
Fixes #6241
2017-08-24 23:37:59 -07:00
Tim Abbott eb781de78d settings: Fix buggy use of JavaScript regular expressions.
Using weird characters when filtering options items in these various
settings pages would throw exceptions whenever they didn't form a
valid regular expression.
2017-08-24 18:32:01 -07:00
Brock Whittaker d2a4afeacf Change message click => message long-tap event on mobile.
Previously on mobile, clicking on a message would make the compose
box open, but this is a relatively finnicky event whenever scrolling
so we realistically want to open the compose box on long-tap (with
a 750ms delay) to prevent false clicks and provide a closer-to-native
experience.
2017-08-24 16:52:18 -07:00
Brock Whittaker 624f1bb151 Restyle checkboxes to be less visually abrasive.
This restyles the checkboxes to be more subtle in their rest and
unchecked state so they don't create too much visual noise on the
page.
2017-08-24 14:19:49 -07:00
Brock Whittaker 3e2e24f4cd Lighten subscriptions settings grey boxes.
This increases the luminosity of the subscriptions settings boxes
from 93% to 97%.
2017-08-24 14:19:49 -07:00
Brock Whittaker cac4aeaa5f Clean up "Stream accessibility" section.
This cleans up the "Stream accessibility" section by putting the
radio boxes in a container along with fixing the margins around
various things.
2017-08-24 14:19:49 -07:00
Brock Whittaker 74f48ed5ba Make stream creation titles more consistent in size.
This brings down the number of stream creation title sizes from
4 (!!) to 1.
2017-08-24 14:19:47 -07:00
Brock Whittaker b73f5c9770 Fix responsive issue with stream filter search.
This fixes the search input collapsing to a second line in between
1024px and 1033px width views.
2017-08-24 13:59:40 -07:00
Brock Whittaker 44636051e4 Make /help/ sidebar more discoverable on mobile/narrow.
This makes the /help/ sidebar more discoverable at windows less
than 1000px in width because it makes it stick out a bit when it
is closed with the hamburger menu at the top.

Fixes: #6038.
2017-08-24 13:38:22 -07:00
Brock Whittaker 321074856e /integrations/: Focus search bar on page load.
This focuses the search bar on initial page load.
2017-08-24 11:38:13 -07:00
Vaida Plankyte 380dd38fc7 assets: Add email illustration SVGs to assets folder. 2017-08-24 11:37:24 -07:00
Cynthia Lin 60ca87a3e1 analytics: Add link to Analytics user docs. 2017-08-23 17:34:08 -07:00
Steve Howell b215229d22 unread: Add code to set unread counts from page_params data.
This won't run in production due to the feature flag.
2017-08-23 17:25:52 -07:00
Steve Howell 540c452fc2 unread: Use a an "id_set" for unread_messages. 2017-08-23 17:25:52 -07:00
Vaida Plankyte b2c0ff68c2 frontend: Add hotkey information to title/inline text.
This should make many Zulip hotkeys significantly more discoverable.
2017-08-23 17:12:09 -07:00
Brock Whittaker a6f2a0c943 settings: Remove whitespace on left side of bot key.
The bot API key when selected in the "Your bots" panel would have
some whitespace due to the fact that the HTML markup would make
some space between the span and button.

Fixes: #6189.
2017-08-23 15:31:28 -07:00
David Taylor 2bb5013efc integrations: Add discourse integration.
The actual integration lives on the Discourse side.
2017-08-23 15:25:12 -07:00
Vaida Plankyte a7ccd313bc frontend: Add email illustrations to static/images/emails. 2017-08-23 13:45:00 -07:00
Yago González 7d5d8ac61e lint: Add rule for spacing inside Handlebars translation tags.
This commit also includes the fixes to make all Handlebars templates
compliant with the new rule.
2017-08-23 13:08:57 -07:00
Tim Abbott 57dfded339 narrow: Add some clarifying comments. 2017-08-23 12:43:11 -07:00
Brock Whittaker 9e191b235f streams: Update button styles to new styles.
This updates the old red and blue buttons for the email address
add function and for the table unsubscribe function to be the new
style of buttons.
2017-08-23 12:29:32 -07:00
Brock Whittaker 2bb5042315 Use native `.click` event over jQuery `.click` event.
For whatever reason, the clipboard doesn’t want to work if you use a
jQuery click trigger. Perhaps because the jQuery event trigger doesn’t
create a native event at all. By doing this however, it doesn’t appear
to affect any other code but does allow for the clipboard to work again.

Fixes: #6002.
2017-08-23 12:26:50 -07:00
Brock Whittaker 4617a650c0 Compact two `row.find(".alter-copied")` statements into one. 2017-08-23 12:26:50 -07:00
Tim Abbott 74c628b105 editing: Fix live update of ability to edit messages.
Previously, we didn't check the organization-level settings when
rendering a message list; instead, we only checked it when putting
messages into the message_store.  That resulted in the state being
stale in the event that the setting controlling whether one can edit
messages was changed.

We remove some node tests, because revidving the node test for their
new home in message_list_view would be more work than we probably want
to do with an upcoming release.  We basically need to be better about
exporting functions like populate_group_from_message_container and
set_topic_edit_properties, so we can do fine grained testing.

When we get around to the node tests, rather than exporting these
functions, it might make sense to create a new module with a name
like message_container.js, which would have all of these
last-second type of data manipulations on message objects.  This
would be nice to split out of message_list_view.js.  MLV is our
biggest module, and it's mostly cohesive, but it's real job
should be about assembling messages into a DOM list, which is
probably 80% of the code now.  The 20% that I'd want to consider
splitting out is actually closer in spirit to message_store.js.

Thanks to Steve Howell for helping with the node tests.
2017-08-23 12:03:35 -07:00
Brock Whittaker cf4444123a informational-overlays: Remove outline on focus.
This removes the outline that comes on focus of one of the overlay
sections.

Fixes: #6188.
2017-08-23 11:05:52 -07:00
Vaida Plankyte a7b400135d landing-page.css: Reduce width of CTA container in apps page. 2017-08-23 10:24:56 -07:00
Umair Khan f265718854 i18n: Escape settings names in settings status messages.
By default, all text is escaped in i18next. We can use '__- ' to
unescape.

Fixes #6219
2017-08-23 00:22:59 -07:00
Max Schaefer 4825b6e5ad topic_list: Remove a spurious assignment and simplify a conditional.
Variable `show_topic` was assigned in both branches of the
conditional, but the assignment in the "then" branch was useless,
since the variable wasn't subsequently read. Hence the assignment can
be dropped, leaving the "then" branch empty. The "if" statement can
then be simplified by removing the "then" branch entirely and flipping
the condition. Since `show_topic` is now only used inside the "if", it
is slightly tidier (though semantically equivalent) to move its
declaration inside.
2017-08-22 23:49:47 -07:00
Max Schaefer 34f97cfb9a tab_bar: Remove a spurious assignment.
Variable `stream` is a local variable (declared on [line
51](85c3f59292/static/js/tab_bar.js (L51))). It
is not read after this assignment, which hence becomes useless.
2017-08-22 23:49:33 -07:00
Max Schaefer bbe87231cd upload_widget: Remove a spurious argument.
This call refers to the `accept` function on [line
118](85c3f59292/static/js/upload_widget.js (L118)),
which takes no arguments (unlike the `accept` function on [line
33](85c3f59292/static/js/upload_widget.js (L33)),
which takes one argument, but isn't in scope here).
2017-08-22 23:48:55 -07:00
Brock Whittaker b4d0d09cc2 about: Add a banner to /about/ with a picture from PyCon.
This adds a PyCon banner photo of people working on sprints to the
top of the /about/ page.
2017-08-22 23:34:34 -07:00
Tim Abbott 06f8fd529d realm: Add clear error message for too-long realm name.
This fixes an exception we saw in production, as well as fixing the
form to not offer ultra-long names that we don't allow.
2017-08-22 22:04:52 -07:00
franziskagoltz 61fbf1a7e3 editing: Hide topic-edit-pencil if message editing is disabled.
This fixes a confusing bug where administrators would be offered the
convenient topic-edit pencil even if message editing was actually
disabled.

This doesn't yet fix the real-time sync issues of changing the setting
without reloading.

Fixes #5946.
2017-08-22 19:43:56 -07:00
Brock Whittaker d07281fa66 rename: Change list_rendering.js => list_render.js.
The method itself is called `list_render`, so the file should
reflect that name.
2017-08-22 17:37:36 -07:00
Brock Whittaker 25e5a10a5b unicode: Replace "×" with HTML and HEX entities.
This refactors and fixes unicode issues where entities don't display
properly due to being a special character that seems to be rendered
incorrectly in a non-deterministic way every time.
2017-08-22 16:31:53 -07:00
Harshit Bansal 1a43728b1e emoji_picker: Fix tracebacks in navigation if search results are empty.
This fixes 2 bugs:

* If you perform a search and search results are empty then if you try
  to navigate using arrow keys, page-down/page-up etc. it will give a
  traceback.
* Search for example 'a' and then navigate to the last of the search
  results using arrow keys. Now press 'tab' to go back the search box
  and restrict the search to for e.g. 'ab' and now try to navigate
  using arrow keys, page-up/page-down etc you will get a traceback.
2017-08-22 14:48:02 -07:00
Brock Whittaker 09be694ea3 Rewrite scrollbar width check to not use jQuery.
This check was going to do the wrong thing when we upgraded to jQuery 3.
2017-08-22 12:50:54 -07:00
Rishi Gupta b32fe9f2a0 features: Update screenshot and add tool to generate.
This adds a new management command that should make generating or
updating screenshots a bit easier in the future.
2017-08-22 11:32:22 -07:00
Brock Whittaker 1a9c1241af Disable ability to highlight message reactions.
This adds the `user-select: none` property to `.message_reactions`
to disable accidental highlighting or selecting of the text.
2017-08-22 11:11:40 -07:00
Max Schaefer 8aa5a02866 js: Remove a few spurious arguments. 2017-08-22 09:37:17 -07:00
Max Schaefer 4d0f304048 js: Fix two misphrased conditions. 2017-08-22 09:37:15 -07:00
Aditya Bansal 0dcbacdbc6 emoji_picker: Refactor toggle_emoji_popover to split out to functions. 2017-08-22 08:46:55 -04:00
Vishnu Ks 517d9b7594 /apps/: Detect the user OS and show the appropriate app by default. 2017-08-20 22:11:56 -07:00
Aditya Bansal e1cc0455ee emoji_picker: Fix issue with emoji tab shifting.
In this commit we basically do these things:
* Clear up section_head_offsets before pushing stuff in it so that
its size doesn't keep on growing indefinitely with time and users
opening emoji picker.
* Make use of popover element to find the correct element in DOM
to scan for section elements. This prevents us from filling stuff
twice into section_head_offsets because of presence of two
elements for '.emoji-popover-subheading' in DOM since popover
destroy is an async call.
* Using this popover element also helps in avoiding manuplation
of the DOM elements of the popover that was destroyed (Because
popover destroy is async it still maybe around). One instance of
this is associating scroll event with the right instance of
'.emoji-popover-emoji-map'.
2017-08-18 12:18:39 -04:00
Steve Howell eeb164dfc5 bug: Show the count in the bankruptcy modal.
(This was a recent regression.)
2017-08-17 23:30:41 -04:00
Vaida Plankyte 8a29f1dcf2 config_error.html: Increase container width. 2017-08-17 11:27:36 -07:00
Steve Howell 770ec92891 hotkeys: Fix "n" key to work inside a muted stream.
Normally the "n" key skips over muted streams, but if we
are currently narrowed inside a muted stream, it will now
go to the next topics within that stream.

For me the use case was that I have a stream I check up on
about once a day, and "n" would be super useful for me to
clear out unread counts while still skimming some content,
and without having to temporarily unmute the stream.
2017-08-17 09:01:49 -07:00
Tim Abbott f8b1916781 stream_sidebar_row: Rename data-name to data-stream-name.
This is for greater consistency with the rest of the codebase.
2017-08-16 18:03:44 -07:00
Tim Abbott 9271346753 stream_sidebar_row: Remove duplicate data-name attribute. 2017-08-16 18:03:44 -07:00
Tim Abbott 5e968ce30d stream_list: Use data-topic-name for topic names.
The name data-name was ambigious.
2017-08-16 18:03:44 -07:00
Tim Abbott d9dcdbbbe9 stream_popover: Use data-stream-id when building topic popovers. 2017-08-16 18:03:29 -07:00
Tim Abbott dbae28683c stream_popover: Use data-stream-id when building popover. 2017-08-16 18:03:29 -07:00
Tim Abbott c6d7cfb60b stream_popover: Fetch the current stream by data-stream-id. 2017-08-16 18:03:29 -07:00
Tim Abbott 7d9303cfe8 topic_list: Stop accessing legacy data-stream name field.
We should be using data-stream-id everywhere.
2017-08-16 18:03:28 -07:00
Tim Abbott 88e3ba9576 stream_list: Fix enter key to use data-stream-id. 2017-08-16 18:02:57 -07:00
Tim Abbott 047237e45b stream_list: Remove a reference to data-name in sidebar. 2017-08-16 18:02:56 -07:00
Tim Abbott 4acd7595cd stream_sidebar: Clean up use of ambiguously named data-id.
We prefer to specify the type of data objects wherever possible.
2017-08-16 18:02:29 -07:00
Tim Abbott 78d9fcd23a streams: Remove a reference to data-stream-name. 2017-08-16 18:02:29 -07:00
Greg Price a099e698e2 py3: Switch almost all shebang lines to use `python3`.
This causes `upgrade-zulip-from-git`, as well as a no-option run of
`tools/build-release-tarball`, to produce a Zulip install running
Python 3, rather than Python 2.  In particular this means that the
virtualenv we create, in which all application code runs, is Python 3.

One shebang line, on `zulip-ec2-configure-interfaces`, explicitly
keeps Python 2, and at least one external ops script, `wal-e`, also
still runs on Python 2.  See discussion on the respective previous
commits that made those explicit.  There may also be some other
third-party scripts we use, outside of this source tree and running
outside our virtualenv, that still run on Python 2.
2017-08-16 17:54:43 -07:00
Tim Abbott 4b72b461e5 user_events: Fix buggy-looking logging code.
The previous logging exception looked like it sorta left off.
2017-08-16 16:23:41 -07:00
Aditya Bansal 7beeef9782 emoji_picker: Export emoji_collection and complete_emoji_catalog. 2017-08-16 19:18:26 -04:00
Aditya Bansal 406806b7df emoji_picker: Start using current emoji categories for rendering. 2017-08-16 19:18:26 -04:00
Aditya Bansal 245d571ae9 emoji.js: Refactor to make better use of initialize(). 2017-08-16 19:18:26 -04:00
Aditya Bansal 505262ca0b emoji_picker.js: Export initialize function. 2017-08-16 19:18:26 -04:00
Aditya Bansal 85fe355ba7 emoji_picker: Move click handler out from global scope.
In this commit we are moving the .emoji-popover-emoji.reaction
click handler to register_click_handlers() so as to have parity
with rest of the code design.
2017-08-16 19:18:26 -04:00
Tim Abbott 3a2a396303 zephyr: Fix tracebacks opening user info popovers. 2017-08-16 16:07:27 -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
Steve Howell b4590e1303 Add topic_generator.reverse_wrap_exclude().
This allows us to traverse a list backwards, cycling to the
bottom as needed.

This code is going to be used for the "A" key that cycles
upward in the stream sidebar.  It's probably overkill for
that use case, but it does give us O(1) behavior and avoids
the pitfall of accidentally mutating a list when reversing it.
2017-08-16 15:45:47 -07:00
Tim Abbott dac7cfa026 emoji picker: Fix exceptions with regex characters in emoji filter.
Previously, the Zulip webapp would throw an exception if you used a
character like "+" in your search query, since we were using regular
expressions, when really we should have been just searching for
characters.
2017-08-16 13:06:05 -07:00
Tim Abbott 7a5c6628a6 server_events: Fix formatting of server_events exception. 2017-08-16 11:59:49 -07:00
Vaida Plankyte cd1b01996e frontend: Add perfectScrollbar to invite users modal. 2017-08-16 08:23:34 -07:00
Vaida Plankyte 11d935f52a frontend: Add perfectScrollbar to right pane of manage subs overlay.
Tweaked by tabbott to use a more precise selector.
2017-08-16 08:23:34 -07:00
Vaida Plankyte 8ae263bf15 frontend: Add perfectScrollbar to left sidebar of manage subs overlay.
Tweaked by tabbott to use a more precise selector.
2017-08-16 08:23:33 -07:00
Rafid Aslam 5f7e23e8ef frontend: Add perfectScrollbars to Settings/Organization overlay.
Use perfectScrollbar on settings sidebar, since the default scrollbar
makes settings menu break when not enough vertical space available.

Add perfectScrollbar to main settings section, and reset the scrollbar
position when switching between tabs.

Also delete the z-index on `.settings-list` since it makes the
perfectScrollbar covered.

Fixes #5216.
2017-08-16 08:23:30 -07:00
Vaida Plankyte 971dc71ed6 ui.js: Create perfectScrollbar functions. 2017-08-16 08:07:28 -07:00
Vaida Plankyte d3f0d2cc9f help: Add perfectScrollbar to markdown container. 2017-08-15 21:10:14 -07:00
Brock Whittaker 83184d5c60 /about/: Merge with /authors, redesign page.
This adds the authors to the Zulip repository on GitHub from
/authors/ along with re-styling the page to fit the same
aesthetic as /for/open-source/ and other product-pages.
2017-08-15 16:09:01 -07:00
Brock Whittaker eec26c5da6 Extract "open source" feature column into its own section. 2017-08-15 15:26:46 -07:00
Tim Abbott c043d31074 portico: Fix accidental console.log statement. 2017-08-15 15:23:16 -07:00
Brock Whittaker 41dbbcf062 Change the notice text to be on the same line and grey. 2017-08-15 13:27:48 -07:00
Brock Whittaker cc8de243a5 Switch from #errors to new .alert.alert-error.
This switches to the newer style of displaying alerts.
2017-08-15 13:27:48 -07:00
Brock Whittaker dfb3d03c0b Fix broken input sizing for subdomains.
In the case of no subdomains, the input is too large because the JS
calculated size does not account for padding. The correct solution is
to do this in JS.
2017-08-15 13:27:48 -07:00
Akash Nimare eb88bd9552 portico: Point desktop app links to latest release. 2017-08-15 10:51:22 -07:00
Tim Abbott 842bf77efb unread: Convert mark_topic_as_read to use stream IDs.
This is safer in its handling of potentially renamed streams.
2017-08-15 10:40:02 -07:00
Tim Abbott f3a41ac796 unread: Convert mark_stream_as_read to use stream IDs.
The logic is simpler and more robust.
2017-08-15 10:40:02 -07:00
Steve Howell 89f9017686 Create new endpoints for marking streams/topics as read.
The new endpoints are:
    /json/mark_stream_as_read: takes stream name
    /json/mark_topic_as_read: takes stream name, topic name

The /json/flags endpoint no longer allows streams or topics
to be passed in as parameters.
2017-08-15 10:17:29 -07:00
Tim Abbott 9081f2cf44 reactions: Store the emoji codepoint in the database.
This is the first part of a larger migration to convert Zulip's
reactions storage to something based on the codepoint, not the emoji
name that the user typed in, so that we don't need to worry about
changes in the names we're using breaking the emoji storage.
2017-08-15 09:29:27 -07:00
Robert Hönig 4be814fc16 integrations: Add OpsGenie integration. 2017-08-15 08:42:19 -07:00
Steve Howell b59d7d54de tab_bar: Remove a now-irrelevant comment. 2017-08-14 17:34:55 -07:00
Steve Howell 57f17ae543 Extract top_left_corner.js.
Here are the functions in top_left_corner:

    get_global_filter_li: pure code move
    update_count_in_dom: simplifed copy of similar function in stream_list.js
    update_dom_with_unread_counts: pure code move, split out from function
       of same name in stream_list.js
    delselect_top_left_corner_items: pure code move
    handle_narrow_activated: pure code move + rename
    handle_narrow_deactivated: pure code move, split out from from function
       of smae name in stream_list.js
2017-08-14 13:03:57 -07:00
Steve Howell 0f3b565d40 Create explicit handlers for stream activate/deactivate.
Calling explicit functions ensurest that the sidebars
get activated for narrows before less important things
happen, and it also makes testing easier.
2017-08-14 13:03:57 -07:00
Steve Howell 8655fae910 Make deselect_top_left_corner_items() more accurate.
This function was actually de-selecting stream sidebar items
before.  Now we just explicitly de-select top-left items in it,
and we do stream-sidebar stuff in update_stream_sidebar_for_narrow().
2017-08-14 13:03:57 -07:00
Harshit Bansal 99d3668523 emoji_picker: Change emoji picker to be category based. 2017-08-14 12:52:35 -07:00
Steve Howell 78be1b362e Remove home icon in tab bar for non-home narrows.
This reduces clutter, particularly on mobile web.
2017-08-14 12:48:09 -07:00
Steve Howell 81708e3e2a tab_bar: Extract is_all() helper. 2017-08-14 12:48:09 -07:00
Steve Howell 274938bf5f Eliminate approximate_unread_count().
We use page_params.unread_msgs.count in the web
app instead.

Fixes #1300.
2017-08-14 12:39:00 -07:00
Tim Abbott 5f87037bf5 Fix upwards scrollback when narrowing to streams centered on old messages.
Previously, when you switched to a stream narrow with the central
message outside the range of messages cached in the browser, we would
reset the UI for loading more messages, but not actually reset the
state for whether it should be possible.

This seems to have been an oversight in refactoring back in 2014.

Fixes #6109.
2017-08-14 12:05:40 -07:00
Brock Whittaker 41f98bbdb9 Remove the slide animation from product pages. 2017-08-14 11:34:14 -07:00
Brock Whittaker 158bd23b59 left-sidebar: Style "More topics" to be more consistent.
The "More topics" link was not lined up with the topics due to a
recent change anymore; we also increase the font size slightly.

Fixes: #6090.
2017-08-14 11:33:51 -07:00
Steve Howell 612e3766ce Turn on feature_flags.user_server_topic_history.
With this flag turned on, all streams will have a "more topics"
link, and clicking that link will always fetch topics from the
server to show a complete list of topics that you have had messages
for on that stream.

Note that if you only recently joined a public stream, your list
of topics won't go back to before you joined the stream, even though
that content is searchable.  We may change that in the future, but
we will need to be careful about spamming folks who frequently
unsubscribe from streams.
2017-08-11 13:01:39 -07:00
Steve Howell 60cca43d5e Always show "more topics" link if you have server history.
Until we have an easy way to consistently determine whether a
stream has more topics than have been loaded already, we err
on the side of showing a "more topics" link.  This in some ways
leads to a more consistent experience where you can zoom in on
any stream, even one that's really new.
2017-08-11 13:01:39 -07:00
Steve Howell 24e9dbe80b Use data-stream-id for zooming topics. 2017-08-11 13:01:39 -07:00
Steve Howell 17ff7317b9 Replace #stream_sidebar_{id} with data-stream-id.
We weren't actually using #stream_sidebar_{id} anywhere, and
data-stream-id allows for more conventional idioms in future
commits.
2017-08-11 13:01:39 -07:00
Steve Howell fad024ebda Simplify stream sidebar narrows.
This fix simplifies how we re-render topic lists when we
re-narrow or zoom out from a topic list.

    * The topic_list.zoom_out() no longer gets called as
      part of re-narrowing, and we eliminate the clear_topics
      option.

    * For all situations where we narrow to a filter that does
      not have a topic, we simply call the new function
      clear_topics().

    * The stream_list code no longer calls remove_expanded_topics()
      in cases where the new narrow has a topic.  This allows us
      to optimize away scroll/flicker churn a little more easily.

As part of this, we rename maybe_activate_stream_item() to
update_stream_sidebar_for_narrow(), since the function clears
stuff as well as turning stuff on.
2017-08-11 13:01:39 -07:00
Steve Howell 2146e17709 node tests: Improve topic_list tests.
We test a little deeper now, covering rebuild (albeit mostly with
stubs) and active_stream_id.
2017-08-11 13:01:39 -07:00
Steve Howell f706efe12e Add topic_list.active_stream_id(). 2017-08-11 13:01:39 -07:00
Steve Howell 089670ac1c Extract stream_list.show_all_streams(). 2017-08-11 13:01:39 -07:00
Steve Howell d2686bdcdd Simplify maybe_activate_stream_item().
We extract get_sidebar_stream_topic_info() and just call
topic_list.rebuild() directly, which allows us to eliminate
rebuild_recent_topics().
2017-08-11 13:01:39 -07:00
Steve Howell cd4dd90641 Extract stream_list.update_top_left_corner_for_narrow().
This is mostly a pure code extraction.  It makes the call
to reset_to_unnarrowed() happen later in sequence.

The order of operations here is mostly unimportant, but
there may actually be some tiny user-facing benefit
in terms of having the logic happen more sequentially.

BEFORE:
    reset streams
    fix top left
    redraw streams

AFTER:
    fix top left
    reset streams
    redraw streams
2017-08-11 13:01:39 -07:00
Steve Howell c5d95a2db8 stream list: Rename method to scroll_stream_into_view.
The old name was scroll_to_active_stream, but it can be used
when pinning a stream, so "active" isn't necessarily accurate.
2017-08-11 13:01:39 -07:00
Steve Howell 9201137059 Fix scrolling glitches when zooming out to streams.
If you go into "more topics" for a stream with many topics,
and then scroll down, and then zoom out again with "All
streams", we make sure the active stream is still in view.
2017-08-11 13:01:39 -07:00
Steve Howell 9dd78c803c Make auto-scrolling less aggressive.
We have code that can automatically scroll an element into "view"
in its container.  We use this for stream sidebar rows inside the
stream list.

Generally the stream sidebar rows are small enough to fit into
the container, and the prior algorithm worked correctly for that
scenario.

If you have lots of topics, however, and a short screen, the
algorithm was being too aggressive.  For example, if the top
wasn't showing, it would scroll the top into view, but at the
cost of scrolling the bottom out of view.

This fix makes the general scrolling algorithm more tame.

Part of the user-facing problem is that the element we pass
into the scrolling code for the stream sidebar rows is bigger
than the part of the row that actually should be shown on
screen.  Nevertheless, it makes sense here to make the general
algorithm more robust.
2017-08-11 13:01:39 -07:00
Steve Howell c11c5c3795 Extract stream_list.scroll_delta() and add tests. 2017-08-11 13:01:39 -07:00
Steve Howell 5608dc0add Fix bug with topic edits on read messages.
If you read a message, then got a topic edit for it, we were
adding the message to our data structure of unread stream/topic
messages.

Now we guard against this in unread.update_unread_topics. I
no longer expose an update() method in unread_topic_counter,
since we really want to do the unread check at a higher level
to keep other data structures consistent.
2017-08-10 14:36:18 -04:00
Jack Zhang 93c1790d91 integration.js: Invoke adjust_font_sizing on all re-renders. 2017-08-10 10:21:53 -07:00
Jack Zhang c8c27ddcc7 Extract adjust_font_sizing into top level of integrations.js module. 2017-08-10 10:21:53 -07:00
Jack Zhang ffe14e339d Extract /integrations code from landing-page into separate bundle. 2017-08-10 10:21:53 -07:00
Jack Zhang 48e0c2565b Increase individual integration subpage sidearea width.
All category labels are kept to one line of text.
2017-08-10 10:21:53 -07:00
Jack Zhang feb52eb777 Decrease create-your-own integration tile font size on mobile. 2017-08-10 10:21:53 -07:00
Jack Zhang b85d3e28ce portico: Update display text for integrations categories dropdown.
Category 'All' -> text 'Filter by category'; icon chevron right when
the dropdown is closed, icon chevron down when the dropdown is open

All other categories -> text CATEGORIES[state.category]; icon chevron down
2017-08-10 10:21:53 -07:00
Jack Zhang 10bef65f00 i18n: Import localstorage module into translations.
localstorage.supported() breaks on portico pages, where
the localstorage variable is not exposed globally.

This change is coupled with this commit:
94a1070979 (diff-a15e4886338acf8091c948c25f47caaa)
2017-08-10 10:21:53 -07:00
Jack Zhang fc6c2b321b portico: Reimplement /apps routes using pushState. 2017-08-10 10:21:53 -07:00
Jack Zhang b255949501 Show integration categories on integration sub-pages. 2017-08-10 10:21:53 -07:00
Jack Zhang 0e41ace321 Hide deprecated integrations with legacy tag. 2017-08-10 10:21:53 -07:00
Jack Zhang 3e04062da1 Show name of integration in mobile single-integration view. 2017-08-10 10:21:53 -07:00
Jack Zhang d3cc201332 Refactor /integrations state, routing, and rendering logic.
A large portion of the diff for landing-page.js is due to refactoring the
contents of integrations_search into top level UI update functions.

State flows as follows: dispatch(action) -> render(state) -> update UI

Routes now use pushState instead of hashes.

On transition between categories scrolling position is fixed,
and on transition between catalog and integration sub-pages the page
scrolls to the top.
2017-08-10 10:21:53 -07:00
Jack Zhang c0328de03d portico: Load INTEGRATIONS and CATEGORIES page data. 2017-08-10 10:21:53 -07:00
Jack Zhang 5a87f90b24 landing-page: Replace detect_path with path_parts.
path_parts returns an array of all location.pathname's `chunks`,
the strings within the path, split by slash.
2017-08-10 10:21:53 -07:00
Jack Zhang cc54fe2e30 Move integrations dropdown click handler into integration_events. 2017-08-10 10:21:53 -07:00
Jack Zhang 63ad7b6769 Rename /integrations/doc API endpoint as /integrations/doc-html. 2017-08-10 10:21:53 -07:00
Brock Whittaker 00c44379e3 Replace Doctor on Demand logo with new logo.
This updates the logo for Doctor on Demand.
2017-08-10 10:19:44 -07:00
Vaida Plankyte 9548d4635a frontend: Remove IDs from alt value of inline images. 2017-08-10 09:43:43 -07:00
Brock Whittaker 41f395caf1 your-account: Change "no changes made" error to success.
This changes the alert error "Error changing settings: No new data
supplied" to "No changes made" as a success bar.
2017-08-09 19:46:43 -07:00
Brock Whittaker 4b4283550f lightbox: Fix incorrectly displayed avatar image.
The lightbox "v" shortcut should not show a user's avatar,
so this limits the scope of images it can choose to ones inside
of the `.message_content` div.
2017-08-09 14:33:00 -07:00
Brock Whittaker 2b45c17dbc /features/: Fix wave position.
On some monitors it appears as though there's a slight gap between
the bottom of the wave and the top of the section below. This moves
the wave down a pixel to ensure the gap disappears.

Fixes: #6064.
2017-08-09 13:52:22 -07:00
Steve Howell 9cad3a009f Add topic server history, but behind a feature flag.
You can now see full topic history if you set the flag
`feature_flags.use_server_topic_history` to `true`.
2017-08-08 17:07:09 -04:00
Steve Howell 3b88e592d0 Add topic_data.get_server_history().
This isn't connected to anything yet, but you can now get
all the historical topics for a stream by calling
topic_data.get_server_history().
2017-08-08 17:07:09 -04:00
Brock Whittaker 7d80e0c78c portico: Fix #registration padding.
This fixes the registration padding to not be really large. It was an
issue of margin + padding instead of using margin for both where the
result would be max(margin1, margin2).
2017-08-08 13:21:48 -07:00
Brock Whittaker 6a406e2b70 portico: Fix tables to be striped again.
This fixes tables to be in more of a compartment and striped again
(which they lost due toe the light grey background).
2017-08-08 13:21:48 -07:00
Brock Whittaker 9f2017c1aa portico: Unify with smaller box shadows.
This unifies components with smaller, more consistent box shadows.
2017-08-08 13:21:48 -07:00
Brock Whittaker 3d4198c681 Replace `String.prototype.startsWith` with `indexOf`.
This replaces the `startsWith` string prototype method with `indexOf`
because no versions of Internet Explorer support this feature, and
it really is not difficult to just use `indexOf` instead and check
whether the starting index of the full string is 0.
2017-08-08 12:06:32 -07:00
Brock Whittaker be33266f83 Make 4xx and 5xx pages full screen.
This makes the 4xx and 5xx pages full screen by changing the
`.error_page` div to be fixed and full screen height.
2017-08-08 11:58:22 -07:00
Greg Price 8ccd8a7d27 settings: Wait for i18n setup before rendering settings nav.
Much like the parent commit and 038a2c769, but this time for the
"Settings"/"Organization" nav at the upper-left of the settings overlay.
2017-08-07 18:22:51 -07:00
Greg Price ee3ead2744 ui: Wait for i18n setup before rendering hotkeys help.
Much like 038a2c769, but for the three tabs at the top of the
`?` help overlay for keyboard shortcuts.
2017-08-07 18:22:51 -07:00
Greg Price 8ab213e3e4 locale: Update Japanese strings. 2017-08-07 16:58:10 -07:00
Jack Zhang c69b5d7d65 hotkey: Add support for hotspots on enter. 2017-08-05 18:32:37 -07:00
Jack Zhang 04fda9e51f hotspots: Decrease default hotspot icon z-index to 100.
This keeps hotspot icons positioned at the front of the message
viewport but behind sidebars (i.e. the left sidebar has a z-index
of 103). Hotspots associated with elements outside of the message
viewport should be individually adjusted at the bottom of hotspots.css.
2017-08-05 18:32:37 -07:00
Jack Zhang 1e40665e51 hotspots: Debounce hotspot placement on UI updates by 10ms.
A small delay to ensure that the event (i.e. a click) has completed
and the UI has updated before hotspot icon and popover placement
is recomputed.
2017-08-05 18:32:37 -07:00
Jack Zhang 5ce0db9f43 hotspots: Add friendly whale illustration to popover. 2017-08-05 18:32:37 -07:00
Jack Zhang bbe8f73c23 popovers: Reimplement compute_placement.
compute_placement utilizes the dimensions of the viewport, viewport location of
an element, and dimensions of an element to determine if a popover will fit
horizontally and/or veritically given its orientation. The default placement
is now viewport_center, which displays the popover, without an arrow, in the
fixed center of the viewport.

This should be particularly useful for hotspots on mobile or large popovers
that contain a lot of content. The property hotspot.location.popover can be
optionally set to fix the orientation of a popover (most likely to
VIEWPORT_CENTER).
2017-08-05 18:32:37 -07:00
Vaida Plankyte ca19cb6900 frontend: Fix stream-creation aria-label assignment. 2017-08-05 18:11:27 -07:00
Vaida Plankyte ee23e6f118 frontend: Fix default_language_modal aria-hidden assignment. 2017-08-05 18:11:27 -07:00
Brock Whittaker 4321f1f2b4 /help/: Remove "| User Documentation" string in narrow windows.
This responsively moves the header so that it doesn’t push the login,
registration nav options to the next row.
2017-08-05 17:57:07 -07:00
Brock Whittaker ef3131c77b help: Change .header nav to be on top of page elements.
WARNING: This change affects all portico pages, but it looks better.
This makes the nav sit on top and have a subtle box shadow.
2017-08-05 17:57:03 -07:00
Brock Whittaker 22eb102a8e help: Change .markdown .content to be white. 2017-08-05 17:57:02 -07:00
Brock Whittaker 3f550a940b help: Impose a max width for the .markdown .content. 2017-08-05 17:57:00 -07:00
Tim Abbott c657db77e8 lightbox_canvas: Fix use of unsupported const. 2017-08-05 16:47:11 -07:00
Brock Whittaker e22920bef6 Fix lightbox zoom issues.
This fixes the lightbox zoom issues that occurred on some browsers
due to the units of `deltaY` being in lines rathern than pixels,
making it incredibly slow to zoom.
2017-08-05 15:47:34 -07:00
Steve Howell 541156792e Add /mark_all_as_read endpoint.
This change simplifies how we mark all messages as read.  It also
speeds up the backend by taking advantage of our partial index
for unread messages.  We also use a new statsd indicator.
2017-08-04 14:10:46 -07:00
Steve Howell eafd5a731a Remove dead code: messages.flags.send_force_collapse. 2017-08-04 13:31:26 -07:00
Steve Howell cc94d6179c Remove dead code: messages.flags.send_force_expand. 2017-08-04 13:31:26 -07:00
Steve Howell 437cabe34c Just use message.unread when rendering.
By the time we render messages, we will have set message.unread,
so we don't need to calculate it from flags.

We add a line to the local-echo path to make this explicit
in that code.
2017-08-04 13:31:26 -07:00
Steve Howell f81f9a26e8 Call message.set_message_booleans() in update_messages().
When we learn about updated message, a bunch of flag/boolean
fields concern us:

    starred
    mentioned
    alerted
    is_me_message

We now set booleans consistently with how we set new incoming
messages.
2017-08-04 13:31:26 -07:00
Steve Howell 187ec3a922 Set message.unread in set_message_booleans().
The sooner we make message.unread consistent with message.flags,
the better.
2017-08-04 13:31:26 -07:00
Steve Howell abe7f4cc40 Extract message_store.set_message_booleans().
We'll want to reuse this for message updates, and we'll eventually
want to bypass this for local echo.
2017-08-04 13:31:26 -07:00
Steve Howell ff54d52589 Extract message.set_read_flag().
This code adds 'read' to message.flags and sets message.unread
to false.

It's not clear that the boolean message.unread is used in any
meaningful way, but we set it to false to avoid confusion.  The
bankruptcy code was not doing this before.

Another quirk that existed before was that you could get two
'read' flags in a message when you declared bankruptcy.  It's
also plausible that this could happen if you marked a message
as read via two different ways.  It probably did not cause
user-facing bugs, but it would be confusing for troubleshooting.

Fixes #5032.
2017-08-04 13:31:26 -07:00
Steve Howell d5681556d5 Call unread.process_loaded_messages earlier when inserting.
We want to maintain the invariant that unread.js always knows
about unread messages as soon as they are loaded.
2017-08-04 13:31:26 -07:00
Steve Howell a07bd70449 Inline message_util.do_unread_count_updates(). 2017-08-04 13:31:26 -07:00
Steve Howell 7cae3fa916 Use bucketers in unread_topic_counter. 2017-08-04 13:31:26 -07:00
Steve Howell 66c2ca9a2a unread: Add make_bucketer().
This class encapsulates reverse lookups to make deletions
O(1).  It is also a bit smarter about not creating
throwaway objects, by avoiding setdefault.
2017-08-04 13:31:26 -07:00
Steve Howell 42f3b3ec00 unread: Add make_id_set().
This is a better abstraction for a set of ids, plus all the
dictionaries are kind of confusing.
2017-08-04 13:31:26 -07:00
Steve Howell 241f095213 Extract unread_ops.process_read_messages_event().
The new method borrows some code from the event loop
and unread_ops.mark_messages_as_read, and it is now
flexible about message_ids being marked as unread
even when there is no corresponding message in the
message store.  For that scenario we still want to
update our data structures, which wasn't happening
before this change.  (Generally, this was a non-issue
up until now, but it will become a bigger issue when
we start loading unread message ids from the server.)
2017-08-04 13:31:26 -07:00
Steve Howell 00a3f6b5f2 Extract process_newly_read_message(). 2017-08-04 13:31:26 -07:00
Steve Howell 8125667f90 Add unread.id_flagged_as_unread().
This function allows us to see whether unread.js thinks a message
id is unread (as opposed to looking at the message itself).  This
method is useful when we get notifications from the server that a
message has been read.  In the future, we may not actually have
a local copy of an unread message, but we'll still know that it is
unread based on page_params.  We'll want to update the data in that
case.

Going forward, we'll want to deprecate message.flags for most use
cases and just use the unread.js data structures to track unread
messages.
2017-08-04 13:31:26 -07:00
Steve Howell 5a10137ad9 Extract message_list.first_unread_message_id().
This de-duplicates code that solved the same problems using
two different phrasings.
2017-08-03 11:32:54 -07:00
Steve Howell c32b9a5d19 Remove dead code related to unread_in_current_view. 2017-08-03 11:32:54 -07:00
Steve Howell 325d7f0f57 unread: Simplify code to mark messages as read.
We now call the function mark_as_read(), and it only requires
passing in a message_id.
2017-08-03 11:32:54 -07:00
Steve Howell eac155d3b8 unread: Use reverse_lookup in unread_topic_counter. 2017-08-03 11:32:54 -07:00
Steve Howell 1927a6ca45 Simplify unread_topic_count.update().
The prior implementation was needlessly complex.  Both del() and
add() are cheap and idempotent.

With this change we no longer bother to delete a topic from a
dictionary when its last message is mark as read, since it doesn't
really help performance.  We add a line to the tests to maintain
100% line coverage.
2017-08-03 11:32:54 -07:00
Steve Howell fad4ed4e78 unread: Use reverse_lookup in unread_pm_counter.
This allows us to use simply a message_id to mark a PM as read.
2017-08-03 11:32:54 -07:00
Brock Whittaker f2b71ba12a subs: Make "All streams" link to appropriate hash.
This makes the “All streams” toggle bring the user to the hash
“streams/all” which saves their state.

Fixes: #5984.
2017-08-03 10:59:13 -07:00
Steve Howell e7cc7bba05 pm list: Avoid unnecessary id -> email conversion.
In a subsequent commit, we may have unread counts for
deactivated users.  There is no reason to fail hard on these
scenarios; if there is no list item for a user_ids_string,
updating the unread count should be a noop.
2017-08-02 09:40:47 -07:00
Steve Howell b446d96ed6 Add people.pm_lookup_key 2017-08-02 09:40:47 -07:00
Steve Howell 8a7397fef6 people.js: Explicitly sort user_ids numerically.
It's not always clear whether user_ids are strings or integers, so
we explicitly convert them to integers for sorting when creating
keys for PMs.

To keep the tests passing, this commit removes some unneeded
defensive code in message_store.js that only applies to contrived
test input.
2017-08-02 09:40:47 -07:00
Steve Howell b110f3bab3 Extract sorted_other_user_ids(). 2017-08-02 09:40:47 -07:00
Steve Howell b4c157c644 Extract unread.unread_mentions_counter.
This was extracted mostly for symmetry with the other two
counter classes in unread.js.  It's just a thin layer on top
of a Dict() object.
2017-08-02 09:40:47 -07:00
Vaida Plankyte 02d65a67af frontend: Edit confirm_continue_registration.html to be clearer.
Fixes #5707.
2017-08-02 08:51:25 -07:00
Brock Whittaker 334689ad51 Fix password reset alignment issue.
This fixes the password reset input box not lining up with the button.
2017-08-01 23:54:45 -07:00
Brock Whittaker 0b89561524 portico: Redesign the /features landing page.
This is a redesign of the features landing page from the current style
that includes the new sections in a grid format as well as some new
high-quality sections.
2017-08-01 23:39:44 -07:00
Rishi Gupta 31c011dfcc onboarding: Add picture to onboarding messages. 2017-08-01 22:47:57 -07:00
Rishi Gupta fbceba2b81 tutorial: Remove exports.start. 2017-08-01 22:38:22 -07:00
Rishi Gupta 51bc7801dd tutorial: Narrow to /is/private instead of pm-with welcome-bot.
Main reasons:
* Shouldn't be hardcoding welcome bot

* compose_actions.cancel() was not closing the compose box, for some
  reason. It was working fine before commit a few up from here ("tutorial:
  Remove rest of tutorial."), but I think possibly due to the fact that one
  had to click a button to exit the tutorial (that could be wrong, it was
  hard to pinpoint why it was working before that commit and not after.)

This code should be going away anyway once #5816 is resolved.
2017-08-01 22:38:22 -07:00
Rishi Gupta 0c665e9bbe tutorial: Remove unnecessary actions.
* .screen is no longer being changed by other parts of the tutorial
* first_run_message we don't need, since we're guaranteed to have a message.
* Changing to #home and narrow.deactivate are not needed since we're
  immediately narrowing to PM with welcome-bot.
2017-08-01 22:38:22 -07:00
Rishi Gupta 4f417700ef tutorial: Remove logic in start that is immediately undone in finale.
Setting stream colors and then setting them back, disabling and enabling
event handlers, and setting tutorial status twice.
2017-08-01 22:38:22 -07:00
Rishi Gupta 852bbfa16a tutorial: Remove tutorial_finale.
Was already orphaned, since skip is always true. This is just removing the
code.
2017-08-01 22:38:22 -07:00
Rishi Gupta 0286a41c4c tutorial: Remove is_running and defer logic. 2017-08-01 22:38:22 -07:00
Rishi Gupta 99df794f2c tutorial: Remove window resizing logic. 2017-08-01 22:38:22 -07:00
Rishi Gupta 38ad318651 tutorial: Remove fake_messages and extra current_msg_list rendering. 2017-08-01 22:38:22 -07:00
Rishi Gupta be7f6db854 tutorial: Remove rest of tutorial.
Replaces the call to welcome() in tutorial.start with finale(true), and then
iteratively removes all orphaned code.
2017-08-01 22:38:22 -07:00
Rishi Gupta e1843dd1b9 tutorial: Remove delayed messages.
These have been replaced by the initial stream messages and PMs.

The two pieces of information that exist here and not in the initial stream
messages are a link to /integrations, and a demonstration of image
uploading/pasting.

I think the current information presented is already a lot, though probably
it would be good to work in integrations somehow. Image pasting should just
be done in a separate Zulip that demonstrates the many different formatting
features.
2017-08-01 22:38:22 -07:00
Brock Whittaker 5ee0725731 Remove unnecessary comment. 2017-08-01 18:33:11 -07:00
Brock Whittaker 199a0582d7 Reduce <h3> heading margin.
This reduces the margin-top of the <h3> headings.
2017-08-01 18:32:18 -07:00
Brock Whittaker 448358bf96 /help/: Change image styling.
This changes from larger box shadows to subtle line borders.
2017-08-01 18:32:18 -07:00
Joshua Pan b7fe2fe7d8 Move maybe_get_stream_name to stream_data.js.
This also gets rid of the unnecessary set_global
in settings_org.js test, which made tests fail after
moving the code.
2017-08-01 16:19:41 -07:00
Brock Whittaker 7c63b061c1 settings: Remove intermediate hash change.
This removes an unecessary intermediate hash change when opening
up the settings page automatically on page load.

Fixes: #3634.
2017-08-01 15:38:17 -07:00
Brock Whittaker 463f69fd1b Enable scrolling on user presences on mobile.
The overflow was set to "hidden". I'm unsure of how this was even
working on desktop, but the #user-presences div certainly would
not scroll on mobile. This enables mobile scrolling.
2017-08-01 14:52:16 -07:00
Brock Whittaker 850efdebdd Add equal padding to sides of the right sidebar on mobile.
This adds equal padding to both the left and right side of the mobile
sidebar so that text and divs don’t hit the right side of the screen.
2017-08-01 14:52:16 -07:00
Brock Whittaker 17c4ef2e21 Fix settings back arrow vertical alignment.
The back arrow to get to the settings tabs on mobile was too low in
position in the header.
2017-08-01 14:48:13 -07:00
Brock Whittaker bceebb1547 Make right sidebar user search input larger.
This makes the <input> 100% in width, rather than only about 60% of the
width of the sidebar.
2017-08-01 14:48:13 -07:00
Brock Whittaker d1508a6435 Add "touch-action: manipulation" for less tap delay.
This is a google recommendation to remove the 300ms tap delay on
mobile web.
2017-08-01 12:37:08 -07:00
Brock Whittaker 14254f9668 lightbox: On .player-container direct click, hide lightbox.
When a user clicks on the `.player-container` node and the click
target is actually that (and not the YT video iFrame within), then
hide the lightbox – they likely mean to exit out of the lightbox.
2017-08-01 09:25:52 -07:00
Steve Howell 7caf8edadc Extract notifications.reify_message_id().
This removes the last need for a message_id_changed event.
2017-08-01 08:59:14 -07:00
Steve Howell 3f06f28ad7 sending messages: Extract sent_messages.js.
This commit extract send_messages.js to clean up code related
to the following things:

    * sending data to /json/report_send_time
    * restarting the event loop if events don't arrive on time

The code related to /json/report changes the following ways:

    * We track the state almost completely in the new
      send_messages.js module, with other modules just
      making one-line calls.

    * We no longer send "displayed" times to the servers, since
      we were kind of lying about them anyway.

    * We now explicitly track the state of each single sent
      message in its own object.

    * We now look up data related to the messages by local_id,
      instead of message_id.  The problem with message_id was
      that is was mutable.  Now we use local_id, and we extend
      the local_id concept to messages that don't get rendered
      client side.  We no longer need to react to the
      'message_id_changed' event to change our hash key.

    * The code used to live in many places:
        * various big chunks were scattered among compose.js,
          and those were all moved or reduced to one-line
          calls into the new module
        * echo.js continues to make basically one-line calls,
          but it no longer calls compose.report_as_received(),
          nor does it set the "start" time.
        * message_util.js used to report received events, but
          only when they finally got drawn in the home view;
          this code is gone now

The code related to restarting the event loop if events don't arrive
changes as follows:

    * The timer now gets set up from within
      send_messages.message_state.report_server_ack,
      where we can easily inspect the current state of the
      possibly-still-in-flight message.

    * The code to confirm that an event was received happens now
      in server_events.js, rather than later, so that we don't
      falsely blame the event loop  for a downstream bug.  (Plus
      it's easier to just do it one place.)

This change removes a fair amount of code from our node tests.  Some
of the removal is good stuff related to us completing killing off
unnecessary code.  Other removals are more expediency-driven, and
we should make another sweep at ramping up our coverage on compose.js,
with possibly a little more mocking of the new `send_messages` code
layer, since it's now abstracted better.

There is also some minor cleanup to echo.resend_message() in this
commit.

See #5968 for a detailed breakdown of the changes.
2017-08-01 08:58:56 -07:00
Vaida Plankyte 30361f50f8 frontend: Fix elements that are not visible should not be focusable.
Fixes #5534.
2017-08-01 08:56:11 -07:00
Harshit Bansal a13535ff1f alert_words: Don't muck up rendered HTML content while munging.
Prior to this we were also performing highlighting inside HTML tags
which was wrong and causing weird behavior. Like, for example, if
someone added `emoji` as an alert word then any message containing
both emoji and alert word was rendered with a jumbo emoji.

Fixes: #4357.
2017-07-31 21:20:21 -07:00
Brock Whittaker 7eb41c5f7e Make lightbox canvas feature cross-browser compatible.
This makes the canvas zoom and pan feature cross-browser compatible in
a few ways:

1. Replace deprecated `mousewheel` event in favor of the similar and
cross-browser event `wheel`.

2. Create approximate substitute for `e.movementX` and `e.movementY`
values that are missing in Safari.
2017-07-31 17:03:31 -07:00
Brock Whittaker 8445f886d7 Add ability to pan and zoom lightbox images.
This adds the ability to pan and zoom lightbox images because they
are now converted to <canvas> elements.
2017-07-31 17:03:31 -07:00
Steve Howell 90c5b53da3 Remove send_times_log feature.
We no longer use this in development.
2017-07-31 14:57:34 -07:00
Tim Abbott a9fa1a5527 api: Migrate /json/messages_in_narrow off legacy API.
This completes the major endpoint migrations to eliminate legacy API
endpoints from Zulip.

There's a few other things that will happen naturally, so I believe
this fixes #611.
2017-07-31 13:08:06 -07:00
Tim Abbott 6a50e13156 uploads: Remove legacy /json/upload_file endpoint.
This migrates Zulip to use the equivalent API endpoint that has been
present for a while.
2017-07-31 13:08:06 -07:00
Tim Abbott 1e5aee054b settings: Migrate main settings-change code to API.
This was one of the few major remaining endpoints that were still on
the old-style legacy API.
2017-07-31 13:08:06 -07:00
Harshit Bansal 3796292913 markdown: Fix the rendering of realm filters.
A realm filter should match only after the start of a line, whitespace
or opening delimiters. But markdown was not configured to respect those
rules which was causing some weird rendering behavior. This commit fixes
the regex used for matching realm filters. On the backend we are using
regex with negative lookbehind to perform matches but since javascript
regex don't support lookbehind we are using a workaround on the frontend
using `contains_backend_only_syntax()` function which detects if a realm
filter can be rendered correctly by backend only and if so it stops the
message from getting echoed locally.

Fixes: #5154.
2017-07-31 12:42:36 -07:00
Steve Howell a4b0ca8f07 unread.js: Remove unused argument to get_counts(). 2017-07-31 09:06:29 -04:00
Steve Howell 34e452bcfd Extract unread.unread_pm_counter().
This class is mostly a thin layer over the dictionary, but it
consolidates all the logic to create lookup keys, which have
to follow the convention of being comma-separated, numerically
sorted user_ids.
2017-07-31 08:59:18 -04:00
Steve Howell 19ebf1e23b bankruptcy: Clear unread counts for mentions. 2017-07-31 08:30:46 -04:00
Steve Howell bf81782e59 Rename num_unread_for_subject -> num_unread_for_topic. 2017-07-31 08:11:18 -04:00
Steve Howell fe74e79a17 Rename subject_count -> topic_count.
This fixes all names in the JS codebase.
2017-07-31 08:04:20 -04:00