mirror of
https://github.com/zulip/zulip.git
synced 2025-11-08 07:52:19 +00:00
This is the beginning of a fix for #22524 which converts several banners to a new style. As a part of that set of changes, this commit creates the shared template and warning styling. The resolved topic warning was picked (for no particular reason) to migrate first. Further commits updating other banners to follow.
38 lines
1.1 KiB
TypeScript
38 lines
1.1 KiB
TypeScript
import $ from "jquery";
|
|
|
|
import * as common from "./common";
|
|
|
|
// banner types
|
|
export const WARNING = "warning";
|
|
|
|
export const CLASSNAMES = {
|
|
// warnings
|
|
topic_resolved: "topic_resolved",
|
|
};
|
|
|
|
export function show(error_html: string, $bad_input?: JQuery, alert_class = "alert-error"): void {
|
|
$("#compose-send-status")
|
|
.removeClass(common.status_classes)
|
|
.addClass(alert_class)
|
|
.stop(true)
|
|
.fadeTo(0, 1);
|
|
$("#compose-error-msg").html(error_html);
|
|
// TODO: Replace with compose_ui.hide_compose_spinner() when it is converted to ts.
|
|
$("#compose-send-button .loader").hide();
|
|
$("#compose-send-button span").show();
|
|
$("#compose-send-button").removeClass("disable-btn");
|
|
|
|
if ($bad_input !== undefined) {
|
|
$bad_input.trigger("focus").trigger("select");
|
|
}
|
|
}
|
|
|
|
export function show_not_subscribed(error_html: string, $bad_input?: JQuery): void {
|
|
show(error_html, $bad_input, "home-error-bar");
|
|
$(".compose-send-status-close").hide();
|
|
}
|
|
|
|
export function hide(): void {
|
|
$("#compose-send-status").stop(true).fadeOut(500);
|
|
}
|