zulip/static/js
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 < 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
..
bundles search: Add search_pill_widget.js. 2018-07-23 11:29:10 -07:00
portico help: Use simplebar instead of container to calculate hash scrolling. 2018-07-23 10:10:02 -07:00
stats eslint: Enable `conditionalAssign` config of no-trailing-spaces rule. 2018-06-11 07:51:24 -04:00
.eslintrc.json Change name of eslintrc file to .eslintrc.json 2016-11-29 08:58:39 -08:00
activity.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
admin.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
admin_sections.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
alert_words.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
alert_words_ui.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
archive.js eslint: Enable `no-extra-parens` rule. 2018-06-11 07:51:24 -04:00
attachments_ui.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
avatar.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
blueslip.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
bot_data.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
buddy_data.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
buddy_list.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
channel.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
click_handlers.js settings_overlay.html: Upgrade to use font-awesome 4.7 icon prefixes. 2018-07-11 20:17:11 +05:30
colorspace.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
common.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
components.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
compose.js message edit: Add markdown shortcuts to message edit UI. 2018-07-23 10:41:46 -07:00
compose_actions.js Remove redundant narrow_state.get_current_filter(). 2018-07-10 14:20:24 +05:30
compose_fade.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
compose_pm_pill.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
compose_state.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
compose_ui.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
composebox_typeahead.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
condense.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
copy_and_paste.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
debug.js eslint: Enable `no-extra-parens` rule. 2018-06-11 07:51:24 -04:00
dict.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
drafts.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
echo.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
emoji.js build_emoji: Migrate to use `emoji_names.py` file. 2018-07-13 21:18:02 +05:30
emoji_picker.js emoji: Update `emoji-datasource` packages. 2018-07-23 08:04:58 -07:00
favicon.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
feature_flags.js Remove feature_flags.mark_read_at_bottom. 2018-07-07 10:19:15 +02:00
fenced_code.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
fetch_status.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
filter.js refactor: Use early-exits in can_apply_locally(). 2018-07-11 20:00:56 +05:30
floating_recipient_bar.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
gear_menu.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
hash_util.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
hashchange.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
hotkey.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
hotspots.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
info_overlay.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
input_pill.js pills: Allow removing pill without calling the remove event handler. 2018-07-23 11:29:10 -07:00
integration_bot_widget.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
invite.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
keydown_util.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
lightbox.js lightbox: Fix a "Pan & Zoom" causing an error with thumbnailed images. 2018-07-18 10:19:56 -07:00
lightbox_canvas.js lightbox: Make `v` close the lightbox during Pan & Zoom. 2018-07-23 10:36:48 -07:00
list_cursor.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
list_render.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
list_util.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
loading.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
local_message.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
localstorage.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
markdown.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
message_edit.js message edit: Add markdown shortcuts to message edit UI. 2018-07-23 10:41:46 -07:00
message_events.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
message_fetch.js left sidebar: Make sure the selected stream is visible in left sidebar. 2018-07-23 10:32:10 -07:00
message_flags.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
message_list.js recipient_row.handlebars: Upgrade to font-awesome 4.7 icon prefixes. 2018-07-11 20:31:17 +05:30
message_list_data.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
message_list_view.js mlv: Remove unecessary function names. 2018-07-12 11:43:21 -04:00
message_live_update.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
message_scroll.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
message_store.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
message_util.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
message_viewport.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
muting.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
muting_ui.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
narrow.js search: Add a basic implementation of search pills. 2018-07-23 11:29:10 -07:00
narrow_state.js Add narrow_state.is_reading_mode(). 2018-07-10 14:20:24 +05:30
navigate.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
night_mode.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
notifications.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
overlays.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
panels.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
people.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
pm_conversations.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
pm_list.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
pointer.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
popovers.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
presence.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
reactions.js reactions: Fix minor formatting in log message. 2018-07-10 16:22:52 -04:00
realm_icon.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
recent_senders.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
reload.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
reminder.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
resize.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
rows.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
rtl.js refactor: Extract rtl.set_rtl_class_for_textarea(). 2018-07-11 19:20:22 +05:30
schema.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
scroll_bar.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
scroll_util.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
search.js search: Add a basic implementation of search pills. 2018-07-23 11:29:10 -07:00
search_pill.js search: Add a basic implementation of search pills. 2018-07-23 11:29:10 -07:00
search_pill_widget.js search: Add a basic implementation of search pills. 2018-07-23 11:29:10 -07:00
search_suggestion.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
sent_messages.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
server_events.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
server_events_dispatch.js invitations: Send 'invites_changed' event for invitations events. 2018-07-13 18:00:06 +05:30
settings.js notification settings: Add UI for stream email notifications. 2018-07-14 12:19:33 +05:30
settings_account.js profile fields: Fix fragile JavaScript for deleting date fields. 2018-07-11 19:16:24 +05:30
settings_bots.js settings UI: Add copy zuliprc button to bot information box. 2018-07-10 15:19:05 +05:30
settings_display.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
settings_emoji.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
settings_filters.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
settings_invites.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
settings_muting.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
settings_notifications.js notification settings: Add UI for stream email notifications. 2018-07-14 12:19:33 +05:30
settings_org.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
settings_panel_menu.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
settings_profile_fields.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
settings_sections.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
settings_streams.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
settings_toggle.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
settings_ui.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
settings_user_groups.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
settings_users.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
setup.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
socket.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
stream_color.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
stream_create.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
stream_data.js notification settings: Add UI for stream email notifications. 2018-07-14 12:19:33 +05:30
stream_edit.js notification settings: Add UI for stream email notifications. 2018-07-14 12:19:33 +05:30
stream_events.js notification settings: Add UI for stream email notifications. 2018-07-14 12:19:33 +05:30
stream_list.js left sidebar: Make sure the selected stream is visible in left sidebar. 2018-07-23 10:32:10 -07:00
stream_muting.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
stream_popover.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
stream_sort.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
submessage.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
subs.js refactor: Make vars local inside subs.filter_table(). 2018-07-23 10:01:38 -07:00
tab_bar.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
templates.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
tictactoe_widget.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
timerender.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
todo_widget.js widgets: Add todo widget. 2018-07-10 11:18:05 +05:30
top_left_corner.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
topic_data.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
topic_generator.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
topic_list.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
translations.js i18n: Fix reference error for localstorage. 2018-05-30 23:28:21 +05:30
transmit.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
tutorial.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
typeahead_helper.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
typing.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
typing_data.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
typing_events.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
typing_status.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
ui.js single_message.handlebars: Upgrade to font-awesome 4.7 icon prefixes. 2018-07-11 20:31:17 +05:30
ui_init.js search: Initialize search pill widget in ui_init.js. 2018-07-23 11:29:10 -07:00
ui_report.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
ui_util.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
unread.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
unread_ops.js Remove feature_flags.mark_read_at_bottom. 2018-07-07 10:19:15 +02:00
unread_ui.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
upload.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
upload_widget.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
user_events.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
user_groups.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
user_pill.js pills: Enable user avatar images for user pills. 2018-07-10 15:07:56 +05:30
user_search.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
util.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
voting_widget.js voting_widget: Don't update question in question.outbound function. 2018-07-06 11:30:12 -04:00
widgetize.js widgets: Add todo widget. 2018-07-10 11:18:05 +05:30
zcommand.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
zform.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00
zulip.js app: Prepare JS files for consumption by webpack. 2018-07-05 10:53:36 +02:00