Commit Graph

4422 Commits

Author SHA1 Message Date
Steve Howell 106d58df47 Add stream_data.get_non_default_stream_names().
This allows us to get the typeahead values for adding a default
stream using client-side data.
2017-08-27 19:08:04 -07:00
Steve Howell b32a9444dd js: Clean up how we track default stream names.
We continue to have page_params.realm_default_streams, but
now we do lookups on whether a stream is a default stream
by using a Dict indexed by stream_id.

We are also careful to update that during live updates.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

The old code was using jQuery operations that got tripped up
by our splitters between active and inactive streams.

Fixes #4569
2017-08-16 15:45:47 -07:00
Steve Howell b4590e1303 Add topic_generator.reverse_wrap_exclude().
This allows us to traverse a list backwards, cycling to the
bottom as needed.

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

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

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

Fixes #5216.
2017-08-16 08:23:30 -07:00
Vaida Plankyte 971dc71ed6 ui.js: Create perfectScrollbar functions. 2017-08-16 08:07:28 -07:00
Vaida Plankyte d3f0d2cc9f help: Add perfectScrollbar to markdown container. 2017-08-15 21:10:14 -07:00
Brock Whittaker 83184d5c60 /about/: Merge with /authors, redesign page.
This adds the authors to the Zulip repository on GitHub from
/authors/ along with re-styling the page to fit the same
aesthetic as /for/open-source/ and other product-pages.
2017-08-15 16:09:01 -07:00
Brock Whittaker eec26c5da6 Extract "open source" feature column into its own section. 2017-08-15 15:26:46 -07:00