Commit Graph

5304 Commits

Author SHA1 Message Date
Tommy Ip 6a694418b2 refactor: s/error-msg/compose-error-msg. 2017-11-27 21:35:14 -08:00
Tommy Ip b9c2f479d3 refactor: s/send-status-close/compose-send-status-close. 2017-11-27 21:35:14 -08:00
Tommy Ip c0c58f9761 refactor: s/send-status/compose-send-status. 2017-11-27 21:35:14 -08:00
Tommy Ip ddaff4cd2a refactor: Extract upload mechanics to new JS module.
Tweaked by tabbott to move changes from the next commit that are
required for this to pass tests into this commit.

Note that this exports a few items that were not previously exported.
2017-11-27 21:31:51 -08:00
Tim Abbott 0445322625 compose: Export the major upload-related methods.
This is a preparatory commit to moving these to their own module.
2017-11-27 21:31:24 -08:00
Tim Abbott df58f0f7ae compose: Export some upload-related variables. 2017-11-27 21:31:23 -08:00
Rishi Gupta 83149a953a copy paste: Turn off toMarkdown in production.
At least until some of the TODOs at the bottom of
node_tests/copy_and_paste.js are done.
2017-11-27 16:44:16 -08:00
Rohitt Vashishtha 8082780853 typeahead: Update @mention to not autocomplete "@ " (@space).
Tweaked by tabbott to also cover "@** ".

Fixes #7533.
2017-11-27 15:15:56 -08:00
Steve Howell 025b8c19ae Simplify code to warn about private stream links.
This change does a few things:

    * I use "early return" to make the code a bit flatter
      and easier to comment.

    * I added more comments.

    * I removed some unneeded passing of `invite_only` into
      the template.
2017-11-27 10:41:10 -08:00
Umair Khan 8f190e0746 user-groups: Update marked.js to do proper local echo for mentions.
We implement markdown in the JS as well to improve the
usability.  Comes complete withunit tests.

Fixes #7381.
2017-11-27 09:16:09 -08:00
Umair Khan 9d0eea8dd1 user-groups: Add is_member_of. 2017-11-27 09:08:30 -08:00
Rhea Parekh 1d826ae201 composebox: Warn when linked to private streams.
Fix issue #6860
2017-11-27 07:41:59 -08:00
Rohitt Vashishtha be56a99734 popover: Populate compose_box with popover user's email.
Replaces use of compose.respond_to_message with compose.start, manually
populating the email field with the popovered user's email.

Fixes #7526.
2017-11-26 22:59:37 -08:00
Shubham Dhama 5e23bfa779 typeahead: show typeahead for syntax of the from @**... or #**...
Fixes: #7494.
2017-11-26 11:18:47 -08:00
Balaji2198 585cd36a2e setting: Align elements properly in invite users.
Adds a margin-top to `Check all` and `Uncheck all` elements.

Fixes #7488.
2017-11-26 09:13:33 -08:00
Eeshan Garg 15bf0ebc61 css: Fix overflowing long URLs in Markdown macros.
Long URLs in Markdown macros overflow their containers without this
property. This reverts 0dc91a9148.  We
will likely need to fix the original Windows bug that
0dc91a9148 has resolved another way.
2017-11-25 17:02:38 -08:00
Tim Abbott 13a1b44aa8 settings: Fix missing target=_blank on realm emoji images.
This resulted in problems with the desktop app, where clicking these
links would leave the user in a situation where they needed the "back"
button in order to get back to the webapp.

Fixes zulip/zulip-electron#342.
2017-11-25 09:43:01 -08:00
Robert Hönig 0dc91a9148 css: Fix code blocks overflowing for integration names. 2017-11-24 09:26:08 -08:00
Cynthia Lin b607d26f0a lightbox: Fix image metadata not displaying at full width when possible. 2017-11-24 09:21:31 -08:00
akashnimare 271c3c1101 portico: Fix portico dropdown bug.
This fixes a responsiveness bug where the portico dropdown was not
showing up properly in a mobile view.
2017-11-23 15:56:50 -08:00
Tim Abbott 1152246993 Revert "reactions: Change from grey to translucent."
This reverts commit 30f45ac061.

This commit caused problems with the compose box emoji picker
overflowing its bounds in Firefox at 90% zoom.
2017-11-23 14:55:00 -08:00
Tim Abbott 4d4532a27e copy_and_paste: Add a simple extensible test suite.
This commit is mostly about adding the test suite; some of the results
are things we'd like to change.
2017-11-23 12:59:01 -08:00
Andy Perez e7f1825617 bugdown: Update KaTeX to version 0.8.3 from 0.7.1.
Fixes #7480.
2017-11-23 12:43:34 -08:00
Greg Price 47abd9c522 i18n: Update translations (including complete Korean!) 2017-11-22 18:11:20 -08:00
Steve Howell 59870b2203 Make dark theme toggle only run in dev mode. 2017-11-22 16:13:09 -08:00
akashnimare a37e993907 portico: Remove unnecessary background from realm-icon.
This PR removes unnecessary white background from realm-icon.
Also, I have given padding and border-radius to make it look good.

This also fixes a bug where realm-name didn't show up because of the
white font color.
2017-11-22 15:00:22 -08:00
Tommy Ip f425f9ad3d navbar: Fix transparency issue. 2017-11-22 13:02:13 -08:00
Andy Perez 0449dc8b8a bugdown: Fix handling of nested fenced math blocks.
Change any fence delimiters (backticks and tildes) to be
interpreted literally inside of math fenced_code blocks.

Fixes #5190.
2017-11-22 12:19:43 -08:00
Tommy Ip db240de555 /team: Make the contributor list more fair.
Don't display contributors with less commits than the 100th server
contributor (the Github API limits the output of users to 100).
2017-11-22 11:33:24 -08:00
Tommy Ip e44b8809b2 /team: Render contributors list in tabs client side. 2017-11-22 11:33:24 -08:00
Cynthia Lin e071d27b6b lightbox: Fix text overflow of translated user interface.
Fixes #7469.
2017-11-22 09:56:30 -08:00
Garvit 52069998eb compose: Preserve links when pasting html.
This uses the to-markdown.js library to do all the hard work of
parsing HTML and turning it into markdown and not e.g. uploaded files.

Tweaked by tabbott to better scope when it activates to just include
pastes of HTML content.

Fixes #5853.
2017-11-21 19:52:47 -08:00
Tim Abbott 9fa58a3c16 compose_ui: Automatically resize textarea after adding new syntax.
This fixes existing problems as well as an upcoming problem that
copy-and-pasting in markdown should usually expand the compose text
area.
2017-11-21 19:52:47 -08:00
Vishnu Ks 34689370cd settings: Create UI and backend for setting signups stream. 2017-11-21 17:39:51 -08:00
Tim Abbott 84b9147fe3 gitignore: Add static/generated/icons. 2017-11-21 09:27:04 -08:00
Rohitt Vashishtha 5221ea5db5 settings: Make CSS selector more specific in table rows in org settings.
Fixes #7374. Since we use `table-layout: fixed`, the width of the first
row are applied to all the remaining rows, thus wrapping all the columns
to 20% width. This is fixed by making the selector specific to only
user_rows and not the editable data row.
2017-11-21 09:12:55 -08:00
Steve Howell 4a6c3eeb98 Use realistic filepaths in zuliprc docs and hints.
The first part of this change is to have the "Your bots"
tooltip not lie about creating `.zuliprc`, because it
doesn't put a dot in front of the file.

And then the more significant change here is to make
the "Running a bot" documentation use realistic filepaths,
both in terms of where the download typically puts the file,
and where you want to move it to.
2017-11-21 07:32:24 -08:00
Cynthia Lin aa50fae4ba portico: Add anchor link support to API and user docs.
Fixes #7432.
2017-11-20 17:23:19 -08:00
akashnimare 9d973129ab user docs: Update compose box screenshots. 2017-11-20 17:14:01 -08:00
rht bff736868e Generate custom-icon-webfont on each provision or update-prod-static.
Fixes #7354.
2017-11-20 16:36:49 -08:00
Harshit Bansal 8a4fc9970f reactions.js: Migrate webapp to use the new reactions API.
Fixes: #6909.
2017-11-20 15:27:20 -08:00
Tommy Ip 3a397b2f2d /team: Left align BDFL name and role in non-mobile UI. 2017-11-20 09:44:17 +00:00
derAnfaenger 73915a9631 docs: Move integration docs to /api. 2017-11-17 11:58:54 -08:00
Umair Khan 06b57e8512 style: Merge css of social login/register buttons. 2017-11-17 11:44:13 -08:00
Andy Perez 83f563aeff bugdown: Properly parse empty blockquotes.
The character ">" now only starts a blockquote if the resulting
blockquote would be non-empty.  Thus, by itself, ">" is now
interpreted literally by bugdown, fixing #687.  The message
with contents consisting of ">>>" is now parsed as a doubly
(not triply) nested blockquote with contents ">".  Properly
formed blockquotes have identical behavior as before, but now
bugdown can no longer produce empty blockquotes as output.

Fixes #2886, #687.
2017-11-17 11:41:44 -08:00
Andy Perez bdaf3275f7 message feed: Fix display height of empty messages.
Ideally, empty messages are never created.  However, sometimes even
non empty messages can act as if empty, such as one consisting only
of an opening and closing blockquote tag.  This sets the
.message_content to have a minimum height equal to the line height.
This is overridden with zero (the default) in the case of collapse.
2017-11-17 11:40:22 -08:00
Brock Whittaker 2b6587c6bf overlays: Move overlays earlier in index.html.
It appears as though the ordering of the overlays in the DOM is
overriding their z-index in Safari on mobile. This moves them up to
the top of the template ahead of the header so that the header will no
longer display above the overlays in positioning.

Fixes: #7248.
2017-11-17 11:03:08 -08:00
Brock Whittaker 4fb7292dd4 message-feed: Add dark mode support for inline code. 2017-11-17 10:30:24 -08:00
Brock Whittaker 874598b291 left-sidebar: Change icons to be translucent.
This changes the icons to be translucent rather than grey and also
makes them get darker on hover rather than lighter (which didn’t really
make sense) on the normal theme.
2017-11-17 10:30:24 -08:00
Brock Whittaker 5081294c5b streams: Remove unnecessary font color declaration, change to translucent.
This changes a declaration from grey to translucent and another to
remove an unnecessary color declaration.
2017-11-17 10:30:23 -08:00
Brock Whittaker 015cd65e8f message-feed: Change borders from grey to translucent.
This changes the borders from grey to translucent and bins them to the
nearest tenth of opacity.
2017-11-17 10:30:23 -08:00
Brock Whittaker 7d2607c919 settings: Change borders from grey to translucent.
This also changes the .settings-section table borders to be darker
which keeps it inline with the rest of the styling.
2017-11-17 10:30:23 -08:00
Brock Whittaker 30f45ac061 reactions: Change from grey to translucent.
This keeps the look the same on a white background but works better on
color backgrounds, as it shares a similar saturation.
2017-11-17 10:30:23 -08:00
Brock Whittaker d13e556923 reactions: Remove unecessary color declaration. 2017-11-17 10:30:23 -08:00
Brock Whittaker e14e61c22e compose: Change borders from gray to translucent.
This works better on color backgrounds while staying the same on white.
The compose input borders are also darkened slightly.
2017-11-17 10:30:23 -08:00
Brock Whittaker 83f329b41a components: Change checkboxes from grey to translucent.
This works better with color background and looks the same on white.
2017-11-17 10:30:23 -08:00
Brock Whittaker aeed2e6863 dark-mode: Remove unnecessary CSS and fix dark mode bugs. 2017-11-17 10:30:18 -08:00
Brock Whittaker 151e5b0e51 app: Remove column-middle background color.
The declaration making the background color white seems to be
unnecessary.
2017-11-17 08:44:04 -08:00
Brock Whittaker f5f217570c message-feed: Change private message blue to be translucent.
This looks the same on white, different on dark blue.
2017-11-17 08:44:04 -08:00
Brock Whittaker 2d9a570ceb drafts: Remove unnecessary white background on messages.
This removes the white background behind the messages that isn’t useful
since they are already on a white background.
2017-11-17 08:44:04 -08:00
Brock Whittaker 53616cc714 gear-menu: Inherit body color.
Instead of overriding the default link color with grey, just inherit
the body color.
2017-11-17 08:44:04 -08:00
Brock Whittaker a77b41dce4 navbar: Remove background attribute on search bar.
This removes the background color declaration on the search bar so it
can inherit the standard input background color.

navbar: Let search bar inherit from base color.
2017-11-17 08:44:04 -08:00
Brock Whittaker 3df96a27cc message-feed: Make stream labels inherit color.
Instead of overriding the default link color with grey, just inherit
the base color.
2017-11-17 08:44:04 -08:00
Brock Whittaker ff39aa0eb5 message-feed: Remove white backgrounds on messages.
They aren’t necessary either I don’t believe.
2017-11-17 08:44:04 -08:00
Brock Whittaker cd3ea16785 navbar: Remove white background.
It’s never been necessary afaik.
2017-11-17 08:44:04 -08:00
Brock Whittaker e0e7c0091b compose: Change from grey to translucent black. 2017-11-17 08:44:04 -08:00
Brock Whittaker 3c4900205c streams: Fix width bug with stream creation form footer.
The footer was a few pixels short and would create a gap in the bottom
right hand corner of the streams overlay when the stream creation flow
is open.
2017-11-17 08:44:04 -08:00
Brock Whittaker 1514ea9be6 streams: Inherit base color rather than redefining text color.
This also removes an unecessary font-weight declaration that
was immediately being overridden.
2017-11-17 08:44:04 -08:00
Brock Whittaker efb7206756 settings: Change grey colors to translucent black. 2017-11-17 08:44:04 -08:00
Brock Whittaker e806300b51 settings: Use `.modal-bg` class to control background color.
This lets the `.modal-bg` class dictate background color instead of
manually setting it for all modals.
2017-11-17 08:44:04 -08:00
Brock Whittaker 537c1c211b right-sidebar: Remove base color definition.
The right-sidebar should just inherit the color of the body, not invent
a new lighter shade of grey.
2017-11-17 08:44:04 -08:00
Brock Whittaker 3ebccda703 left-sidebar: Make <ul> links inherit body color.
The links were overridden with a dark grey to not display normal link
color but should really just inherit the body color.
2017-11-17 08:44:04 -08:00
Brock Whittaker 9852861f8a compose: Change white background to be on #compose.
This changes the white background placement to be on #compose rather
than .compose-content.
2017-11-17 08:44:04 -08:00
Brock Whittaker ca46a2152b popovers: Restyle border-bottom below avatar in user popovers.
This styles the border-bottom to be an opacity based solution to
work the same with the normal mode and better with dark mode.
2017-11-17 08:44:04 -08:00
Brock Whittaker 16d06c6a78 portico-header: Remove border between image and realm name.
This removes the border between the realm image and the realm name in
the portico header that is shown when logged in.
2017-11-16 16:03:24 -08:00
Tim Abbott 638eb7a8e4 docs: Update links to ReadTheDocs to always use https.
This is better security practice.

We also add a lint rule to enforce this for the future.
2017-11-16 10:59:24 -08:00
Tim Abbott 054952a44a docs: Update links from codebase to point to ReadTheDocs. 2017-11-16 10:53:49 -08:00
David Rosa Tamsen 7072fa5b37 docs: Reorganize developer docs to improve navigation.
This commit helps reduce clutter on the navigation sidebar.
Creates new directories and moves relevant files into them.
Modifies index.rst, symlinks, and image paths accordingly.

This commit also enables expandable/collapsible navigation items,
renames files in docs/development and docs/production,
modifies /tools/test-documentation so that it overrides a theme setting,
Also updates links to other docs, file paths in the codebase that point
to developer documents, and files that should be excluded from lint tests.

Note that this commit does not update direct links to
zulip.readthedocs.io in the codebase; those will be resolved in an
upcoming follow-up commit (it'll be easier to verify all the links
once this is merged and ReadTheDocs is updated).

Fixes #5265.
2017-11-16 09:45:08 -08:00
Tommy Ip acdc4c9d27 /team: Improve the responsiveness of the team profiles.
Fixes #7349
2017-11-15 17:08:08 -08:00
Tommy Ip 0bd09398d8 /team: Use CSS grid for contributors table. 2017-11-15 17:08:08 -08:00
Aastha Gupta c84f1686b7 emoji: Display emoji in messages as text as well as reactions.
Fixes #6795.
2017-11-15 16:59:11 -08:00
Brock Whittaker b76578ca13 Add an experimental dark mode stylesheet.
Note from tabbott: While this initial version is experimental and
definitely incomplete, we expect to have a solid version done over the
next few weeks (after more refactoring).  We're merging this now to
make it easy to test both versions when refactoring our CSS.

Fixes #267.
2017-11-15 16:45:34 -08:00
Brock Whittaker ce62abce73 dark-mode: Add "T" hotkey for dark mode theme. 2017-11-15 16:45:34 -08:00
Brock Whittaker f9f0f356be settings: Add backend storage and interface for night mode.
This allows the night mode setting to be stored in the backend.
2017-11-15 16:36:06 -08:00
Brock Whittaker 2c000c0f1d settings: Increase specificity of sidebar <li> selector.
This was interfering with <li> elements outside of the settings page.
2017-11-15 13:42:44 -08:00
Brock Whittaker 744c4af958 left-sidebar: Remove topics help code.
This removes code associated with the dead topic help feature that is
below “more topics”.
2017-11-15 11:01:33 -08:00
Florian Jüngermann b31917be1d frontend: Remove redundant stream separator in the left sidebar.
In the case of no 'normal' streams (only pinned and dormant ones) there are two separators
between the groups of streams. My commit removes one.
2017-11-15 10:06:25 -08:00
Cynthia Lin d5a3691561 media: Display stream list filter at full width. 2017-11-14 11:12:13 -08:00
Cynthia Lin 940ca17c46 hotkeys: Expand collapsed sidebars when sidebar searches are initiated.
Fixes #7351.
2017-11-14 11:12:13 -08:00
Cynthia Lin 7d2672cfcd popovers: Include expanded mobile sidebars as active popovers. 2017-11-14 11:12:13 -08:00
Steve Howell 99ecb51c5f minor: Add whitespace after commas in CSS. 2017-11-13 12:43:43 -08:00
Steve Howell f35b7b4c77 css: Convert colors to hsl() format.
This changes most of the app-related CSS files, but leaves
things like landing pages and bootstrap alone.
2017-11-13 12:43:43 -08:00
Steve Howell ba51078418 Simplify CSS linter and clean up CSS.
The CSS linter was pretty hard to reason about.  It was
pretty flexible about certain things, but then it would
prevent seemingly innocuous code from getting checked in.

This commit overhauls the pretty-printer to be more composable,
where every object in the AST knows how to render itself.  It
also cleans up a little bit of the pre_fluff/post_fluff logic
in the parser itself, so comments are more likely to be "attached"
to the AST node that make sense.

The linter is actually a bit more finicky about newlines, but
this is mostly a good thing, as most of the variations before
this commit were pretty arbitrary.
2017-11-13 12:43:43 -08:00
Umair Khan 597a6e6c74 user-groups: Add user groups in typeahead code. 2017-11-13 11:42:17 -08:00
Umair Khan 0e21cbc5d9 user-groups: Create static/js/user_groups.js. 2017-11-13 13:08:15 +05:00
Brock Whittaker 7b4124b7b4 portico-header: Add background to avatar images.
This adds a white background color to avatar images that may
have a transparent background.
2017-11-10 19:25:42 -08:00
Brock Whittaker ca2f93db31 settings: Restyle "emoji style" section.
This restyles and rewords some of the emoji style section to look
better and fit it more with the current style guide.

Tweaked by tabbott to modify the historical migration rather than
adding a new one.  This is OK because the emojiset choices text change
doesn't touch the database; it's just a Django Python code thing.

Also removed translation tags, since we don't need them for a set of
brand names.
2017-11-10 17:04:27 -08:00
Harshit Bansal 439bc2920a settings: Change the control for selecting emojiset to radio group.
Fixes: #7260.
2017-11-10 16:59:03 -08:00
Andy Perez 4d51a6cfac bugdown: Fix $$ whitespace handling.
The intended use of $$ is for inline expressions, not for multiline
ones; ```math is an acceptable alternative for the latter.  Hence,
the $$-syntax for inline TeX no longer permits newlines within it.

This was also necessary for the next change to be sensible; namely
allowing for spaces around both $$ when crafting inline TeX instead of
forcing everything to be crammed together, e.g. $$x=7$$.  In order to
avoid uninentionally creating inline expressions, the opening and
closing $$'s of an inline expression must now both exactly consist of
two dollar signs, no more and no less.

Fixes: #6488.
2017-11-10 16:54:27 -08:00
Brock Whittaker 5ae4b8d3f3 input-pill: Add clean up functions.
This adds functions to remove pills and reset the state.
2017-11-10 14:14:03 -08:00
Brock Whittaker 70a14d8b44 bootstrap: Patch bootstrap.js to support contenteditable.
If the lookup input is contenteditable, it should be searching for text
rather than input.
2017-11-10 14:14:03 -08:00
Brock Whittaker 1bb45dd946 hotkey: Prevent hotkey interactions with pills.
This prevents hotkeys from firing when any of the pills or pill
input sections are focused.
2017-11-10 14:14:03 -08:00
Brock Whittaker 00d11fb0af input-pill: Add styling.
This adds some styling for the default case of the input pills and some
custom styling.
2017-11-10 14:14:03 -08:00
Brock Whittaker 5a0bba2afc input-pill: Add validation callback for pills.
This adds a validator that when calling `reject` will reject a pill
from being added.
2017-11-10 14:14:03 -08:00
Brock Whittaker 5d0aae283f input-pill: Add key/value caching.
Some of the calls in our codebase will call for the `.keys()` method a
lot, so this caches the results and returns them rather than mapping
the array if it knows the state to be the same as before.
2017-11-10 14:14:03 -08:00
Brock Whittaker 93141cbe39 input-pill: Have all clicks directly on container focus input.
If a user clicks on the pill container and not directly on a pill
or on an "x" inside of a pill, it should be presumed they are
trying to input new text. This effectively makes the whole non-pill
section an input bar.
2017-11-10 14:14:03 -08:00
Brock Whittaker 7b00736fa2 input-pill: Add "input_pill" class and documentation. 2017-11-10 14:14:03 -08:00
Brock Whittaker d27882325c hotkeys: Refactor text selectors to be array.
This makes it easier in the future to see diffs and to add/remove text
selectors for hotkey prevention.
2017-11-10 14:14:03 -08:00
Cynthia Lin 1bcc07f7dd popovers: Add bot icon to user profile popovers for bots.
Fixes #7176.
2017-11-10 11:18:43 -08:00
Cynthia Lin a3e5f2a887 message view: Use new custom bot icon in messages. 2017-11-10 11:18:43 -08:00
Cynthia Lin 0b800b0a7d icons: Create framework for custom icons and add new bot icon. 2017-11-10 11:18:42 -08:00
Umair Khan ef545b9180 user-groups: Add css for user-group-mention class. 2017-11-09 17:35:46 -08:00
Garvit 8084f2dc55 Add: Profile picture popover on clicking mentions in chats.
Fixes #6380
2017-11-09 12:21:16 -08:00
YJDave de67bf81fd org settings: Allow users to delete their message.
Fixes #7049.
2017-11-09 10:20:34 -08:00
Steve Howell d7254a0556 Append space as needed in compose_ui.smart_insert(). 2017-11-09 09:49:20 -08:00
Steve Howell f935afa241 Prepend space as needed in compose_ui.smart_insert(). 2017-11-09 09:49:20 -08:00
Steve Howell 1b1858aa64 node tests: Test compose_ui.smart_insert(). 2017-11-09 09:49:20 -08:00
Steve Howell 12dc567a89 Move insert_syntax_and_focus() to compose_ui.js.
This change also removes a couple lines of test code that
weren't really testing anything.
2017-11-09 09:49:20 -08:00
derAnfaenger 19bc55aa45 Fix various typos.
The typos and their corrections were found with the
aid of https://github.com/lucasdemarchi/codespell.
2017-11-09 16:26:38 +01:00
Brock Whittaker 4817ba44a4 tab-switcher: Switch tabs with left/right arrows.
This now allows all tab switcher components to be used with left
and right arrows, given that a tab is already in focus, which is
the default behavior unless overridden (like on the streams
overlay).
2017-11-08 18:13:57 -08:00
Brock Whittaker 5b86b65818 message-feed: Do not autoscroll new messages if popovers open.
Do not attempt to autoscroll down to view new messages if popovers are
open. This prevents the issue where someone can be viewing a profile or
reacting to a message and not be able to due to a new message coming in.

Fixes: #7319.
2017-11-08 13:37:00 -08:00
Brock Whittaker 228b0c4290 /help/: Add a slide class for sidebars that should have slide mechanism.
This adds a slide class that specifies that the JS actions for sliding
up and down sections is the desired behavior, along with a bit of CSS
to help display correctly in the case of not being a sliding section.
2017-11-08 13:01:33 -08:00
Brock Whittaker 670f20248a /api/: Fix incorrect sidebar styling.
This rule is only applied to the API page which makes it inconsistent
with the /help/ page.
2017-11-08 13:01:33 -08:00
Brock Whittaker dfb3597eb2 left-sidebar: Remove leading whitespace underline on global filters.
This removes the leading whitespace that was approximately the width of
a space character that would get underlined when hovering over any one
of the global filters.
2017-11-08 12:29:40 -08:00
Steve Howell c2860ce214 Set client_gravatar=True in the webapp.
The webapp knows how to compute gravatar URLs, so there is no need
for the server to send us gravatar URLs.
2017-11-07 16:38:14 -08:00
Brock Whittaker 54ac11f2e1 left-sidebar: Fixup line height issues with unread counts.
This centers the text along with the unread counts vertically within
the <li> in the left sidebar.
2017-11-07 16:28:34 -08:00
Angelika Serwa 9930cb43cd stream_settings: Add loading spinner when creating a new stream.
Add a spinner for when a stream is being created to show that
an operation is being performed, while also disallowing users to
modify the form in the meanwhile.

Commit modified by Brock Whittaker <brock@zulipchat.com>.

Fixes: #5268.
2017-11-07 12:26:47 -08:00
Tim Abbott 17f3cbbb90 Revert "static: Optimize SVG images."
This apparently messed up the size of the bot icon on some browsers.

This reverts commit 7a6e0dda41.
2017-11-07 12:15:22 -08:00
Brock Whittaker 95f34b2a90 left-sidebar: Increase line-height to not cut off text bottom.
This increases the line height so it does not cut off the bottom of the
stream text in characters like “g”.
2017-11-07 10:57:00 -08:00
Brock Whittaker c5eaf303cc left-sidebar: Allow for more space for unread counts.
This leaves enough space for up to 100,000 unread message counts, which
perhaps above we should change to say something like “102K”.
2017-11-07 10:57:00 -08:00
Steve Howell f105c480b3 Calculate gravatar hashes on the webapp client.
This change prepares us to have the server send avatar_url
of None when somebody wants a gravatar avatar (as opposed
to a user-uploaded one).

Subsequent commits will change behavior on both the server
and client to have this happen.  So this commit has no-op
code for now, but it will soon use the fallback-to-gravatar
logic.
2017-11-07 10:36:02 -08:00
Steve Howell 7e4702c9c1 Avoid double-escaping HTML for settings notifications.
The i18n.t function already escapes HTML, so we should avoid
calling jQuery's text() method, which double escapes the HTML.

The symptom reported here was that if you changed your
timezone to something like like America/Mexico_City, you'd
see `&#x2F;` instead of `/`.

Most callers to the `ui_report` functions clearly call `i18n.t`
on the messages with code like this:

    ui_report.success(i18n.t("No changes to save!"), status);

There are some exceptions:

    blueslip.js: has really long hard coded messages
    reload.js: mostly says "Reloading...", which perhaps we should
               translate
    settings_account.js: uses helper functions
    settings_lab.js: uses local variable
    settings_org.js: i18n happens in property_types
    ui.js: uses generic_embed_error (unaffected by this change)

Fixes #7280
2017-11-07 09:52:20 -08:00
Steve Howell 567da076ad i18n: Translate strings in settings_account.js. 2017-11-07 09:52:20 -08:00
Steve Howell 2b6fee3c53 i18n: Translate deactivation errors in the webapp. 2017-11-07 09:52:20 -08:00
Steve Howell aa61db9301 Change warn -> error in people.report_late_add().
This commit is easy to revert if we want to tone down errors
to warnings for the short term, while our codepath still does
proper handling for adding users when they come in messages.
2017-11-07 09:51:10 -08:00
Steve Howell 02a011d627 Add people.report_late_add().
We want to know when users are added after page load, as it can
be a symptom of stray messages leaking in or live-update problems,
etc.

Fixes #7120
2017-11-07 09:51:10 -08:00
Steve Howell aebfdaa8ed refactor: Use early-return in extract_people_from_message(). 2017-11-07 09:51:10 -08:00
Steve Howell 294a1fb8f8 refactor: Extract people.maybe_incr_recipient_count().
This logic used to be in extract_people_from_message(), but
we are deprecating extract_people_from_message(), whereas
the maybe_incr_recipient_count() function has logic that we
want to keep.
2017-11-07 09:51:10 -08:00
Steve Howell c291c74e45 minor: Make comment more accurate in popover error condition. 2017-11-07 09:51:10 -08:00
Steve Howell 5271241b24 Read page_params.realm_non_active_users() at page load.
This change is the first step in making it so that we load
non-active users at page load time in the webapp.

Before this change, we would reactively handle deactivated
users when we saw them as senders in messages.  Subsequent
changes will make it a warning if we see unknown senders
in messages.
2017-11-07 09:51:10 -08:00
Steve Howell 48b18e4a38 Only show active realm users in compose typeahead.
There's no reason to include deactivated users in compose
typeahead, since we won't let the compose happen.

This also removes cross-realm bots from the typeahead, which
is mostly driven by not having a convenient function to include
them, but also it's rare that it makes sense to talk to a cross-realm
bot unless replying to it.
2017-11-07 09:51:10 -08:00
Cynthia Lin 7a6e0dda41 static: Optimize SVG images. 2017-11-04 20:57:19 -07:00
Cynthia Lin d94a84e77f static: Remove unused images. 2017-11-04 20:57:19 -07:00
Cynthia Lin f63585bd6d hotkeys: Ensure navigation hotkeys do not work while overlay is open.
Fixes #7123.
2017-11-03 15:38:10 -07:00
Cynthia Lin e7de4f5d74 hotkeys: Modify draft toggle behavior. 2017-11-03 15:38:10 -07:00
Brock Whittaker 4af9e11115 left-sidebar: Add overflow ellipsis on long stream names.
On stream names that don’t quite fit, we’ll add overflow ellipsis to
them. It appears we already did this on mobile in a sub-optimal way so
we can remove that media query with preference to the new, better
styling.
2017-11-01 13:27:42 -07:00
Brock Whittaker c9af964357 list_render: Add sorting reversal.
This allows a user to reverse the sort order by clicking again on an
active tab, which changes from ascending to descending order.

Fixes: #7254.
2017-11-01 13:26:40 -07:00
Brock Whittaker 26dd785b2b list_render: Use correct arrow for ascending.
Ascending files (as it currently is by default) should use an upwards
arrow.
2017-11-01 13:26:40 -07:00
Brock Whittaker fd19743098 settings: Fix scrolling on settings page in narrow height windows.
This allows a user to scroll all the way down on the sidebar and the
main panel in the settings page on narrow height windows by removing
the min-height specification and making the “Log out” line in the
sidebar become statically positioned at shorter heights.

Fixes: #7251.
2017-11-01 13:25:27 -07:00
Cynthia Lin ad374ad3c5 css: Fix improper indentation to fix Travis test failure. 2017-10-31 18:58:59 -07:00
Cynthia Lin 6a4e7ad12e user settings: Enhance Uploaded files sorting.
Fixes #7149
2017-10-31 18:33:41 -07:00
Cynthia Lin 5d9327a25b user settings: Improve Uploaded Files design.
* Prevent long file names from corrupting table display.

* Add sticky table header.

Fixes #7189.
2017-10-31 18:33:41 -07:00
Brock Whittaker 425738fa24 landing-page: Extract /team/ from /about/.
This extracts and creates a /team/ page using the existing
'team.html' template and applying the why-page styling to it.
2017-10-31 11:37:42 -07:00
Shubham Dhama aab0eeb5cc popovers: Hide opened popover on navigating back.
Hides popover if it remains open and an overlay such as the settings
UI is opened via the browser back button.

Fixes: #7230.
2017-10-31 08:47:00 -07:00
Tim Abbott 3104d3ea3e api: Fix rendering of code blocks after clicking sidebar links.
We need to call `render_code_sections` to show the code block for the
current language whenever switching which code block we're looking at.
2017-10-30 22:53:41 -07:00
Tim Abbott f01f596138 help: Merge api.js and help.js bundles to fix code blocks.
In addition to decreasing the excessive number of bundles we had, this
will set us up to fix rendering of code blocks when clicking the
sidebar links in the /api-new site.
2017-10-30 22:53:17 -07:00
Brock Whittaker e86e259cb1 /api/: Add Markdown-based /api-new documentation.
This commit allows for the /api-new/ page to rendered similarly to our
/help pages.  It's based on the old content for /api, but we're not
replacing the old content yet, to give a bit of time to restructure
things reasonably.

Tweaked by eeshangarg and tabbott.
2017-10-30 22:32:43 -07:00
Greg Price eb55a3a1ba template context: Give better names to the URLs for the API.
The "subdomain" label is redundant, to the extent it's even
accurate -- this is really just the URL we want to display,
which may or may not involve a subdomain.  Similarly "external".

The former `external_api_path_subdomain` was never a path -- it's a
host, followed by a path, which together form a scheme-relative URL.
I'm not quite convinced that value is actually the right thing in
2 of the 3 places we use it, but fixing that can start by giving an
accurate name to the thing we have.
2017-10-30 18:29:29 -07:00
Jack Zhang fef828a037 compose: Add video link button, powered by Jitsi. 2017-10-30 17:13:47 -07:00
Tim Abbott bb80c0cc24 compose_state: Extract insert_syntax_and_focus.
This moves the existing emoji picker code to a new library.
2017-10-30 17:12:56 -07:00
Harshit Bansal 5020ba4a20 emoji: Allow users to change emoji set.
This feature was merged in PR #4383 but was disabled due to some
remaining emoji infra changes.

Fixes: #209.
2017-10-28 10:38:33 -07:00
Catherine Kleimeier fe2adeeee1 hotkeys: Fix ESC removing message feed focus in Firefox.
We correct a bug on Firefox where using the ESC key to close an edit
box that was opened by the left arrow key caused the message feed to
lose focus, making it difficult to navigate the message feed by
keyboard afterwards.

We fix this bug by changing the function that handles the ESC key
during an edit to pass the correct object to the message_edit.end
function.

Fixes #7072.
2017-10-27 17:11:12 -07:00
Brock Whittaker 25251e0216 /about/: Create a team partial.
This creates a template for the /team/ page that is currently just
embedded inside the /about/ page.  This includes the titles for core
team members with their pictures.
2017-10-27 14:50:48 -07:00
Henrik Pettersson 09cd47c6ad Add UI for viewing and cancelling open Zulip invitations.
Lets administrators view a list of open(unconfirmed) invitations and
resend or revoke a chosen invitation.

There are a few changes that we can expect for the future:

  * It is currently possible to invite an email that you have already
    invited, it might make sense to change this behavior.

  * Resend currently sends an invite reminder instead of resending the
    original invite, this is because 'custom_body' was not stored when
    the first invite was sent.

Tweaked in various minor ways, primarily in the backend, by tabbott,
mostly for style consistency with the rest of the codebase.

Fixes: #1180.
2017-10-27 13:07:43 -07:00
derAnfaenger 45c21b79e1 settings ui: Restrict file type for image file pickers.
Previously, we would allow users to pick any file, even if we didn't
support that file type.
2017-10-27 10:21:36 -07:00
derAnfaenger 64025d2ce7 integrations: Add Errbot documentation.
Fixes zulip/python-zulip-api#49.
2017-10-27 09:22:51 -07:00
Brock Whittaker c771873439 informational-overlays: Make tab-switcher full-size.
The tab-switcher did not satisfy the full space of the header and
seemed to be a bit visually broken. This fixes it and makes it 100%
width.
2017-10-26 16:52:37 -07:00
Brock Whittaker 6500611ecd /plans/: Change FAQ section answers to <p>.
By changing the sections to paragraphs, the underlines come back
for the links.
2017-10-26 15:15:22 -07:00
Brock Whittaker 798133a403 landing-pages: Remove :hover underlines in unecessary places.
All links by default had an underline on hover, including when
<a> tags were wrapping <div> and <img> tags, which made for a small
underline near them on hover. This better focusses the underline
behavior to just paragraphs and lists.
2017-10-26 15:15:22 -07:00
Brock Whittaker a2a0e9b1c0 landing-page: Detect meta key to prevent page transitions.
This detects the meta key being pressed to open a page in a new
tab and therefore will prevent the page animation from fading out
the body content, in case the user wants to go back to that page
again.
2017-10-26 15:05:34 -07:00
Brock Whittaker 3d7fb4888b portico-header: Add down chevron to indicate dropdown.
This adds a down chevron to the pill org realm section to indicate
clicking it will drop it down.
2017-10-26 13:56:53 -07:00
Brock Whittaker 53d739f9aa portico-header: Add pill with org/realm name.
This adds a pill element that includes the org/realm name that you
are currently signed into.
2017-10-26 13:56:53 -07:00
Steve Howell df03e30d68 popovers: Fix is-active checks for popovers.
We were incorrectly reporting active bots as non-active in
popovers, and we had no test coverage for cross-realm bots.

We also rename the function to is_active_user_for_popover,
since the old name, realm_user_is_active_human_or_bot, suggested
the wrong semantics for cross-realm bots.

Last but not least, we only do a blueslip warning if a user id
is not found.  When lookups fail, we are pretty confident that
the user is not active, so an error is overkill.  We can change
that as part of issue #7120.

Fixes #7153
2017-10-26 13:56:32 -07:00
Brock Whittaker ae9d686d26 features: Make more responsive.
This fixes some responsiveness issues with the features page where the
text for headers would go off the screen on mobile and narrower devices.
2017-10-26 11:01:20 -07:00
Brock Whittaker e20dd2f1fc features: Add constraints to message-feed image.
This adds two constraints to the image:

1. The `max-width` can not be more than 500px (which prevents it
from being to vertically tall.
2. The `display` is set to `none` below 1024px because the image is
too small at that point to be legible.
2017-10-26 11:01:20 -07:00
Steve Howell f8f4d9cb63 people.js: Rename realm_get -> get_active_user_for_email.
We rename this function to be more clear, and we also remove
a stray function name for `realm_get` that was for the wrong
exported function.
2017-10-26 09:52:42 -07:00
Steve Howell 2699a6aac9 refactor: Extract people.is_valid_email_for_compose().
It's easier to unit test logic inside of people.js than compose.js.

We allow users to compose emails to any of our cross-realm bots.
Someday we may tighten up which cross-realm bots are valid targets,
since it's not necessarily the case that those bots do anything
useful when you send them messages.
2017-10-26 09:45:08 -07:00
Steve Howell 8cf5e05827 Rename realm_people_dict -> active_user_dict.
This dictionary includes bots, so the reference to
"people" in the name `realm_people_dict` was misleading.

We omit `realm` for brevity sake--it's usually the case
that folks implementing new features can safely ignore
cross-realm bots, and it's on our roadmap to move those
bots into the realm.
2017-10-26 09:26:28 -07:00
Steve Howell 646bd356a3 Rename get_realm_human_user_ids -> get_active_user_ids.
The function name `get_realm_human_user_ids` was a lie--it
includes active bots as well.

The only user of this function is `activity.js`, which wasn't
impacted by the misleading name, because we eventually filter
out bots in the `info_for` function.

It's possible that we actually want to include bots in the right
sidebar, since they can be difficult to discover in other parts
of the UI.  Or, if we want to keep the right sidebar as all
human users, we may eventually want to make the logic to exclude
bots happen higher in the stack (but for real, this time).
2017-10-26 09:17:43 -07:00
Brock Whittaker 03805fdca4 landing-page: Remove incorrect gray text.
This changes some text that would display gray when on a blue body
text page; we considered changing the opacity instead, but probably we
should just delete this..
2017-10-25 16:49:42 -07:00
Brock Whittaker f885ec82db landing-page: Make <ul> formatting consistent.
This changes the <ul> styling so that when not nested in a <p>
tag it'll have the standard font-weight (400) and be the same
color as the body text (blue/gray).
2017-10-25 16:36:31 -07:00
Brock Whittaker fd779c1ba6 compose: Remove PM recipient box outline.
This removes the old blue styled outline around the PM recipient
box that was part of the older bootstrap styling in favor of the
dark outline on :focus that had been implemented for the rest of
the recipient boxes recently.
2017-10-25 15:15:58 -07:00
Brock Whittaker a9a9333b2a portico: Show whether the user is logged in.
This creates a dropdown in place of the normal register/login links
you get when logged out, with an option to go to the app or log out if
that appears you click on the avatar.

A bit more work is needed to make this look really good, but it's a
great start.
2017-10-25 14:59:24 -07:00
Tim Abbott 10dc9ecc92 i18n: Update translation strings for 1.7 release. 2017-10-25 09:20:29 -07:00
Tim Abbott 11eba1173c popovers: Don't show bots as deactivated in user popovers.
Apparently this is a bug that slipped in when we started showing
normal users as deactivated in the user popovers: all bot users were
treated that way as well.

We'll want to do #7153 as a follow-up to get things fully working how
we want them.
2017-10-24 15:59:51 -07:00
Tim Abbott d8a873a571 filter: Improve group-pm-with descriptions.
This makes it a bit clearer what this actually does.
2017-10-24 13:19:24 -07:00
Tim Abbott 3ee53d5de3 auth: Don't offer password reset links when useless.
If an organization doesn't have the EmailAuthBackend (which allows
password auth) enabled, then our password reset form doesn't do
anything, so we should hide it in the UI.
2017-10-24 12:07:43 -07:00
Tim Abbott 1978455287 subs: Fix exception with streams overlay open but no active stream.
Previously, if you had the streams overlay open (but no active stream
clicked) while another user edited your subscriptions state, we'd
throw an exception handle the get_events call, because the code for
rerendering the subscribers list didn't consider the possibility that
there was no active stream.
2017-10-23 22:56:14 -07:00
Tim Abbott 9d0e1a2e0c subs: Don't try to update stream settings UI when closed.
The recent fixes we made to make stream settings update properly when
doing live updates were great, but they would throw an exception if
the stream settings overlay wasn't open.  This fixes that by adding
the appropriate check.
2017-10-23 22:44:27 -07:00
Tim Abbott bdc7772bab subs: Fix bug with invalid access to stream IDs.
`sub.id` isn't a valid field; it's `sub.stream_id`.
2017-10-23 22:44:05 -07:00
Brock Whittaker 4b45878946 notifications: If "Notification" is undefined, just return "denied".
We do not want the code to lead to a path where it will attempt to
display native notifications if the “Notification” object doesn’t
exist, as this likely means that the device does not support OS
notifications.
2017-10-23 21:29:42 -07:00
Tim Abbott a57f577650 i18n: Update translations files. 2017-10-23 16:18:16 -07:00
Brock Whittaker e304c44c2e integrations: Impose max-width for readability.
This imposes a maximum width constraint on the center block so
that it can maintain readability and keep the content paragraphs
to less than 1000px.

Fixes: #7092.
2017-10-23 14:24:31 -07:00
Brock Whittaker 981e6e6836 settings: Display "Never" over "Invalid Date" for inactive users.
This shows the text "Never" for users who are part of a realm but
have never been active, rather than a more vague JavaScript output
of "Invalid Date" due to the fact that their last presence
evaluates to NaN.
2017-10-23 13:57:11 -07:00
Tim Abbott 4db99196e9 message_edit: Fix red highlighting for messages mentioning you.
When we added support for mentioning users when editing messages, we
neglected to add this bit of code needed to make sure the UI code in
message_list_view.js would actually rerender that part of the
message's state.

Arguably, this is a sign that the message_container structure should
be just recomputed every time we rerender messages, but that's a less
tactical fix.
2017-10-23 11:02:30 -07:00
Tim Abbott 4418425c10 translations: Add a few new languages.
Indonesian, at least, has gotten pretty far in translating.
2017-10-20 14:20:31 -07:00
Brock Whittaker 79d0f13885 sidebars: Move arrows and unread counts away from scrollbars.
The arrows were too close to the scrollbars that it would be
difficult to click them sometimes. This moves over the arrows and
unread counts to combat the issue.
2017-10-20 13:29:10 -07:00
Brock Whittaker 1a9c13a655 left-sidebar: Vertically align nested PM lines.
This vertically aligns the lines to be centered rather than about
three pixels closer to the bottom than to the top.
2017-10-20 13:11:43 -07:00
Brock Whittaker e5a09f422c notification-banner: Check if mobile before displaying.
Notifications essentially don't work on any mobile web clients,
so don't even show the banner.

This also fixes a traceback where it checks the permission state
with `notifications.permission_state()`, which calls
`Notification.permission`, which will error due to `Notification`
not existing on mobile devices.

Fixes: #7105.
2017-10-20 13:07:40 -07:00
Tim Abbott 961e615d9a i18n: Update translations. 2017-10-20 10:31:06 -07:00
Tim Abbott bd5e7f8965 Revert "i18n: Only load active language."
This reverts commit f04981513b.

We're not sure, but we suspect that this made Zulip not show es for
folks using es_es as their locale.  Further testing is required.
2017-10-20 10:08:17 -07:00
Umair Khan f04981513b i18n: Only load active language.
Before this if we selected zh-hans then i18next would laod zh-hans, zh and
en. Now it will only load zh-hans.
2017-10-19 17:56:49 -07:00
Umair Khan 69fc227eb8 i18n: Create loadPath function.
This function returns the correct URL to retrieve zh-Hans from Django.

Fixes #6885
2017-10-19 17:56:49 -07:00
Shubham Dhama e321e15c49 date-separator: Make date rows unselectable.
Fixes #6311.
2017-10-19 17:49:57 -07:00
Vishnu Ks 4b5327b326 form: During realm creation give option to install in root domain.
This presents multiple states for the subdomain input option
depending on the existence of a root domain.

Commit modified heavily by Brock Whittaker <brock@zulipchat.com>.

Fixes #6863.
2017-10-19 16:10:14 -07:00
Brock Whittaker 5889132732 notifications: Remove test for "webkit" in userAgent.
This removes a test for "webkit" in the userAgent string in order
to see whether notifications should be displayed. This is so that
the notifications process will work correctly in Firefox and not
keep registering as "false" which makes the notifications prompt
continue to re-show itself.
2017-10-19 15:01:12 -07:00
Vishnu Ks 534141ed07 popover: Pass value of is_active to userlist popover.
This was forgotten in 4f088292ee,
breaking the right sidebar user popover.
2017-10-19 10:58:35 -07:00
Brock Whittaker 7107d19aeb notifications: Detect whether notifications are blocked.
This checks whether the user is already in the state of having
blocked notifications, so that we can *not* show them the banner
to enable notifications, since browsers won't allow the request
to go through again.

Perhaps in a follow up we should create a different banner for
this case that shows how to enable notifications at the browser
level for this site.
2017-10-18 21:55:43 -07:00
Brock Whittaker 96c66d4297 panels: Make them mobile responsive.
This makes them responsive to resizes and fixes a responsive
issue with the floating recipient being too high when the alerts
were more than one line height.
2017-10-18 21:55:43 -07:00
Aastha Gupta 0fae83b301 notifications: Prompt user to enable desktop notifications.
This is a two-step notifications process that will ask a user
to enable notifications and if they click exit give them three
options:

1. Enable notifications.
2. Ask later.
3. Never ask on this computer again.

The first two are self-explanatory (ask later = next session it
asks again). The third is captured and stored in localStorage and
a check is done on page load to see whether or not notifications
should be displayed.

Commit modified heavily by Brock Whittaker <brock@zulipchat.com>.

Fixes #1189.
2017-10-18 21:55:43 -07:00
Tim Abbott 70b8d881d9 sidebars: Fix left sidebar PM unread counts alignment.
This change was missed in 04273c077d.
2017-10-18 18:11:11 -07:00
Brock Whittaker 04273c077d sidebars: Make sidebar margins more uniform.
The left and right sidebar are now equidistant from the edges of the
center pane, and the contents within have equal margin from the edges
of their containers (5px).
2017-10-18 18:03:06 -07:00
Brock Whittaker 12c9076e98 right-sidebar: Align unread counts horizontally.
The group PM unread counts were pushed over toward the edge of the
screen which made them unaligned with the user unread PMs directly
above.

Fixes: #7064.
2017-10-18 18:03:06 -07:00
Brock Whittaker 4a4fbe3194 right-sidebar: Vertically align arrows in user presences.
The arrows were too low by 2px due to the generic styling that
applied to the left sidebar not working consistently with the
right sidebar.
2017-10-18 18:03:06 -07:00
Brock Whittaker 6f77887b4d /help/: Reduce margin-top for closer anchoring.
This lowers the amount of margin in the :before hack that we use
to put padding before anchored elements from 40px to 30px on <h1>
tags and 10px on everything else, which seems to be plenty.

Fixes: #7069.
2017-10-18 16:17:16 -07:00
akashnimare 70367deec3 apps: Add a direct link to installation section in desktop guide.
Fixes #6595.
2017-10-18 14:23:47 -07:00
Brock Whittaker 9090d6b12f streams: Re-render subscriber list on sub/unsub.
This re-renders the subscriber list on sub/unsub as long as that is the
current active stream settings.

Fixes: #6955.
2017-10-18 11:45:07 -07:00
Brock Whittaker 586369296c /subs/: Refactor to create a "get_safe_hash" method.
This returns a string always, checks if the “location” variable exists
inside of window, and will trim the first character (“#”) on hashes.
2017-10-18 11:45:07 -07:00
Brock Whittaker a93bedc8e6 streams: Re-highlight row after re-subscribing.
When re-subscribing by way of the "Subscribe" button in the right
side settings panel, the row will now be marked as active to
highlight that the row is still selected and being looked at.

Fixes: #6955.
2017-10-18 11:45:07 -07:00
Tim Abbott 2bc14d256f lint: Ban two spaces after comma in JS code.
We exclude the frontend tests, mostly because the lint rule isn't that
precise, and the test code has some sample user input that's a bit
funny.
2017-10-18 10:22:18 -07:00
Tim Abbott b634d9f38b lint: Ban two spaces after comma in CSS. 2017-10-18 10:11:33 -07:00
Tim Abbott 05b9316d5f i18n: Fix missing translation tags on deactivated notice. 2017-10-18 00:09:11 -07:00
Brock Whittaker 4f088292ee popovers: Hide user email and PM feature for deactivated users.
This hides the emails of deactivated users from the popovers along
with the link to send a PM to them.
2017-10-18 00:06:12 -07:00
Tim Abbott 773f8fcb05 stream_events: Fix exceptions when subscribed by another client.
We were getting several exceptions in mark_subscribed if the streams
overlay wasn't open, basically because we'd try to filter the
right-side stream list when it wasn't present in the DOM.
2017-10-17 23:42:29 -07:00
rht 691598a88b py3: Remove "from six.moves import range".
This is no longer required, since in Python 3, this is what the range
built-in does.
2017-10-17 23:28:14 -07:00
rht a603a4f9f5 Remove `from __future__ import absolute_import`.
Except in:
- docs/writing-bots-guide.md, because bots are supposed to be Python 2
  compatible
- puppet/zulip_ops/files/zulip-ec2-configure-interfaces, because this
  script is still on python2.7
- tools/lint
- tools/linter_lib
- tools/lister.py

For the latter two, because they might be yanked away to a separate repo
for general use with other FLOSS projects.
2017-10-17 22:59:42 -07:00
Alena Volkova 5515a075ec urls: Move the report endpoints to be API-style routes. 2017-10-17 22:05:56 -07:00
Harshit Bansal 9234abbd59 notifications: Fix realm emojis not appearing in desktop notifications. 2017-10-17 22:03:33 -07:00
Steve Howell 5a77a4d122 Inline muting_ui.mute_topic and unmute_topic.
These methods were only called by similarly named methods, so
it was kind of a confusing API, and they didn't really
encapsulate anything useful.
2017-10-17 17:41:21 -07:00
Steve Howell dea1888022 Fix muting_ui.persist_and_rerender() bug.
We were calling muting_ui.persist_and_rerender(), but
that function no longer exists.  Now we use the simpler
API.
2017-10-17 17:41:21 -07:00
Brock Whittaker 7cb7158a42 /help/: Re-add perfectScrollbar for sidebar and markdown.
This adds back the perfectScrollbar for the sidebar and markdown
sections because we already lost CTRL-F functionality, so we may
as well bring back the pretty, non-obtrusive scrollbars.

This updates the scrollbar after a successful `slideToggle` of
one of the sidebar sections.

Fixes: #6999.
2017-10-17 17:14:36 -07:00
Tim Abbott 7d3e3ff78c apps: Link to Electron app version 1.5.0. 2017-10-17 16:44:20 -07:00
Shubham Dhama d6a34c7a0c composebox_typeahead: Start emoji typeahead with single letter.
This changes the behaviour of the typeahead in the compose box to
start appearing with single letter lying in the range of a-z or '+'.

This is a nice solution, because all emoji names start with lower-case
letters, while most emoticons like :P use a capital letter or similar.

Fixes: #6808.
2017-10-17 16:06:13 -07:00
Brock Whittaker a768ed548c /for/*: Restyle /for/ and /why/ pages.
This restyles them to be more readable and more put together
than before by changing the line heights, text colors, and padding.
2017-10-16 09:58:13 -07:00
Tim Abbott 9ae506ac0e compose: Enable mention syntax when editing messages.
We had been waiting on doing this for a long time to make sure the
feature actually did what it was supposed to (completed last week);
this change adds the typeahead to ensure it actually works.

While we're fixing this, we remove the split between the edit and
compose code paths for typeahead, which is good, because we'd already
accidentally added the syntax-highlighting feature in only one place.

Fixes #195.
2017-10-12 18:08:32 -07:00
Brock Whittaker 4ab8337b2b message-feed: Normalize padding for topic headers.
This normalizes the padding on the sides of the topic headers to
all be 6px on the left and right for both PMs and for streams.
2017-10-12 14:25:40 -07:00
Brock Whittaker 33c1755c69 message-feed: Remove visually unappealing top border.
This removes an unecessary and unappealing top border to the
message headers while keeping all else the same.
2017-10-12 14:25:40 -07:00
Steve Howell 52299ce987 Highlight alert words in mentions you send to yourself.
Fixes #6946.
2017-10-12 14:03:36 -07:00
Brock Whittaker 6d8a8f2b7c list_render: Return data if no arguments present.
This will return the active data set if no arguments are provided to
the `data` method.
2017-10-12 10:42:06 -07:00
Steve Howell ae139a78b8 presence: Change "unknown" to "offline".
We never make an actionable distinction between the "unknown"
presence status and the "offline" status, so we now
just use "offline" as the status for persons who don't
have recent presence records that the client knows about.

(Usually, users without presence rows have never been online,
or they have been deactivated, or they have been offline so long
that they don't show up in our date-limited queries.)
2017-10-12 10:42:06 -07:00
Steve Howell 8593c25f45 refactor: Simplify user_last_seen_time_status().
We are about to stop supporting the presence status of "unknown."
Part of this fix is to stop checking for that status.

The implication of this change is that when we go
to display the time a user was last online, we now
mostly just look to see if presence.last_active_date
is undefined.  We were wary of that approach before, but it
is probably the most sane approach here.

I updated the comment abover this section to reflect
our philosophy going forward.

BTW the timestamp is kind of buried in the UI for now, as you have to
open the popover and then hover over the circular presence
indicator.
2017-10-12 10:42:06 -07:00
Tim Abbott 8828e96b87 presence: Avoid checking activity when reloading.
We sometimes get blueslip errors from browsers that are clearly still
attempting to reload long after they should have.  These browsers can
produce a lot of unnecessary presence update exceptions.

To solve that, we start checking reload_in_progress in the presence
code path.

While we're at it, we also add some blueslip logging for the reload
code path, in case it becomes useful when debugging future issues.
2017-10-11 20:39:28 -07:00
Brock Whittaker f8a2f06a84 reload: Continually attempt to reload page when reloading.
We've had a few reports of users using modern Chrome having problems
where reload.is_in_progress() was true, but the browser was just
sitting there, not having reloaded.

This will continually attempt to reload the page periodically try and
compensate for the behavior in Chrome where it appears that the tab
has to be active or semi-active for `location.reload` to be respected
when Chrome is trying to save power, which means that it should just
continually try until the page is active again, in which case the
`location.reload` func will work and reload the page.

See https://developers.google.com/web/updates/2017/03/background_tabs
for the Chrome featureset that we believe may be involved with this
issue.

Tweaked by tabbott to reload earlier and add the on-focus handler.

Fixes: #6821.
2017-10-11 20:38:33 -07:00
Harshit Bansal eedcbe2d47 drafts: Automatically delete misbehaving drafts while formatting.
While applying formatting to drafts if any draft contains some syntax
which our markdown processor is unable to process delete the draft so
that drafts overlay can be opened without any error. Also report the
exception to the server so that error can be fixed.
2017-10-11 17:44:03 -07:00
Brock Whittaker 36c2a6d8c9 streams: Change copy for stream creation suggestion.
This changes the copy and reverses the order of the button and text.
2017-10-11 16:17:36 -07:00
Brock Whittaker 71d61f93d5 streams: Change button styles on new stream creation form.
This changes the button styles from the old bootstrap buttons to
the new button styles on the stream creation form.
2017-10-11 16:17:36 -07:00
Brock Whittaker 6039687ecd streams: Add "Create Stream" button to right side.
This adds a button to allow a user to more easily discover the
stream creation functionality to the right side of the streams
overlay.
2017-10-11 16:17:36 -07:00
Tim Abbott c1f12e3f8a scrolling: Fix out-of-order bug in the message list.
The issue has a lot of extra details, but in short, if several
messages were sent at very close to the same time, it's possible that
the event queues will receive the "new message" events out-of-order.
This, in turn, could cause `get_events` to return an incorrectly
sorted block of messages.  These would then be passed into
`message_list.add_messages`, which doesn't handle that sort of
unsorted situation correctly (in short, the `self.first.id()`
comparison checks are not accurate for that situation, since we don't
update the boundaries after the first messages is processed).

The end result of this bug was that it was possible for the message
list to be out-of-order, which in turn would cause exceptions when
scrolling with the mouse.

Fixes #6948.
2017-10-11 15:57:11 -07:00
amanharitsh123 39c0771800 portico: Add back to login page link on reset page.
This adds a link that goes back to the login page only for the
Zulip Electron application.

Fixes: #6763.
2017-10-11 14:02:49 -07:00
Brock Whittaker 5b3bd49061 portico: Enable content discrimination by platform.
This allows CSS to discriminate by platform and show particular
content; in this case showing things with the attribute
[if-zulip-desktop] content only on “ZulipElectron”.
2017-10-11 14:02:49 -07:00
Brock Whittaker d17db446cf Fix up the hostpot styling.
This changes the box shadow to be less bold than currently,
makes the button target larger, the text larger, and the hotspots
anti-aliased.
2017-10-11 13:53:59 -07:00
Brock Whittaker 3379be9b46 components: Switch checkboxes to be natively grayscale.
This switches the checkboxes to be natively grayscale by
referencing the `checkbox.png` file rather than `checkbox-gree.png`
which means that we no longer need to apply the -webkit-filter
setting for grayscale.
2017-10-11 13:15:44 -07:00
Brock Whittaker 835b6c7059 components: Make checkboxes darker.
This makes the standard checkboxes 7% darker and makes the disabled
ones about 12% darker + 7% darker than they were before, to
increase visibility.

Fixes: #6331.
2017-10-11 13:15:44 -07:00
Brock Whittaker c2b7cd0f7e color-picker: Fix input height to display correct on FF.
This fixes the input to not be too short on FF and to have proper
padding on Chrome.

Fixes: #6361.
2017-10-11 12:59:28 -07:00
Brock Whittaker 1096bd11c9 streams: Rename settings hide/show functions.
The stream settings hide/show functions were "collapse" and
"show_sub", and this changes them to be "hide_sub_settings" and
"show_sub_settings".
2017-10-11 12:44:10 -07:00
Brock Whittaker 20af49b2bb streams: Call `actually_filter_streams` on stream events update.
Previously it was called before the event was processed by the server
and the subscription was updated to have the user subscribed to a
stream, so there was a race condition that would make it iso that
sometimes the stream line would disappear on the next render pass due
to the event not having completed yet.

This makes it so that the re-render happens after the event is
processed in `stream_events.js`.

Fixes: #6797.
2017-10-11 12:44:10 -07:00
Brock Whittaker 2ae2727c8b streams: Refactor `actually_filter_streams` to be public.
This refactors the function to be publicly accessible so we can call
the filter streams function from other modules.
2017-10-11 12:44:10 -07:00
Brock Whittaker 59cfed16ed streams: Hide and show settings properly for subscribed streams.
This now will show the settings properly when one unsubscribes and
resubscribes to a particular stream.

Fixes: #6798.
2017-10-11 12:44:10 -07:00
Brock Whittaker 9e9927d1d0 streams: Refactor `setup_subscriptions_stream_hash` arguments.
This refactors the arguments in the `setup_subscriptions_stream_hash`
method to remove the `stream_id` param and just take it from the `sub`
argument it is passed (which is an object that contains the property,
`stream_id`.
2017-10-11 12:44:10 -07:00
Brock Whittaker 7b8f2f8828 emoji-popover: Change :focus state from outline to darken.
This changes the :focus state of reactions that have been reacted
by yourself to darken on :focus rather than have the default
browser outline.
2017-10-11 12:31:49 -07:00
Brock Whittaker 897b33e79d components: De-duplicate `.no-underline` class.
This de-duplicates occurances of the `.no-underline` class by
removing it from "portico.css" and ensuring compaitbility by adding
support for the standard and :hover cases.
2017-10-11 12:24:44 -07:00
Brock Whittaker df9092cf42 components: Split out "app_components.css" for shared components.
This new “app_components.css” is for shared components between the
internal app and the portico pages.
2017-10-11 12:24:44 -07:00
Garvit 5f8fbc5d35 message view: Decode HTML in Stream subscription messages.
Previously, we would display effectively double-HTML-escaped content
here.

Fixes #6652.
2017-10-11 09:59:48 -07:00
Alena Volkova 79560e21bf urls: Move the json/tutorial_status endpoint to be an API-style route. 2017-10-09 15:13:33 -07:00
Tim Abbott 93e666c4bf compose: Restore shift-enter to always inserting a newline.
This was a not-well-thought-through behavior change done in #6489; the
part that was actually a problem was ctrl-enter not producing spaces
anyway.

So we fix this, and also add a comment explaining why.

Fixes #6908.
2017-10-09 15:10:54 -07:00
Harshit Bansal 6f4d24d851 reactions.js: Fix the conditional check for sending reaction request.
Request for adding an reaction only if there is a default emoji or
an active realm emoji with that name while request for removing a
reaction should be sent only if there is a default emoji or a realm
emoji(may be active or deactivated) with that name. Earlier we were
not including deactivated realm emojis while deciding whether a
request for removing a reaction should be sent or not which was
causing requests for the removal of reactions with deactivated realm
emojis not to be sent to the backend.

Fixes: #6007.
2017-10-09 11:31:21 -07:00
Eeshan Garg 71eee35bce webhooks: Add a Google Code-in integration. 2017-10-09 09:04:39 -07:00
Greg Price a116303604 passwords: Express the quality threshold as guesses required.
The original "quality score" was invented purely for populating
our password-strength progress bar, and isn't expressed in terms
that are particularly meaningful.  For configuration and the core
accept/reject logic, it's better to use units that are readily
understood.  Switch to those.

I considered using "bits of entropy", defined loosely as the log
of this number, but both the zxcvbn paper and the linked CACM
article (which I recommend!) are written in terms of the number
of guesses.  And reading (most of) those two papers made me
less happy about referring to "entropy" in our terminology.
I already knew that notion was a little fuzzy if looked at
too closely, and I gained a better appreciation of how it's
contributed to confusion in discussing password policies and
to adoption of perverse policies that favor "Password1!" over
"derived unusual ravioli raft".  So, "guesses" it is.

And although the log is handy for some analysis purposes
(certainly for a graph like those in the zxcvbn paper), it adds
a layer of abstraction, and I think makes it harder to think
clearly about attacks, especially in the online setting.  So
just use the actual number, and if someone wants to set a
gigantic value, they will have the pleasure of seeing just
how many digits are involved.

(Thanks to @YJDave for a prototype that the code changes in this
 commit are based on.)
2017-10-08 15:48:44 -07:00
Greg Price 11e767f5b1 passwords: Revise our password-quality logic for clarity.
This should be a pure refactor: we're just removing or tightening
some obsolete comments, and rearranging some logic to make it
easier to follow.
2017-10-08 15:48:44 -07:00
Steve Howell 3e6bfe1b23 Use user_ids, not emails, for bulk stream operations.
We now return user_ids for subscribers to streams in add-stream
events.  This allows us to eliminate the UserLite class for
both bulk adds and bulk removes.  It also simplifies some JS
code that already wanted to use user_ids, not emails.

Fixes #6898
2017-10-08 12:31:12 -07:00
Steve Howell 810532641e activity.js: Extract get_filtered_and_sorted_user_ids().
This function was extracted from build_user_sidebar().  We
also slightly streamlined it to not unnecessarily call
filter() when the filter text was blank. This extraction
also eliminated the need for us to have the two-line
filter_and_sort() function.

Also, we get to 100% coverage in this commit.
2017-10-08 12:01:59 -07:00
Steve Howell 6888255153 Add people.get_realm_user_ids().
This saves us from doing an unnecessary map() in
activity.js.
2017-10-08 12:01:59 -07:00
Steve Howell 943eefb7c0 activity.js: Extract get_filter_text().
We were using slightly different logic to get the filter
text in various places.  Now we're consistent, and it's
easier to test the edge-case behavior.
2017-10-08 12:01:59 -07:00
Steve Howell 3ef2df363b activity.js: Consolidate initialization code.
We now intialize user-list-filter within activity.initialize(),
which gives us more control to set the module variable
`meta.$user_list_filter` before we build the user sidebar,
while setting up its handlers after we build the sidebar.
2017-10-08 12:01:59 -07:00
Steve Howell 662b5ffbba activity.js: Remove inaccurate comment.
The comment removed here doesn't make sense, since meta
is not exported.
2017-10-08 12:01:59 -07:00
Steve Howell e3ee0245c4 Change userid -> user_id in people.js. 2017-10-07 12:16:45 -07:00
Brock Whittaker 8d3ebd8b47 /for/*: Add ".small" version of why-page hero.
This adds a small version that has 130px less padding than the
original header.
2017-10-06 17:01:34 -07:00
Tim Abbott 82b708b721 eslint: Add and enforce space-in-parens lint rule. 2017-10-06 12:36:59 -07:00
Tim Abbott 391e54f568 message_list: Limit potential damage of auto-scrolling.
We've been getting reports for a few months of folks coming back to
their Zulip window after a night's sleep and finding it scrolled to
the bottom, past dozens or hundreds of messages that they haven't
read.  Oddly, the pointer is actually still located where it should be
(verifiable by hitting the Up key), but it's too late: everything
below gets marked as read because bottom_whitespace is in view.

There's only a few places in the zulip codebase where we scroll the
page down, and this is the main one of them.  My best theory for what
could be happening is that the browser is, in its overnight
power-saving mode, not granting the Zulip window the resources to
actually repaint the early scrolls.  This, in turn, would cause
scrolling down to happen that is not limited by the need to keep the
pointer in view.

I don't think that this fully closes the issue; ideally, we'd have a
reproducer and much more precise detection logic for this situation,
but it should mostly resolve the problem with likely no user-facing
visible harm.
2017-10-06 11:36:33 -07:00
Tim Abbott 01c9acedd1 locale: Update translations. 2017-10-06 10:09:53 -07:00
Tim Abbott fe6a04cbdb Revert "locale: Fix incorrect locale name for zh-Hans."
This reverts commit ba8dc62132.

As best I can tell, the old configuration was correct for what Django
wanted.  Further testing is required, but this at least brings
.tx/config to match the actual filenames; I think our Chinese
translations have been broken until now.
2017-10-06 10:09:08 -07:00
Umair Khan e3e95b3523 i18n: Update translations files.
This commit combines a `tx pull` with updating the translations.json
files to change the values of those items whose key is equal to the
value. The new value is an empty string.
2017-10-05 23:03:33 -07:00
Tim Abbott ba8dc62132 locale: Fix incorrect locale name for zh-Hans. 2017-10-05 22:54:02 -07:00
Umair Khan 326a6f6b4f i18next: Don't allow empty string as valid translation.
Previously we used to mark a key as unstranlated if its value was equal
to it in translations.json. This had an issue because it didn't allow
otherwise valid cases where key was equal to the value.

This commit solves the problem by disallowing an empty string as a valid
translation and then using the empty string as the value for all the
unstranslated keys.

Fixes #5261
2017-10-05 22:44:34 -07:00
brockwhittaker a0a2241c66 /hello/: Fix the width of the call-to-action button.
This fixes the width of the call-to-action button to be auto, as it
previously was set in the #hero to be 150px which forced the words in
the button to wrap to two lines.
2017-10-05 21:02:05 -07:00
Brock Whittaker a6f5d3d93a emoji-picker: Do not change scroll on emoji hover.
Currently when hovering on an emoji it will focus it, which makes
the browser by default scroll down or up to include the entirity
of the focused element. This corects the scrollTop to what it was
before the focus event adjusted the scroll position.

This is a follow-up to #6869.
2017-10-05 15:51:06 -07:00
derAnfaenger ad5bc4b06c js: Use shorthand $() instead of $(document).ready(). 2017-10-05 10:10:37 -07:00
Tim Abbott bcbe41177a emoji_picker: Fix hover behavior to key off entire emoji.
Previously, you had to hover over the smaller area where the emoji
image was to select it, whereas the user expectation is that hovering
the emoji's padding should select it as well.
2017-10-05 09:11:03 -07:00
Harshit Bansal b8c58cc830 emoji_picker: Make the mouse hover and key navigation share same state.
This commit makes the arrow key navigation and mouse hover affect the
same state such that for example if one moves the mouse over some emoji
and then hits down-arrow the cursor will move down by one from where he
left the mouse at rather than beginning from the top-left corner.

Fixes: #6827.
2017-10-05 09:02:49 -07:00
Cynthia Lin 884d4dad6e emoji_picker: Change emoji background color when selected by hotkey.
[Tweaked by HarshitOnGithub to remove the `:hover` and `:active`
selector.]
2017-10-05 09:02:49 -07:00
Harshit Bansal 7546e3325f emoji_picker: Add `get_emoji_coordinates()` function.
Given the `emoji-id` of an emoji in emoji picker this function
returns its coordinates, i.e, section number and index.
2017-10-05 09:02:49 -07:00
Harshit Bansal da86cbdaf5 emoji_picker: Extract `get_emoji_id()`. 2017-10-05 09:02:49 -07:00
Harshit Bansal 48ac282667 hotkeys: Remap ':' to close the reactions popover in case of empty search.
Fixes: #6806.
2017-10-05 19:05:27 +05:30
Harshit Bansal 1e50ec4039 hotkey: Rename `:` from 'open_reactions' to 'toggle_reactions_popover'. 2017-10-05 19:05:27 +05:30
Brock Whittaker 84bf6e3424 left-sidebar: Restyle "more topics" flow.
This adds a nice elipses animation to the left sidebar "more topics"
flow.
2017-10-04 23:23:03 -07:00
Tim Abbott e2f2035562 activity: Fix misordered conditional for filtering. 2017-10-04 21:57:01 -07:00
Tim Abbott 588f6c7ac9 activity: Remove presence.get_mobile call.
This didn't do anything anyway, and with the new activity list
filtering code, was causing exceptions.
2017-10-04 21:23:40 -07:00
Tim Abbott 68e75833b7 activity: Fix the node tests.
These were unfortunately broken with the recent changes to filter all
users.
2017-10-04 21:06:51 -07:00
Brock Whittaker 0c42e4a705 typeahead: Fix typeahead positioning for iOS keyboard case.
When the iOS keyboard is open and up, the positioning gotten by
getBoundingClientRect will display a `top` value that is short by the
height of the keyboard, which will usually end up placing things north
of the top of the screen.

By changing to jQuery $.fn.offset instead, the positioning appears to
be correct in all cases; iOS keyboard up, down, and desktop usage.

Fixes: #6366.
2017-10-04 17:39:42 -07:00
Brock Whittaker 3b50bc82e0 right-sidebar: Filter *all* users, not just recent users on input.
This will look through all users and not just ones active in the last
three weeks but only when you are searching with the right sidebar
input box.

Fixes: #5775.
2017-10-04 17:03:23 -07:00
Brock Whittaker a223b7364b activity: Switch ".user-list-filter" to only be queried once.
For static queries like this, just fetch it once so we don’t have to
worry about the overhead.
2017-10-04 17:03:23 -07:00
Brock Whittaker af35b9632a errors: Move error page CSS above @media queries.
Normal CSS shouldn't be below @media queries, so this moves the
chunk of ".error_page" related CSS above the @media queries in
"portico.css".
2017-10-04 15:48:11 -07:00
Brock Whittaker 97c4d16ef6 5xx: Fix line height for headers.
The header line-height is too short when it collapses to multiple
lines so this sets the line-height back to "normal" from "30px"
which sets the text further apart.
2017-10-04 15:48:11 -07:00
Brock Whittaker add854886f 5xx: Make image respond to mobile view.
By setting the width to 100%, it will go smaller than 500px in mobile
views rather than staying at 500px.

Fixes: #6854.
2017-10-04 15:40:32 -07:00
Brock Whittaker fc4311b1e6 5xx: Change min-height to reflect new footer.
The min-height for the error pages was not updated to reflect the
height of the new footer, so this updates the value and makes it a
non-scrolling page in most browsers again.
2017-10-04 15:40:32 -07:00
Vishnu Ks 94cb5b854f frontend: Show info on /emails only in dev env. 2017-10-04 14:45:08 -07:00
Brock Whittaker 99933d5cce settings: Set the upload table colum min-widths.
This sets the column width of the upload table actions and size
columns to always be 75 so that the buttons are always in the same
line and take up the least amount of space possible with that
constraint.
2017-10-04 14:29:18 -07:00
Vishnu Ks 80fc9cda3a settings: Mention about /emails after sending change email mail. 2017-10-04 08:20:29 -07:00
Vishnu Ks 0c35bd60cf frontend: Seperate out info on accessing emails to template. 2017-10-04 08:20:29 -07:00
Vishnu Ks 8964e04238 templates: Mention about /emails after the email is sent in dev env. 2017-10-04 08:20:29 -07:00
Sarah a72c7ac28f ui_init.js: Fix typo in comment. 2017-10-03 17:57:54 -07:00
Brock Whittaker a7f602fed6 /help/: Fix sidebar target bug.
This tries to toggle the next item when clicking on an <h2>
in the sidebar, however we want to first check the next item is
an <ul> element, so that we are collapsing or showing a list,
instead of something like an <h2> which currently happens with
the "#guides" element.
2017-10-03 16:38:47 -07:00
Brock Whittaker 9c08f9417c /help/: Make sidebar text smaller to remove overflow.
This removes issues with the text overflowing to two lines by
making the text about 5% smaller.
2017-10-03 16:36:37 -07:00
Brock Whittaker 20c685bf9f /help/: Make sidebar down arrows less prominent.
Lower the opacity to make the arrows stand out less.
2017-10-03 16:36:37 -07:00
Brock Whittaker c9514d0ad2 /help/: Remove underline and changes text from "Index" => "Main Index".
This removes the underline on hover and changes the text to get to the
index.

This also changes it to an <h2> tag so that it will be more inline
with the styling of the rest of the sections, but without the
down chevron.
2017-10-03 16:36:37 -07:00
Brock Whittaker 513df556bb /help/: Show first sidebar section by default.
F
2017-10-03 16:36:37 -07:00
Brock Whittaker 80545e30d4 /help/: Make "| User Documentation" in header more prominent.
This makes the section more visible through increasing the font weight.
2017-10-03 16:36:37 -07:00
Brock Whittaker ee7f7f00ac /help/: Normalize margin on tip indicators.
This normalizes the padding on the tips to be equal on the top and
bottom.
2017-10-03 16:36:37 -07:00
Brock Whittaker 97cc24c4a5 /help/: Change ".markdown" background to white. 2017-10-03 16:36:37 -07:00
Brock Whittaker 6c43749c1a /help/: Restyle headers.
This restyles the headers to make the <h1> more prominent with a line
break below it, and the <h2> to be less prominent with smaller text and
pushed closer to the <p> tags.
2017-10-03 16:36:37 -07:00
Brock Whittaker 16bbe0ceb9 /help/: Remove sidebar bullets.
This removes the circular bullets on the <li> items in the sidebar.
2017-10-03 16:36:37 -07:00
Brock Whittaker 1d8ded48ec /help/: Change sidebar to be light grey. 2017-10-03 16:36:37 -07:00
Brock Whittaker e179e4c5ea /help/: Reduce padding between list items.
Remove the padding on the <p> tags for the most part inside of the <li>
sections to make them more consistent with the line heights of the body
text.
2017-10-03 16:36:37 -07:00
Brock Whittaker 2087543113 /help/: Change tips borders to be the same hue/saturation.
This changes the borders of the tips to be the same hue and saturation
as the backgrounds, just with less luminosity for consistency.
2017-10-03 16:36:37 -07:00
Brock Whittaker b1c2947efa /help/: Change text to be dark blue/grey.
This changes the body text to be a dark blue tinted grey.
2017-10-03 16:36:37 -07:00
Brock Whittaker 383669de0b /#streams/: Add checkmark hover state.
This adds a hover state to just the checkmark that makes it darker
than the line hover state that allows a user to know that the
checkmark is allowed to be toggled.
2017-10-03 15:55:18 -07:00
Brock Whittaker 60e3abddcb media.css: Make compose box not collapse to two lines.
This makes the compose box not collapse to two lines by making input
fields smaller.

Fixes: #6366.
2017-10-03 15:49:16 -07:00
Brock Whittaker 9cc5014ae9 media.css: Make min-width small enough to support iPhone 5.
This makes the min-width go down to the screen width of the iPhone 5
(320px) so that content doesn’t overflow.
2017-10-03 15:49:16 -07:00
Brock Whittaker 3a4abc25a1 media.css: Group two @media queries together.
There were two `@media (max-width: 500px)` queries that should have
been grouped together.
2017-10-03 15:49:16 -07:00
Steve Howell c5b7e3f1ab Eliminate have_scrolled_away_from_top boolean.
The `have_scrolled_away_from_top` logic goes way back
to November 2012.

Now we unconditionally load older messages when we scroll
to the top of the feed.  Before this bug, you could get
"stuck."  It was a bit difficult to reproduce, but with
the right combination of render window sizes and batch
sizes, you would hit the home key quickly and hit the top
of the feed in a way that the flag got in the way of
going back in history.

Fixes #6628
2017-10-03 11:29:47 -07:00
Steve Howell 4d00c390ea Call maybe_rerender when prepending messages to a list.
We had a bug where once you scrolled back far enough
in the message view, your "window" for rendered messages
would be at the max, and `prepend` was not adjusting
the window correctly.  Now we follow the example of
`append` and call `maybe_rerender`.

This partially addresses #6628, where users were
reporting that the home key stopped going up in their
feed.  There was another bug at play for that issue
as well, which is fixed in the next commit.
2017-10-03 11:29:46 -07:00
Steve Howell 860f62c792 Have home key go to actual first message in the list.
Before this, the home key would go to the first message in our
render window.  Now we go to the first message in our local
list of messages.  (Note that there may still be older
messages, so it will still often take multiple uses of the
home key to truly get to the top of your feed.)
2017-10-03 11:28:28 -07:00
Cynthia Lin ea75772a01 user docs: Add index page for searching. 2017-10-03 11:13:36 -07:00
Cynthia Lin 71af43601a user docs: Add collapsible sidebar sections. 2017-10-03 11:13:36 -07:00
Cynthia Lin 18c0257fc4 emoji_picker: Change background color upon hover for unreacted emojis. 2017-10-03 11:06:17 -07:00
Cynthia Lin c87ecf0f63 hotkeys: Prevent drafts overlay from showing while lightbox is open.
Fixes #6757.
2017-10-03 08:36:54 -07:00
Cynthia Lin c99f3d585d hotkeys: Prevent lightbox closing when message view hotkey is pressed.
Fixes #6757.
2017-10-03 08:36:54 -07:00
Nalin Bhardwaj 73de273726 stats: Remove hourly data from messages sent over time.
Fixes #6564.
2017-10-01 22:10:43 -07:00
Anupam-dagar f82c5e9626 settings: Remove save changes button from "UI settings" section.
Fixes: #6330.
2017-09-30 09:11:18 -07:00
Tim Abbott 327db90a3d Fix fetching of medium-size user avatars.
In the refactoring in 31d3b1ecc0 that
fixed live-updating of the medium-size avatar data, we started just
fetching the normal-size avatar, not the medium-size avatar.  We fix
this by changing this code path to pass in the user object and
construct the URL using that.

While we're at it, we switch to using the user ID, not the email, to
construct these avatar URLs.
2017-09-30 08:57:25 -07:00
Tim Abbott 376cab8ba4 popover: Rename show_message_info_popover.
It's really a user info popover.
2017-09-30 08:57:25 -07:00
Tim Abbott ddb1a03a5b popovers: Pass user into show_message_info_popover.
This makes the interface cleaner, which is helpful preparation for
being able to make clicking on mentions show the user's profile as
well.
2017-09-30 08:57:24 -07:00
Tim Abbott e0087cab69 popovers: Remove unnecessary call to timerender.
This calls hasn't been actually used since 2013.
2017-09-30 08:57:24 -07:00
Tim Abbott 3c7e470cfb popovers: Refactor showmessage_info_popover.
We now rely on getting the sender object from people.js, rather than
hackishly trying to handle the case that it doesn't exist.
2017-09-30 08:57:24 -07:00
Tim Abbott 16b47a86e4 popovers: Refactor show_sender_info variable names.
We're going to use the original variable names for other things soon.
2017-09-30 08:57:24 -07:00
Tim Abbott 18fd5e1a3b user popover: Remove unnecessary historical argument.
We stopped using this some time ago.
2017-09-30 08:57:24 -07:00
Tim Abbott d56aa83e31 popovers: Clean up name fetching for presence user info.
Previously, we relied on fetching the name of the user from the data
attributes on the individual elements, when we can get a more reliably
up-to-date value from the people.js data structure we're fetching
anyway.
2017-09-30 08:57:24 -07:00
Ali Rizwi 6c0ea18ea9 user settings: Make "Mobile push notifications always" a subsetting.
"Mobile push notifications always" is now indented and a
sub-setting of "Mobile push notifications when offline".
It can be selected only when the outer setting is
selected, otherwise it is greyed out.

Fixes #6570.
2017-09-29 17:58:41 -07:00
Tim Abbott 6c1c29408e composebox_typeahead: Rewrite code for handling modifier+enter.
We've iterated on this code incorrectly something like 3 times now, so
it's worth rewriting it with a lot of comments in a way that makes
sense.

The main actual functional change here is that modified key + enter
now is consistently the opposite of enter (in terms of whether to
provide a newline or send the message) in all cases.

Fixes #6489.
2017-09-29 17:22:29 -07:00
Harshit Bansal b69e85fa05 emoji_picker: Don't display title text for emojis in emoji picker.
Now that we display the name and aliases of the currently focused
emoji at the bottom of the emoji picker, we don't need to display
the title text for emojis separately.

Fixes: #6111.
2017-09-29 21:10:07 +00:00
Harshit Bansal bb38f98975 emoji_picker: Update emoji showcase on mouse hover. 2017-09-29 21:10:03 +00:00
Harshit Bansal 2873b886fb emoji_picker: Add emoji showcase.
Emoji showcase refers to the space at the bottom of the emoji
picker we use for showing name as well as aliases of the currently
focused emoji.

Fixes: #6110.
2017-09-29 21:09:00 +00:00
Harshit Bansal 4973d992d1 emoji_picker: Move the category tabs to just below the emoji filter.
Also removes the now unused `get_rendered_emoji_categories()` function.
2017-09-29 20:22:09 +00:00
Harshit Bansal 5620d88b7d typeahead: Fix the vertical positioning of emojis. 2017-09-29 11:17:06 -07:00
Harshit Bansal d4dfc53a0f emoji.js: Remove some unused data structures.
This commit removes some unused data structures: `emojis_by_unicode` and
`default_unicode_emojis` to be particular.
2017-09-29 11:17:06 -07:00
Harshit Bansal 0940d2cf85 build_emoji: Remove the hack used for displaying flag emojis correctly.
This hack was used to fix the broken flag emojis in emoji-picker.
It was broken due to the incomplete migration to iamcal dataset.
See issue #4775 for more details.
2017-09-29 11:17:06 -07:00
Harshit Bansal 5b5bcce098 emoji: Migrate bugdown emoji to use sprite sheets.
This commit switches to use sprite sheets for rendering emojis
in all the remaining places, i.e., message bodies and composebox
typeahead. This commit also includes some changes to notifications.py
file so that the spans used for rendering emojis can be converted
to corresponding image tags so that we don't break the emoji rendering
in missed message emails since we can't use sprite sheets there.

As part of switching the bugdown system to use sprite sheets, we need
to switch the name_to_codepoint mappings to match the new sprite
sheets.  This has the side effect of fixing a bunch of emoji like
numbers and flag emoji in the emoji pickers.

Fixes: #3895.
Fixes: #3972.
2017-09-29 11:14:34 -07:00
Brock Whittaker b3b7bf70ca activity: Update sidebar selectors if they don't exist.
The sidebar selectors may not exist at a particular point on load but
we’d like to realistically cache the results once they are, so we try
to load them live until we know that a valid selector has been found.
2017-09-28 18:29:54 -07:00
Brock Whittaker 232b6c694b activity: Remove unnecessary scrollbar update of users.
This call to update the users scrollbar is inside a huddles update
method which should only affect the group PMs, so we can remove the
update function.
2017-09-28 18:29:54 -07:00
Brock Whittaker c9864d3d0e activity: Remove unnecessary extra call to `resize_page_components`.
The `exports.build_user_sidebar` method already calls the resize
function, so there’s no need to call it again or wrap it in the
`actually_update_users_for_search` method.
2017-09-28 18:29:54 -07:00
Brock Whittaker 8e2d9d64b2 settings: Enable sorting on uploads table.
This allows for sorting in the uploads table by all of the attributes
in ascending order by clicking on the headers.

Fixes #6747.
2017-09-28 16:16:16 -07:00
Brock Whittaker b56aca5f1d list_render: Add DOM events to detect sort triggers.
When a `data-sort` is clicked in the body, it will trigger an attempt
to find the closest `list_render` instance, retrieve it from memory,
and then sort by the particular method specified.
2017-09-28 15:33:21 -07:00
Brock Whittaker 279edce92e list_render: Add generic sort functions.
This adds generic sort functions such as sorting by alphabetic order
and by numeric order (which involves parsing the numbers first).
2017-09-28 15:33:20 -07:00
Brock Whittaker 3706e2c6ba list_render: Add sort mechanism to list_render.
This allows for someone to specify a generic sorting function which
accepts a prop to sort by, a sorting function which runs with just a
function on the whole object, and the ability to remove the sorting
function in play.
2017-09-28 15:33:20 -07:00
Brock Whittaker 72530c9cfb list_render: Remove unnecessary call to "clear".
Calling `prototype.init` also calls `prototype.clear`.
2017-09-28 14:57:59 -07:00
Brock Whittaker 24b5030776 settings: Add perfectScrollbar to uploads table.
This adds the perfectScrollbar to the uploads table so that it will
function properly in the settings container since the parent node has a
perfectScrollbar.
2017-09-28 14:13:33 -07:00
Brock Whittaker 7b8fd1aafb settings: Add file search to the uploads table.
This uses the searching capabilities of the list_render class to search
for files by name; normalized by lowercase locale.
2017-09-28 14:13:33 -07:00
Brock Whittaker 7882039a11 settings: Add `list_render` basics to the uploads table.
This implements the basic form of list_render to the uploads table so
it will now load progressively.

Fixes: #6746.
2017-09-28 14:13:33 -07:00
Brock Whittaker 583d7b2834 settings: Move the upload tips input, and alerts out of list-render wrapper.
This moves the stuff that should not scroll with the table such as the
search box and tips so it is moved out to be above the
`.progressive-table-wrapper` element.
2017-09-28 14:13:33 -07:00
Brock Whittaker 57283b3861 settings: Add "View file" option over file name.
The "View file" option will open the file in a new window if it
is a filetype that can open in the browser and if not, it will just
trigger a download or whatever the browser's settings are.
2017-09-28 14:13:33 -07:00
Brock Whittaker a5d94dea26 settings: Change "View file" => "Download file".
The action when you click the download button is to download, so
the preferred terminology here would be to "Download file".
2017-09-28 14:13:33 -07:00
Brock Whittaker 7f3b4c5baf /apps/: Add max-width constraint to hero content.
This adds a max-width constraint to the hero content so that the images
inside the hero don’t keep expanding forever and eventually outside of
the hero’s bounds.

Fixes: #6713.
2017-09-28 14:01:19 -07:00
Brock Whittaker c1c19eb8c9 /apps/: Underline the install guide link.
This changes the link color from a not-so-visible green to white.
2017-09-28 14:00:05 -07:00
YJDave e3917b7d63 portico-signup: Strip whitespace from email fields.
This strips out whitespace from the email fields on the register
and login screens.

Fixes: #6578.
2017-09-28 11:53:23 -07:00
Tim Abbott 9187acfb8c apps: Point to the current Android app. 2017-09-28 11:26:52 -07:00
Shubham Dhama 1d0073cef9 /help/: Fix mobile scrollbar appearing incorrectly.
For <1000px (aka the mobile view), we need to set "overflow: hidden"
on the sidebar unless the sidebar is actually expanded.

Fixes: #6730.
2017-09-28 11:02:36 -07:00
Rhea Parekh 31d3b1ecc0 user settings: Update user popover on updating avatar.
Previously, we were incorrectly not using the latest data available on
the frontend to compute the URL for the larger avatar image.

Fixes: #6702.
2017-09-28 10:03:45 -07:00
Tim Abbott c13126b99d images: Fix executable bit on Windows desktop screenshot. 2017-09-27 20:53:04 -07:00
Brock Whittaker fabf0f53c4 /hello/: Update hero CTA to be more visible.
This makes the button a solid white rather than a transparent button
with a white outline so that it will draw more attention to itself.
2017-09-27 20:49:47 -07:00
Tim Abbott 0744961afe docs: Add more comprehensive documentation on error reporting.
Fixes #2232.
2017-09-27 19:47:08 -07:00
Brock Whittaker 983be4e8ce right-sidebar: Add perfectScrollbar to the right sidebar.
This adds the perfectScrollbar to the right side and theoretically
updates it any time a piece of code interacts with the sidebar and
updates the counts of users displayed in it.
2017-09-27 19:21:20 -07:00
Brock Whittaker 43fd0e8134 /apps/: Show download instructions selectively based on device.
This shows the download instructions only selectively based on
whether the device has download instructions for it. This means
currently it shows the page for Windows, Mac, and Linux.
2017-09-27 18:48:52 -07:00
Brock Whittaker ce6a262c28 settings: Fix "Notifications stream" list scrolling.
The list needs to be set to use perfectScrollbar so that it can
scroll due to the fact that it resides within another instance of
perfectScrollbar.

Fixes: #6351.
2017-09-27 18:46:19 -07:00
Brock Whittaker 2ed3c615de popovers: Fix padding to be more uniform.
The popovers for the message down chevron and left sidebar had
strange side padding and non-uniform padding between the top and
bottom. This changes them to all have the same padding as the
nav `#gear_menu`; none on the sides and 5px on the top and bottom.
2017-09-27 18:46:08 -07:00
Brock Whittaker d92a98be38 left-sidebar: Move "< All Streams" right ten pixels.
This moves the chevron arrow and the "All Streams" text over 10px
so that it will be inline with the hashes below and not be up
against the edge of the screen in some collapsed modes.
2017-09-27 18:09:45 -07:00
Brock Whittaker 55bc9e3f76 left-sidebar: Simplify and make more uniform the "All streams" header.
The issue before was that the left sidebar would become too tall for
the screen because the standard header that has “STREAMS” and buttons
is 20px tall, and this one is 30px tall. This makes it much shorter,
changes the text to be the same style as the “STREAMS” text (medium
grey, uppercase text).

The markup is then fixed to be significantly less verbose than before —
changing a list to just a simple link.
2017-09-27 18:09:45 -07:00
Brock Whittaker 38b3eeb332 left-sidebar: Combine two selections for `#stream-filters-container` to one.
This combines two different selections of the
`#stream-filters-container` into one chained selection and writes a
comment on how it is possible due to the return value of `.css`.
2017-09-27 18:09:45 -07:00
Vishnu Ks 17cc32f168 settings: Show error or success message when deleting uploaded files.
Fixes #6519
2017-09-27 17:50:22 -07:00
Vishnu Ks 8faa9ab214 settings: Show upload quota and total uploads size in uploaded files page.
Fixes #6408
2017-09-27 17:50:22 -07:00
Vishnu Ks 865bc06945 settings: Show attachment size and upload date in uploaded files page. 2017-09-27 17:50:22 -07:00
Brock Whittaker 945e97ec35 portico: Style "confirm email change" page.
This adds the white box styling to the "confirm email change" page.

Fixes: #6706.
2017-09-27 17:41:45 -07:00
Brock Whittaker 4e86bffb15 /help/: Remove "overflow: hidden" from sidebar on mobile.
This removes the "overflow: hidden" value in CSS on screens that
are less than 1000px wide.

Fixes: #6700.
2017-09-27 17:18:33 -07:00
Brock Whittaker f397925df2 /apps/: Add an "install instructions" line.
This adds a line under the app description that has a link to the
installation instructions for all the platforms.
2017-09-27 15:50:09 -07:00
Harshit Bansal ee6024281a org_settings: Fix dropup menu for notifications stream not opening.
We were having an anchor tag inside a button which is incorrect HTML.
Chrome and safari handle this case but firefox doesn't and hence the
dropup menu wasn't opening on firefox.
2017-09-26 23:04:49 -07:00
Brock Whittaker 5331e52f6d settings: Convert tables to use perfectScrollbar.
This converts tables in the organization section to use
perfectScrollbar.
2017-09-26 22:54:20 -07:00
Brock Whittaker 042132f156 settings: Fix default streams scrolling issue.
The progressively rendered table extends too far down, causing the page
to scroll needlessly, which then causes there to be two scrollbars — a
scrollbar for the table and a view scrollbar outside that.

Fixes: #6391.
2017-09-26 22:54:20 -07:00
Harshit Bansal ef4337edcb hotkey: Remap `+` key to use canonical name for thumbs up emoji. 2017-09-26 16:50:00 -07:00
Brock Whittaker 01b0a8156d /register/: Make the text error fall on own line.
This makes the text error fall on its own line rather than being inline
and pushing the checkbox over out of line with the rest of the elements.
2017-09-26 16:34:19 -07:00
Brock Whittaker baa87be5e2 Standardize error text color.
This standardizes the error text color to be the same in the
`.help-inline.text-error` class as it already is in other errors.
2017-09-26 16:34:19 -07:00
Brock Whittaker 8a8d1410f8 portico-signin: Fix organization name text overflow.
This fixes the issue on subdomain.zulipchat.com/login/ where the
organization name will have characters such as the lowercase "g"
cut off near the bottom due to the line-height being too small and
the overflow being hidden.

This re-arranges the properties to fix that issue.
2017-09-26 16:10:14 -07:00