zulip/static/js
Abhijeet Prasad Bodas 42aea49784 left sidebar: Add support to unstar all messages in topic.
This adds support for unstarring all (starred)
messages from a particular topic, from the topic
popover.

The earlier implementation of this in #16898
was reverted in bc55aa6a01 (#17429)
because it had two problems-

1. The crash reported in bc55aa6a01
was due to message_store returning undefined. This happens
when the message itself hasn't been fetched from the server
yet, but we know that the message is starred from the ids
in `page_params` in `starred_messages.js`.
This commit handles this case explicitly.
Note that, we simply ignore those messages which
we haven't fetched, and because of this, it may
happen that we don't unstar some messages from that
topic. The correct implementation for this would
be to ask the backend for starred IDs in a topic.

2. The earlier implementation actually unstarred **all**
messages. This was because it grabbed the topic and stream_id
from the topic popover `data` attributes, after the topic
popover had been closed. This passed `undefined`, which
the function then interpreted as an action to unstar all
messages.
With this commit, we use the confirm_dialog widget,
which eliminates the need to store this data in the DOM.
2021-03-23 00:17:15 -07:00
..
analytics js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
billing js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
bundles notifications: Remove in_browser_notify and bootstrap-notify. 2021-03-22 23:40:38 -07:00
portico js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
stats js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
types eslint: Enable @typescript-eslint/consistent-type-imports. 2021-03-18 17:26:19 -07:00
activity.js refactor: Extract watchdog module. 2021-03-22 13:17:37 -07:00
admin.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
alert_words_ui.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
alert_words.js js: Convert static/js/alert_words.js to ES6 module. 2021-02-10 10:27:14 -08:00
archive.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
attachments_ui.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
avatar.js refactor: Move user_can_change_* to settings_data. 2021-03-21 17:07:41 -07:00
blueslip_stacktrace.ts eslint: Enable @typescript-eslint/consistent-type-imports. 2021-03-18 17:26:19 -07:00
blueslip.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
bot_data.js bots: Lift render_bots calls to dispatcher code. 2021-03-22 19:40:06 -07:00
browser_history.js refactor: Extract browser_history module. 2021-03-22 13:29:32 -07:00
buddy_data.js compose fade: Extract compose_fade_users class. 2021-03-21 20:16:08 -07:00
buddy_list.js node tests: Use clean BuddyList instance in tests. 2021-03-18 16:37:20 -04:00
channel.js minor: Fix mention of success handler in error wrapper. 2021-03-18 10:09:22 -07:00
click_handlers.js notifications: Remove in_browser_notify and bootstrap-notify. 2021-03-22 23:40:38 -07:00
color_data.js js: Convert static/js/color_data.js to ES6 module. 2021-02-28 14:23:00 -08:00
colorspace.js js: Convert static/js/colorspace.js to ES6 module. 2021-02-10 10:27:14 -08:00
common.js zjsunit: Do not run $(...) automatically. 2021-03-13 11:48:50 -05:00
components.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
compose_actions.js refactor: Extract stream_bar.decorate. 2021-03-22 13:21:56 -07:00
compose_fade_helper.js compose fade: Extract compose_fade_users class. 2021-03-21 20:16:08 -07:00
compose_fade_users.js compose fade: Extract compose_fade_users class. 2021-03-21 20:16:08 -07:00
compose_fade.js compose fade: Extract compose_fade_users class. 2021-03-21 20:16:08 -07:00
compose_pm_pill.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
compose_state.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
compose_ui.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
compose.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
composebox_typeahead.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
condense.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
confirm_dialog.js confirm_dialog: Make it usable outside settings. 2021-03-23 00:17:15 -07:00
copy_and_paste.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
csrf.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
css_variables.js styles: Use range context queries to eliminate *_max variables. 2021-02-05 09:23:59 -08:00
debug.js eslint: Fix unicorn/no-array-for-each. 2021-01-25 14:53:19 -08:00
desktop_integration.js refactor: Extract browser_history module. 2021-03-22 13:29:32 -07:00
drafts.js refactor: Extract browser_history module. 2021-03-22 13:29:32 -07:00
dropdown_list_widget.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
echo.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
emoji_picker.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
emojisets.js eslint: Fix unicorn/prefer-add-event-listener. 2020-10-07 16:00:33 -07:00
favicon.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
feature_flags.js js: Convert static/js/feature_flags.js to ES6 module with modzulator. 2021-02-10 10:27:14 -08:00
feedback_widget.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
fetch_status.js js: Convert static/js/message_scroll.js to ES6 module. 2021-02-28 14:23:00 -08:00
filter.js refactor: Extract message_parser module. 2021-03-22 13:21:56 -07:00
floating_recipient_bar.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
fold_dict.ts typescript: Enable strictNullChecks. 2020-07-28 11:01:35 -07:00
gear_menu.js refactor: Extract browser_history module. 2021-03-22 13:29:32 -07:00
global.d.ts js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
hash_util.js refactor: Extract browser_history module. 2021-03-22 13:29:32 -07:00
hashchange.js refactor: Extract browser_history module. 2021-03-22 13:29:32 -07:00
hbs.d.ts
hotkey.js refactor: Extract browser_history module. 2021-03-22 13:29:32 -07:00
hotspots.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
huddle_data.js node tests: Add test() wrapper for suggestions. 2021-03-12 15:29:23 -05:00
i18n.js docs: Add comment links to i18n documentation. 2020-09-18 11:44:04 -07:00
info_overlay.js refactor: Extract browser_history module. 2021-03-22 13:29:32 -07:00
input_pill.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
invite.js refactor: Extract browser_history module. 2021-03-22 13:29:32 -07:00
keydown_util.js js: Convert static/js/keydown_util.js to ES6 module. 2021-02-28 14:23:00 -08:00
lazy_set.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
lightbox_canvas.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
lightbox.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
list_cursor.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
list_util.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
list_widget.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
loading.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
local_message.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
localstorage.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
markdown_config.js js: Convert static/js/hash_util.js to ES6 module. 2021-02-28 14:23:00 -08:00
markdown.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
message_edit_history.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
message_edit.js refactor: Extract stream_bar.decorate. 2021-03-22 13:21:56 -07:00
message_events.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
message_fetch.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
message_flags.js left sidebar: Add support to unstar all messages in topic. 2021-03-23 00:17:15 -07:00
message_list_data.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
message_list_view.js refractor: Created set_calculated_message_container_variables function. 2021-03-17 17:21:42 -07:00
message_list.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
message_live_update.js js: Convert static/js/message_list.js to ES6 module. 2021-03-02 17:06:35 -08:00
message_parser.js refactor: Extract message_parser module. 2021-03-22 13:21:56 -07:00
message_scroll.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
message_store.js node tests: Introduce message_store.create_mock_message() helper. 2021-03-18 15:55:39 -07:00
message_util.js refactor: Extract message_parser module. 2021-03-22 13:21:56 -07:00
message_view_header.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
message_viewport.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
muting_ui.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
muting.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
narrow_state.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
narrow.js refactor: Extract browser_history module. 2021-03-22 13:29:32 -07:00
navigate.js js: Convert static/js/unread_ops.js to ES6 module. 2021-03-02 17:06:35 -08:00
night_mode.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
notifications.js notifications: Remove in_browser_notify and bootstrap-notify. 2021-03-22 23:40:38 -07:00
overlays.js refactor: Extract browser_history module. 2021-03-22 13:29:32 -07:00
padded_widget.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
page_params.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
panels.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
peer_data.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
people.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
pill_typeahead.js js: Convert static/js/typeahead_helper.js to ES6 module. 2021-02-28 14:23:00 -08:00
pm_conversations.js node tests: Clean pm_conversations more simply. 2021-03-18 16:37:20 -04:00
pm_list_dom.js js: Convert static/js/pm_list_dom.js to ES6 module. 2021-02-28 14:23:00 -08:00
pm_list.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
poll_widget.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
popovers.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
presence.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
reactions.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
ready.js ready: Wait for other ready callbacks before marking app loaded. 2021-03-14 17:36:22 -07:00
realm_icon.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
realm_logo.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
recent_senders.js node tests: Clean up recent_senders test. 2021-03-12 11:18:44 -05:00
recent_topics.js recent_topics: Directly pass jquery element instead of event object. 2021-03-16 14:54:22 -07:00
reload_state.js node tests: Add test() wrapper for channel. 2021-03-20 11:00:48 -04:00
reload.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
reminder.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
rendered_markdown.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
resize.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
rows.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
rtl.js js: Convert static/js/rtl.js to ES6 module. 2021-02-28 14:23:00 -08:00
schema.js js: Convert static/js/schema.js to ES6 module. 2021-02-10 10:27:14 -08:00
scroll_bar.js right-sidebar: Fix design bugs with keyboard-shortcuts. 2021-03-22 19:29:46 -07:00
scroll_util.js js: Convert static/js/ui.js to ES6 module. 2021-03-02 17:06:35 -08:00
search_pill_widget.js refactor: Extract browser_history module. 2021-03-22 13:29:32 -07:00
search_pill.js js: Convert static/js/input_pill.js to ES6 module. 2021-03-02 17:06:35 -08:00
search_suggestion.js js: Convert static/js/search_suggestion.js to ES6 module. 2021-02-28 14:23:00 -08:00
search_util.js js: Convert static/js/search_util.js to ES6 module. 2021-02-10 10:27:14 -08:00
search.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
sent_messages.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
server_events_dispatch.js bots: Lift render_bots calls to dispatcher code. 2021-03-22 19:40:06 -07:00
server_events.js refactor: Extract watchdog module. 2021-03-22 13:17:37 -07:00
settings_account.js refactor: Move user_can_change_* to settings_data. 2021-03-21 17:07:41 -07:00
settings_bots.js bots: Lift render_bots calls to dispatcher code. 2021-03-22 19:40:06 -07:00
settings_config.js refactor: Move desktop_icon_count_display_values. 2021-03-22 13:17:37 -07:00
settings_data.js refactor: Move user_can_change_* to settings_data. 2021-03-21 17:07:41 -07:00
settings_display.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
settings_emoji.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
settings_exports.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
settings_invites.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
settings_linkifiers.js linkifier settings: Remove loading indicator. 2021-03-15 11:19:59 -07:00
settings_muting.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
settings_notifications.js notifications: Simplify sound playing. 2021-03-22 23:36:38 -07:00
settings_org.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
settings_panel_menu.js refactor: Extract browser_history module. 2021-03-22 13:29:32 -07:00
settings_profile_fields.js settings: Fix input mouse behaviour in custom profile fields. 2021-03-15 11:11:47 -07:00
settings_sections.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
settings_streams.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
settings_toggle.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
settings_ui.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
settings_user_groups.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
settings_users.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
settings.js refactor: Move desktop_icon_count_display_values. 2021-03-22 13:17:37 -07:00
setup.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
spoilers.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
starred_messages.js left sidebar: Add support to unstar all messages in topic. 2021-03-23 00:17:15 -07:00
stream_bar.js refactor: Extract stream_bar.decorate. 2021-03-22 13:21:56 -07:00
stream_color.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
stream_create.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
stream_data.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
stream_edit.js refactor: Extract browser_history module. 2021-03-22 13:29:32 -07:00
stream_events.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
stream_list.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
stream_muting.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
stream_pill.js js: Convert static/js/stream_data.js to ES6 module. 2021-02-28 14:23:00 -08:00
stream_popover.js left sidebar: Add support to unstar all messages in topic. 2021-03-23 00:17:15 -07:00
stream_sort.js code cleanup: Remove obsolete stream_sort code. 2021-03-13 11:48:50 -05:00
stream_topic_history.js js: Convert static/js/unread.js to ES6 module. 2021-03-02 17:06:35 -08:00
stream_ui_updates.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
submessage.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
subs.js refactor: Extract browser_history module. 2021-03-22 13:29:32 -07:00
templates.js js: Convert static/js/templates.js to ES6 module. 2021-02-10 10:27:14 -08:00
timerender.js node tests: Ensure clean data for timerender tests. 2021-03-14 11:38:21 -04:00
todo_widget.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
top_left_corner.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
topic_generator.js js: Convert static/js/unread.js to ES6 module. 2021-03-02 17:06:35 -08:00
topic_list_data.js js: Convert static/js/unread.js to ES6 module. 2021-03-02 17:06:35 -08:00
topic_list.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
topic_zoom.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
transmit.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
tutorial.js js: Convert static/js/narrow.js to ES6 module. 2021-03-02 17:06:35 -08:00
typeahead_helper.js compose: Remove presence circles for wildcard users. 2021-03-12 02:10:21 -08:00
typing_data.js node tests: Add test() wrapper for typing_data. 2021-03-15 13:05:49 -04:00
typing_events.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
typing.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
ui_init.js refactor: Extract stream_bar.decorate. 2021-03-22 13:21:56 -07:00
ui_report.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
ui_util.js refactor: Extract stream_bar.decorate. 2021-03-22 13:21:56 -07:00
ui.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
unread_ops.js js: Convert static/js/message_list.js to ES6 module. 2021-03-02 17:06:35 -08:00
unread_ui.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
unread.js refactor: Move desktop_icon_count_display_values. 2021-03-22 13:17:37 -07:00
upload_widget.js js: Convert static/js/upload_widget.js to ES6 module. 2021-02-28 14:23:00 -08:00
upload.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
user_events.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
user_groups.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
user_pill.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
user_search.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
user_status_ui.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
user_status.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
util.js js: Convert static/js/util.js to ES6 module. 2021-02-10 10:27:14 -08:00
vdom.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
watchdog.js refactor: Extract watchdog module. 2021-03-22 13:17:37 -07:00
widgetize.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
zcommand.js refactor: Extract browser_history module. 2021-03-22 13:29:32 -07:00
zform.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
zulip_test.js zulip_test: Re-export internal functions used by Puppeteer tests. 2021-03-02 17:06:35 -08:00
zulip.js js: Convert static/js/message_list.js to ES6 module. 2021-03-02 17:06:35 -08:00