Commit Graph

15 Commits

Author SHA1 Message Date
Kevin Mehall d92939d53e [important] Fix regression in 9259a24
Use the new count_full_messages_between instead of subtraction in
message_list_view.append. By finding a count higher than it should be
when summarized messages are present, it didn't add new messages until
the pointer moved under certain conditions.

(imported from commit c10d9c1a0d23891acce88bf8d79866c08cb75681)
2013-10-21 16:01:18 -04:00
Kevin Mehall bd58861b09 Ignore summarized messages when calculating rendering windows.
Summary blocks can contain hundreds of messages. When the rendering window
code didn't take this into account, it would lead to all kinds of
unpleasant behavior when you scroll.

Trac #1888

Unfortunately, this replaces a subtraction with a function that iterates
through all the messages.

(imported from commit 9259a246946cd968a8725c38ff5ef2d4b4793717)
2013-10-21 11:48:57 -04:00
Kevin Mehall ba87ebc246 Fix duplicated summary blocks when scrolling up.
Make prepend re-render the whole render window instead of just the added
messages.

(imported from commit 6270a33ff0fe98fc901b687ca533ef0ea127d052)
2013-10-21 11:48:56 -04:00
Kevin Mehall a528b7134c Move summary_adjective to its own method
(imported from commit d451ffcf3ff460ffe030e265ca83fec1094c6217)
2013-10-21 11:48:56 -04:00
Steve Howell a78a1ec36c Use <a> tags for links in the recipient/summary bars.
The main user-facing feature here is that users can open narrows
in new tabs or windows. Internally, it makes the HTML more semantic.

One consequence of making these elements into actual anchor tags
is that clicking on them no longer triggers this logic to
close the compose box when you click outside of it:

        // Unfocus our compose area if we click out of it. Don't let exits out
        // of modals or selecting text (for copy+paste) trigger cancelling.
        if (compose.composing() && !$(e.target).is("a") &&
            ($(e.target).closest(".modal").length === 0) &&
            window.getSelection().toString() === "") {
            compose.cancel();
        }

Instead of patching the above code, I elected to just call
compose.cancel() explicitly in the click handlers for the links
themselves.

We are gonna try to clean up the compose-box behavior globally soon.

(imported from commit c9a01916f1714fe3dd495d25c78cd5e5532105ef)
2013-10-09 17:09:10 -04:00
Steve Howell 660475bd0c Hide muted messages.
Instead of collapsing muted messages, just hide them altogether
in view where it makes sense to hide them.

(imported from commit 1c2c987ff302ceb135a025753cf421b4de1aea71)
2013-09-23 10:53:06 -04:00
acrefoot 08157d6f62 Render both the above and below time on date_row
If the date_row is between two messages, it tells you when the message
below was sent, but not when the message above was sent--for that you'd
either have to click on a message or keep scrolling up. This is especially
annoying when there are sometimes gap days on a particular stream (you shouldn't
assume that the message above is simply from the previous day).

This adds the date of the previous message (the time above) to the date_row.

(imported from commit 4c6c956118ae09fedca042e797a6029fdd26e00c)
2013-08-30 16:05:05 -04:00
Steve Howell 0721ea2aca summary_verb -> summary_adjective
(imported from commit c2980ed2e8d644a3b0eebba53365f61977a4f944)
2013-08-23 16:03:23 -04:00
Steve Howell 4a7bab9a6f Allow collapsing of recipient sections.
This is experimental, for staging only.  There might be a better
way to model this than dueling force_expand/force_collapse flags,
but it works for now.  The code in collapse_recipient_group()
could also be DRYed up relative to expand_summary_row().

(imported from commit 107151d1ecd640970fb7700d41278a003bd1abaa)
2013-08-23 15:57:31 -04:00
Steve Howell 9662594bf4 Add data-messages attribute to recipient rows.
This is to set up collapsing, but I think they could be useful
in general, so I'm keeping this is a separate commit.

(imported from commit 0da2b8ef246649f678c7cb6664ee78bf36aca076)
2013-08-23 15:57:31 -04:00
Steve Howell a0b28a03e4 Extract finish_group() helper in MessageListView.render()
(imported from commit db13ca858631d10a310aba3bd2540a545fd5b871)
2013-08-23 15:57:30 -04:00
Steve Howell 579444eee2 Enable "enter" key for muted summary rows.
(The approach has been simplified to look for summary_row in
the DOM, which makes muted and summary features work off the
same code.)

(imported from commit 4fa3d6ae5ad7bbac5958e60ecffb368d6ef29d2e)
2013-08-23 15:52:08 -04:00
Scott Feeney d0be30ab08 Format edit times properly
The "Last edited:" time should match the post time (12 hour format, with
exceptions).

(imported from commit 13d981da2945cecd3f287da0e4200c32b3921682)
2013-08-23 14:07:53 -04:00
Steve Howell 795248a1d0 Mute any topic named "muted" on zulip.com.
This change will allow us to test the muting feature on
staging.  Any topic named "muted" will automatically be
muted.  You can also mute any other topic on the console:

    muting.mute_topic('devel', 'ios');
    current_msg_list.rerender();

More UI around this experiment will be coming soon, as well
as support for muting entire streams.

The muting module keeps track of which topics are muted, but a
user can expand muted messages, and once that happens, the
messages are marked with the "force_expand" flag that gets
persisted to the back end.

Muted messages are rendered in similar fashion to the summarized
rows, and as part of unifying some of that code, we have
made it so that expanding a summarized section doesn't remove
individual flags related to summaries; instead, the messages
get the force_expand flag set.

(imported from commit acee4190e63813d46850415c41ff8ebfae4a6953)
2013-08-23 12:10:27 -04:00
Steve Howell 53f62bd71c Created MessageListView class.
(The code for MessageListView  was extracted from message_list.js.)

(imported from commit 60c0bac4c734d3850f8b8c047a978c292b19cc13)
2013-08-19 12:17:56 -04:00