mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 05:53:43 +00:00 
			
		
		
		
	reminders: Add alert message for set reminder success or failure.
This commit is contained in:
		@@ -242,8 +242,9 @@ $(function () {
 | 
			
		||||
    $("body").on("click", ".copy_message", function (e) {
 | 
			
		||||
        var row = $(this).closest(".message_row");
 | 
			
		||||
        message_edit.end(row);
 | 
			
		||||
        row.find(".alert-copied").css("display", "block");
 | 
			
		||||
        row.find(".alert-copied").delay(1000).fadeOut(300);
 | 
			
		||||
        row.find(".alert-msg").text(i18n.t("Copied!"));
 | 
			
		||||
        row.find(".alert-msg").css("display", "block");
 | 
			
		||||
        row.find(".alert-msg").delay(1000).fadeOut(300);
 | 
			
		||||
        e.preventDefault();
 | 
			
		||||
        e.stopPropagation();
 | 
			
		||||
    });
 | 
			
		||||
 
 | 
			
		||||
@@ -227,7 +227,24 @@ function do_set_reminder(msgid, timestamp) {
 | 
			
		||||
    reminder_message.reply_to = recipient;
 | 
			
		||||
    reminder_message.private_message_recipient = recipient;
 | 
			
		||||
    reminder_message.to_user_ids = people.email_list_to_user_ids_string(emails);
 | 
			
		||||
    compose.schedule_message(reminder_message);
 | 
			
		||||
 | 
			
		||||
    var row = $("[zid='" + msgid + "']");
 | 
			
		||||
 | 
			
		||||
    function success() {
 | 
			
		||||
        row.find(".alert-msg")
 | 
			
		||||
            .text(i18n.t("Reminder set!"))
 | 
			
		||||
            .css("display", "block")
 | 
			
		||||
            .delay(1000).fadeOut(300);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    function error() {
 | 
			
		||||
        row.find(".alert-msg")
 | 
			
		||||
            .text(i18n.t("Setting reminder failed!"))
 | 
			
		||||
            .css("display", "block")
 | 
			
		||||
            .delay(1000).fadeOut(300);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    compose.schedule_message(reminder_message, success, error);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
exports.render_actions_remind_popover = function (element, id) {
 | 
			
		||||
@@ -688,7 +705,8 @@ exports.register_click_handlers = function () {
 | 
			
		||||
        popovers.hide_actions_popover();
 | 
			
		||||
        var id = $(this).attr("data-message-id");
 | 
			
		||||
        var row = $("[zid='" + id + "']");
 | 
			
		||||
        row.find(".alert-copied")
 | 
			
		||||
        row.find(".alert-msg")
 | 
			
		||||
            .text(i18n.t("Copied!"))
 | 
			
		||||
            .css("display", "block")
 | 
			
		||||
            .delay(1000).fadeOut(300);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -649,7 +649,7 @@ td.pointer {
 | 
			
		||||
/* The way this overrides the menus with a background-color and a high
 | 
			
		||||
   z-index is kinda hacky, and requires some annoying color-matching,
 | 
			
		||||
   but it works. */
 | 
			
		||||
.alert-copied {
 | 
			
		||||
.alert-msg {
 | 
			
		||||
    position: absolute;
 | 
			
		||||
    right: -110px;
 | 
			
		||||
    font-size: 14px;
 | 
			
		||||
@@ -662,11 +662,11 @@ td.pointer {
 | 
			
		||||
    display: none;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.private-message .alert-copied {
 | 
			
		||||
.private-message .alert-msg {
 | 
			
		||||
    background-color: hsl(192, 19%, 95%);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.include-sender .alert-copied {
 | 
			
		||||
.include-sender .alert-msg {
 | 
			
		||||
    top: -3px;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -33,7 +33,7 @@
 | 
			
		||||
                            {{/if}}
 | 
			
		||||
                        {{/include_sender}}
 | 
			
		||||
                    </span>
 | 
			
		||||
                    <span class="alert-copied pull-right">{{t 'Copied!' }}</span>
 | 
			
		||||
                    <span class="alert-msg pull-right"></span>
 | 
			
		||||
                    <span class="message_time{{#if msg.locally_echoed}} notvisible{{/if}}{{#if status_message}} status-time{{/if}}">{{timestr}}</span>
 | 
			
		||||
                    {{#if_and last_edit_timestr include_sender}}
 | 
			
		||||
                        {{#unless status_message}}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user