Commit Graph

4728 Commits

Author SHA1 Message Date
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