Commit Graph

8352 Commits

Author SHA1 Message Date
Yashashvi Dave 5506b16fa8 user settings: Add separate alert-save widget for profile custom fields.
Fixes part of #12748
2019-07-25 13:33:44 -07:00
Yashashvi Dave 3c16b73fcd account settings: Simplify handlebars conditional logics.
This commit simplifies complex handlebars conditional
logic for account settings tooltips and fields.
2019-07-25 13:33:44 -07:00
Anders Kaseorg 2ac944c31f css: Remove message_hovered class.
This appears to have been dead for years.

Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2019-07-23 17:54:12 -07:00
Tim Abbott 2273608477 css: Fix buggy pointer-events behavior in message feed.
I noticed a super weird bug where the edit pencil would disappear on
hover inside the message feed (!).  Investigation determined that what
was actually happening was that the Drafts overlay had been shown and
then hidden at a time when the mouse cursor was over the icons with
`data-toggle="tooltip"` configured, and the tooltip showing.  The
result was that this tooltip object, if you mouse over it, would cause
us to no longer be hovering over the message (because your cursor was
actually over the invisible drafts widget's leaked tooltip).

Ideally, we'd have fixed this by making the drafts modal `display:
none`, but that would interfere with the modal's closing animation,
and there's no good way to have an event trigger on a CSS animation
finishing.

There's a second bug that makes this possible, however, which is that
the drafts modal is supposed to be `pointer-events: none` while
hidden, but some rogue CSS for `message_top_line *` set
`pointer-events: auto` to override `pointer-events: none` on
`message_top_line` was accidentally applying to things inside that
line in the drafts modal, and furthermore accidentally overriding the
`none` setting for the modal as a whole.

We fix that second bug here, which resolves the overall issue.
2019-07-23 17:22:14 -07:00
Anders Kaseorg 82828bdba4 HTML validation: Remove invalid <button href> attribute.
For .start-button, Bootstrap carousel already supports <button
data-target> as a valid alternative to <button href>.  For
.call-to-action, the margin is decreased to exactly offset the lack of
margin collapsing with display: inline-block.  There should be no
visual change.

Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2019-07-23 16:16:22 -07:00
Alexandra Ciobica 1c7db8eb9a css: Fix why-zulip images.
The addition of `.markdown` class added border and shadow on images,
which does not look good on the landing page.
2019-07-23 15:00:54 -07:00
Rishi Gupta 3ffc174dcb settings: Update description for unread count setting. 2019-07-22 20:37:19 -07:00
Anders Kaseorg f54a63e2f9 webpack: Transpile JS code with Babel.
Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2019-07-22 17:55:32 -07:00
Anders Kaseorg ecfb7c6a7f lint: Add TypeScript compiler as a linter.
Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2019-07-22 17:55:18 -07:00
Cynthia Lin 8c55e27d1e night mode: Fix loss of border color on default style buttons. 2019-07-22 17:28:38 -07:00
Cynthia Lin e37f529e6a portico: Add and use .button class for links requiring button styling.
Buttons cannot be nested in anchor links because that is invalid HTML.
To make links look like buttons, create a .button class that inherits
styling from buttons and apply them to the necessary links.

Fixes #6126.
2019-07-22 17:28:38 -07:00
Priyank Patel e69c2f1aa2 notifications: Send message received from desktop app notification reply.
Adds a electron_bridge event that takes in message id and reply recived from
the notification reply and sends a message. We do this in webapp so desktop
doesn't have to depend on narrow and channel modules.

We also modify zjunit to reset window.electron_bridge after every run
to avoid leaking it.
2019-07-22 17:20:44 -07:00
Tim Abbott 1b9a0367f2 settings: Fix indication for whether push notifications are enabled.
This was apparently broken in
981433d13c, which used an apparently
invalid partial syntax for doing lookups.
2019-07-22 16:14:13 -07:00
Anders Kaseorg 0310c3def4 css: Fix weird checkbox scrolling bug in Chrome.
This fixes a problem in Chrome where checking our styled checkboxes in
the stream creation form sometimes caused parts of the page to scroll
in weird ways or disappear.

The issue was that the hidden `position: absolute` checkboxes weren’t
scrolling with the `#stream-creation` scrollbar, which is `overflow:
auto`, not SimpleBar.  When you focused them, Chrome tried to scroll
them into view by whatever means necessary.  In this case, the
necessary means were to scroll the `.subscriptions-container`, which
is `overflow: hidden`.

Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2019-07-22 10:56:19 -07:00
Harshit Bansal bf14a0af4d auth: Migrate google auth to python-social-auth.
This replaces the two custom Google authentication backends originally
written in 2012 with using the shared python-social-auth codebase that
we already use for the GitHub authentication backend.  These are:

* GoogleMobileOauth2Backend, the ancient code path for mobile
  authentication last used by the EOL original Zulip Android app.

* The `finish_google_oauth2` code path in zerver/views/auth.py, which
  was the webapp (and modern mobile app) Google authentication code
  path.

This change doesn't fix any known bugs; its main benefit is that we
get to remove hundreds of lines of security-sensitive semi-duplicated
code, replacing it with a widely trusted, high quality third-party
library.
2019-07-21 20:51:34 -07:00
Rohitt Vashishtha 5fc37c5f9b compose: Add compose typeahead for stream+topic mentions.
We implement 3 changes:

1. Partial Stream Typeahead

   In addition to regular stream completion, we do partial completion
   of stream typeahead on pressing '>'. We use our custom addition to
   typeahead.js: this.trigger_selection to start topic_list typeahead.

   Implements: `#stream na|` (press >) => `#**stream name>|`.

2. Topic Jump Typeahead

   'topic_jump' typeahead moves the cursor from just ahead of a
   completed stream-mention to just after the end of the mention
   text and is triggered by typing '>' after the stream mention.
   This typeahead merely uses the regex matching and event hooks of
   the typeahead library instead of displaying any text completions.

   Implements: `#**stream name** >|` => `#**stream name>|`.

3. Topic List Typeahead

   'topic_list' typeahead shows the list of recent topics of a stream
   and if your current text doesn't match one of them, also shows you
   the current query text, allowing you to create mentions for topics
   that do not exist yet.

   Implements: `#**stream name>someth|` => `#**stream name>something** |`.

At the end of this commit, we support the following mechanisms to
complete the stream-topic mention:

1. Type "#denmar|".
2. Press Enter to get "#**Denmark** |".
3. Press > to get "#**Denmark>|".
4. Type topic name and press enter.

OR

1. Type "#denmar|".
2. Type > to get "#**Denmark>|".
3. Type topic name and press enter.

Both result in the final inserted syntax: "#**Denmark>topic name**".

Documentation is still pending.

Fixes #4836.
2019-07-21 20:38:17 -07:00
Rohitt Vashishtha 83cbd62ba1 typeahead: Support custom selection triggers in bootstrap typeahead.
We add support for triggering typeahead_completion on custom keyup events
in addition to Tab and Enter. The function `this.trigger_selection` takes
the keyup event as its argument and has the same `this` context as the other
typeahead functions.

This is being added to support partial completion of stream typeahead to
directly start the topic_list typeahead.
2019-07-21 20:18:48 -07:00
Rohitt Vashishtha 63e200997d typeahead: Support automatic selection in bootstrap typeahead.
We add support for automatically selecting the currently highlighted
option in a typeahead without rendering the typeahead or the user
pressing 'enter'. The function `this.automated` can use available
data such as this.completing and this.token to determine if we should
automate selection or not.

This is being added to support the topic_jump mechanism.
2019-07-21 20:18:48 -07:00
Rohitt Vashishtha 5e6493d36e compose_state: Maybe update stream name on stream name change.
If we rename a stream that we are composing to, we now change the
stream name in the compose target as well.
2019-07-21 20:18:29 -07:00
Rohitt Vashishtha 3f03ae66f0 compose: Ensure valid destination stream in typeahead completion.
If we complete a typeahead with an invalid stream name in composebox,
we would get 'compose_stream is undefined' error while running the
checks to prevent accidentally mentioning private streams.

We can safely early-return from this function and let the 'send'
event handler show the error to the user.
2019-07-21 20:18:29 -07:00
Rohitt Vashishtha 5d20c4b8fb typeahead: Clear rendered stream html on stream rename.
Previously, after a stream name, you could search for it using its
new name but the typeahead would still display the old name.
2019-07-21 20:18:29 -07:00
YashRE42 0fa90162f9 buddy_list: Do not fade current user in PMs.
Fixes a bug where we would fade out our own name because it wasn't in
selected as a recipient in the compose box, when making a PM.
2019-07-21 15:06:10 -07:00
YashRE42 9f5fca5579 notifications: Refactor and test notifiable unreads logic.
In this refactor, we extract two functions in unread.js.  Which one to
use depends on whether res has already been fetched or not.

This also adds node tests to maintain coverage of unread.js.

Tweaked by tabbott for cleaner variable names and tests.
2019-07-21 14:56:42 -07:00
Rishi Gupta 7d8d0b2284 settings: Update upgrade text and styling.
When we add Plus, the first sentence should change to "Available on Zulip
Standard and Plus".

I copied the styling of .tip out of expediency, but it's also possible that
long term we'll want only 1 tip-like box styling.

The hover styling is a bit random, but I tried to copy other hover styles I
found in settings.scss.

Note that this renames .upgrade_realm_plan_type_suggestion to .upgrade-tip.
2019-07-21 14:32:36 -07:00
Rishi Gupta a93045c12d message view: Add keyboard shortcut to title for [More...]. 2019-07-20 14:39:15 -07:00
Rohitt Vashishtha 9d6727d18c echo: Update topic_links when we get messages back from server. (#12832) 2019-07-20 14:38:52 -07:00
Cynthia Lin bbdf00e6e5 night mode: Improve coloring of .new-style buttons.
Border and text color applied by specific classes such as sea-green
were nullified by the previous selector; this commit restores the coloring
for these buttons.
2019-07-19 13:27:37 -07:00
Cynthia Lin fd7cf53190 templates: Eliminate anchor links with nested buttons.
Given that all links are now modals triggered by JS, the anchor links are
just invalid HTML that have no purpose. This commit refactors the HTML to
eliminate them by adding the Bootstrap-native btn-link class to maintain
styling. Fixes part of #6126.
2019-07-19 13:27:37 -07:00
vinitS101 fe2ec995b6 message_view: Add js tooltip hovers for emoji reactions.
This removes HTML title hovers for emoji reaction buttons below messages
and replaces them with js tooltips.

Fixes #8679.
2019-07-19 12:45:44 -07:00
vinitS101 278ccc559b message_view: Add a js tooltip hover for reaction button.
This change removes the html title for the reaction button
and replaces it with a JS Tooltip with the same title text.
2019-07-19 12:45:44 -07:00
Vinit Singh 86073588be dependencies: Upgrade jquery-autosize 1.17.7 to autosize 4.0.2.
The API for the autosize library changed upstream, so several changes
had to be made to relevant js files for a successful upgrade.

Resolves #12695.
2019-07-18 14:33:16 -07:00
Tim Abbott 500b161aab unread: Enable the load_server_counts setting for everyone.
This change is long overdue.  After implementing this much more robust
system and deploying it on chat.zulip.org, we hesitated to make
load_server_counts the default behavior in master, because of data
anomalies present for many existing users (basically messages far back
in their history that they had never read, on streams they believed
themselves caught up on), which would have been confusing for many
users.

However, because the mobile apps have been using this data set for a
long time, we've likely cleared out the anomalies from active users'
data set.  And for older users, they're going to come back to
approximately infinite unread messages anyway, so the data anomalies
are unlikely to be important.

Fixes #7096.
2019-07-18 13:34:55 -07:00
Anders Kaseorg c4fee086a6 css: Restore keyboard accessibility to styled checkboxes. 2019-07-18 12:19:48 -07:00
Anders Kaseorg ab89f40a66 generate-custom-icon-webfont: Replace with webpack webfonts-loader.
Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2019-07-18 12:00:00 -07:00
Cynthia Lin 7bb5162fc7 portico: Refactor button selectors to use SCSS nesting. 2019-07-18 11:54:30 -07:00
Cynthia Lin 0f44608974 portico: Reorder button selectors in preparation for SCSS nesting. 2019-07-18 11:54:30 -07:00
Cynthia Lin 7c1b6aa5a8 portico: Remove style selector for superflous button.grey-transparent.
There is no element with the .grey-transparent class in the current
codebase, so it is likely legacy and thus unnecessary.
2019-07-18 11:54:30 -07:00
Vaibhav ba2d609e6a css: Nest `.subscriptions-header` inside `.subscriptions-container`. 2019-07-18 11:41:18 -07:00
Vaibhav d104935d69 css: Nest `.display-type` inside `.subscriptions-container .right`. 2019-07-18 11:41:18 -07:00
Vaibhav bafcad8ef3 css: Use SCSS nesting for `.subscriptions-container`. 2019-07-18 11:41:18 -07:00
Vaibhav ef64f33808 css: Reorder subscriptions.scss so .subscriptons-container is in same place. 2019-07-18 11:41:18 -07:00
Vaibhav 3c0f447f1a css: Use SCSS nesting for `.subscriptions-header`. 2019-07-18 11:41:18 -07:00
Vaibhav 279b52ac82 css: Reorder subscriptions.scss so .subscriptions-header is in same place. 2019-07-18 11:41:18 -07:00
Mohit Gupta 648a60baf6 narrow: Add condition whether to show unread message first in narrow.
All narrows that have is: query or can mark unread message as read
will show unread message first.
2019-07-17 17:58:20 -07:00
Mohit Gupta 6ec40cf9a0 search: Don't mark messages as read in search narrow.
Don't mark unread messages as read while searching.
This behavior will be extended to other narrows later.

Fixes: #12556.
2019-07-17 17:58:20 -07:00
YashRE42 7867830e14 settings: Adjust styling of ? icons. 2019-07-17 17:47:08 -07:00
Priyank Patel ea2e7ccf27 message_fetch: Use user ID for sender and group-pm-with operator. 2019-07-17 16:09:12 -07:00
Alexandra Ciobica 28ebe3e6ba css: Refactor topic edit buttons to use scss nesting. 2019-07-17 22:30:39 +03:00
Alexandra Ciobica 117e1e05ea css: Clean up styling of topic edit buttons.
Related to: #11233.
2019-07-17 22:20:52 +03:00
Archit Kaushik e8eaa19ae4 topic edit: Improve styling of topic edit icons (save and cancel).
The earlier styles were inconsistent with the rest of UI.
The new styles follow the colour scheme.

Fixes #10983
2019-07-17 22:20:52 +03:00