Commit Graph

6942 Commits

Author SHA1 Message Date
Yashashvi Dave 463fb622b6 custom profile field: Remove all static use of field-type name or id.
This commit removes all static use of field-type's name or id in
frontend.
2018-08-21 11:37:51 -07:00
Yashashvi Dave 6e65235a6d zerver/lib/events.py: Add FIELD_TYPE_CHOICES_DICT to page_params.
This commit add FIELD_TYPE_CHOICES_DICT to page_params and replace
FIELD_TYPE_CHOICES.

FIELD_TYPE_CHOICES_DICT includes all field types with keyword, id
and display name. Using this field-type-dict, we can access field
type information by it's keyword, and remove all static use of
field-type'a name or id in frontend.
This commit also modifies functions in js where this page_params
field-types is used.
2018-08-21 11:37:51 -07:00
Max Nussenbaum eaefa31969 portico: Fix mis-sized bullets.
This fixes the mis-sized text in the bulleted lists on /for/
working-groups-and-communities (and some other pages), by ensuring
p tags inside li tags don't get font-size styling applied to them
twice.
2018-08-21 11:34:39 -07:00
Yago González 6949ce1bad templates: Replace   with normal spaces.
This line full of non-breaking spaces dates back to before Zulip being
open sourced (ca4e6a0ff), so we can assume it was a fix that we don't
need anymore.
2018-08-21 11:13:47 -07:00
Rishi Gupta 9a759060cd user docs: Remove outdated app guides. 2018-08-20 18:52:04 -07:00
Rohitt Vashishtha 8a61ac3500 typeahead: Move displaced comment to correct location. 2018-08-20 12:44:24 -07:00
Akash Nimare dab75e4990 help: Fix styling of emoticons on help pages. 2018-08-17 11:37:29 -07:00
Rishi Gupta fa50f68ec5 settings: Rename emoji settings. 2018-08-17 08:49:48 -07:00
Yashashvi Dave 8ef0c6d99a custom profile field: Add length validation on field name and hint.
Add max length validation for custom field name and hint
on create-field and update-field backend views and
frontend forms.

Fixes #10284.
2018-08-17 08:37:27 -07:00
Harshit Bansal 44694653ae emoji: Remove `display_url` from the context of `admin_emoji_list`.
This attribute seem to be artifact of some refactoring that we did
but forgot to remove it. Just a minor cleanup.
2018-08-14 12:07:56 -07:00
Harshit Bansal 3e5e7a0b19 emoji: Pre-fetch octopus emoji in `emoji.js`.
If we don't prefetch the image then on slow networks it will appear
as if octopus emoji is not present.
2018-08-14 12:01:02 -07:00
Harshit Bansal 7be7561c68 emoji: If current emojiset is text then fallback to google emojiset.
If `TEXT_EMOJISET` is currently selected emojiset then fallback to
`GOOGLE_EMOJISET` for displaying emojis in emoji picker and
composebox typeahead. We should pre-load the spritesheets in`emoji.js`
even in case of text emojiset otherwise on slow networks emoji picker
will appear empty initially.
2018-08-14 12:01:00 -07:00
Tim Abbott c208aff0da i18n: Update translation files. 2018-08-14 11:57:54 -07:00
Shayan Toqraee a4b14b8526 compose.js: Move set rtl logic to keyup event.
This fixes an issue where the ltr/rtl translation lagged one character
behind as a user typed.
2018-08-14 11:41:53 -07:00
Shayan Toqraee 56b031733a rtl.js: Fix support for supplementary planes of unicode characters (>= U+10000). 2018-08-14 11:39:29 -07:00
Akash Nimare 321b705591 left-sidebar: Add max-height to private message container.
This fixes a UI bug where if a user had a lot of recent private
message threads, they'd take over the entire left sidebar.

This was caused by not setting the max height of users list in private
message container.

Fixes: #5384.
2018-08-14 10:18:34 -07:00
Yashashvi Dave dc962f8b43 custom profile field: Don't push null values to json request.
This commit add checks in frontend to remove null values of choices
from json data. This allows user to successfully create/edit choice
custom field, even if there is blank input in choices.
2018-08-14 10:17:57 -07:00
Yashashvi Dave f8b6bb6614 custom profile field: Remove add-btn of choices.
This commit
- Remove `add-btn` in choices, to create new input
  for choice
- Add logic which create blank input for choice at
  the bottom if user start typing into above input choice.
2018-08-14 10:17:57 -07:00
Yashashvi Dave ec6a94ac34 custom profile field: Add logic for delete-btn of choices.
This commit add following logic in delete-btn of choices, so
user can not delete all choices of custom field.
Show `delete-btn` in all choices, but if there exist only
choice hide `delete-btn` of that choice.
2018-08-14 10:17:57 -07:00
Yashashvi Dave 3c9a2a6d53 custom profile field: Remove logic of choice-field-delete-btn.
Hide `delete-btn` of first choice in create-new-custom-field and
edit-choice-type-field form, so user can not delete all choices
and have to submit at least one choice.
This commit remove this logic of choice-field-delete-btn from
both settings.
This is preparatory commit of adding new logic in `delete-btn`.
2018-08-14 10:17:57 -07:00
Cynthia Lin 452389df0d night mode: Fix coloring of message edit info tooltip. 2018-08-13 16:17:15 -07:00
Cynthia Lin f3fb616d17 night mode: Improve styling of user groups in night mode. 2018-08-13 16:17:15 -07:00
Cynthia Lin 300c4c496f user groups: Display error on user group name edit failure.
Fixes #10234.
2018-08-13 16:13:49 -07:00
Cynthia Lin b63efb4f5d settings: Remove duplicate color property for alert notifications. 2018-08-13 16:13:49 -07:00
Cynthia Lin 736388b4df user groups: Improve styling of user groups in admin view. 2018-08-13 16:13:49 -07:00
Marco Burstein 4dbf59dbaa compose: Create a separate "New stream message" title editing function.
To reduce code duplication, create a new function for editing the
"New stream message" button title.
2018-08-13 15:08:15 -07:00
Tim Abbott 62bee26ea7 Revert "hotkey: Add hotkey to narrow to starred messages."
This reverts commit 144d21494e.
2018-08-13 15:05:36 -07:00
Eeshan Garg 97995b4779 webhooks/teamcity: Update docs to conform to style guide. 2018-08-13 14:54:43 -07:00
Akash Nimare ee1f87494d portico: Remove unused CSS from why-zulip page. 2018-08-13 13:35:17 -07:00
Yashashvi Dave 069acc08cd stream settings: Fix hide change-sub-type when admin unsubscribe stream.
Fixes #10163
2018-08-13 12:14:01 -07:00
Joshua Pan 144d21494e hotkey: Add hotkey to narrow to starred messages.
Fixes #9684.
2018-08-13 11:39:32 -07:00
Joshua Pan 71d81371fc hotkeys: Allow star message while compose box is open. 2018-08-13 11:17:23 -07:00
Shubham Padia e21e8c1bae compose: Hide subscribe button and change text for waiting period users.
Fixes #10124.
Users in the waiting period category cannot subscribe other users to
a stream. When a user tries to mention another unsubscribed user, a
warning message appears with a subscribe button on it to subscribe
the other user.
This commit removes the subscribe button and changes the warning text
for users in the waiting period category.
2018-08-13 10:18:35 -07:00
Shubham Padia 3f019cafb2 compose: Improve error handling when subscribing other users to a stream.
Instead of displaying a fixed error message inside the yellow bar itself,
now the yellow bar disappears on error and a red compose_error is shown.
The error message is the one returned from the server.
2018-08-13 10:18:35 -07:00
Max Nussenbaum 18449c7c57 upgrade: Fix horizontal centering on annual/monthly buttons.
This fixes the annual/monthly selection buttons on the upgrade
page so that the text within them is properly centered.
2018-08-10 22:48:10 -07:00
Max Nussenbaum e0bd719f5c upgrade: Fix styling issue on Add Card button.
This fixes the active state of the Add Card button, which previously
showed a miscolored blue background on click.
2018-08-10 22:48:10 -07:00
Shubham Padia 165636e0c4 compose: Don't close compose box on clicking bottom right keyboard shortcut.
Fixes #9803.
The compose box closes on any click in the document outside the compose
box except for an element with an anchor tag or in its parents.
This commit adds an anchor tag as parent of the keyboard shortcuts
icon.
2018-08-09 17:51:40 -07:00
Shubham Padia 4f4aee6d10 compose: Do not close compose box on click if parent/itself contains "a".
When the icon or the text of a menu item in settings dropdown was
clicked, already open compose box was closed. Clicking on the empty
area of that menu item i.e the area where the icon or text was not
present did not close compose box. This commits check whether the
target itself is an anchor tag or of any of its parent contains the
anchor tag.
2018-08-09 17:51:40 -07:00
Rohitt Vashishtha 38c7969555 marked: Warn against placing capture blocks below 'text' block. 2018-08-09 17:20:18 -07:00
Tim Abbott c2e5cc99a4 tools: Move generate-custom-icon-webfont to a subdirectory. 2018-08-09 15:39:57 -07:00
Marco Burstein 6f14f4f047 compose: Update the `New topic` button to `New stream message` in PMs.
If a user is narrowed by `is:private`, `pm-with`, or `group-pm-with`,
change the `New topic` button to say `New stream message` instead for
added clarity.

Also, add to the Casper and Node tests for this behavior.

Fix #9072.
2018-08-09 08:55:01 -07:00
Tim Abbott 9209b8ce8e i18n: Update translations from transifex. 2018-08-08 17:52:55 -07:00
Harshit Bansal 9057e543ac emoji: Disable support for letting users switch emojisets.
Due to copyright issues with potentially displaying Apple emojisets on
non-apple devices, as well as iamcal dropping support for the emojione
emojiset (see https://github.com/iamcal/emoji-data/pull/142), we are
dropping (perhaps temporarily) support for allowing users to switch
emojisets in Zulip.

This commit just hides the feature from the user but leaves most of
the infrastructure in place so that in the future if we decide to
re-enable the support we will not need to redo the infrastructure work
(some JS-side code is deleted, mostly because we'll want to re-add the
feature using the do_settings_change infrastructure anyway).

The most likely emoji set to add is the legacy "blobs" Google emoji
set, since it seems popular with some users.

Tweaked by tabbott to remove some additional JS code and update the
changelog.
2018-08-08 15:48:04 -07:00
Yashashvi Dave 1cfe7f6494 user popover: Fix user-type-field not showing in user popover.
User type custom field are not showing in user profile popover.
Because we weren't passing proper argument to func to get data.
2018-08-08 14:59:17 -07:00
Yashashvi Dave f8d4578be1 user popover: Fix choice field shows index of selected choice instead value.
Choice type of custom field, displays index of selected choice by user
instead of value of choice.
Fix this by parsing choice-type custom field to get field value before
rendering user popover template.

Fixes #10239
2018-08-08 14:59:17 -07:00
Yashashvi Dave 4aedc055ce custom profile fields: Fix click handler executed multiple times.
Previously, we incorrectly setup the click handler on
create-custom-field-btn each time settings overlay opens, which
executes handler multiple times results in more than one HTTP request
to server for custom field creation.

This commit creates an ID for create-field-btn and initializes the
click handler on this button, instead of the form; the side effect of
that change is that we're now no longer double-adding this click
handler every time the page is opened.

This isn't a clean solution; ideally, we'd only call the function to
add the click handler once in the first place.

Fixes #10126.
2018-08-08 14:54:37 -07:00
Yashashvi Dave 7b92b836a7 create stream: Remove unnecessary call of `update_announce_stream_state`.
Function `update_announce_stream_state` is used to update announce-stream
checkbox. If stream is private announce-stream checkbox gets disabled
by this function.

There are unncessary calls to `update_announce_stream_state` fuction.
i.e. it is called
 - when user clicks on `copy-from-stream` link to toggle streams-list
 - when stream-checkboxes value is changed to copy subs from stream
 - when user-filter value is changed to search users
These events does not affect announce-stream value, therefore
there is no need to call this function to update it.
2018-08-08 11:54:28 -07:00
Yashashvi Dave 7480c73d9f custom profile field: Reset initial choices in edit-field-choice form.
Currently, our edit-field-choice form in custom profile field settings
in admin UI, is rendered when settings modal is loaded not when admin
user clicks on edit-btn.
Admin user open edit-field-form of choice-type-field, do some changes
in choices, discard those changes and close edit-field-form.
When admin user again open this edit-field-form, those discarded
changes are displayed, instead of original choices data.

Fix this issue by re-rendering field choices when admin user clicks
on edit-field-btn.
2018-08-08 11:42:20 -07:00
Yashashvi Dave 07959bf18e custom profile field: Reset delete-btn of choices on choice ordering.
Admin user must enter at least one choice for choice type fields
in create new custom field form. Admin can not delete all choice
options in form.
Reset delete-btn of choice inputs on choice reordering so that
admin can delete all choice except first choice input option.
2018-08-08 11:31:15 -07:00
Yashashvi Dave e4bd72ea44 custom profile field: Replace choice-order input with drag-drop rows.
Currently, admin user has to add order of custom-field-choice in
input box to create and edit choice-type custom field.
Remove this input boxes and add drag-drop list of custom-field-choices
using Sortable.js.

Fixes #10129
2018-08-08 11:31:15 -07:00
Cynthia Lin d37a7dd9a7 popovers: Recolor user profile avatar border to fit in night mode. 2018-08-08 11:29:51 -07:00
Cynthia Lin 16518aaa34 night-mode: Change coloring of disabled items to fit night mode. 2018-08-08 11:29:49 -07:00
Cynthia Lin 89dbfc2926 night-mode: Fix stream creation loading indicator background color. 2018-08-08 11:29:49 -07:00
Cynthia Lin ecbc58c586 settings: Fix color styling for nested inputs to work in night mode. 2018-08-08 11:29:48 -07:00
Cynthia Lin a001e8d6ec night-mode: Fix color of clear search button for filter inputs. 2018-08-08 11:29:45 -07:00
Cynthia Lin d46ad47bd2 night-mode: Fix broken selector for legacy searchbox styling. 2018-08-08 11:29:36 -07:00
Marco Burstein 995d073dbf org settings: Fix a bug where the loading spinner was not visible.
In Chrome, the loading spinners on the Bots and Deactivated Users pages
were not visible due to the `filter` elements having duplicate IDs across
the different pages. (There are multiple `filter` elements with the ID
`uil-ring-shadow` on the page.)

To solve this, when generating a new loading SVG element, we append
the container element's ID to the filter's ID, thus preventing any
duplicates.

Fix #8620.
2018-08-08 10:59:23 -07:00
Shubham Dhama 44b18fcaba invite: Refactor update_subscription_checkboxes.
This is a preliminary commit for further changes.
In refactoring, logic for gettings streams is extracted.
2018-08-07 14:02:50 -07:00
Shubham Dhama 915960ee58 invite: Change "User join as" to dropdown. 2018-08-07 14:02:50 -07:00
Yashashvi Dave 55325b71a4 stream settings: Display nothing-selected when active-stream is deleted.
Display nothing-selected in stream settings tab, if we get delete-stream
event of active-stream(which stream's settings tab is opened) in
frontend.
2018-08-07 13:30:53 -07:00
Yashashvi Dave ee8948c3e1 default stream: Limit private streams in default stream suggestions.
Admin users can't add private unsubscribed streams to the default
streams list.  Therefore, we shouldn't include private streams the
user is not subscribed to in the default stream suggestions.
2018-08-07 13:29:17 -07:00
Rohitt Vashishtha c41c82aae0 settings_emoji: Use display_name in handlebars.
This commit fixes two issues with the previous implementation:

1. JavaScript's replace replaces only the first instance,
   thus we need to use a regex.
2. Handlebars was setting the id of the HTML elements with
   spaces in between which broke the delete button; now a
   new variable display_name is passed to the template.

This also makes changes to the casper tests to have an emoji
name with multiple spaces in it to ensure this bug doesn't
appear again.
2018-08-07 10:22:08 -07:00
Marco Burstein 9c1dd5cda5 compose: Deactivate the reply button when there are no messages.
When visiting a narrow like
https://chat.zulip.org/#narrow/stream/doesnotexist, grey-out the reply
button and add the title `There are no messages to reply to.`

Also, add to the tests for `narrow.js` with
`#left_bar_compose_reply_button_big`.

Fix #8547.
2018-08-07 10:19:45 -07:00
Marco Burstein 5a160c66b7 night-mode: Add styles for disabled buttons.
Also create the similar styles for the hovered state.
2018-08-07 10:19:44 -07:00
Yashashvi Dave 6a382f332e create stream: Fix announce_stream isn't disabled in create-private-stream.
Currently in create new stream form, announce_stream option isn't get
disabled for private stream with public history.
This commit fixes the above issue.
2018-08-07 10:15:22 -07:00
Priyank Patel 97d93ec8cb group pms: Fix unread count not on the same line of text.
Fixes #10199.
The issue was observed on Chrome v68 while it was not reproduced
on Chrome v64.
2018-08-05 16:04:07 -07:00
Joshua Pan 3a74df17de hash_util: Remove unnecessary parameter is_absolute_url.
is_absolute_url was always true. Removed the conditional also.
2018-08-04 17:56:02 -07:00
Steve Howell ecb3879d0c refactor: Break subs dependency in stream_data.
We move remove_deactivated_user_from_all_streams
into stream_events.js.  There were some minor changes
to rename variables and also to not rely on using
`stream_info`.
2018-08-04 14:06:19 -07:00
Abhilash Verma 1d2f8bed92 emoji: Show emoji names with spaces on front-end.
This commit also supports entering emoji names with spaces
replacing them with underscores before saving.

Fixes #10177.
2018-08-04 09:40:52 -07:00
Abhilash Verma 8826ea1eaf settings_emoji: Reduce size to 20px in custom emoji list. 2018-08-04 09:40:52 -07:00
Abhilash Verma fd9652a9d7 settings_emoji: Make strings more user-friendly. 2018-08-04 09:37:48 -07:00
Steve Howell c8898e1dc8 refactor: Move by_conversation_and_time_uri to hash_util.
This removes the 100% coverage on hash_util, but we are
pretty careful about not messing with this code.
2018-08-04 09:32:27 -07:00
Steve Howell ffca07ffdd refactor: Move by_sender_uri to hash_util. 2018-08-04 09:32:27 -07:00
Steve Howell a866f3ec17 refactor: Move huddle_with_uri to hash_util. 2018-08-04 09:32:27 -07:00
Steve Howell fc62e554ce refactor: Move pm_with_uri to hash_util. 2018-08-04 09:32:27 -07:00
Steve Howell 9accc2a3b6 refactor: Move operators_to_hash to hash_utils.
This breaks some unnecessary dependencies on
hashchange.js, in favor of hash_util, which
has fewer dependencies.
2018-08-04 09:32:27 -07:00
Steve Howell ab26e27fef Move stream-related uri helpers to hash_util.
This allows several modules to no longer need
to import `narrow` (or, in our current pre-import
world, to not have to use that global).

The broken dependencies are reflected in the node
tests, which should now run slightly faster.
2018-08-04 09:32:27 -07:00
Steve Howell a4c2971b1e Remove unused uri helpers. 2018-08-04 09:32:27 -07:00
Shubham Dhama db4ee05653 stream_data: Add helper function to get default streams. 2018-08-04 09:27:16 -07:00
Shubham Dhama 14855097c6 input_pill: Add documentation link. 2018-08-04 09:27:16 -07:00
Steve Howell ab22b4411f refactor: Move list of frequent emojis to emoji.js.
All of our data related to emojis is in emoji.js.
Now typeahead_helper no longer depends on emoji_picker.

Generally we want typeahead_helper to only depend
on data modules to avoid complicated circular
dependencies (or at least mitigate them).
2018-08-04 07:59:42 -07:00
Steve Howell f4a8ff415c minor: Fix comments for frequently used emojis.
I think it's a known problem that we don't match
on common aliases for our top N emojis, but I don't
attempt to address that here.  I just made the
comments reflect the names we use in our
current data structures.
2018-08-04 07:59:42 -07:00
Steve Howell 95490e98c9 Break emoji_picker dependency inside util.js.
We don't need util.js to be depending on emoji_picker.js.

The function emoji_prefix_sort is only used
in typeahead_helper, so I just moved the implemenation
to there.
2018-08-04 07:59:42 -07:00
Steve Howell c7ab3884c6 refactor: Extract reload_state module.
This is part of work to break some of our
nastier circular dependencies in preparation
for our es6 migration.

This commit should facilitate loading leaf-like
modules such as people.js before all of the things
that reload.js depends on.
2018-08-04 13:55:02 +00:00
Steve Howell a7d7f6cada settings: Make unsubscribed streams less sticky.
When you unsubscribe a stream by clicking on the
checkmark, we don't want it to disappear right
away, but we also don't need it to stay around
once you start searching for new streams.

Note from Tim: This commit removes some complex code that was just a
workaround for the fact that this widget used to automatically
re-filter immediately after clicking to unsubscribe a user.

Since we've since fixed that original issue, we don't need this.
2018-08-03 16:01:02 -07:00
Steve Howell 04ac832183 Change ui check to ui_report in blueslip.
This was an oversight from an old refactoring.
2018-08-03 15:59:10 -07:00
Akash Nimare edf23cd743 desktop: Update desktop app to v2.3.5. 2018-08-03 10:19:33 -07:00
Tim Abbott b658462a43 locale: Update translations data from transifex.
This includes adding several new languages that now have significant
translations.

Fixes #10165.
2018-08-03 09:49:01 -07:00
Yashashvi Dave aa14d24618 settings: Fix color of icons in custom profile settings. 2018-08-02 17:27:28 -07:00
Tim Abbott 97711ce083 settings: Remove useless duplicated margin-top.
We only needed this margin for the "filter settings" CSS, and it
doesn't take effect anyway due to CSS precedence.
2018-08-02 17:26:56 -07:00
Tim Abbott 0984d876ed settings: Fix styling for admin_filters_table.
Apparently, the 20px top margin was being overriden because it wasn't
deeply layered enough.
2018-08-02 17:24:38 -07:00
Steve Howell 1c2ddb00d1 buddy list: Add padding to progressive scrollings.
We add a padded div to our container for the buddy
list to give scrolling the illusion that we've
rendered every list item, while still letting
the browser do the heavy lifting instead of trying
to fake it out too much.
2018-08-02 16:59:27 -07:00
Tim Abbott 786501f707 buddy list: Shrink #user_presences to 95% width.
This fixes annoying problems where the scrollbar at the right of the
buddy list looks bad where it overlaps the buddy list.
2018-08-02 16:57:25 -07:00
Steve Howell 94884a4418 buddy list: Introduce buddy_list_wrapper div.
This new div allows us to split out two concerns:

    semantic list of items - remains in #user_presences
    widget real estate - controlled by new #buddy_list_wrapper

We will use this for progressive rendering.  We want to add
padding to the buddy list without messing with the integrity
of the actual HTML '<ul>' list.  (One ugly alternative would
have been to add a dummy list item, which be a pitfall for
any code traversing the list.)

Basically, all the code relating to click handlers and similar
things was left alone.  We only change js/css related to
scrolling, resizing, and overflow.
2018-08-02 16:56:50 -07:00
Steve Howell 1a84af1e79 buddy list: Add v1 progresive scrolling.
This version of progressive scrolling lazily
renders buddy list items, but it doesn't
provide the browser with any notion of upcoming
list items, so as you scroll down and the size
of the rendered list grows, the scrollbar shows
you being too close to the bottom.

This maintains 100% coverage on buddy_list.js.
2018-08-02 16:56:50 -07:00
Steve Howell 407b13af25 list_cursor: Replace container with scroll_container_sel.
Our lists tend to have both containers and scroll_containers,
and we care more about the latter to the extent they're
different.
2018-08-02 16:56:50 -07:00
Shubham Dhama 4a53560106 settings_users: Change users "Make admin" button to dropdown.
This is done taking "Guest user" into account as we're soon
gonna support that.
2018-08-02 15:55:50 -07:00
Shubham Dhama 338acb1008 settings_users: Change class name for "Save changes" button. 2018-08-02 15:55:50 -07:00
Shubham Dhama 7776fa0d05 settings_user: Move "Make admin" button to user-info-form modal. 2018-08-02 15:55:50 -07:00
Shubham Dhama 4206314184 settings_users: Update admin_icon with admin change event. 2018-08-02 15:55:50 -07:00
Shubham Dhama 6d699ff59c settings_user: Add icon for admin users. 2018-08-02 15:55:50 -07:00
Sampriti Panda bcab6748ff subs: Remove default selected tab in subscriptions modal.
Earlier, on opening the subs modal, the "Subscribed" tab would be selected
by default when the components.toggle was created for tab switching.
This would change the hash to `#streams/subscribed`, and then extra work had
to be done to change it back to `#streams/all` leading to a longer open times.

With this change, `#streams` and `#streams/subscribed` both take you to
the "Subscribed Tab", and `#streams/all` takes you directly to
the "All Streams" tab.
2018-08-02 10:20:01 -07:00
Cynthia Lin 0f34e2fe3c subs: Fix broken streams list header/search container in Safari.
Fixes #10064.
2018-08-02 09:55:32 -07:00
Tim Abbott 9779117e3c message_flags: Add a comment to explain the update_starred flag. 2018-08-01 11:11:32 -07:00
Tim Abbott 4b4d420a5f message_flags: Clarify name for toggle_starred_and_update_server.
This makes it clear that the function sends the update to the server,
not just toggling the UI or local data structures.
2018-08-01 11:09:12 -07:00
Joshua Pan 2fcc54ac14 ui: Rename update_starred to update_starred_view. 2018-08-01 11:07:44 -07:00
Roman Godov 5e70577f84 models: Rename Realm.show_digest_email field.
This renames Realm.show_digest_email field to
digest_emails_enabled, for greater clarity as to what it does
just from seeing the setting name, without having to look it up.

Fixes part of #10042.
2018-08-01 11:05:58 -07:00
Shubham Dhama 5fafddaef5 settings_user: Use `person` as an argument in open_user_info_form_modal. 2018-08-01 10:39:03 -07:00
Sampriti Panda d917901ca3 subs: Fix bug with narrow_to_row callback in subs modal.
We set the keep=false for the narrow_to_row callack so that it is deleted
once the subs modal is opened. Previously, this callback would cause issues
when you then tried to open the All Streams Settings as it would narrow to
the stream row.
2018-08-01 10:14:09 -07:00
Cynthia Lin 9efe907ef1 night_mode: Use nested selectors to change night mode element styling.
This is a SASS-exclusive feature that simplifies a majority of the night
mode selectors.
2018-07-31 17:41:27 -07:00
Cynthia Lin 0314d63e7a night_mode: Improve legacy searchbox styling to fit night mode. 2018-07-31 17:41:27 -07:00
Cynthia Lin ae48010158 night_mode: Improve pill searchbox styling to fit night mode. 2018-07-31 17:41:27 -07:00
Tim Abbott 0044866682 events: Fix starring logic correctly.
In 47aaa73f96, we fixed one issue, which
is that server_events_dispatch.js was calling `update_starred` with
the wrong arguments, but created a new one (toggle_starred wasn't
updated) and missed another (which is that we weren't ever updating
message.starred, and thus if you toggle a message's star-state in one
browser, and then tried to toggle it back in a second, it would feel
like the click didn't work, because it was trying to toggle
e.g. off->on a second time).
2018-07-31 17:38:24 -07:00
Cynthia Lin cdbb38096a night_mode: Fix broken background color for user profile. 2018-07-31 17:06:11 -07:00
Joshua Pan 47aaa73f96 events: Fix buggy update starred event.
Fixes #10111.
2018-07-31 14:47:36 -07:00
Akash Nimare cc6af84a08 portico: Redesign download button on apps page.
This PR updates the styling of download button so
that it matches with the other buttons on portico pages.

Partially fixes #10104.
2018-07-31 14:18:28 -07:00
Shubham Padia 3e6eb360c4 stream edit: Remove bottom margin from `sub_settings_title`. 2018-07-31 11:12:09 -07:00
Shubham Padia 7d6ee2e10a stream_edit: Display server error message when subscribing other users. 2018-07-31 11:12:09 -07:00
Tim Abbott d377ac5768 people: Fix blueslip errors for late-added users.
This was supposed to be suppressed when a reload is in progress,
however, the logic was accidentally checking that
reload.is_in_progress was a defined function, not whether a reload was
actually in progress.
2018-07-31 10:41:33 -07:00
Tim Abbott f71316edd0 presence: Suppress some unnecessary blueslip errors for presence.
There was previously a race condition where reload.is_in_progress was
set after `activity.js` sent the presence request to the server, but
before we process the response; in that race condition, we still
shouldn't send blueslip errors to the server.
2018-07-31 10:40:34 -07:00
Akash Nimare 57ed871800 pill: Fix broken width of input-pill.
This PR fixes a UI bug which was caused by removing
the width of pill-container.

This issue was only visible in night mode.
2018-07-31 09:45:12 -07:00
Roman Godov c0806917ec models: Rename Realm.restricted_to_domain field.
This renames Realm.restricted_to_domain field to
emails_restricted_to_domains, for greater clarity as to what it does
just from seeing the setting name, without having to look it up.

Fixes part of #10042.
2018-07-31 09:28:33 -07:00
Cynthia Lin 29442ffb93 zcommand: Add light/dark mode command aliases for day/night mode.
Fixes #10095.
2018-07-31 07:12:31 -04:00
Shubham Padia 28589c5563 search pills: Backspace should remove a search pill with typeahead open.
Fixes part of #10026.

Typeaheads stopped propogation of keydown and keyup events for any
key except tab and enter. If stopAdvance was true even tab and enter
were not allowed.

advanceKeyCodes option was added to typeahead which allowed to specify
key codes for which propogation of keydown and keyup events should not
stop. advanceKeyCodes does not respect the stopAdvance option.
As the backspace key code is added to advanceKeyCodes in search.js,
the backspace key deletes pill on pressing backspace if input is empty
or only consists of spaces.
2018-07-30 14:33:06 -07:00
Shubham Dhama 4186ebe56a settings_user: Don't render bot_owner_select for user list.
This optimize the case when the user-info-form modal is opened
in user-list by not rendering bot_owner_select handlebar.
This bug is before changing form to modal.
2018-07-30 13:48:36 -07:00
Shubham Dhama 8f115c8291 settings_user: Refactor `open-user-form` click handler. 2018-07-30 13:48:36 -07:00
Shubham Dhama 5506f74084 settings_user: Remove redundant verbose check of owner value. 2018-07-30 13:48:36 -07:00
Shubham Dhama e08daf9a00 settings_user: Add modal for user info and roles form.
Advantages of changing it to modal is that now it doesn't render
form for every row i.e. form is rendered only for row edit button
is clicked.
2018-07-30 13:48:36 -07:00
Shubham Dhama 2b738d02c3 org settings: Refactor modal "partials" to a seperate file. 2018-07-30 13:48:36 -07:00
Shubham Dhama 2bcd21aeca org settings: Use people.get_active_human_persons to get active humans. 2018-07-30 13:48:36 -07:00
Shubham Dhama 16357fc84a people: Add common function for getting active human users. 2018-07-30 13:48:36 -07:00
Aditya Bansal 5b5d8bb310 thumbnails: Rename data-original to data-src-fullsize. 2018-07-30 13:00:23 -07:00
Harshit Bansal 8aabce5a5f hotkeys: Use canonical name for reacting with `+` hotkey.
This is sort of a temporary fix to bring the state back to how it
was in commit: ef4337edcb. However,
long-term we will need to fix our local echo feature to do merging
of names just like we do on backend.
2018-07-30 12:18:33 -07:00
Steve Howell 6a4bacbd18 stream settings: Avoid redundant sorting step.
We don't need to get our original items in sorted
order, especially since we re-sort them using
a different comparison function.
2018-07-30 11:25:32 -07:00
Steve Howell 51edcb02c8 Streamline typeahead for stream links.
We don't need to get sorted streams in the "source"
function for typeahead, since we sort them later,
and we don't need to recalculate values.

This preserves the behavior that we include
unsubscribed streams in the typeahead, which is
probably intentional.
2018-07-30 11:25:32 -07:00
Steve Howell 5c4d44bf3d refactor: Extract subs.get_stream_id_buckets().
This pulls the essential bucketing/sorting logic out
of filter_table().

The diff isn't quite as clean as I'd like, but some
of the code that got added back to filter_table() can be
eliminated in the future.  Basically, all the stuff
related to hidden ids can just be zapped if we go
to an approach of just re-building the DOM cleanly
whenever our filters change.
2018-07-30 11:25:32 -07:00
Steve Howell 68dba4515d refactor: Use triage_stream() to filter streams.
We replace two calls to stream_matches_query() with
a single call to triage_stream(), which prevents us
from doing the same is-subscribed checks twice.
2018-07-30 11:25:32 -07:00
Steve Howell 95edf68fd0 Refactor stream_matches_query to early-exit.
For the non-subscribed case, checking flags is a quick
way to reject streams vs. the more expensive indexOf
checks.
2018-07-30 11:25:32 -07:00
Steve Howell 95d136ca5e Extract search_util.js module.
We probably should have done this a while ago, even
though these functions are pretty tiny.  The goal here
is to make it easier to have more consistent search
semantics.

Our first use case is subs.js.  In this case we
are able to decouple a bit of generic string
matching from the subs-specific code.
2018-07-30 11:25:32 -07:00
Steve Howell 064d0f3c89 Extract stream_data.sort_for_stream_settings().
We move some data code from subs.js to stream_data.js.

It's not clear we have been using the optimal sort for
dealing with locales, but this change preserves the
current behavior.  The only subtle change here is that
we look up subs using a Dict now instead of a plain
JS object.
2018-07-30 11:25:32 -07:00
Steve Howell 5641c77c94 refactor: Introduce other_stream_ids in filter_table().
We now build up three buckets of stream ids for slightly
more consistent code that will help in future refactorings.
2018-07-30 11:25:32 -07:00
Lyla Fischer ba791b7071 user docs: Remove add-a-link-preview since it is a server admin doc. 2018-07-29 20:32:46 -04:00
Lyla Fischer 9f80322a35 user docs: Update custom-linkification doc. 2018-07-29 20:32:46 -04:00
Lyla Fischer c6938a42d6 user docs: Update add-custom-emoji. 2018-07-29 20:32:46 -04:00
Tim Abbott aa8533a5f7 locale: Update transation data from transifex and repo. 2018-07-27 12:26:10 -07:00
Steve Howell 441a21fac8 Use jQuery objects in MessageListView._rows.
The values of this dictionary used to be raw DOM elements,
but get_row() wraps them again, so there's not a huge
reason to store them as raw DOM elements internally.  It
is slightly easier to reason about the code if everything
stays at the jQuery level.

To preserve the old behavior here, we have to do something
that is kind of ugly, but at least it's explicit now.  In
the old code, our cache was DOM elements, and if an id
wasn't in the cache, we would sneakily return $(undefined)
with this code in get_row():

    return $(this._rows[id]);

And it turns out that $(undefined) is basically just a
zero-element jQuery object.  A lot of our code depends
on this behavior and just works around the zero-element
objects as needed with checks like this:

    if (this.selected_row()).length === 0) {
        // don't try to get offset
    }

For now we just preserve this behavior.  We could eventually
be more strict here, or at least have aggressive warnings
on cache misses, but we'd need to retrofit code to be
able to call something like `has_rendered_selection()`
and/or deal with `undefined` as the return value for the case
where the selection hasn't been rendered.

Here is some example code that would cause tracebacks if
we just returned `undefined` for cache misses:

    rerender_preserving_scrolltop: function () {
        // old_offset is the number of pixels between the top of the
        // viewable window and the selected message
        var old_offset;
        var selected_row = this.selected_row();
        var selected_in_view = selected_row.length > 0;
        if (selected_in_view) {
            old_offset = selected_row.offset().top;
        }
        return this.rerender_with_target_scrolltop(selected_row,
            old_offset);
    },
2018-07-27 11:14:53 -07:00
Steve Howell 69b42a7440 refactor: Extract MessageListView._fix_single_row().
This function is more cohesive and always takes in
a jQuery object containing exactly one DOM element,
and it does all stuff at the jQuery level of
abstraction (no raw DOM).

It's a pretty simple extraction--removing the level
of indentation makes the diff a bit noisy.
2018-07-27 11:14:27 -07:00
Steve Howell 6b2c291b4e refactor: Extract MessageListView._put_row().
Saving row data in `_rows` is a very data-specific task,
unlike the rest of `_post_process`, plus extracting it
will help with unit testing.
2018-07-27 11:10:50 -07:00
Steve Howell 3d853f9bf4 refactor: Pass in jQuery objects to _post_process.
We shorten the name of the function and avoid having
all the callers call `.get()`.  Now we mostly stay
in jQuery "space", which avoids some confusion about
when we're dealing with raw DOM elements and which
will facilitate unit testing.
2018-07-27 11:10:49 -07:00
Shubham Padia 5bf6e55778 search pills: Fix visual bugs due to CSS refactoring of input pills.
Changed search pill padding, `.navbar-search` flex-wrap to match with
the CSS refactoring in 66df4e3e84.
The `height: 100%` changes to `.navbar-search` and `.input-append`
make up for the issue in which the pills overflowed in the mobile
view due to `.navbar-search` height being declared 40px explicitly
while the actual heiight in mobile view was shorter.
2018-07-27 10:54:09 -07:00
Yashashvi Dave 00f9772ccc stream list: Scroll to opened stream on zoom out from stream-more-topics.
Currently on zoom out from stream topics, scrollbar didn't scroll back
to opened stream. Because call to scroll-to-stream func isn't called
after all streams view is displayed. So wrong stream element is
passed to func.

Fix this by calling scroll-to-stream func after all-stream-list view
is displayed.
2018-07-27 09:09:53 -07:00
Cynthia Lin e9cf545ada scroll_util: Account for element padding in height calculations. 2018-07-27 09:09:52 -07:00
Cynthia Lin ee82f14d04 subs: Use scroll_util to move selected stream rows into view.
This eliminates a bunch of complex logic we previously used when
trying to make keyboard stream row navigation smoother.
2018-07-27 09:08:49 -07:00
Aditya Bansal 5190f4c51a stylesheets: Fix coding style to comply with stylistic rules. 2018-07-27 00:15:58 -07:00
Aditya Bansal 5bca93d147 hotspots.scss: Fix styling to conform to stylistic rules. 2018-07-27 00:15:58 -07:00
Aditya Bansal 4cbe827581 portico.scss: Fix styling to conform to stylistic rules. 2018-07-27 00:15:58 -07:00
Aditya Bansal 92e29db3f5 landing-page.scss: Fix styling to conform to stylistic rules. 2018-07-27 00:15:58 -07:00
Cynthia Lin 2fe4056b3c composebox_typeahead: Add user groups to PM recipient typeahead.
When a user group is selected, we add PM pills for each user in the
group instead of creating a PM pill for the user group.

Fixes #9971.
2018-07-26 11:21:11 -07:00
Cynthia Lin 0198e2b2b1 typeahead: Add new functions for differentiating user groups and people.
We use these new functions in the message compose typeahead so that they
can also be used in a PM recipients typeahead with both people and user
groups.
2018-07-26 11:21:11 -07:00
Steve Howell 8aa3eebe70 refactor: Render Stream Settings in two steps.
We now render the "skin" part of "Stream Settings" before
adding in the actual streams.  The new function
populate_stream_settings_left_panel() takes care of adding
the streams.  It uses a new template called
`subscriptions.handlebars`.

Splitting out this function will give us more flexibility
for various improvements.

First, we can decide to render the list after we open the
overlay, just to avoid the problem that users don't know why
the modal's opening.  (And we could add a loader spinner as
needed.)

Second, we can improve our filter features so that we do
filtering in the data instead of moving DOM rows around,
which is expensive.

Third, we can eventually introduce progressive rendering.

Finally, having the function broken out will make profiling
more precise about where bottlenecks exist.
2018-07-26 11:20:46 -07:00
Shubham Padia 6162ea1075 pills: Add `flex-wrap: wrap` to pill container for all pills.
Fixes #10059.
In 66df4e3e84,
`display: inline-flex` was added to `.pill-container` but
`flex-wrap: wrap` was missing which forced overflow pills to be on
one line and made the pill text overflow vertically. This was not
observed in composebox pills as `.pm_recipient .pill-container`
already had a `flex-wrap: wrap` rule which has been removed in this
commit to avoid duplication.
2018-07-25 16:35:00 -07:00
Steve Howell 5cdce82f7c refactor: Add compare_function to buddy_list.
We were passing this in before, but having it as
a data member reinforces the idea that we'll want
this to be a first-class concept in the list, since
we depend on ordering for various things.
2018-07-25 15:53:27 -07:00
Steve Howell 45ab5a2f61 refactor: Simplify navigation code for buddy list.
We can now take advantage of self.keys to return
first_key, prev_key, and next_key.
2018-07-25 15:53:27 -07:00
Steve Howell d69b3a3c71 refactor: Track user_ids in buddy_list.js.
We now keep track of keys in buddy_list.js, so that
when we insert/remove items, we no longer need to
traverse all the DOM.  Instead, we just find out
which position in the list we need to insert the
key in (where "key" is "user_id") and then find
the relevant DOM node directly and insert the new
HTML before that node.  (And of course we still
account for the "append" case.)

There's a little more bookkeeping to make this
happen, but it should help reduce some code in
upcoming commits and pave the way toward
progressive rendering optimizations.

This commit should produce a minor speedup
for activity-related events that go through
buddy_list.insert_or_move(), since we are
not traversing the DOM to find insertion points
any more.
2018-07-25 15:53:27 -07:00
Steve Howell 18c3cb8f7e refactor: Extract buddy_data.get_items_for_users().
This will be useful for lazy rendering, where our
buddy_list widget already knows the keys (aka "userids")
it wants to render as you start scrolling them into
view.
2018-07-25 15:53:27 -07:00
Aditya Bansal fa3a337f37 stylelint: Fix css stylistic violations in various scss stylesheets. 2018-07-25 14:58:25 -07:00
Aditya Bansal be77e600ee stylelint: Fix landing-page.scss to comply with stylelist rules. 2018-07-25 14:58:25 -07:00
Shubham Padia 56644d149a typeahead: Replace `no-break space (U+00A0)` in query with `space (U+0020)`.
Typing "tim " did not did not produce any match when suggesting person
in composebox typeahead or user group typeahead as the space at the
end of the "tim " string passed by the browser was a
`no break-space (U+00A0)`  instead of `space (U+0020)`.

Although there are unicode characters other than `no break-space` which
represent spaces, only U+00A0 is replaced as it was the only space
character encountered when testing this issue manually.

Fixes #10039.
2018-07-25 14:55:11 -07:00
Rishi Gupta 1bbe87cf82 portico: Add links to import from slack and gitter to /new. 2018-07-25 08:49:27 -07:00
Shubham Padia 22c5a73ccb search: Add #searchbox_legacy selector to #searchbox rules in media.scss.
This is a fixup for e1291cf839.
While copying the the rules of `#searchbox` to `#searchbox_legacy`
in the search pills feature, the existing `#searchbox` rules were
missed in the conversion.
`#searchbox_legacy` has been added beside `#searchbox` in `media.scss`
instead of replacing that as both of them need those rules for the
mobile view.
2018-07-25 08:47:58 -07:00
Lyla Fischer d50faa4d81 user docs: Add reference to support email in docs footer. 2018-07-24 11:10:23 -07:00
Cynthia Lin 9593a8a7f5 help: Exclude anchor link hash to highlight main article in sidebar.
Currently, if you access an article link with an anchor link that isn't
featured in the sidebar, the main article won't be highlighted. Thus, we
exclude the anchor link hash from the article-searching selector if
the full article pathname wasn't found.
2018-07-24 09:01:42 -07:00
Vishnu Ks 82fc82b7e2 billing: Sign and verify the seat count during upgrade. 2018-07-24 08:04:00 -07:00
Cynthia Lin eaeec30590 help: Fix broken anchor link handling in documentation.
Fixes #10022.
2018-07-23 23:18:33 -07:00
Marco Burstein 7daf7c1498 portico: Slightly shrink the Core Team profiles' width.
Shrinking the widths enables all five core team profiles to be aligned
on the same line, instead of having four on the first line and one
profile on its own line.

Fix #10008.
2018-07-23 22:43:07 -07:00
Marco Burstein bb09bea0b6 ui: Simplify hotkey deprecation notices.
To reduce code duplication when creating hotkey deprecation notices,
create the `get_hotkey_deprecation_notice` function. Also, create a
`ui` testing file with a test for the new function.

Fix #10004.
2018-07-23 22:41:59 -07:00
Steve Howell 520e85b866 Use topic_data.js for topic typeaheads.
This replaces some old code with calls to topic_data.js.

Now our topic typeahead uses the same data as our
sidebar, stream suggestions, and the "n" key, so any
future improvements to that data will benefit all
features the same.

This is an important piece of #9857.
2018-07-23 16:08:24 -07:00
Joshua Pan 6890b98dec settings: Use delivery_email for user settings. 2018-07-23 15:38:41 -07:00
Harshit Bansal fbdc21a161 typeahead: Extract `query_matches_string()`. 2018-07-23 12:35:08 -07:00
Harshit Bansal a906d564a3 emoji: Rename `css_class` to `emoji_code` in emoji.js.
Now that `emoji_collection` and `emojis_by_name` are global
datasources in the webapp we need to rename things carefully
to reflect their actual meaning. The fact that emoji code is
used as a css class for unicode emoji is one thing but it is
not its sole use so renaming it seems a good idea.
2018-07-23 12:35:08 -07:00
Harshit Bansal 88bc78645d emoji: Move `emoji_collection` from emoji picker to emoji.js.
This commit moves the `emoji_collection` datasource in the emoji
picker to emoji.js and renames it to `emojis_by_name`. It is a
mapping from emoji name to object where each object describes an
emoji. This is an effort in the direction of de-duplicating and
unifying the datasets being used by various our widgets(like
emoji picker and composebox typeahead) in the webapp. Migrating
all the widgets to a single datasource will help us in removing
the whole class of annoying bugs which causes some emojis to be
missing from some widgets.
2018-07-23 12:35:08 -07:00
Harshit Bansal c0b0fb7cce emoji: Move `EMOTICON_CONVERSIONS` mapping to build_emoji infra.
This commit closes a long pending issue which involved moving the
`EMOTICON_CONVERSION` mapping to build_emoji infrastructure so
that there is only one source of truth. This was pending from the
time when this feature was implemented.
2018-07-23 12:35:08 -07:00
Shubham Padia ef2f6b7e47 hotkey: Blur search pill or searchbox contenteditable div on `Esc` key.
Pressing `Esc` did not blur a contenteditable div by default, while
an input field was blurred by default. Due to this when a user tried
to unnarrow using `Esc` key when the searchbox had focus, the focus
remained stuck in the div itself and no further action was taken.
2018-07-23 11:37:10 -07:00
Shubham Padia 9b1dc48ebd keyboard-shortcuts: Focus instead of select on `/` if search pills enabled.
If search pills are not enabled, the text present in the search bar
will be selected on pressing '/' and writing someting without deselecting
the text will clear the search text. Since selecting the pills would
not make sense in this context, the search box is focused instead.
2018-07-23 11:29:10 -07:00
Shubham Padia 22b2393cae pills: Use `widget` instead of `my_pill` throughout the app.
`compose_pm_pill.my_pill`, `search_pill_widget.my_pill` and any of
its occurrences throughout the app have been replaced to use `widget`
instead.
2018-07-23 11:29:10 -07:00
Shubham Padia 1f553a41d0 search: Higlight `#searchbox` on focus.
Adds box-shadow to `#searchbox` when either `#search_query` or any
of the pills have focus. Uses jquery instead of pure css as the
`:focus` event occurs on `#search_query`, while we want to add
box-shadow to `#searchbox`. This could have been done with
`:focus-within` CSS selector, but it is not supported in IE or Opera.

`#search_query` already had an onfocus/focusout listener, adding
listeners to `#searchbox.pills` for those events wouldn't have worked
as you don't want the focusout event to fire when the focus shifts
from input to pill.

Also adds `focusin`, `focusout` and `css()` to zjquery. `css` is
same as `val`, except it returns an empty object in case of no value
instead of an empty string. I don't think `css()` is valid syntax
in actual jquery.
2018-07-23 11:29:10 -07:00
Shubham Padia 73e4f3b3fa search: Do not display `All messages` suggestion if bar not empty.
Previously `All messages` was displayed irrespective of the existing
pills. Now the suggestion is displayed only if no pills are present
2018-07-23 11:29:10 -07:00
Shubham Padia 8b153f6452 search: Validate suggestion against existing operators.
After adding search pills, suggestions were based only on the
current input and no validation against the existing pills was done.
operator_subset_suggestions have been removed. Default suggestions
for base_operators have also been removed.
Handle multiple operators:
if `is:starred stream:Ver` was typed without selecting the typeahead
or pressing enter in between i.e search pill for is:starred has not yet
been added, then the description of `is:starred` will act as a prefix
in every suggestion.
Also makes changes re-enabling person suggestions for names with spaces.
2018-07-23 11:29:10 -07:00
Tim Abbott db4f6e278f search: Duplicate get_default_suggestion.
This lets us modify the implementation of this function for the search
pills implementation only.
2018-07-23 11:29:10 -07:00
Tim Abbott 5b0e9b7fe6 search: Duplicate search_suggestions.get_suggestions.
This large function will need to be modified significantly as part of
the pills effort, and copying it lets us preserve behavior in
production until we're ready to cut things over.
2018-07-23 11:29:10 -07:00
Shubham Padia 069a4f1626 search: Disable tab_bar due to addition of search pills.
tab_bar.js becomes redundant after implementation of search pills.
This commit adds a comment to tab_bar.initiliaze, so the event
listeners related to it do not get initiated. This does not remove
any code related to tab_bar.js.
Also adds left and right border around the search icon.
2018-07-23 11:29:10 -07:00
Shubham Padia 36707a33ca search: Add a basic implementation of search pills.
Following points have been implemented in this commit:
1.) Add search pill on selecting typeahead.
2.) Re-narrow after removing a search pill.
3.) Add quiet optional parameter to removeLastPill.
4.) Pre populate search pills in narrow.activate.
5.) Clear existing search pills on narrow.deactivate.

Description of above points:
1.) I tried out using the description from suggestions.lookup_table
to append a pill using appendValidatedData so that the description
had not to be calculated again. But the description in the suggestions
lookup contains html due to highlighting. This html is escaped when
inputed in a pill. An attempt was also made to remove the higlighting
by replacing the tags. But other espaced characters like &lt; also
popped up, so it was better to use append_search_string.
3.) If one wants to refresh the pill using pill.clear and wants to
repopulate them, evaluating the event_handler associated with the
action of removing the pill may not be desired.
4.) Pill population code is added to narrow.activate. Pills are not
populated if the narrow was triggered by search as search handles the
addition and removal of pill by itself. The reason for not handling
search too in narrow.activate is to avoid clearing the pills and
repopulating them. Example of some of the triggers for narrow.activate
include `restore draft`, `topic change`,`sidebar`.

Also modifies tests for search.js
2018-07-23 11:29:10 -07:00
Shubham Padia 6ff13d0d01 pills: Allow removing pill without calling the remove event handler.
Adds an optional parameter `quiet` to removeLastPill and removeAllPills.
If `quiet` is a truthy value, the event handler associated with the
pill will not be evaluated. This is useful when using clear to reset
the pills.
2018-07-23 11:29:10 -07:00
Shubham Padia 5212026620 search: Change letter-spacing to normal for search box.
The letter-spacing was changed last in commit
fc4d80d941 which is about a 5 year old
commit at the point of writing. The change is removed as I did not
notice any visual change on removing it. Changing the letter spacing to
normal lets the text in the pills be seen legibly, otherwise the characters
were overlapping.
2018-07-23 11:29:10 -07:00
Shubham Padia 4c575985c1 search: Initialize search pill widget in ui_init.js.
Adds the initialize function to search_pill_widget.js for initializing
a pill object on search query box.
2018-07-23 11:29:10 -07:00
Shubham Padia e228687094 search: Make search query a contenteditable div for search pill.
Input pills require a contenteditable div with a class named input
to fall inside the pill container. On converting the input tag into
a div, the size of the input decreases which is compensated by a
line-height of 40px. Comment above letter-spacing:normal was removed
as chrome and firefox do not change the letter-spacing to normal
for a div via the default browser stylesheet.

NOTE: Currently writing something into the div will call the action
corresponding to that key in the keyboard shortcuts. The input will
work fine once the pills have been initiated.

For the casper tests, for now, we just use the legacy search code.
When we change that, $.val() cannot be used on contenteditable div, so
$.html() will need to be used instead in select_item_via_typeahead.
2018-07-23 11:29:10 -07:00
Tim Abbott e1291cf839 search: Copy CSS to a separate #searchbox_legacy block.
This way, we can edit the CSS for the searchbox without having to
worry about changing the legacy behavior.
2018-07-23 11:29:10 -07:00
Tim Abbott 87427fb923 css: Put searchbox CSS into a single CSS block. 2018-07-23 11:29:10 -07:00
Tim Abbott 26cd7f931c css: Move message edit history CSS from middle of search CSS. 2018-07-23 11:29:10 -07:00
Shubham Padia 5e93922a7d search: Add search_pill_widget.js.
Also adds the file to the static asset pipeline.
search_pill_widget.js will be used to access the pills object for
the search query box. It will act in a similar way to
compose_pm_pill.js. Why is this needed: Consider you've initiated
a pills object in search.js for the search query box. Now you want to
also access that pills object to pre-populate pills after a reload in
hashchange.js. search_pill_widget.js makes this easy without the use
of events.
2018-07-23 11:29:10 -07:00
Sampriti Panda ffb29ddaf1 subs: Replace tr block with t in subs handlebars template.
The `tr` block does clones the `options` array (which contains the
entire subscriptions data set) very inefficiently, which leads to the
rendering being very slow.

We don't need a `tr` block here, as there is no dynamic content that
needs to be replaced.
2018-07-23 10:55:16 -07:00
Yashashvi Dave bbe326dd29 message edit: Add markdown shortcuts to message edit UI.
This makes the ctrl+B, ctrl+I, ctrl+shift+L shortcuts available when
doing message editing.

Fixes #9917.
2018-07-23 10:41:46 -07:00
Yashashvi Dave 987c4f7df3 static/js/compose.js: Clean `add_markdown` function.
Rename `add_markdown` function to `wrap_text_with_markdown` and
use closure variables in function `wrap_text_with_markdown`.
2018-07-23 10:38:18 -07:00
Marco Burstein 3ae5e40f8f lightbox: Make `v` close the lightbox during Pan & Zoom.
When Pan & Zoom (canvas) is enabled, the `v` hotkey does not work due to
`LightboxCanvas` overriding the `keydown` event. Add `v` as an option in
the new listener.

Fix #9777.
2018-07-23 10:36:48 -07:00
Cynthia Lin c3b1381c2a left sidebar: Make sure the selected stream is visible in left sidebar.
This triggers a scroll in the left sidebar after an initial narrow if
the target stream isn't visible.

Fixes #9043.
2018-07-23 10:32:10 -07:00
Cynthia Lin 66df4e3e84 input-pill: Refactor pills to eliminate fixed positioning of elements. 2018-07-23 10:21:13 -07:00
Cynthia Lin f081ee7120 help: Limit width of documentation content. 2018-07-23 10:10:02 -07:00
Cynthia Lin 55d5089156 help: Use simplebar instead of container to calculate hash scrolling. 2018-07-23 10:10:02 -07:00
Steve Howell 9608b82a36 refactor: Make vars local inside subs.filter_table().
There was no reason for these to be module variables.
2018-07-23 10:01:38 -07:00
Harshit Bansal bf70955c0c emoji: Update `emoji-datasource` packages.
This commit updates the `emoji-datasource` packages to version 4.0.4.
This update brings following changes to emoji infra:

1: Fix for the bleeding sprite sheets.

2: The category of some emojis has been changed. Categorywise breakup of
   net gain or loss is as follows:
    Travel & Places: 58 (gain)
    Symbols: 47 (loss)
    Smileys & People: 52 (gain)
    Objects: 11 (loss)
    Food & Drink: 3 (gain)
    Animals and Nature: 46 (gain)
    Activities: 9 (loss)

3: There were some changes in the image farm of the package which were
   breaking our old emoji farm. I fixed them by modifying the remapped
   emoji map.

Fixes: #8235.
2018-07-23 08:04:58 -07:00
Akash Nimare 5f4895f780 user-groups: Centre align popover content. 2018-07-22 20:14:29 -07:00
Cynthia Lin 84a977967b subs: Fix regression in Filter streams input focus during modal opening.
This behavior was originally implemented in commit 6993f89, but due to not
specifying a toggle option, the Subscribed/All streams switcher tab was
focused after the input was focused, leading to the input's loss of focus.

Fixes #9981.
2018-07-22 10:20:44 -04:00
Abhigyan Khaund 29a95f3cbf desktop: Update app version to v2.3.3. 2018-07-19 10:54:58 -07:00
Marco Burstein 11cbe2bf6a lightbox: Fix a "Pan & Zoom" causing an error with thumbnailed images.
Images on the new thumbnailing system generate an error when
"Pan & Zoom" is enabled:

    Browser Error: Lightbox for unknown message undefined
    39648: http://localhost:9991/webpack/app.js
        | Object.blueslip_error [as error]
    50743: http://localhost:9991/webpack/app.js
        | Object../static/js/lightbox.js.exports.open
    50897: http://localhost:9991/webpack/app.js
        | HTMLDivElement.
    39474: http://localhost:9991/webpack/app.js
        | HTMLDivElement.blueslip_wrapper
    16299: http://localhost:9991/webpack/app.js
        | HTMLDivElement.dispatch
    16107: http://localhost:9991/webpack/app.js
        | HTMLDivElement.elemData.handle

To fix this, instead of using the `src` attribute as the key for
`asset_map`, which can be either the original or thumbnailed version
depending on the situation, always use the original version.

Also, create `frontend_tests/node_tests/lightbox.js` to test this
functionality.

Fix #9955.
2018-07-18 10:19:56 -07:00
Marco Burstein a6939a5078 lightbox: Fix lightbox not showing new thumbnails as selected.
The current code for detecting which image to add the `selected` class
to is `preview_source.match(src)`. With the new thumbnails, this no
longer works because thumbnail URLs include a `?`, which has its own
RegEx significance. To solve this, check for equality instead of using
RegExes.
2018-07-18 10:19:56 -07:00
Aditya Bansal 98a4e87e1d thumbor: Complete implementation of thumbnailing.
Various pieces of our thumbor-based thumbnailing system were already
merged; this adds the remaining pieces required for it to work:

* a THUMBOR_URL Django setting that controls whether thumbor is
  enabled on the Zulip server (and if so, where thumbor is hosted).

* Replaces the overly complicated prototype cryptography logic

* Adds a /thumbnail endpoint (supported both on web and mobile) for
  accessing thumbnails in messages, designed to support hosting both
  external URLs as well as uploaded files (and applying Zulip's
  security model for access to thumbnails of uploaded files).

* Modifies bugdown to, when THUMBOR_URL is set, render images with the
  `src` attribute pointing /thumbnail (to provide a small thumbnail
  for the image), along with adding a "data-original" attribute that
  can be used to access the "original/full" size version of the image.

There are a few things that don't work quite yet:
* The S3 backend support is incomplete and doesn't work yet.
* The error pages for unauthorized access are ugly.
* We might want to rename data-original and /thumbnail?size=original
  to use some other name, like "full", that better reflects the fact
  that we're potentially not serving the original image URL.
2018-07-15 00:39:41 +05:30
Sarah de2ec8a05c notification settings: Add UI for stream email notifications.
Previous commits have fully implemented the logic for stream email
notifications; this final commit adds support for configuring it to
the UI.

Fixes #6511.
2018-07-14 12:19:33 +05:30
Harshit Bansal f636882e04 build_emoji: Migrate to use `emoji_names.py` file.
This migrates Zulip to use a dramatically better set of names and
aliases for our emoji set, defined in emoji_names.py (which is in turn
manually generated from our hand-curated CSV file).

This should significantly improve the experience of using Zulip's
emoji picker and emoji typeahead for finding what one is looking for.
2018-07-13 21:18:02 +05:30
Max Nussenbaum 122dcc9760 billing: Style upgrade page.
This styles /upgrade.
2018-07-13 18:32:29 +05:30
Max Nussenbaum 8fd900626d billing: Style billing page.
This adds styles to /billing.
2018-07-13 18:30:38 +05:30
Max Nussenbaum 4af3b8bdda settings: Improve styling of draggable profile field rows.
This changes the icon indicating that you can drug the custom
profile field rows in settings to be the double rows of dots
typically used to indicate draggability. It also gives those
rows the "move" cursor on hover.
2018-07-13 18:17:03 +05:30
Cynthia Lin 960f83238b help: Replace perfect-scrollbar with simplebar in help pages.
The perfect-scrollbar library created one major problem, which is that
`ctrl-F` didn't work, and several smaller problems.

Fixes #9748 and fixes #8887.
2018-07-13 18:03:32 +05:30
Cynthia Lin ab9f167053 help: Refactor help page CSS to eliminate padding on content containers.
This is essential for using simplebar, since simplebar doesn't account
for parent <div> paddings, which might cause scrollbars to be mispositioned
if not considered.
2018-07-13 18:03:32 +05:30
Cynthia Lin 1babd6aa28 help: Prevent scrolling on sidebar when collapsed in mobile view. 2018-07-13 18:03:32 +05:30
Cynthia Lin 8ee034a41c help: Prevent scrolling when cursor is on body.
When you hover above the navbar, the cursor focuses on the page
body and scrolls the entire page, breaking the positioning of the
fixed sidebar and page content.

We disable scrolling on the body but allow the sidebar and Markdown
content page elements to be scrolled to fix this bug.
2018-07-13 18:03:32 +05:30
Aastha Gupta dfde4fac85 invitations: Send 'invites_changed' event for invitations events.
Fixes #7665

In case of invitation events, 'invites_changed' event without
any real payload is sent to all the realm admins and the user.
The event is handled by reloading the list to view recent changes.

Commit tweaked by shubhamdhama:
* Send an `invite_changed` event when an user accept an invite.
    Also, added the test for the same.
* No need to delete the invite list in frontend, current logic
    handles the case when the invite data is changed properly.
* Extracted the common logic for sending an event into
    `notify_invites_changed`.
2018-07-13 18:00:06 +05:30
Cynthia Lin 0ed13e3631 stats: Fix incorrect data-user attribute on Everyone button.
For some reason, it was defined as "realm" instead of "everyone",
resulting in undefined value JS errors when draw_plot() was called.

Fixes #9937.
2018-07-13 10:24:13 +05:30
Joshua Pan 3ac49c1503 mlv: Remove unecessary function names.
We have deprecated this code style.
2018-07-12 11:43:21 -04:00
Anders Kaseorg ae55107560 HTML validation: Replace Drafts button with styled link.
<button> inside <a> is invalid.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2018-07-12 18:47:10 +05:30
Anders Kaseorg 6107382b2a HTML validation: Remove invalid <pipe> element from portico-header.
It seems to have been there to paper over a styling problem that was
actually caused by slightly mismatched font sizes (em vs. rem).

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2018-07-12 18:46:31 +05:30
Eeshan Garg 3eaf00444a markdown: Render nested multi-line code blocks correctly.
This commit adds a Markdown tree-processor extension that renders
multi-line code blocks that are nested inside lists with the
formatting. Note that the code block could be nested inside multiple
list levels and would still get rendered correctly.

Tim: This fixes the need for unpleasant workarounds like
f5bfa4e793 and makes nested code blocks
in our documentation look exactly how users would expect them to.
2018-07-12 12:22:04 +05:30
Aditya Bansal c47db1a1e8 left_sidebar.html: Upgrade to use font-awesome 4.7 icon prefixes. 2018-07-11 20:31:18 +05:30
Aditya Bansal 82877fa116 recipient_row.handlebars: Upgrade to font-awesome 4.7 icon prefixes. 2018-07-11 20:31:17 +05:30
Aditya Bansal fb839c1d5b compose.html: Upgrade to use font-awesome 4.7 icon prefixes.
We also adjust some CSS so that icons after this upgrade look exactly
or nearly the same as they did before the upgrade.
2018-07-11 20:31:17 +05:30
Aditya Bansal 61e4bb1bf4 user_info_popover_content.handlebars: Use fa-4.7 icon prefixes. 2018-07-11 20:31:17 +05:30
Aditya Bansal f605fdf2c8 topic_edit_form.handlebars: Upgrade to font-awesome 4.7 icon prefixes. 2018-07-11 20:31:17 +05:30
Aditya Bansal 1fb2dc5b65 tab_bar.handlebars: Upgrade to font-awesome 4.7 icon prefixes. 2018-07-11 20:31:17 +05:30
Aditya Bansal 6f5a1d3893 stream_sidebar_row.handlebars: Upgrade to font-awesome 4.7 icon prefixes. 2018-07-11 20:31:17 +05:30
Aditya Bansal dad1b60355 stream_sidebar_actions.handlebars: Use fa-4.7 icon prefixes. 2018-07-11 20:31:17 +05:30
Aditya Bansal 66096e9509 single_message.handlebars: Upgrade to font-awesome 4.7 icon prefixes. 2018-07-11 20:31:17 +05:30
Aditya Bansal 37b1100a2c organization-settings-admin.handlebars: Use fa-4.7 icon prefixes. 2018-07-11 20:31:17 +05:30
Aditya Bansal 4731ad1a1b account-settings.handlebars: Upgrade to font-awesome 4.7 icon prefixes. 2018-07-11 20:31:17 +05:30
Aditya Bansal 69afb0673c message_edit_form.handlebars: Upgrade to font-awesome 4.7 icon prefixes. 2018-07-11 20:31:17 +05:30
Aditya Bansal 5f459e0bb1 draft.handlebars: Upgrade to font-awesome 4.7 icon prefixes. 2018-07-11 20:31:17 +05:30
Aditya Bansal 9b57f859cc bot_avatar_row.handlebars: Upgrade to font-awesome 4.7 icon prefixes. 2018-07-11 20:31:17 +05:30
Aditya Bansal 376ac9bdec alert_word_settings_item.handlebars: Use fa-4.7 icon prefixes. 2018-07-11 20:31:17 +05:30
Aditya Bansal 21364316e9 admin_profile_field_list.handlebars: Use fa-4.7 icon prefixes. 2018-07-11 20:31:16 +05:30
Aditya Bansal 76ed02dd35 admin_invites_list.handlebars: Upgrade to font-awesome 4.7 icon prefixes. 2018-07-11 20:31:16 +05:30
Aditya Bansal a2c58072a7 admin_filter_list.handlebars: Upgrade to font-awesome 4.7 icon prefixes. 2018-07-11 20:31:16 +05:30
Aditya Bansal 092a8e05e2 user_group_info_popover_content.handlebars: Use fa-4.7 icon prefixes. 2018-07-11 20:31:16 +05:30