Commit Graph

2883 Commits

Author SHA1 Message Date
Tim Abbott 4a1f1db9ee users: Avoid inserting into the DOM in a loop.
This fixes a major performance issue loading the administration page
in large organizations.
2017-03-08 16:21:25 -08:00
Tim Abbott a8d8855624 attachment: Avoid inserting into the DOM in a loop.
This has a huge impact on the performance of loading the settings page
if you have a decent number of past uploaded files.
2017-03-08 16:20:50 -08:00
Tim Abbott 9c02e59b66 hotkey: Fix K/J being treated as hotkeys in compose. 2017-03-08 16:02:33 -08:00
Tim Abbott e61b54b74a Fix spacebar being broken in the compose box.
This fixes a regression introduced in
8801158dfd.

Apparently the `page_up`/`page_down` hotkey definitions somewhat
confusingly called `spacebar` `page_down`, etc.  Probably worth doing
further cleanup on this.
2017-03-08 15:57:56 -08:00
Tim Abbott fc3927a124 subs: Improve meta.stream_created targeting.
This fixes a potential race where you get subscribed to a stream
around the same time that you create a stream.
2017-03-08 14:47:49 -08:00
Brock Whittaker 022aeca085 subs: Prepend new streams to top of stream list.
This prepends new streams that are created to the top of the list so
that they are more visible when being created.
2017-03-08 14:47:00 -08:00
Brock Whittaker 8801158dfd Add hotkey actions for page up/down in compose box.
The hotkey actions make the caret position go to the top of the compose
box or bottom respectively, while the compose box is open.

Fixes #1910.
2017-03-08 14:13:05 -08:00
Tim Abbott ee231c0223 login: Improve development server login copy. 2017-03-08 12:36:04 -08:00
Umair Khan d4228e8151 capitalization: Fix waiting period threshold changed. 2017-03-08 12:33:37 -08:00
Umair Khan 22c1c13f38 capitalization: Fix View Source / Edit Topic. 2017-03-08 12:33:37 -08:00
Umair Khan 935cacfc86 capitalization: Fix View Source. 2017-03-08 12:33:37 -08:00
Umair Khan 523f8ecd79 capitalization: Fix Upload New Avatar. 2017-03-08 12:33:37 -08:00
Umair Khan 3dd823b0af capitalization: Fix Stream Name. 2017-03-08 12:33:36 -08:00
Umair Khan fdb709d0b7 capitalization: Fix No Drafts. 2017-03-08 12:29:07 -08:00
Umair Khan 9faf73eaa9 capitalization: Fix Generate new API Key. 2017-03-08 12:29:07 -08:00
Umair Khan 569418f0b4 capitalization: Fix Full Bot Name. 2017-03-08 12:29:07 -08:00
Umair Khan 7d398f4ce3 capitalization: Fix Exit Tutorial. 2017-03-08 12:29:07 -08:00
Umair Khan 7420d77cc3 capitalization: Fix Edit User. 2017-03-08 12:29:07 -08:00
Umair Khan 1863ce41f1 capitalization: Fix Delete Avatar. 2017-03-08 12:29:07 -08:00
Umair Khan a67b405f3b capitalization: Fix Delete Alert Word. 2017-03-08 12:29:07 -08:00
Umair Khan 780e3d8d12 capitalization: Fix Deactivate Account. 2017-03-08 12:29:07 -08:00
Umair Khan 6728d212a6 capitalization: Fix Copy from Stream. 2017-03-08 12:29:07 -08:00
Umair Khan 33325d94ab capitalization: Fix Change Password. 2017-03-08 12:29:07 -08:00
Umair Khan 7973b7ffd2 capitalization: Fix Allow Subdomains. 2017-03-08 12:29:07 -08:00
Umair Khan 0a41c12a07 capitalization: Fix Alert Word. 2017-03-08 12:29:06 -08:00
Umair Khan 0d31bcc2f7 capitalization: Fix API Key. 2017-03-08 12:29:06 -08:00
Steve Howell a61f468348 Simplify buddy list status level sorting.
Introducing the level function makes it a bit more clear that active
users get sorted to the top.

It also shaves a couple milliseconds for large buddy lists, although
that is mostly negligible compared to name sorting and rendering.
2017-03-08 11:32:23 -08:00
Steve Howell bdd8964ca9 Simplify and speed up buddy list name sorting.
We remove duplicate calls to people.get_person_from_user_id here.
With 2000 users, this makes the sort about 10ms faster.
2017-03-08 11:32:23 -08:00
Steve Howell a246d2dcb3 refactor: Eliminate presence_info params.
It's easier to reason about the activity.js code if we just
make it clear that presence_info is a global singleton.  Going
forward, functions that use that data will explicitly refer to
exports.presence_info.

This change makes some tests slightly more awkward to set up, but
with the actual code you now don't have to question whether there
are multiple copies of presence_info to maintain.

The diff for compare_function is a bit confusing to read, but it's
basically just de-dented since we don't need to parameterize the
compare function any more.
2017-03-08 11:32:23 -08:00
Steve Howell 89d362656a Simplify focus_lost() function (and add comments).
The function focus_lost() was setting has_focus to false
in all cases; now it does it more clearly.  I also added a
comment explaining why we don't ping on losing focus.
2017-03-08 11:32:22 -08:00
Steve Howell 7cec88c748 performance: Avoid unnecessary buddy list redraws.
We no longer build the buddy list twice during page load; we
build it just once from page_params information.  (We also send
the initial ping and schedule subsequent pings slightly later in
the process.)

We also don't do redraws upon regaining focus, since we don't
show ourselves in the buddy list, and even if we did, we wouldn't
need a full server update.

To have this flexibility, we introduce the want_redraw flag to
focus_ping.
2017-03-08 11:09:13 -08:00
Brock Whittaker 3b55519b11 Redesign "/features/" page in portico.
This redesigns the features page to incorporate the new landing nav,
CSS animations, and general styling of the product page set.
2017-03-07 23:25:39 -08:00
Raghav Jajodia 21f0339cfc compose: Focus on topic when narrowed to a stream+topic.
When narrowed to a stream+topic and clicking the "new topic" button,
focus in on topic and the text remains selected.
Fixes #3888.
2017-03-07 22:24:57 -08:00
K.Kanakhin 1cb0f8dc41 Add size limit for uploading user avatars and realm icons.
- Add settings parameter for max realm icon size.
- Add settings parameter for max user avatar size.
- Add checking file size to avatar and icon
  uploading views.
- Transfer file size limit parameter to frontend.
- Add tests.
2017-03-07 22:13:01 -08:00
K.Kanakhin 72424f3a9f realm-icon: Fix variable name for realm icon source. 2017-03-07 22:09:58 -08:00
Vasu Verma d4a004c420 Fix enter key not deleting selected text in compose box.
Fix #3889.
2017-03-07 22:04:04 -08:00
Feorlen e0acdfde0d Add a Splunk webhook integration.
Add a webhook to create messages from Splunk search alerts. The search
alert JSON includes the first search result and a link to view the full
results. The following fields are used:

* search_name - the name of the saved search
* results_link - URL of the full search results
* host - the host the search result came from
* source - the source file on that host
* _raw - the raw text of the logged event.

The Zulip message contains:
* search name
* host
* source
* raw

The destination stream and message topic are configurable: the default
stream is "splunk" and the default topic "Splunk Alert". If the topic is
not provided in the URL, the search name is used instead (truncated if too
long. If a needed field is missing, a default value is used instead.

Example: "Missing source"

It is possible to configure a Splunk search to not include some values,
so I've provided defaults rather than return an error for missing data.
In practice, these fields are unlikely to be deliberately suppressed.

Note: alerts are only available for Splunk servers using a valid trial,
developer, or paid license.

I've added tests for the normal case of one search result, the topic from
the search name, and for a search missing one of the fields used. Tested
using Splunk Enterprise 6.5.1.

Fixes #3477
2017-03-07 21:48:26 -08:00
Joshua Pan b1e7ecdad2 user search: Hitting enter narrows to user PM.
Fixes #3874.
2017-03-07 21:05:56 -08:00
Tim Abbott 345ece0ee5 message view: Improve readability of dates and times. 2017-03-07 18:56:30 -08:00
Boris Yankov 890ff16b37 message view: Increase font weight of timestamps for readibility. 2017-03-07 18:56:05 -08:00
Archana BS a6b5b03122 stats: Change time ranges for bar graph and pie chart.
- Change templates/analytics/stats.html to use 'Last
  Week', 'Last Month', 'Last Year' time ranges instead
  of 'Last 10 days', 'Last 30 days'.
- Change static/styles/stats.css to not set background
  color for default time option, for messages sent by
  client and message by recipient type.
- Change static/js/stats/stats.js to show only available
  time range options, and set background color for the
  default. The default is Last Month if it exists, and
  otherwise All Time.

Fixes: #3856
2017-03-07 17:25:58 -08:00
Raghav Jajodia d52e08a25c analytics: Add a "Last updated" to the bottom of the stats page.
Fixes #3857.
2017-03-07 16:02:27 -08:00
Tim Abbott ec16a3298d reactions: Expand click area for opening popover. 2017-03-06 22:26:12 -08:00
Brock Whittaker ec9bad4096 Hide the emoji icon in message when emoji is selected.
This hides the emoji icon from the shown state when users select an
emoji from the popover.
2017-03-06 22:24:21 -08:00
Brock Whittaker 4d5aa3ddc9 Restyle and refactor .message_controls for better UX.
This refactors the .message_controls to stop relying on absolute
positioning and strange CSS, and throws them inline.

This also restyles so they hang to the right of the time which is now
always present.

Fixes: #3761.
2017-03-06 22:24:21 -08:00
Steve Howell a17deb144a Use data-stream-id in topics popover. 2017-03-05 15:44:44 -08:00
Steve Howell 8e2e406404 refactor: Extract stream_popover.js.
This module handles the popovers in the stream list--one for
stream actions and another for topic-specific actions.

The extraction was mostly straightforward, but I did move some
of the code related to the color picker to be more consistent
with how I organized the other click handlers.
2017-03-05 15:44:43 -08:00
Steve Howell ba49962f9a refactor: Extract stream_popover_sub().
Part of this change moved a click handler from subs.js to
popover.js.
2017-03-05 15:44:43 -08:00
Steve Howell 6630b84dc0 Remove data-stream-name from subscription_settings. 2017-03-05 15:44:43 -08:00
Steve Howell 58b018858e refactor: Pass in sub to ajaxUnsubscribe(). 2017-03-05 15:44:43 -08:00