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.

banners: Cleanup navbar banner related code.

Sayam Samal073e5d24211b
diff --git a/web/src/navbar_alerts.ts b/web/src/navbar_alerts.ts
index a7a04d54e7d..b6c7358ab8c 100644
--- a/web/src/navbar_alerts.ts
+++ b/web/src/navbar_alerts.ts
@@ -3,15 +3,12 @@ import Handlebars from "handlebars";
import $ from "jquery";
import assert from "minimalistic-assert";
-import render_navbar_alert_wrapper from "../templates/navbar_alerts/navbar_alert_wrapper.hbs";
-
import * as banners from "./banners.ts";
import type {AlertBanner} from "./banners.ts";
import * as channel from "./channel.ts";
import * as desktop_notifications from "./desktop_notifications.ts";
import * as feedback_widget from "./feedback_widget.ts";
import {$t, $t_html} from "./i18n.ts";
-import * as keydown_util from "./keydown_util.ts";
import type {LocalStorage} from "./localstorage.ts";
import {localstorage} from "./localstorage.ts";
import {page_params} from "./page_params.ts";
@@ -507,20 +504,6 @@ export function initialize(): void {
},
);
- $("#navbar_alerts_wrapper").on(
- "click",
- ".alert .close, .alert .exit",
- function (this: HTMLElement, e) {
- e.stopPropagation();
- const $process = $(this).closest("[data-process]");
- $(this).closest(".alert").hide();
- if ($process.attr("data-process") !== "profile-missing-required-fields") {
- maybe_show_empty_required_profile_fields_alert();
- }
- $(window).trigger("resize");
- },
- );
-
$("#navbar_alerts_wrapper").on(
"click",
".accept-update-time-zone",
@@ -593,27 +576,4 @@ export function initialize(): void {
});
},
);
-
- // Treat Enter with links in the navbar alerts UI focused like a click.,
- $("#navbar_alerts_wrapper").on("keyup", ".alert-link[role=button]", function (e) {
- e.stopPropagation();
- if (keydown_util.is_enter_event(e)) {
- $(this).trigger("click");
- }
- });
-}
-
-export function open(args: {
- data_process: string;
- rendered_alert_content_html: string;
- custom_class?: string | undefined;
-}): void {
- const rendered_alert_wrapper_html = render_navbar_alert_wrapper(args);
-
- // Note: We only support one alert being rendered at a time; as a
- // result, we just replace the alert area in the DOM with the
- // indicated alert. We do this to avoid bad UX, as it'd look weird
- // to have more than one alert visible at a time.
- $("#navbar_alerts_wrapper").html(rendered_alert_wrapper_html);
- $(window).trigger("resize");
}
diff --git a/web/styles/zulip.css b/web/styles/zulip.css
index ccd7b60709b..3ca25872fa6 100644
--- a/web/styles/zulip.css
+++ b/web/styles/zulip.css
@@ -286,56 +286,6 @@ p.n-margin {
box-shadow: inset 0 -1px 0 var(--color-navbar-bottom-border);
}
-#navbar_alerts_wrapper {
- font-size: 1rem;
- position: relative;
-
- .alert {
- /* Since alerts are only rendered into the DOM when they are first
- displayed, display: block is the right default for this setting. */
- display: block;
- margin: 0;
- padding-top: 12px;
- padding-bottom: 12px;
-
- border: none;
- border-radius: 0;
-
- text-align: center;
- text-shadow: none;
- color: hsl(0deg 0% 100%);
-
- &.alert-info {
- background-color: hsl(170deg 46% 54%);
-
- &.red {
- background-color: hsl(0deg 46% 54%);
- }
- }
-
- .close {
- line-height: 24px;
- position: absolute;
- right: 18px;
- top: 50%;
- transform: translateY(-50%);
- }
-
- .alert-link {
- color: hsl(169deg 100% 88%);
- font-weight: 600;
- }
-
- &.red .alert-link {
- color: hsl(0deg 100% 88%);
- }
-
- .buttons .alert-link {
- margin: 0 5px;
- }
- }
-}
-
.app {
min-width: 100%;
min-height: 100%;
diff --git a/web/templates/navbar_alerts/navbar_alert_wrapper.hbs b/web/templates/navbar_alerts/navbar_alert_wrapper.hbs
deleted file mode 100644
index 3b065fba0bc..00000000000
--- a/web/templates/navbar_alerts/navbar_alert_wrapper.hbs
+++ /dev/null
@@ -1,5 +0,0 @@
-<div data-process="{{data_process}}" class="alert alert-info {{#if custom_class}}{{custom_class}}{{/if}}">
- {{{rendered_alert_content_html}}}
- <span class="close" data-dismiss="alert" aria-label="{{t 'Close' }}" role="button" tabindex=0>&times;</span>
-</div>
-