Commit Graph

2741 Commits

Author SHA1 Message Date
Steve Howell e6bcc01c33 email -> id: Make browser's filter for "sender" more robust. 2017-02-07 17:37:05 -08:00
Steve Howell 64125a76e2 Use data-user-id for message popover menu. 2017-02-07 17:37:05 -08:00
Steve Howell ae850fdeb4 Use message.sender_id to create URLs in message popover. 2017-02-07 17:37:05 -08:00
Steve Howell 44f155e7b2 Generate message.pm_with_url more directly from ids.
We have added people.pm_with_url(message), which computes a
PM url from a private message using user ids rather than emails.

We call this in add_message_metadata(), since the slugs will
be valid even if emails change, so we don't need to compute
them on the fly during message rendering.
2017-02-07 17:37:05 -08:00
Harshit Bansal 8ed0e09c1f subs.js: Make `redraw_privacy_related_stuff()` a global function. 2017-02-07 17:02:16 -08:00
Rishi Gupta e0cb009f1b analytics: Refactor and clean up messages_sent_over_time. 2017-02-07 15:35:43 -08:00
Rishi Gupta 3c692684a0 analytics: Move stats.js out of portico/.
stats.js is a logged-in view.
2017-02-07 15:35:43 -08:00
kpdp cda7faee83 compose: Fix the compose box not resizing when restoring drafts.
Fixes #3592.
2017-02-07 14:41:44 -08:00
Elliott Jin 9b854c62bc search_suggestion: Suggest multiple people in `pm-with` searches.
Currently, searching for group private messages requires typing each
person's email individually.  This change improves the typeahead
suggestions for group `pm-with` searches by suggesting additional people
whenever a comma is entered.

Fixes: #3575
2017-02-07 14:13:29 -08:00
Tim Abbott 7badc39b02 reactions: Fix exceptions reacting to locally echoed messages.
Previously, we were incorrectly not updating the data-message-id used
in the .message_reactions section to use the final ID when
echo.reify_id was called.

This meant in particular that if someone else reacted to a message you
sent, and you clicked it to share the reaction, you'd get an exception.
2017-02-07 14:13:29 -08:00
Tim Abbott ac5c505d3c analytics: Make page-content full height. 2017-02-07 11:17:16 -08:00
Rishi Gupta a99f5ca066 analytics: Update bar colors on message_sent_over_time. 2017-02-07 11:07:51 -08:00
khantaalaman ee0b16b1ef Update Font Awesome to version 4.7.0.
Fixes #3329.
2017-02-06 22:45:02 -08:00
Steve Howell 5b8e217bf4 Add people.update_email().
The function people.update_email() is not yet connected
to anything, but it sets the stage for upcoming changes.

When emails get updated, fundamentally we just update
the appropriate person object and add a new key to
people_dict.  We sort of get a shim for free--old email
lookups will continue to work--but we add blueslip warnings
for stale lookups.
2017-02-06 22:38:22 -08:00
Steve Howell 0555970fae message_store: Populate sender_email based on people.js.
Messages that come to us from the server may have an out
of date sender email, so we use message.sender_id and
people.js to get the current email.
2017-02-06 22:38:22 -08:00
Steve Howell a8f706b1b5 refactor: Use user_id as key for people.realm_people_dict. 2017-02-06 22:38:22 -08:00
Steve Howell 2ed85263c8 refactor: Use user_id as key for people.cross_realm_dict. 2017-02-06 22:38:22 -08:00
Steve Howell 955b85f515 Use user_id to check if a message has a new person.
This prepares us for the upcoming ability to update
emails.
2017-02-06 22:38:22 -08:00
Steve Howell d01493bc42 refactor: Use user_id as key for pm_recipient_count.
We now key people.pm_recipient_count by user_id, which makes
one less dictionary that we'll need to update when we support
email updates.
2017-02-06 22:38:22 -08:00
Steve Howell 08bc69f8af huddles: Calculate huddle strings more robustly.
We now build huddle strings used in activity.js from
user ids in message.display_recipient.
2017-02-06 22:38:22 -08:00
Harshit Bansal 50800d4993 Refactor: De-duplicate the message rendering code in message_list_view.js.
Extract the duplicated message template rendering code in
message_list_view.js to `_get_message_template()` helper function.
2017-02-06 22:30:50 -08:00
Harshit Bansal 8350866406 popovers: Rename `data-msgid` to `data-message-id`.
Rename the `data-msgid` to `data-message-id` to match the style of our
other data objects.
2017-02-06 22:30:50 -08:00
Rishi Gupta 86b45b57df analytics: Fix rangeselector buttons for messages_sent_over_time.
Previously was using the daily_rangeselector regardless of whether we
started in the daily or weekly view.
2017-02-06 17:48:56 -08:00
Tim Abbott babb6aaa47 settings: Stop serving zxcvbn from node_modules/.
Now that we have the minified_source_filenames feature, we don't need
to serve zxcvbn from node_modules/ directly to avoid re-minifying it.

Moving this this allows us to stop shipping the (duplicate)
node_modules directory in release tarballs, which will save many
megabytes of unnecessary increase in our release tarball size.
2017-02-06 17:21:34 -08:00
Steve Howell 0ab832cc49 bug fix: Clean up blue highlighting in the left corner.
In a96fdd18b1, I introduced a few
regressions related to the blue highlighting that happens
in the top left corner for Home, Private messages, Starred
messages, and @-mentions.  Basically, we weren't clearing
the highlighting when we thought we were, so Home would stay
blue too long and the other filters wouldn't turn blue.

We went a surprising long time before noticing the regression.
This fix adds a function called deselect_top_left_corner_items()
to clear the blue backgrounds, so that will happen more explicitly.

And then I restored a line of code to pm_list.js that puts the
blue in place when you are in an is:private narrow (vs. a
specific PM narrow).
2017-02-06 16:10:24 -08:00
Cynthia Lin ac4d551b32 user docs: Conform *Reply to a message* to user docs styling guide. 2017-02-05 15:19:44 -08:00
khantaalaman c3fd0d4e0c subs: Fix incorrect use of RegExp in stream filtering.
When filtering streams, we were incorrectly treating the regexp input
provided by the user as a regular expression, meaning that terms like
`c++` would trigger errors because they are invalid regular expression
syntax.  We fix this by replacing RegExp with a simple IndexOf check.

Node test added by tabbott.

Fixes #3559.
2017-02-05 13:01:43 -08:00
khantaalaman b82104a769 message-view: Uncollapsing using [More...] made easier.
The [More...] link for un-collapsing messages has been made easier to
click, by giving it a top margin which prevent clicks on the top
portion of it from being masked by the top part of the message body.

Fixes #3313.
2017-02-05 12:48:12 -08:00
Rishi Gupta e5441af2c3 analytics: Add word wrap to pie chart legend text. 2017-02-04 00:24:09 -08:00
Rishi Gupta 12e8373692 analytics: Change pie chart colors to be more differentiated. 2017-02-04 00:22:39 -08:00
Amy Liu 24f0716df3 analytics: Clean up graph styling.
This fixes a number of issues in the prototype /stats graphs, including:

* Adding a Total Users number to the Users graph.
* Changing the Messages sent over time graph so that the bot
trace is hidden by default.
* Fades out the last bars in the weekly view to represent unfinished
ata.
* Sets the default view to weekly only if the realm is > 12 weeks old.
* Gets rid of the tooltips and replaces them with hover text
for the Number of Users graph.
* Fixes a bug in the legend colors for the Messages Over Time
graph.
* It also adds the year to the hover text.
* Sets the pie chart colors and adds spaces between sectors.
* Changes the font to Humbug.
2017-02-03 17:17:23 -08:00
Tim Abbott a889346c9f Remove zh_CN old Django name for Chinese. 2017-02-03 14:29:03 -08:00
Steve Howell 89b9c5eece blueslip: Avoid blueslip spam for failed email lookups.
If an email lookup fails, we now wait for five seconds before
doing a blueslip.error() call (after re-checking the email).
2017-02-03 13:02:26 -08:00
Tim Abbott 43d343027b Update translations for Zulip 1.5 release. 2017-02-03 12:32:04 -08:00
Rishi Gupta aafb1c70f0 analytics: Fix pie chart sorting computations in stats.js. 2017-02-02 18:19:48 -08:00
Cynthia Lin 17ad591eb4 docs: Fix bullet formatting and indenting. 2017-02-02 12:25:58 -08:00
Cynthia Lin 944b809fd7 docs: Replace "search help" with "search operators".
For better clarification and to avoid confusion with user documentation tab.
2017-02-02 12:25:58 -08:00
Brock Whittaker 377592802c hashchange: Fix exiting #subscriptions overlay not updating hash.
This applies fixes a bug where if a user used the Esc key, the
subscriptions hash did not get restored to its previous state.
2017-02-02 12:13:08 -08:00
khantaalaman 8c7321abad compose: Show restore-draft option in write mode only.
Fixes #3491.
2017-02-02 11:42:56 -08:00
brockwhittaker 894f0b5bf0 Fix hashchange closing #subscriptions on IE.
This fixes an issue where Array.prototype.split is called on an
undefined instance due to the EventTarget.oldURL property not being
recorded in IE. We fix this by recording it ourselves.
2017-02-02 11:40:26 -08:00
Rishi Gupta 2bd214077b analytics: Limit pie charts to 6 segments. 2017-02-02 09:20:53 +00:00
brockwhittaker d38d12db8d Fix for broad ID selector.
This fixes the broad ID selector `*[id]:before` to be a more specific
selection of h{x} tags inside the `.markdown` container.
2017-02-01 11:24:00 -08:00
Amy Liu 0a39e354dc analytics: Add graphs of usage statistics on /stats.
This adds a frontend for the analytics system we've had for a few
months, showing several graphs of the data in Zulip.

There's a ton more that we can do with this tooling, but this initial
version is enough to provide users with a pretty good experience.

Fixes #2052.
2017-01-31 22:18:54 -08:00
Cynthia Lin 2fbe2229a4 portico: Fix portico header covering anchor links.
Fixes issue #3506
2017-01-31 21:54:09 -08:00
Rishi Gupta 783096627c user docs: Change link color to #399993.
Also removes gradient.
2017-01-31 18:17:49 -08:00
Rishi Gupta d8012c5b7b user docs: Change footer to be less prominent. 2017-01-31 18:17:49 -08:00
Tim Abbott daf43c5e4d navbar: Add margin between icons and text. 2017-01-31 18:11:34 -08:00
brockwhittaker 49b150bcb3 navbar: Center icons in gear-menu.
This centers the icons in the gear menu so they are naturally
in line and centered.
2017-01-31 18:11:28 -08:00
Cynthia Lin 42487d372e docs: Update *Searching for messages* doc with new UI and features. 2017-01-31 18:04:59 -08:00
brockwhittaker b37b7de498 Fix the position of the edit message label.
This fixes the position of the "Topic" label to be above
the input and adds a "Content" label to improve consistency.
2017-01-31 17:53:20 -08:00
Steve Howell bc20692a91 Prevent tracebacks when admin screens aren't loaded.
Various server events can be passed into admin.js before
the initial widgets have been set up.  This code short
circuits live update code when these events happen.

Note that live updates don't consistently work for the
admin pages before this fix (and after it), since don't
store data changes when the widgets aren't built.
2017-01-31 10:34:06 -08:00
khantaalaman e72107dec0 left-sidebar: Fix + icon opening stream-search box.
The of stream-search box in left-sidebar was being opened incorrectly
when clicking the + icon to add a new subscription (because that's
what would happen if you clicked the area around the +). Changes were
made in click_handlers.js by adding e.stopPropagation and
e.preventDefault in appropriate click handler.

Fixes #3517.
2017-01-31 10:00:07 -08:00
Brock Whittaker ebe0aa48a7 Enlargen settings page loading spinner.
Currently the loading spinner on the settings page is too small
and is in the left corner of the parent box. This changes the width
to the same as the main page: 100% fill inside a 38px square container.
2017-01-30 17:51:05 -08:00
Steve Howell 373c8a0bb5 Live-update PM list for full-name changes.
We now trigger an event in user_events.js, and we dynamically
build the list of names in pm_list.js by calling out to
people.get_recipients().

We have a few variations of functions that build lists of names
for huddles, which should be cleaned up eventually.  They are
called at different times in the code path, so the different
functions, while doing mostly the same thing, start with different
data sources.
2017-01-30 11:49:19 -08:00
Steve Howell f836ae0dfb Live-update name changes in the recipient bar.
We now call message_store.get_pm_full_names() when
re-rendering a message list view, rather than reading
msg.display_reply_to, which could be stale.
2017-01-30 11:49:19 -08:00
Steve Howell 2980a9e33d Use user's current full name in recipient bars.
This breaks the function
message_store.get_private_message_recipient into two functions:
get_pm_emails and get_pm_full_names.

The get_pm_emails function behaves the same way as the original
function, but get_pm_full_names now dynamically gets full names
from people.js using the user_id in the message.display_recipient
row.

This makes the recipient bar show the correct new name if you reload
your page.  It doesn't help with live updates.
2017-01-30 11:49:19 -08:00
Steve Howell a98cbff788 Use user's current full name when rendering messages.
The field message.sender_full_name can be out of date, so
we recompute is using data from people.js in
add_message_metadata().
2017-01-30 11:49:19 -08:00
Steve Howell 97243dcd52 Live update full names for senders in the message pane.
Note that this only works for people who are currently logged in.
Folks that log in after you may pick up the old full name from
the message.  (I'll address this in a separate commit.)
2017-01-30 11:49:19 -08:00
Tim Abbott b3c9e186f9 help: Clean up change-your-organization-settings. 2017-01-29 23:02:20 -08:00
Cynthia Lin 7766c122b4 docs: Conform *View messages from a stream* to style guide. 2017-01-29 22:57:38 -08:00
Cynthia Lin 41d66f1ddf docs: Conform *Send a group of people a private message* to style guide. 2017-01-29 22:51:54 -08:00
synicalsyntax 26c13a42f8 docs: Conform *Enable or disable Press Enter to send* to style guide.
Also, tabbott made a number of edits to the content.
2017-01-29 22:49:23 -08:00
synicalsyntax 8932d46657 docs: Conform *Send a stream message* to style guide. 2017-01-29 22:35:24 -08:00
Cynthia Lin 522ac3ea4a frontend: Add #search-operators link to search icon; Fixes #1369. 2017-01-29 07:20:15 -08:00
synicalsyntax 21534930b1 docs: Update *Searching for messages* doc. 2017-01-28 22:49:11 -08:00
Yago González 87a7691bfc translations: Improve some strings. 2017-01-28 18:58:09 -08:00
Tim Abbott b3cb9213d1 Fix malformed double-translated string in alert words code. 2017-01-28 18:23:56 -08:00
Yago González 7fe090f902 translations: Improve some poorly-worded strings. 2017-01-28 18:04:17 -08:00
Rishi Gupta 6b3abce541 build_emoji: Generate emoji names and codepoints from emoji_map.
Replaces the hardcoded list of emoji_names and unicode_emoji_names in
static/js/emoji.js with a list generated from emoji_map.json, both to get
the list out of version control and so we can start modifying it for our
autocomplete. This does not change the contents of emoji_names. It sorts and
removes duplicates from unicode_emoji_names (causes no change in behavior,
since unicode_emoji_names is only used as if it were a set).
2017-01-28 17:05:32 -08:00
synicalsyntax 4c0c7dd3f9 docs: Conform *@-mention a team member* to user documentation styling guidelines. 2017-01-28 15:59:44 -08:00
synicalsyntax 0f2327f9ce docs: Conform *Restore the last unsent message* to user documentation styling guidelines. 2017-01-28 15:59:44 -08:00
khantaalaman 04591d1ce5 js: Fix pressing escape with modals open.
Previously, if you pressed the escape key with various modals open
(keyboard shortcuts, markdown help, etc.), the modals would close but
also the compose box would close and the user would be unnarrowed.
This changes makes it so all that happens is the modal closes.

Fixes #3472.
2017-01-28 15:54:36 -08:00
sinwar 21083278b5 Fix banners for unknown streams.
Fixes #3443
2017-01-28 13:11:31 -08:00
Steve Howell 5251e4981c Prevent traceback in PM recipient matching code. 2017-01-28 04:39:02 -08:00
Brock Whittaker e44723f79d Fix broken emoji popover styling.
This fixes CSS issues such as removing padding with negative margins
and then re-adding padding back later. It also ensures the width of the
picker is exactly six columns wide and does not shift around when zoom
is enabled in the browser.
2017-01-27 16:12:38 -08:00
Brock Whittaker 1dd8fb7966 Display realm emojis in the emoji picker container.
This displays the realm emojis in the emoji picker container in their
own divs styled similarly to the existing .emoji divs.
2017-01-27 15:39:22 -08:00
Tim Abbott f33a9fe384 js: Fix linter errors from rebased code. 2017-01-27 14:54:11 -08:00
Steve Howell f14e2de985 Handle spaces better in compose typeaheads.
We now allow spaces and other special characters to be part
of the token (following "#", "@", or ":") that the typeahead
code will further evaluate as a typeahead candidate.

This is important for folks with short/common first names
on larger realms.
2017-01-27 12:35:46 -08:00
Brock Whittaker ac710be9ae On enter, submit content editable.
On the enter key, the value of the content editable box should be
submitted.
2017-01-27 12:20:21 -08:00
Brock Whittaker 14b471a29f Stream Name to Content Editable.
This changes the stream name component to be content editable.
2017-01-27 12:05:08 -08:00
Brock Whittaker eaeb0e32a7 Stream Description Content Editable Piece.
This makes the stream description a content-editable piece.
2017-01-27 12:04:37 -08:00
Tim Abbott 82b3f7f661 help: Workaround weird wrapping bug with CSS. 2017-01-27 11:50:12 -08:00
Brock Whittaker 8dfd5d7134 Add ordered list styling for /help/ pages.
This adds a styling that puts the numbers in a Zulip brand green bubble
with white text for the number.
2017-01-27 11:41:29 -08:00
Steve Howell ddf17abf5c Prevent dragging of Click/Unclick-all links.
We have links when to create a stream to "Click all" or
"Unclick all" for checkboxes.

In FF it's easy to accidentally start dragging these links,
which has no real value (since their href is uninteresting)
and is confusing.

Perhaps these should just be buttons.
2017-01-27 10:25:18 -08:00
Brock Whittaker 4ac12745cd Add capped height to description box.
This adds a capped height of 70px  to the description box (same as the
images) and then uses a gradient to fade out any text that may be near
the bottom.
2017-01-26 22:02:16 -08:00
Brock Whittaker 214b011bb5 Add subscribe button inside subscription settings.
This adds a subscribe/unsubscribe button inside the subscription
settings container for a stream right next to the stream name.
2017-01-26 21:02:57 -08:00
Brock Whittaker bcdd326b65 Change data-stream-name referencess to data-stream-id.
This changes all references of the data-stream-name to more
predictable data-stream-id references in the subscriptions overlay.
This prevents unescaped characters from breaking selectors and stream
renames from breaking selectors.
2017-01-26 17:32:35 -08:00
Harshit Bansal b4186fdfdd views/realm_aliases.py: Use domain instead of id as handle for RealmAlias.
We need to make the change for the API, and the next commit introduces a
unique_together constraint on (realm, domain) anyway.
2017-01-26 17:24:25 -08:00
Harshit Bansal 06cc306d00 Add stricter domain validation and improve error messages. 2017-01-26 17:24:25 -08:00
Harshit Bansal 0ff22f68b3 settings.css: Make long domains list wrap properly in admin settings. 2017-01-26 17:24:25 -08:00
Harshit Bansal f0e5380ff1 handlebar templates: Rename admin_alias_list to admin-alias-list. 2017-01-26 17:24:25 -08:00
Harshit Bansal 38c50a81ad admin settings: Restyle realm alias modal. 2017-01-26 17:24:25 -08:00
Harshit Bansal ec02599336 admin.js: Simplify wording around the restricted to domain setting.
Remove stringify_list_with_conjunction, which would have been tough for
i18n, and make it clear that the setting only affects new users.
2017-01-26 17:24:25 -08:00
Brock Whittaker 1a63f15382 Only run popovers.hide_all() once on scroll start.
This function throttles the function and only allows the on scroll
event to fire the popovers.hide_all() function once on scroll start
(determined as > 250ms after the last scroll event fire on .app.

This should resolve some performance issues surrounding constantly
firing queries and potentially changing the document tree.
2017-01-26 13:59:14 -08:00
Tim Abbott b52f606c3a Revert "deps: Upgrade and move `jquery-mousewheel` from `static/third` to `npm`"
Apparently, the updated version of this has a serious scrolling
performance problem in the left sidebar that basically makes scrolling
in that area unusable.

This reverts commit b683b2d3c3.
2017-01-26 13:42:00 -08:00
Steve Howell f7c3765c77 Make "Copy from Stream" more transparent/flexible.
This change makes it so that when you are creating a stream
and use "Copy from Stream", the UI will immediately
check/uncheck the user checkboxes that correspond to the
stream's subscribers.

In concrete terms this allows Cordelia to create a new
stream call "Paris" that has all the "Verona" subscribers
except for Hamlet.

It also makes it so that when you go to create the stream,
the response is a little quicker, because we don't have to
iterate the streams.

Finally, it removes an odd quirk from the original design,
where if you clicked on Denmark but then collapsed the
streams, we wouldn't actually add the Denmark subscribers
to your new stream.

The current UI will still be slightly intuitive for people, as
I think checkmarks don't really make sense here.  What we
really want are Add/Remove links (or buttons) next to each
of the existing streams.
2017-01-26 10:24:15 -08:00
Steve Howell 8cfb9e427f Simplify the "Copy from Stream" feature.
I moved the UI element for "Copy from Stream" to be above
the list of users, including the filter box and check/uncheck
links, which no longer get applied to the list of streams.

The reason I no longer apply the filter to streams is...

    * It's kind of confusing to have filters apply to both
      streams and users.  There should be separate filters for
      them, and I will try to resuscitate that feature later.
    * The code to filter the streams was doing a sketchy
      regex operation against user-inputted data. (`match()`)
    * We want to use the same stream filtering code as the
      right sidebar uses.
    * It improves performance for the common case that you
      are filtering users.

The reason I no longer apply the check-all/uncheck-all actions
to streams is that it would be crazy to select all your streams
to copy users from, and it would be expensive/slow for large
realms, and it would likely be done by accident if somebody was
trying to manage individual users.

Finally, the check-all/uncheck-all actions have been scoped
to the users filtered by the text box, so I moved the links
under the text box to make that hopefully more clear to users.
2017-01-26 10:24:15 -08:00
Steve Howell 5c091437da Improve empty user filter handling for stream creates.
If we blank out the user filter for users (by hitting backspace,
for example), then we now have short-circuit logic to display all
the user checkboxes.  (The user-facing behavior doesn't change here,
but now we don't have to process all the strings.)
2017-01-26 10:24:15 -08:00
Steve Howell 88870c316f Use Dict[user_id] in people.filter_by_search_terms.
The function people.filter_by_search_terms() used
to return a JS object with emails as keys to represent
a set of users.  Now we return a Zulip Dict() object
with user_ids as keys.
2017-01-26 10:24:15 -08:00
Steve Howell beb3782e6c Speed up user filtering during stream creation.
The old implementation was O(N squared) for N = number of
users due to its using an O(N) selector inside of a loop.

Now we simply iterate through all the checkboxes and turn them
on or off based on a bunch of O(1) operations.
2017-01-26 10:24:15 -08:00
Raghav Jajodia fc965eb5f6 admin: Add No-change-made message.
A 'no changes made' message is displayed whenever save-changes button
is clicked, albeit no changes are made in the admin page.
2017-01-25 23:10:14 -08:00
Sampriti Panda 4e78ca32de register: Improve styling for frontend errors 2017-01-24 13:39:43 -08:00
Sampriti Panda 3c3902471b register: Improve styling for server-side errors 2017-01-24 13:39:43 -08:00
Eitan Adler 0ce29d7ad6 Remove some some duplicate words in copy. 2017-01-23 23:15:04 -08:00
Tim Abbott 4e171ce787 lint: Clean up E126 PEP-8 rule. 2017-01-23 22:06:13 -08:00
Steve Howell 01aad70910 bug fix: Fix recent regression with at-mentioning.
One of my commits from yesterday erroneously set the
"mentioned" flag on messages that weren't mentioning
the current user, so you would get the pink/salmon
background when you sent at-mentions to other people.

Now we check the user_id before setting the flag.
2017-01-23 16:42:43 -08:00
Tim Abbott a3b51bb9d2 Fix JS error syncing starred out-of-view messages.
Previously, if one starred very old messages (or ones in a stream
you're not subscribed to), your other open browsers would likely throw
an exception syncing the message flag.
2017-01-22 20:39:05 -08:00
Tim Abbott c082564c66 reload: Catch exceptions aborting pending AJAX requests.
It's probably a bug that this throws exceptions sometimes, but it's
not consistently reproducible (or maybe, browser dependent?), and it
isn't really a problem to fail to abort some requests as part of the
page reload process; the abort was just there to make sure as little
as possible is happening so we can garbage-collect effectively.
2017-01-22 20:23:37 -08:00
Raghav Jajodia dd4ea5e56e Fix bot edit cancel button updating name anyway.
Apparently, the bot cancel button was incorrectly tagged with
"submit", and thus ended up saving the changes anyway!

Fixes #3412.
2017-01-21 22:47:29 -08:00
Steve Howell 0fc2f18c1d bug fix: Fix already-rendered messages for avatar updates.
Most of the magic happens in message_live_update.update_avatar().

The prior code was buggy, as it was using person.id instead of
person.user_id, and it was not setting the image resolution.
2017-01-21 21:45:12 -08:00
Steve Howell f75af94984 bug fix: Prefer person.avatar_url to message.avatar_url.
This change is a partial bug fix for avatar live updates.
It makes it so that we prefer the person.avatar_url to
the message.avatar_url when rendering messages.  Our live
update code was already populating person.avatar_url, but
we were ignoring it until now.

This commit does not affect messages that were already
rendered with the old url.
2017-01-21 21:45:12 -08:00
Steve Howell e7e2e388c5 Move small_avatar_url() to people.js. 2017-01-21 21:45:12 -08:00
Steve Howell 4eb1a8f07d Extract user_events.js.
This moves people.update() to user_events.person().

We now also use user_id as the key for finding person
objects in people.js (instead of email).
2017-01-21 21:45:12 -08:00
Steve Howell 601bad554e bug fix: Limit updating full names in admin screens.
If we get a realm_user update for a user that is **not**
changing their full name, we no longer call
admin.update_user_full_name().

This was probably a fairly minor bug.
2017-01-21 21:45:12 -08:00
Steve Howell 28164d68b4 Extract people.set_full_name(). 2017-01-21 21:45:12 -08:00
Steve Howell ee00d848b9 refactor: Eliminate use of page_params.fullname.
We now use people.my_full_name().
2017-01-21 21:45:12 -08:00
Steve Howell 53308b49b2 refactor: Remove last uses of page_params.email in JS code.
Earlier commits removed all uses of page_params.email outside
of people.js, and it turns out we have page_params.user_id, so
we don't even need page_params.email for seeding the data.
2017-01-21 21:45:12 -08:00
Steve Howell 9d16993011 refactor: Use people.my_current_email() in subs.js. 2017-01-21 21:45:12 -08:00
Steve Howell 58fb9e45e4 Fix flaw when subscribing using "Add" button.
When we subscribe ourselves using the "Add" button in the
right pane of "Stream settings", we now call
stream_data.subscribe_myself(), which properly updates our
data structures (more than just sub.subscribed) and prevents
some console errors when you un-subscribe yourself using
the check mark.
2017-01-21 21:45:12 -08:00
Steve Howell f476f5be7d refactor: Add early return to subs.mark_subscribed().
The code now handles the `sub.subscribed` condition up front to
make the code less nested.
2017-01-21 21:45:12 -08:00
Steve Howell 0ccb2e38f8 refactor: Use people.my_current_email() in settings.js. 2017-01-21 21:45:12 -08:00
Steve Howell 2af0302ed0 refactor: Use people.my_current_email() in search_suggestion.js. 2017-01-21 21:45:12 -08:00
Steve Howell 038164ff04 Remove unneeded data param in pointer.fast_forward_pointer(). 2017-01-21 21:45:12 -08:00
Steve Howell 2c684bf39f refactor: Use people.my_current_email() in filter.js. 2017-01-21 21:45:12 -08:00
Steve Howell e10c6719d9 refactor: Use people.my_current_email() in echo.js. 2017-01-21 21:45:12 -08:00
Steve Howell 8c6dab9750 Use data-user-id for mention buttons in local echo.
The local echo code now marks up mention buttons with user ids
instead of email.  Our code in message_list_view.js deals with
either the old style or the new style of markup now to determine
which mention buttons need to be highlighted.

As part of this commit we extract mention_button_refers_to_me().
2017-01-21 21:45:12 -08:00
Steve Howell efdcfcaea2 Clean up message flag handling for mentions in echo.js.
After this change, if a user sends a message with at-mentions, the
local echo code will add the `mentioned` flag to 'message.flags`
as part of the callback to build the HTML, rather then doing it
hackily during a post-processing step.
2017-01-21 21:45:12 -08:00
Steve Howell 894282222a refactor: Move echo.userMentionHandler code.
The userMentionHandler callback now closes on `message` inside
of echo.apply_markdown().  This sets the stage for the next commit.
2017-01-21 21:45:12 -08:00
Steve Howell 2539ed0563 refactor: Have echo.apply_markdown take message as param.
The function echo.apply_markdown() actually applies markdown to
a message now, instead of simply computing markdown.  Passing
in the outer `message` object will allow us to avoid some hacky
post-processing of messages after rendering, because we can
have our parser callbacks update message on the spot in a more
atomic fashion.
2017-01-21 21:45:12 -08:00
Steve Howell ee8502ef0e refactor: Use people.my_current_email() in custom_markdown.js. 2017-01-21 21:45:12 -08:00
Steve Howell 0b9a3251dd refactor: Use people.my_current_user_id() in stream_data.js.
In stream_data.unsubscribe_myself(), we no longer look at
page_params.email.
2017-01-21 21:45:12 -08:00
Steve Howell 5bce806c4e refactor: Introduce people.my_current_email().
This commit doesn't change any behavior yet, but it starts us
down the road of deprecating page_params.email and allowing
people.js to control all access to the current user's email,
which will be important for email changes.
2017-01-21 21:45:12 -08:00
Steve Howell 73125e2718 refactor: Move is_current_user() to people.js.
We no longer have it in util.js, because we will
want to encapsulate this better for upcoming commits
related to email changes.
2017-01-21 21:45:12 -08:00
Tomasz Kolek cc13104780 Add Zapier integration. 2017-01-20 10:43:18 -08:00
Rafid Aslam b683b2d3c3 deps: Upgrade and move `jquery-mousewheel` from `static/third` to `npm`
- Remove `jquery-mousewheel` from `static/third` and fetch it from npm.
- Upgrade `jquery-mousewheel` to 3.1.6.
- Bump up the `PROVISION_VERSION` to 4.5.
- Change some js code to comply with this `jquery-mousewheel` version.

Part of #1709.
2017-01-19 17:24:53 -08:00
Rafid Aslam 10a8c3d2ae deps: Move `xdate` from `static/third` to `npm`
- Remove `xdate` from `static/third` and fetch it from `npm`.
- Bump up the `PROVISION_VERSION` to 4.3.

Part of #1709.
2017-01-19 17:07:55 -08:00
Rafid Aslam 84e802422e deps: Upgrade and move `underscore.js` from `static/third` to `npm`
- Remove `underscore.js` from `static/third` and fetch it from `npm`.
- Upgrade `underscore.js` to 1.8.3.
- Bump up the `PROVISION_VERSION` to 4.2.

Part of #1709
2017-01-19 17:07:45 -08:00
Rafid Aslam 911fcd3831 deps: Upgrade and move `codepointat` from `static/third` to `npm`
- Remove `codepointat` from `static/third` and fetch it from `npm`.
- Upgrade `codepointat` to 0.2.0.
- Bump up the `PROVISION_VERSION` to 4.1.

Part of #1709.
2017-01-19 17:07:32 -08:00
Rafid Aslam 8ac81d2722 deps: Upgrade and move `winchan.js` from `static/third` to `npm`
- Remove `winchan.js` from `static/third` and fetch it from `npm`.
- Upgrade `winchan` to 0.2.0.
- Bump up the `PROVISION_VERSION` to 4.0.

Part of #1709.
2017-01-19 17:07:21 -08:00
Rohith Asrk 213b8cef0c Bootstrap.js: Fix null is not an object error. 2017-01-19 16:28:17 -08:00
Steve Howell 477b4af39d Direct new users to the "new members" stream.
If a new user is auto-subscribed to a stream called "new
members", we will automatically narrow them to that stream
after the tutorial.  Otherwise, we fall back to the code's
previous behavior, which is to direct them to the notifications
stream (often called "announce").

This is somewhat experimental.  If we try this concept out on
the public Zulip realm and it works well, we will create a nice
realm setting for the "new members" stream.
2017-01-19 14:58:31 -08:00
Steve Howell cd6115c24d Make nicer slugs for "sender" narrows.
Slugs are now like our "pm-with" slugs:

    narrow/sender/3-cordelia
2017-01-19 14:54:50 -08:00
Steve Howell 1ae3feac3e Use blueslip.warn, not error, for unknown emails.
In people.emails_strings_to_user_ids_string, we just warn
for bad emails going forward.

Users can enter bad emails into the search location bar,
for example, and that causes us to compute a browser hash,
which in turn uses this function.

(It's possible that we should adjust the search code not
to compute hashes for narrowing when the narrow doesn't
make sense, but that could be a non-trivial fix.)
2017-01-19 14:54:50 -08:00
Brock Whittaker 2ed598c619 Change actually_filter_streams to only run if subs overlay is open.
This change makes it such that the stream filtering operation will only
run if the subscription overlay is visible, preventing any issues with
the lack of existence of elements or processing something that users
won’t be able to see.

Fixes #3388.
2017-01-19 14:26:36 -08:00
Brock Whittaker eccca8fc61 Unify subs modal closing with subs.close().
The new subs.close() function should unify all closing events of the
subscriptions overlay. The function also now tracks whether the
subscription overlay is in a closed or open state.
2017-01-19 14:23:25 -08:00
Yago González ade5e762fb integrations: Add documentation for OpenShift. 2017-01-17 16:04:55 -08:00
Rishi Gupta 3a72b5cda9 analytics: Rename messages_sent_to_realm.
Several additional stats in the pipeline that also relate to messages sent
to the realm.
2017-01-17 15:54:57 -08:00
Steve Howell c0281498e6 group PMs: Fix hrefs in right sidebar for groups.
For the "GROUP PMs" part of the right sidebar, we now have
accurate hrefs when you hover over the groups or right-click
to copy links or open links in new tabs.
2017-01-17 15:13:49 -08:00
Steve Howell c94b8c39d0 Add narrow.huddle_with_uri() convenience method.
This will be used in a subsequent commit.
2017-01-17 15:13:49 -08:00
Steve Howell d757f840dd Make nicer slugs for "pm-with" narrows.
The slugs for PM-with narrows now have user ids in them, so they
are more resilient to email changes, and they have less escaping
characters and are generally prettier.

Examples:

    narrow/pm-with/3-cordelia
    narrow/pm-with/3,5-group

The part of the URL that is actionable is the comma-delimited
list of one or more userids.

When we decode the slugs, we only use the part before the dash; the
stuff after the dash is just for humans.  If we don't see a number
before the dash, we fall back to the old decoding (which should only
matter during a transition period where folks may have old links).

For group PMS, we always say "group" after the dash. For single PMs,
we use the person's email userid, since it's usually fairly concise
and not noisy for a URL.  We may tinker with this later.

Basically, the heart of this change is these two new methods:

    people.emails_to_slug
    people.slug_to_emails

And then we unify the encode codepath as follows:

    narrow.pm_with_uri ->
    hashchange.operators_to_hash ->
    hashchange.encode_operand ->
    people.emails_to_slug

The decode path didn't really require much modication in this commit,
other than to have hashchange.decode_operand call people.slug_to_emails
for the pm-with case.
2017-01-17 15:13:49 -08:00
Steve Howell cc7ccb56d4 Revert "Fix inconsistent spacing in message actions popover."
This reverts commit 1f13a991f4.

Moving to tables makes it so that we can't navigate the menu
with the keyboard.

Fixes #3352
2017-01-17 14:40:49 -08:00
Tommy Ip c407919db3 Add /authors page.
Contributor visualization showing the avatar, user name and number
of commits for each contributors. The JSON data would be updated
upon deployment, triggered by the `update-prod-static` script.
2017-01-17 13:35:55 -08:00
Tim Abbott 9bb390133b admin: Fix emoji creation.
f3b9abee14 apparently failed to update
the frontend.
2017-01-17 00:21:32 -08:00
Tim Abbott 9821b3ebef reactions: Fix JS error for not-yet-fetched messages. 2017-01-17 00:10:41 -08:00
Mahim Goyal 1f13a991f4 Fix inconsistent spacing in message actions popover.
This was implemented by changing the format of the popover from a list
to a table.

Fixes #3010.
2017-01-16 20:10:06 -08:00
Steve Howell c36932d29e Fix unread counts display when pinning/un-pinning.
The fix works by having build_stream_sidebar_row()
automatically update its own unread count when we
build a sidebar row.  Currently we rebuild sidebar
rows when we pin/unpin rows.

As an aside, we currently don't really need to rebuild
the sidebar row when we pin, since we're only moving
the DOM, not altering it.  But this may change in the
future, so I decided to leave that code path in place.
We may decide to do things in the future like showing
pinned streams with bolder fonts or special icons or
whatever.

Fixes #2902
2017-01-16 20:07:08 -08:00
Steve Howell 9616d91bdd minor: Move update_count_in_dom() higher in module.
This change will prevent a lint error in the subsequent
change.  This just moves code in the file.
2017-01-16 20:07:01 -08:00
Steve Howell 9806d429af Add unread.num_unread_for_stream() function. 2017-01-16 20:07:01 -08:00
Steve Howell 4597fdae27 refactor: Change params to update_count_in_dom().
We now just pass in unread_count_elem and count to
update_count_in_dom(), and it does the work of finding
count_span and value_span now.
2017-01-16 20:07:01 -08:00
Raghav Jajodia 4d65f9d6cf Fix left sidebar rendering issue with some zoom levels.
Fixes #3296.
2017-01-16 19:45:33 -08:00
Brock Whittaker 431a69a769 Change filtered/desaturated checkbox to SVG for performance.
Due to the fact that getComputedValue is called when using filter and
opacity attributes, it is much more efficient to use an SVG that has a
changing fill color rather than something that may be interpreted by
browsers as a layout change that requires layout recalculation.

This should result in noticeably smoother and more responsive :hover
events for the streams with greyed checkmarks.
2017-01-16 18:26:09 -08:00
Tim Abbott 9be76e91dd Fix capitalization in 'Add a new bot'. 2017-01-16 18:00:10 -08:00
Tim Abbott c4836bca44 Rename titles for 'Zulip Labs' to 'Experimental settings'. 2017-01-16 18:00:10 -08:00
Tim Abbott 86ddd2277e Fix capitalization in 'Deactivate your account'. 2017-01-16 18:00:10 -08:00
Tim Abbott 9921f3279f Fix capitalization in 'Deactivate account'. 2017-01-16 18:00:10 -08:00
Tim Abbott 2619ee666e Fix capitalization in 'Authentication methods'. 2017-01-16 18:00:10 -08:00
Tim Abbott b68a970018 Fix capitalization and grammar in 'Add a new filter'. 2017-01-16 18:00:10 -08:00
Tim Abbott 1a16c9bd53 Fix capitalization and grammar in 'Delete streams'. 2017-01-16 18:00:10 -08:00
Tim Abbott 6bc1653333 Fix capitalization in 'Create bot'. 2017-01-16 18:00:10 -08:00
Tim Abbott 15b718e2d1 Fix capitalization in 'Your bots'. 2017-01-16 18:00:10 -08:00
Tim Abbott 450ce61e6c Fix internationalization in streams page buttons/labels. 2017-01-16 18:00:10 -08:00
Tim Abbott abd4767b50 Fix capitalization in 'Allowed domains'. 2017-01-16 18:00:10 -08:00
Tim Abbott ee0e4c88bd Fix capitalization in 'Add new default stream'. 2017-01-16 18:00:10 -08:00
Tim Abbott 45dc2d599c Fix capitalization in 'Add a new emoji'. 2017-01-16 18:00:10 -08:00
Tim Abbott 8dc96166fd Fix capitalization in 'Your account'. 2017-01-16 18:00:10 -08:00
Tim Abbott 37e7898303 Fix capitalization in 'Default streams'. 2017-01-16 18:00:10 -08:00
Tim Abbott d38277b095 Fix capitalization in 'New alert word'. 2017-01-16 18:00:10 -08:00
Tim Abbott 572e3565fb Fix capitalization in 'Add/Custom Alert Word(s)'. 2017-01-16 18:00:10 -08:00
Tim Abbott 1703c0c897 Fix capitalization in 'Select default language'. 2017-01-16 18:00:10 -08:00
Tim Abbott 3667ca8114 Fix capitalization in 'Default language'. 2017-01-16 18:00:10 -08:00
Tim Abbott e1e7788e67 Fix capitalization in 'Deactivated users'. 2017-01-16 18:00:10 -08:00
Tim Abbott ab75b41a6f Fix capitalization in 'Save changes'. 2017-01-16 18:00:10 -08:00
Tim Abbott 2bbad279ae Fix capitalization in 'Display settings'. 2017-01-16 18:00:10 -08:00
Tim Abbott 0667ae5d26 Fix capitalization in 'Change password'. 2017-01-16 18:00:10 -08:00
Tim Abbott 56bc421a6f Rename 'Filter Streams' to 'Filter streams'. 2017-01-16 18:00:10 -08:00
Tim Abbott 284931967a Rename 'All Streams' to 'All streams'. 2017-01-16 18:00:10 -08:00
Tim Abbott d5f718a3e7 Rename 'Manage Streams' to 'Manage streams'. 2017-01-16 18:00:10 -08:00
Tim Abbott dd8fb093c8 Rename 'Stream Settings' to 'Stream settings'. 2017-01-16 18:00:10 -08:00
Sampriti Panda b4b6516ca0 narrow: Fix narrowing errors for topics with name 'home'.
Added a `.home-link` class to 'Home' links to separate them
from topic links with the name 'home'

Fixes #3340
2017-01-16 09:46:05 -08:00
synicalsyntax 83946e29ec docs: Conform *View information about a message* doc to documentations styling guidelines. 2017-01-15 11:04:42 -08:00
JefftheBest1 69f9c300b8 ui: Change grey to gray in ui.js comment. 2017-01-14 12:36:06 -08:00
Sampriti Panda 196cf4367b urls: Move /messages/render to POST endpoint 2017-01-13 16:11:51 -08:00
Rafid Aslam 38331aa81a right-sidebar: Remove border on the top of user list
Remove the border on the top of user list, especially on the top
of "USERS" word. The border is moved to bottom of feedback section.
2017-01-13 10:25:28 -08:00
Tim Abbott b6476fdd81 stream creation: Disable autocomplete on filter text box. 2017-01-12 22:53:05 -08:00
Robert Hönig 89a64de986 De-dup "outside_viewport" notifications on different tabs.
Pass down 'local_id' through functions that handle notifications for messages
that are sent locally. If 'local_id' is undefined, the message was not sent in
the respective tab, so no "outside_viewport" notification should be displayed.
This fixes #1783.
2017-01-12 17:08:18 -08:00
Katy310 7206685dae Make more streams visible when window is narrow.
When user list displays on the left, the maximum height of the
<code>stream-filters-container</code> is determined by the function
<code>confine_to_range(lo,val,high)</code>. By changing the value of
<code>lo</code> to 80, the <code>stream-filters-container</code>
resizes to 80 px instead of 40 px.

Fixes #2510.
2017-01-12 16:53:45 -08:00
brockwhittaker b3b361bae0 Add onhover grey checkmarks for unsubscribe streams.
This adds styling such that when you hover over a stream in the streams
list and you are not subscribed, you will see a faint grey checkmark
that serves as a target of where to click so you can subscribe to a
stream.
2017-01-12 16:47:32 -08:00
brockwhittaker 7762614482 Add deep link to unsubscribed streams list.
This adds a deep link behind a “+” icon above the streams list on the
left-sidebar which opens the subscriptions page and then also toggles
the tabs to go to the unsubscribed stream list.
2017-01-12 16:47:32 -08:00
Anirudh Jain 705ae523db emoji picker: Add emoji next at cursor instead of end of message.
Simplified by tabbott.

Fixes: #3155
2017-01-12 15:31:18 -08:00
Rafid Aslam d3ee53bdef Move endpoints to use stream_id instead of stream_name in their URLs
- Change `stream_name` into `stream_id` on some API endpoints that use
`stream_name` in their URLs to prevent confusion of `views` selection.

For example:
If the stream name is "foo/members", the URL would be trigger
"^streams/(?P<stream_name>.*)/members$" and it would be confusing because
we intend to use the endpoint with "^streams/(?P<stream_name>.*)$" regex.

All stream-related endpoints now use stream id instead of stream name,
except for a single endpoint that lets you convert stream names to stream ids.

See https://github.com/zulip/zulip/issues/2930#issuecomment-269576231

- Add `get_stream_id()` method to Zulip API client, and change
`get_subscribers()` method to comply with the new stream API
(replace `stream_name` with `stream_id`).

Fixes #2930.
2017-01-12 15:23:31 -08:00