Commit Graph

94 Commits

Author SHA1 Message Date
Rafid Aslam 45f39be37f lint: Fix many no-unused-vars eslint rule violations.
These have been carefully audited by tabbott to ensure they are
unlikely to cause regressions.
2016-12-14 21:34:51 -08:00
Brock Whittaker 80ad28bab5 Don't repeat date header if message date is same as previous.
This primarily works to make sure that new queued messages don’t end up
with redundant date headers on them.
2016-12-14 20:41:33 -08:00
Brock Whittaker a460fcddef Add Date Headers to Floating Bar and Message Headers.
This adds the date of a block of messages to the floating recipient
bar along with message headers of blocks that are the first of a
particular day.
2016-12-13 20:36:39 -08:00
AZtheAsian ed0bc831be eslint: change one-var from warning to error and fix violations 2016-12-02 11:25:16 -07:00
Tommy Ip b3f4feb996 eslint: change max-len from warning to error and fix violations. 2016-12-02 14:16:33 +00:00
Tommy Ip 7b2c313f37 eslint: change brace-style from warning to error and fix violations. 2016-12-01 10:20:22 -08:00
Tim Abbott 47045179fc Fix traceback rendering narrows to non-subscribed streams.
This fixes a bug where Zulip would throw a TypeError if the user were
to try to narrow to a stream they had never been subscribed to.  With
the new "preview" feature on the subscriptions page, this will now
happen much more often.
2016-09-19 22:10:52 -07:00
Tim Abbott c35781d505 lint: Require folding of } on same line as else statements. 2016-06-09 14:02:49 -07:00
Tim Abbott 0c1b5006f7 lint: Check for space after if in javascript. 2016-06-09 13:47:12 -07:00
Tim Abbott b25562ca1d Add and use util.is_current_user helper function.
Previously, we were checking if a particular user was the current user
in dozens of places in the codebase, and correct case-insensitive
checks were not used consistently, leading to bugs like #502.
2016-06-07 21:58:44 -07:00
Tomasz Kolek 0820ab591a Refresh page when message with /me is edited.
Fixes: #163.

Thanks to Catherine Nguyen (@cnguye11) for her work on this.
2016-05-31 08:29:07 -07:00
Vishnu Ks 4be20c4b4a Move scroll_to_selected to navigate.js. 2016-05-27 01:03:21 -07:00
Kartik Maji 3d77aa49db Add subscribe button in narrowed view when stream has no messages.
A temporary message appears on successful subscription, with a button
offering to unsubscribe in case the user subscribed by accident.
2016-05-18 20:06:30 -07:00
Kartik Maji 206452c867 Add stream subscription button added narrowed views.
Fixes: #273
2016-05-18 20:06:23 -07:00
Vishnu Ks ae49ad383d Rename all function on MessageList to all_messages. 2016-04-25 13:45:18 -07:00
Kate Buckner 4d0f7c7ea4 Add a user-visible setting for 24-hour time display.
(imported from commit d934824fd6b72e64a455aac9ff4585b262145f02)
2015-08-20 17:33:16 -07:00
Jacob Hurwitz d401d1cb47 Fix the scrolldown bug (T27850)
(imported from commit 4ae017908b9cc37231ba201c058a6630ceed908f)
2015-01-15 15:26:25 -08:00
Jason Michalski 55e762b069 Fix bug with date separators when prepending messages
When the date changes between an existing group and a new group the
existing date separator needs to be updated. This is done by rerendering
the existing group.

(imported from commit a3775815e33872b0ec07704dc7ccf5fd2671fa21)
2014-03-29 22:00:00 -04:00
Jason Michalski c147daa312 Firefox does not have an innerText so use textContent
textContent is supported on all browsers and IE 9+

(imported from commit ea13d58bf85b6ffb30fdbece20f9dbdcd6c32896)
2014-03-19 17:30:11 -04:00
Jason Michalski 94279c0522 is_me_message is an attribute of the message not the message_container
(imported from commit db36e529de92a82bb9c5df97030833ca2e3e0f80)
2014-03-19 11:43:32 -04:00
Jason Michalski 456e735725 Fix autoscroll forever
(imported from commit 66cc2661767f54de54012b4abf930e748071585e)
2014-03-19 09:38:10 -04:00
Jason Michalski 3158075405 Use the match data on the message not the message_container
(imported from commit 1289108c767732c76efc7369206ef065f2395e0d)
2014-03-18 18:24:23 -04:00
Jason Michalski 28245ce4e4 Mark messages as read globally
If you read a message in a narrow it should also be marked as read in
the main list.

(imported from commit e892fad0a5b635b5c8de6ebdc79fbfd2b54fab2b)
2014-03-18 16:03:25 -04:00
Jason Michalski c3ded56a7e Do not try to rerender muted messages
(imported from commit 1430b204cd7d32ddcee273b142bcbc2d699caffb)
2014-03-18 15:46:32 -04:00
Jason Michalski e60f76487f Rename message to message_container
Now that we are not directly using message in the message list view
rename the uses of message that are message_containers.

(imported from commit 5c355703a8934a74864f5de6ecb1e2fd851e5d41)
2014-03-18 15:05:39 -04:00
Jason Michalski 1613cad6f6 Separate the global message data from the list display data
The messages being passed to the handlebars templates were global
messages which we were adding per list details to, show name bar etc.
This causes rendering bugs when you try to rerender a message, because a
different list may have changed it. This commit moves the global message
data to a msg attribute on the message_container which will contain the
per list attributes.

(imported from commit 26b1f0d2c72d6288a6d3e7ed5f8692426f2a97ad)
2014-03-18 15:02:31 -04:00
Jason Michalski c39e657a3b Do not try to incrementally update the DOM when it was cleared
When clear_table is called message_groups must also be cleared.
Otherwise render will try to incrementally update the DOM which will
fail when the expected existing nodes are not found.

(imported from commit 5ec3ce01717741b17c719fabded316619cdc4b25)
2014-03-18 13:20:29 -04:00
Jason Michalski 61c16a20b4 Only message rows should be post processed and added to the DOM
The handlebars template adds a text node with a newline after every
message. So we need to filter the jQuery object to include only the
message rows.

(imported from commit 07513b485e805570e450fb93c07091be89bcbd50)
2014-03-18 10:05:20 -04:00
Jason Michalski 35fe8bf81b _post_process_messages realy wants DOM nodes
(imported from commit c419248ff1f7a4338f503f6705dede32e195ed3b)
2014-03-17 22:31:25 -04:00
Jason Michalski c38c9cf894 Me messages should always display the sender
(imported from commit af42ed8dcb9f4bc44e66d4973b9e613302647e12)
2014-03-16 15:14:57 -04:00
Jason Michalski 441688b41e jQuery object's get method returns an array
Passing anything other than an array of DOM elements to
_post_process_messages is an error. In this case we were passing an
array of arrays of DOM elements.

(imported from commit 9e3be18598c406f3578a867dab36731ffeeac921)
2014-03-15 23:46:27 -04:00
Jason Michalski a9235a74f4 Split the group merging logic form the DOM update logic
The goal is to have a more data centric piece that can be unit tested.
We also try to minimise the number of one off jQuery DOM updates and
rerender handlebars fragments instead. This will prevent the
message_group and DOM from drifting apart and not being able to rerender
correctly.

(imported from commit 03f09803f2bc0c3b8187f76f2cfe90be9f7512a3)
2014-03-14 20:48:59 -04:00
Jason Michalski 4f6ee6744d Split out group creation from rendering
To make the rendering process a bit simpler to read this commit is
refactoring the message group creation into its own function.

(imported from commit b53ce96ed8fee3064d7cf891fc248d0c3d821d1a)
2014-03-14 20:48:59 -04:00
Steve Howell f8b71fa497 Created condense.js (with code taken from ui.js).
(imported from commit 72b27b48614a7c396170d46936646e52757e2743)
2014-03-14 20:48:58 -04:00
Leo Franchi af3411cab8 Handle removing the selected local message from the message list
(imported from commit 185fc33cc19699ebe61ce9d65262383e39289cf3)
2014-03-14 20:48:57 -04:00
Leo Franchi c832543168 Remove very confusing dom_id message attribute
(imported from commit c7e3e50bf8827f6f087d7df28ec7b7c173a3c041)
2014-03-14 20:48:51 -04:00
Leo Franchi ef81999f3f Make sure to store raw DOM elements, not jQuery objects, in _rows
(imported from commit ccf85bfd514b5b143c1021d4a186f1448abc700d)
2014-03-14 20:48:50 -04:00
Leo Franchi 6d2c6f269d Make sure to use the proper dom_id in the proper places
(imported from commit c4852f972d4fe8b2732c87dcc499f91f837e912c)
2014-03-14 20:48:50 -04:00
Leo Franchi 8f7542f34d Use elem.html() instead of elem.replaceWith() when swapping in new rendered messages
(imported from commit 82664bf2eb20faa8e98b7912b4c26174046d2dd6)
2014-03-14 20:48:50 -04:00
Leo Franchi 26690adc47 Save the correct-from-dom rerendered message in _rows when rerendering
(imported from commit c021beef3106148a6d085ca16f34a1c4bb4fc7af)
2014-03-14 20:48:49 -04:00
Steve Howell 72c9deb59e Handle errors better when rendering messages.
Catch any exceptions that happen in the process of triggering
the message_rendered.zulip event.  This addresses #2356.

(imported from commit ce771483cd2533d312fbd68e9c2753c80b3c8d49)
2014-03-11 13:06:19 -04:00
Leo Franchi a4a47db9e0 Error out gracefully if edited message is muted
(imported from commit 1aefd61d5633ed67a919cccd2d8c68f7ba8e7bfc)
2014-03-04 17:19:59 -05:00
Leo Franchi f2e8929b8a Hide rerender_message and use rerender_messages() in all cases.
rerender_messages() does extra work such as making rerendering in narrows
safe, as well as updating recipient bars. That should be the only valid entry
point for rerendering individual messages

(imported from commit f91aeb2070b1056ab95e01d68a342558c2813ae8)
2014-03-04 10:47:44 -05:00
Leo Franchi ca031304b9 When rerendering single messages, grab messages from the view's own list
(imported from commit 5b3b5cefd65952b81406adcbd6208551228f0c5d)
2014-03-04 10:38:12 -05:00
Leo Franchi bdaf8b2cfe Update message group recipient bars when rerendering messages individually
(imported from commit 3fb1386fee12c3a4a3f46810368cdd5d8cfb04d8)
2014-03-04 10:09:40 -05:00
Steve Howell 0983809e6f Fix URLs for stream/topic narrowing links in recipient bar.
(imported from commit 4e104cde912521dc360df1a32ce149a5082f9a67)
2014-02-28 16:27:13 -05:00
Leo Franchi dda8bf6d8a Don't error out if we somehow have a top message group but can't find a recipient row
(imported from commit 3b51f6a5e6e7998c33bf994316d5ba16e5cc0378)
2014-02-28 16:27:12 -05:00
Leo Franchi 840ba90512 Show on-hover topic edits in message list
(imported from commit c2cd996c5e17b801e4e10b0a28451c0fb51c5e21)
2014-02-27 20:25:34 -05:00
Zev Benjamin a547043831 Fix search highlighting for message content and topics
Previously topics weren't being highlighted at all and messages had their
highlighting persist across different narrows (because we were only checking
whether the message object had a match_content property, not whether it should
currently be used).

(imported from commit 44c91c6d5799dcdf765e19e1a17bd727ce80c918)
2014-02-27 20:25:33 -05:00
Leo Franchi 7fe74a9d2e Add a background color property to each message
(imported from commit add776a0814353650903258894e0db6fc8ec67b6)
2014-02-27 20:25:29 -05:00