Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

topic_visibility: Remove deprecated topic visibility toggle classes.

Aman Agrawaldd071c73030a
diff --git a/web/src/click_handlers.js b/web/src/click_handlers.js
index 2ffe247a454..b953c7b5a2c 100644
--- a/web/src/click_handlers.js
+++ b/web/src/click_handlers.js
@@ -41,7 +41,6 @@ import * as stream_popover from "./stream_popover";
import * as topic_list from "./topic_list";
import * as ui_util from "./ui_util";
import {parse_html} from "./ui_util";
-import * as user_topics from "./user_topics";
import * as util from "./util";
export function initialize() {
@@ -417,42 +416,6 @@ export function initialize() {
message_edit.toggle_resolve_topic(message_id, topic_name, false, $recipient_row);
});
- // Mute topic in a unmuted stream
- $("body").on("click", ".message_header .stream_unmuted.on_hover_topic_mute", (e) => {
- e.stopPropagation();
- user_topics.set_visibility_policy_for_element(
- $(e.target),
- user_topics.all_visibility_policies.MUTED,
- );
- });
-
- // Unmute topic in a unmuted stream
- $("body").on("click", ".message_header .stream_unmuted.on_hover_topic_unmute", (e) => {
- e.stopPropagation();
- user_topics.set_visibility_policy_for_element(
- $(e.target),
- user_topics.all_visibility_policies.INHERIT,
- );
- });
-
- // Unmute topic in a muted stream
- $("body").on("click", ".message_header .stream_muted.on_hover_topic_unmute", (e) => {
- e.stopPropagation();
- user_topics.set_visibility_policy_for_element(
- $(e.target),
- user_topics.all_visibility_policies.UNMUTED,
- );
- });
-
- // Mute topic in a muted stream
- $("body").on("click", ".message_header .stream_muted.on_hover_topic_mute", (e) => {
- e.stopPropagation();
- user_topics.set_visibility_policy_for_element(
- $(e.target),
- user_topics.all_visibility_policies.INHERIT,
- );
- });
-
// RECIPIENT BARS
function get_row_id_for_narrowing(narrow_link_elem) {
diff --git a/web/src/inbox_ui.ts b/web/src/inbox_ui.ts
index e0ad60b2580..001438e6029 100644
--- a/web/src/inbox_ui.ts
+++ b/web/src/inbox_ui.ts
@@ -1564,58 +1564,6 @@ export function initialize(): void {
compose_closed_ui.set_standard_text_for_reply_button();
});
- // Mute topic in a unmuted stream
- $("body").on(
- "click",
- "#inbox-list .stream_unmuted.on_hover_topic_mute",
- function (this: HTMLElement, e) {
- e.stopPropagation();
- user_topics.set_visibility_policy_for_element(
- $(this),
- user_topics.all_visibility_policies.MUTED,
- );
- },
- );
-
- // Unmute topic in a unmuted stream
- $("body").on(
- "click",
- "#inbox-list .stream_unmuted.on_hover_topic_unmute",
- function (this: HTMLElement, e) {
- e.stopPropagation();
- user_topics.set_visibility_policy_for_element(
- $(this),
- user_topics.all_visibility_policies.INHERIT,
- );
- },
- );
-
- // Unmute topic in a muted stream
- $("body").on(
- "click",
- "#inbox-list .stream_muted.on_hover_topic_unmute",
- function (this: HTMLElement, e) {
- e.stopPropagation();
- user_topics.set_visibility_policy_for_element(
- $(this),
- user_topics.all_visibility_policies.UNMUTED,
- );
- },
- );
-
- // Mute topic in a muted stream
- $("body").on(
- "click",
- "#inbox-list .stream_muted.on_hover_topic_mute",
- function (this: HTMLElement, e) {
- e.stopPropagation();
- user_topics.set_visibility_policy_for_element(
- $(this),
- user_topics.all_visibility_policies.INHERIT,
- );
- },
- );
-
$(document).on("compose_canceled.zulip", () => {
if (is_visible()) {
revive_current_focus();
diff --git a/web/src/message_list.js b/web/src/message_list.js
index 40fefb03ee7..5e6cce73683 100644
--- a/web/src/message_list.js
+++ b/web/src/message_list.js
@@ -458,8 +458,6 @@ export class MessageList {
$recipient_row.find(".always_visible_topic_edit").hide();
$recipient_row.find(".on_hover_topic_resolve").hide();
$recipient_row.find(".on_hover_topic_unresolve").hide();
- $recipient_row.find(".on_hover_topic_mute").hide();
- $recipient_row.find(".on_hover_topic_unmute").hide();
}
hide_edit_topic_on_recipient_row($recipient_row) {
@@ -471,8 +469,6 @@ export class MessageList {
$recipient_row.find(".always_visible_topic_edit").show();
$recipient_row.find(".on_hover_topic_resolve").show();
$recipient_row.find(".on_hover_topic_unresolve").show();
- $recipient_row.find(".on_hover_topic_mute").show();
- $recipient_row.find(".on_hover_topic_unmute").show();
}
reselect_selected_id() {
diff --git a/web/src/recent_view_ui.ts b/web/src/recent_view_ui.ts
index b94098acae9..e5ebd75c4e9 100644
--- a/web/src/recent_view_ui.ts
+++ b/web/src/recent_view_ui.ts
@@ -1749,68 +1749,6 @@ export function initialize({
},
);
- $("body").on(
- "keydown",
- ".on_hover_topic_mute, .on_hover_topic_unmute",
- ui_util.convert_enter_to_click,
- );
-
- // Mute topic in a unmuted stream
- $("body").on("click", "#recent-view-content-table .stream_unmuted.on_hover_topic_mute", (e) => {
- e.stopPropagation();
- assert(e.target instanceof HTMLElement);
- const $elt = $(e.target);
- const topic_row_index = $elt.closest("tr").index();
- focus_clicked_element(topic_row_index, COLUMNS.mute);
- user_topics.set_visibility_policy_for_element(
- $elt,
- user_topics.all_visibility_policies.MUTED,
- );
- });
-
- // Unmute topic in a unmuted stream
- $("body").on(
- "click",
- "#recent-view-content-table .stream_unmuted.on_hover_topic_unmute",
- (e) => {
- e.stopPropagation();
- assert(e.target instanceof HTMLElement);
- const $elt = $(e.target);
- const topic_row_index = $elt.closest("tr").index();
- focus_clicked_element(topic_row_index, COLUMNS.mute);
- user_topics.set_visibility_policy_for_element(
- $elt,
- user_topics.all_visibility_policies.INHERIT,
- );
- },
- );
-
- // Unmute topic in a muted stream
- $("body").on("click", "#recent-view-content-table .stream_muted.on_hover_topic_unmute", (e) => {
- e.stopPropagation();
- assert(e.target instanceof HTMLElement);
- const $elt = $(e.target);
- const topic_row_index = $elt.closest("tr").index();
- focus_clicked_element(topic_row_index, COLUMNS.mute);
- user_topics.set_visibility_policy_for_element(
- $elt,
- user_topics.all_visibility_policies.UNMUTED,
- );
- });
-
- // Mute topic in a muted stream
- $("body").on("click", "#recent-view-content-table .stream_muted.on_hover_topic_mute", (e) => {
- e.stopPropagation();
- assert(e.target instanceof HTMLElement);
- const $elt = $(e.target);
- const topic_row_index = $elt.closest("tr").index();
- focus_clicked_element(topic_row_index, COLUMNS.mute);
- user_topics.set_visibility_policy_for_element(
- $elt,
- user_topics.all_visibility_policies.INHERIT,
- );
- });
-
$("body").on("click", "#recent_view_search", (e) => {
e.stopPropagation();
assert(e.target instanceof HTMLElement);
diff --git a/web/styles/message_header.css b/web/styles/message_header.css
index 633c5c98543..250551cef16 100644
--- a/web/styles/message_header.css
+++ b/web/styles/message_header.css
@@ -230,9 +230,7 @@
}
.always_visible_topic_edit,
-.on_hover_topic_read,
-.stream_unmuted.on_hover_topic_unmute,
-.stream_muted.on_hover_topic_mute {
+.on_hover_topic_read {
opacity: 0.7;
&:hover {
@@ -243,9 +241,7 @@
.on_hover_topic_edit,
.on_hover_topic_unresolve,
-.on_hover_topic_resolve,
-.stream_unmuted.on_hover_topic_mute,
-.stream_muted.on_hover_topic_unmute {
+.on_hover_topic_resolve {
opacity: 0.2;
&:hover {