Commit Graph

1877 Commits

Author SHA1 Message Date
Jessica McKellar ea582d4e12 Use getBoundingClientRect() to more cheaply see if a messages could be condensed.
(imported from commit 34d45fbc95a3597d27d167c9c02e73f9325edbee)
2013-07-15 10:53:03 -04:00
Tim Abbott 5fc6fb5896 Include a link button after the subject when it matches a realm filter.
This way if you refer to "trac #253" in the subject, it's super
convenient to get from your recipient bar to the ticket.

A note on performance: this part of rendering for 1000 messages takes
about 3.5ms for messages with 1 match; this is small compared to the
overall time for to_dict_uncached for that many message objects, so I
think this is OK for now.

(imported from commit 5bdc2b8415d7599d59eb554739f545c485b78d5a)
2013-07-15 10:41:13 -04:00
Leo Franchi 92fc542872 Show a on-hover cog for going directly to stream settings page
(imported from commit 9ba04d88daacd475d9b85ce7c8bd925840290535)
2013-07-12 18:34:13 -04:00
Scott Feeney 91831d5ba7 Refactor compose code to clarify API
Renamed show, hide and clear to show_box, hide_box, and clear_box,
to make it a little more obvious what each one does and make them
greppable.

Also, hide and clear weren't being used by any other modules, so
these functions are no longer exported.

This resolves Trac ticket #1503.

(imported from commit 904d596ef5b8dc2154dc01ed7c9c99a54dc9b31e)
2013-07-12 18:26:13 -04:00
Scott Feeney a7963a24f8 Remove compose.set_mode in favor of compose.start
From Trac ticket #1503:

All of the calls to compose.set_mode() should be calling compose.start()
instead. Nearly all are impossible to trigger while already composing,
and by calling compose.set_mode() they just do the stuff in set_mode()
twice. The only case where this would change behavior, that I can see,
is if you press C, Shift-Tab to unfocus the compose box without
dismissing it and then press c (or vice versa). I think it's okay if we
clear the input fields in that unlikely case.

(imported from commit ba7f181ec9d1df90a443b0a754462a3a201dcabb)
2013-07-12 18:26:13 -04:00
Leo Franchi 017bd6b8b1 Don't limit ourselves to webkit for audible notifications
Previously we were checking for webkit before checking for
$('<audio>') support, but that cuts out non-webkit browsers that support
the basics of the HTML5 audio api.

Now we actually run the feature test in order to enable it, and only
check for webkit when enabling webkit-specific desktop notifications

(imported from commit 851eed86af167d0530f7e1793e2ca1f9b4cdd71d)
2013-07-12 17:28:50 -04:00
Kevin Mehall 218a7dc1bd Send message on Ctrl/Cmd-Enter.
Trac #1445

(imported from commit d9d623ea260c1eaffdcdc49773152e8cf18d3f1c)
2013-07-12 16:17:22 -04:00
acrefoot 00684e1632 Sort our emoji list lexically as opposed to the order of emoji-cheat-sheet
For completions, since we have no representation of categories, users
might expect lexical ordering.

(imported from commit d2e27dd4d8452df6ac48d44551802d7e65519115)
2013-07-12 14:33:39 -04:00
Leo Franchi e5b855d883 Add a bulk invite page for the first user in a realm
(imported from commit cf85c9d475209da4591e2f06f142008fb19ac9d5)
2013-07-12 13:07:02 -04:00
Scott Feeney ffa8541818 Remove vestigial parts of old minify code
(imported from commit 692e292528a1697687f1b3024c58371b2cf9b5c9)
2013-07-12 11:59:11 -04:00
Kevin Mehall 7f7843020d Show server errors in the message edit form.
Refactor common code from compose into a util function.

Trac #1455, #1448

(imported from commit 6fb691ac952b833655584b05f6caedaefe41c1a0)
2013-07-12 11:35:09 -04:00
Scott Feeney 86151bb5ef Blueslip: on staging, save stacktrace for easy c&p
(imported from commit 5c6b3ddd789100b011aeef863495ae8cb5cdaac8)
2013-07-12 11:33:17 -04:00
Kevin Mehall c2b862e238 Bugfix for 7167ed0: fade class is `message_reply_fade_narrowed` when narrowed.
It would show the recipient bar unfaded over a faded message when
narrowed to a stream.

(imported from commit 576e7bd7bdf1fbb3f241f1ba8cd1548c4546257d)
2013-07-11 17:51:38 -04:00
Scott Feeney 4313f2ff1e Set initial user presences in O(n), not O(n²) time
Previous code iteratively called set_user_status() once for each user;
which in turn was rerendering the user sidebar, also once for each user.

I changed the API a bit by replacing activity.set_user_status() with
activity.set_user_statuses(), plural, that takes an object and updates
all the user statuses in one go before rendering.

(imported from commit 1111c9029264f892f25e76d2e5e5ff996dcbc7ca)
2013-07-11 16:48:29 -04:00
Scott Feeney 8fcf208815 Use one template for all user presence rows
This will hopefully fix some lagginess when logging in on the Hacker
School realm, especially on Firefox, as the user presence rows are
populated (previously requiring hundreds of template renders).

(imported from commit 67e2d7f91ad62d8d7a2e212ee7c7121bd73f010b)
2013-07-11 16:48:23 -04:00
Leo Franchi 3525b88fa1 Add messages to all our message lists before calculating unread
(imported from commit e216246a045a3ed2de43076e89eb99648c8bac56)
2013-07-11 15:06:32 -04:00
Kevin Mehall 862f07c9d8 Update fade when returning to home view.
Fix a minor bug where if you return to the home view with a recipient
filled out, it would be unfaded.

(imported from commit d81d974dcb054c63d8a5dd5afec7b072c99d4e3f)
2013-07-11 15:00:10 -04:00
Kevin Mehall 5062a148df Don't fade when subject box is empty.
Otherwise it fades all messages.

Trac #1468

(imported from commit 393514f9f3b2b7f46945878d93e8c12e4685afeb)
2013-07-11 15:00:10 -04:00
Tim Abbott eaf3dbd902 Fix scroll position when unnarrowing after a reload when narrowed.
(imported from commit cc2f9f3f202d8331ee6cd7b9a73611d1f1f193d3)
2013-07-11 14:59:45 -04:00
Jessica McKellar dd57e0490d subs: Rearrange some of the color logic to make the linter happy.
(imported from commit dd4b8b446dae4fc12d817165f67deb423cf06166)
2013-07-11 14:42:45 -04:00
Jessica McKellar 0ad6d7ead1 Display the correct stream color in the color picker when (re-)subscribing.
(imported from commit 56d96799f3a049a0c64cef3bab7f82c9d6420cca)
2013-07-11 14:42:45 -04:00
Kevin Mehall 8df4857524 Revert to old mark as unread on view behavior.
Effectively reverts 185e865 and b67e52d.

(imported from commit e9b95f1fd9e2ab7926f15910044e9e9879ea085f)
2013-07-11 14:01:26 -04:00
Kevin Mehall 674152dae1 Show the recipient bar when the compose box is open, as long as
it's on a message that isn't faded.

Trac #1464

(imported from commit 7167ed0877d3885316b7d38af5f11ec5523d5f7d)
2013-07-11 13:41:49 -04:00
acrefoot eccdb9505b Add missing emoji, normalize {white,black}_square variants
(imported from commit 474db3fb2eeafc7bc59260d8641cfa56a84933d6)
2013-07-11 11:58:29 -04:00
Leo Franchi f0ca927fb2 Only match : preceded by a space for 😧 📝 autocomplete
(imported from commit c2a6a5be733f538b0c7dad61a1c8fdb625fcd03e)
2013-07-11 11:43:39 -04:00
Leo Franchi 8c7156acfa Don't autocomplete emoji until the 2nd letter 💻
(imported from commit 25986e2c3d939b61c4eb71596944748522d2cb54)
2013-07-11 11:41:10 -04:00
Leo Franchi b5273b4c25 Focus the next open textarea when starting a compose
Previously we had fancy logic to determine where to focus, but immediately
clobbered any focus choice we made and forced the stream selection to be in focus.
We also incorrectly determined what to focus in the case of clicking the new PM
button when in a stream narrow.

(imported from commit 01e2cec8eca068ee1d45d3cfb21607b981d5034e)
2013-07-10 17:43:46 -04:00
Steve Howell e736e393aa Show errors when deleting bots.
It's pretty unlikely these will come up in practice.

(imported from commit 6d809a8c98bfa09e69541d7dfd02094c16273c18)
2013-07-10 17:23:20 -04:00
Steve Howell 97994ea7a9 Shorten private operator (private-message -> private).
(imported from commit f938bd56de05cc8fc0da18348d4dec8a18c96bb9)
2013-07-10 16:58:17 -04:00
Steve Howell 43602b589f Shorten mentioned operator (mentioned-message -> mentioned).
(imported from commit 5104f75a7ed19f533ab5bca466d3e017c72bd1b8)
2013-07-10 16:58:16 -04:00
Steve Howell 600964b1de Animate removal of bot from the list.
(imported from commit 4c7e7aa07fa58c924ed78dbdc1d81c6e4bb28756)
2013-07-10 16:19:22 -04:00
Steve Howell c27e1105e5 Allow users to deactivate their bots from the website.
(The back end had been in place already.)

(imported from commit ec4b7b3ea39d71d86b0bdc161740e494ce1e13f7)
2013-07-10 16:19:22 -04:00
Tim Abbott 227995e971 narrow: Don't crash computing then_select_offset for offscreen then_select_id.
Unlike the other cases where we do this sort of offset calculation,
we're working with a message which is not msg_list.selected_id() --
which means that this message might not actually be rendered at all.
Correct for this by just letting then_select_offset stay undefined in
that case.

(imported from commit ebb8a23bf34c52f9495aa88ceca8eb4458d50be1)
2013-07-10 13:21:08 -04:00
Kevin Mehall 4f68cf939e Don't show the subject typeahead when it's not helpful.
When it's not offering any other suggestions, suggesting what
you've typed is unnecessary and confusing and it should just
hide completely instead.

Trac #1476

(imported from commit ff69bb53c661e0a3a193dbddde6e7a4ff8b10031)
2013-07-10 11:41:12 -04:00
Jessica McKellar 6719854961 Make the tutorial popovers visible even in thin windows.
(imported from commit 0cec5db8b3a881ac1850210bd5ff4563ce2ad699)
2013-07-10 11:20:22 -04:00
Tim Abbott 98f6a20900 Fix selector when picking a custom color.
This seems to have been somehow introduced in the refactoring to move
the popovers into their own file
(36ad3c61e4d7eb05751f9b886d15edceab656d71).

(imported from commit f5f58844a9c2da4b4433489be1772263f3aba350)
2013-07-10 11:09:56 -04:00
Steve Howell 86930191ae Show up to 5 subjects in left sidebar (8 -> 5).
(imported from commit 78888034a2b71617dd6f639b4e7db4beedbb5fa5)
2013-07-09 22:30:28 -04:00
Tim Abbott ce365829f1 Fix traceback checking for new messages on empty narrows.
(imported from commit da0ba189f23fecdee376066db956e1320bca4deb)
2013-07-09 17:43:46 -04:00
Jessica McKellar 20a43706f4 When you change a stream color, also update the floating recipient bar if applicable.
(imported from commit 121f48887a18f22ec173ad5e540d040859f2bf62)
2013-07-09 14:22:42 -04:00
Jessica McKellar 2b10ccf03a When you change a stream color, also update the color in the crumb bar.
(imported from commit 187c1738f4a7bf3f888dfccca315feeeb2137f4d)
2013-07-09 14:22:38 -04:00
Jessica McKellar 3c1b59d840 Fix updating the stream color in messages.
(imported from commit 5d38cf7864ddeb489ca653ac568ee9c738577711)
2013-07-09 14:20:41 -04:00
Steve Howell 6347bdfcc8 Starring a message makes it read.
(imported from commit 80c1af9e34f4904266a64d89c57cd82e84c02b48)
2013-07-09 09:57:20 -04:00
Steve Howell 1edd9a1d9f Fix scroll-to-the-middle bug.
(imported from commit dcd102541c8ee2b341060def714c24b05f2db514)
2013-07-08 23:11:09 -04:00
Waseem Daher c89b662ce6 Give up on "pin tab" and instead push for "get app".
(imported from commit 2aacc547bbe4578c19bc6044183eb06005f2e666)
2013-07-08 23:02:56 -04:00
Tim Abbott 849cf69f61 Fix scroll position when updating messages.
(imported from commit 8d6eb0c1cb980f3d5ad46370ae0f05355bcbeb33)
2013-07-08 22:26:17 -04:00
Steve Howell f87b27a9c3 Bold @-mentions link when you click on it.
This fix also cleans up the search operators so that @-mentions
and Private messages have a more similar naming convention.

(imported from commit fb1a2119aab5aa9e179c6e321a8d2ef2e90290cf)
2013-07-08 22:04:28 -04:00
Waseem Daher 58e57d7462 Revert "Increase bottom_whitespace to be most of the viewport height."
This scrolling behavior is driving me crazy on staging.
Reverting until we come up with a better alternative.

This reverts commit 41954fecd9efb43820ed1ccb5210283c17752f51.

(imported from commit 2db602cf51ca734b00ec1bd454c39204468fa024)
2013-07-08 21:04:52 -04:00
Scott Feeney ba71013b7c Hide a popover when showing a different popover
This is one case I forgot from the last commit. For example, if the
message actions popover is open, and you open the user sidebar popover,
the message actions popover should close. It now does.

(imported from commit a241634cb1aabf8883cf95ebd5b8ba96f5ed9908)
2013-07-08 18:58:08 -04:00
Scott Feeney 6030abb888 Fix clicks not dismissing popovers (Trac #1435)
A cleaner, more general solution would be nice but this fixes at least
the most obvious cases for now.

(imported from commit fc7260e25a4f2172eee74af9c2d9384898947ad3)
2013-07-08 18:53:20 -04:00
Scott Feeney d23e8d8a30 Simplify and fix preventDefault -> stopPropagation
(imported from commit 3cb84804027b67662392e5a7c75bfb0603b9318d)
2013-07-08 18:53:03 -04:00
Scott Feeney c42bf9b9b2 Refactor popovers into their own file
(imported from commit 36ad3c61e4d7eb05751f9b886d15edceab656d71)
2013-07-08 18:53:03 -04:00
Tim Abbott 7540ad6234 Fix tracebacks from prepending messages after narrowing.
(imported from commit 6bed33975ee80c324270b518e0dcb807c1f1df41)
2013-07-08 18:18:48 -04:00
Tim Abbott 54c32992fd Fix hitting down-arrow at bottom of message list.
Previously the viewport.scrollTop() command that we ran in this case
would actually scroll far off the bottom of the site; it only did
something that looked reasonable because bottom_whitespace was small
and thus the scroll was truncated.

This version scrolls to 10% of the viewport away from the top.  We may
need to tweak that to instead be a fixed number of pixels or something.

(imported from commit 0176bf6e3662dfa24887f41b110b429bd8054cb0)
2013-07-08 17:32:18 -04:00
Tim Abbott 0e8c55395c Fix save/restoring scroll position when toggling in_home_view.
Previously the code to save/restore the scroll position when toggling
a stream in/out of the home view would only work if you were currently
not in the home tab -- because you used to only be able to do this
from other pages.

(imported from commit 4002a3980dfd87dabd570abee3ebc63417a78cc5)
2013-07-08 17:32:18 -04:00
Tim Abbott 641377e7e0 Add messages at bottom when message list is empty.
(imported from commit d15ff7ddb39e30ca08dd9d0eccf3dae75414a3ef)
2013-07-08 17:32:18 -04:00
Tim Abbott 43279b99ff message_list: Clear rendering window when clearing message list.
(imported from commit 5eefbced42e9ab987e4e2d60332f1d416df605af)
2013-07-08 17:32:18 -04:00
Tim Abbott 166a9c9635 Return the viewport to a corresponding position when unnarrowing.
(imported from commit d1cb35b175a23e18ed79537843ce7940ec370cf3)
2013-07-08 17:32:18 -04:00
Tim Abbott 0d5469f6ab Preserve the location of the selected message when narrowing.
(imported from commit 38230a79d3bb2c403e20ed9b40b04731c0312325)
2013-07-08 17:32:18 -04:00
Tim Abbott 9145246ace message_list: Don't leak date row headers when prepending messages.
(imported from commit 794c668dd79f89000e6559c0d96c78832e4e43d0)
2013-07-08 17:32:17 -04:00
Tim Abbott bdaacc5393 Don't call msg_list.append/prepend with empty arguments lists.
This can cause unnecessary work to be done.

(imported from commit a33d69598531b6a99520f92cbbac1fdb7eb9ee49)
2013-07-08 17:32:17 -04:00
Tim Abbott a158ee233a message_list: Preserve the scroll position when prepending.
Previously, we had some ugly complicated logic through which we
attempted to keep the selected message on screen when prepending
messages, but we didn't actually preserve the scroll position -- the
selected message would jump on the screen.  This fixes that, by just
saving/restoring the scroll position of the selected message.

This perhaps makes our model/view split even less clear, but at least
it's correct.

(imported from commit 0a01450bbbcdf1b45c891d0570c9fcfb11769315)
2013-07-08 17:32:17 -04:00
Tim Abbott 24055e894e message_list: Fix prepending of messages.
message_list.prepend() now actually only rerenders the new messages
when prepending using the where="top" functionality (previously it
would erroneously just adjust the message database and then wait for
message_list.append() to call _maybe_rerender(), determine that things
are awry, and rerender the whole message list).

(imported from commit c64b7b540a4f5332ad792de0fad9f20750e6db1c)
2013-07-08 17:32:17 -04:00
Tim Abbott e5c96fb3ad Increase bottom_whitespace to be most of the viewport height.
This has two benefits:

(1) Users can scroll their last message to near the top of the screen,
which decreases how often one needs to scroll down to track current
messages.

(2) It makes scrolling bugs near the bottom of the screen a lot easier
to find, because scrolling down too far isn't blocked by being unable
to scroll messages off the screen.

We should probably later convert this to some formula that varies
dynamically based on the height of the last message.

(imported from commit 41954fecd9efb43820ed1ccb5210283c17752f51)
2013-07-08 17:32:17 -04:00
Tim Abbott f48097b609 recenter_view: Always place the initial pointer at the center.
It turns out that this code tries to place the initial pointer 1/7
from the top; the only reason something reasonable happened
historically is that bottom_whitespace was only 40% of the screen, so
the pointer message ends up landing in the center anyway.

(imported from commit 56d4c2acd018d9a87551c82a43c214c6d80bfb90)
2013-07-08 17:32:17 -04:00
Tim Abbott f10d3d5517 Only autoscroll for messages that arrived via get_updates.
Previously we incorrectly would sometimes trigger autoscroll when
messages arrived via get_old_messages (i.e. we loaded some historical
messages from the server).  This resulted in some confusing and
erroneous scrolling behavior.

I kinda hate the fact that we need to pass these values all the way
through the rendering process, but fundamentally there's no other way
for _render to find out, and pushing the autoscrolling higher up in
the stack is hard since we don't return anything like the block of new
messages.

(imported from commit c5ed27f1b21691a21c68ed7e09cff8e3e4a75e76)
2013-07-08 17:32:17 -04:00
Steve Howell a90a155e03 Make narrow.by_recipient 'read' a message.
(imported from commit aadefa6be8f04a033d278050eb1d5135d5b1bdc5)
2013-07-08 17:12:32 -04:00
Steve Howell 0908f15109 Make narrow.by_subject 'read' its message.
(imported from commit e81140c440fecd283443eab46f0c65faffee8df1)
2013-07-08 17:12:32 -04:00
Steve Howell 465728da37 Move functions inside zephyr.js (cosmetic).
This is purely cosmetic, and just puts some similar functions
together in a way that JS lint won't complain about calling a
function before it was defined.

(imported from commit 8a5a81ae5b7ca7dbaa60147ae4f32f50b1cbbf3a)
2013-07-08 17:12:32 -04:00
Steve Howell 01d96ee7fb Mark messages as read when beginning a reply.
(imported from commit 9743e044dbb7570edcb341ca726369a673fc3db9)
2013-07-08 17:12:32 -04:00
Jessica McKellar dd53c1fbe3 Keep the compose box open on a buddy list-initiative PM.
(imported from commit aabfec328a3c1b64aab653ddcbe04568f5742727)
2013-07-08 16:36:32 -04:00
acrefoot fdb597b4d3 v1 Emoji autocomplete
(imported from commit 0b0d4b004936ce4abc37f44317aec414451f3a8e)
2013-07-08 15:26:39 -04:00
Luke Faraone e5031e5a0f Perform JS validation of the login form.
This reduces roundtrips hopefully and will provide a friendlier error
message than what would otherwise be produced by Django.

(imported from commit 034aeef00043e3bf059583770f6c08c4f73ceeb5)
2013-07-08 14:00:19 -04:00
Jessica McKellar fd4205d5cd tutorial: tweak the language of some of the popover titles.
(imported from commit 9a6ebdb39049c56137925dd30ff94b852256a0ba)
2013-07-07 19:30:12 -04:00
Jessica McKellar 867647a230 tutorial: don't try to restore event handlers added during the tutorial.
They end up being duplicate blueslip handlers, and they cause hotkeys
to not work.

(imported from commit 6240d1f2b00b3fe9f02ed2e64f2406b22fa4f6ea)
2013-07-07 19:30:12 -04:00
Jessica McKellar b535037d25 Always show the onboarding checklist if it's unfinished.
(imported from commit da5a84f7b70f5240f9bdd54b25719c3ed88fc1ee)
2013-07-07 19:30:12 -04:00
Jessica McKellar 03d6ec0819 tutorial: add missing info to un-collapse senders in the fake PM conversation.
(imported from commit 60518a9c704ab0a4a1ecc0ad6f5f506e9417437c)
2013-07-07 19:30:12 -04:00
Steve Howell 9f95f3f07b Use handlebars for bot rows.
(imported from commit 0dfdb5dd49ec9e553bee0ef837b1010288cb1ea4)
2013-07-06 09:49:22 -04:00
Steve Howell 433f5daef5 Change bots table to a list.
(imported from commit 6e1163d8cab42dafa958a4d1c95f60ef927ef2c3)
2013-07-06 09:49:21 -04:00
Leo Franchi e09016c1e2 Mention our new apps on our /apps page
(imported from commit e1b1f467c72a90a84b54d867c7e31c6721439af0)
2013-07-05 17:56:14 -04:00
Allen Rabinovich 14d3a6b567 Remove unused CSS reference and an unused extra_cls variable
(imported from commit d94e8c432d476009bc729cf0cd889a7871ba26ff)
2013-07-05 14:18:08 -07:00
Allen Rabinovich 1b703b0808 Change crumb bar coloring logic and some text: remove dark background from PM, change the name of Search to Search results, remove background recoloring from the entire crumb bar, set border color instead of background color on individual crumbs.
(imported from commit d2106675b3f06e014e41a67df82778ae04eea45c)
2013-07-05 14:14:29 -07:00
Steve Howell 249252f700 Put spaces after "function" in JS code (cosmetic).
(imported from commit 7579547bfed70b3e53122109d0d6f30ea01f5ac3)
2013-07-05 16:32:32 -04:00
Leo Franchi 26c66b17a9 Mark desktop apps as having sound enabled regardless of webkit
(imported from commit 478fdead0fa43b0706fd0af09c8d890eec0ce5e1)
2013-07-05 16:24:39 -04:00
Jeff Arnold 8f58647ff6 Don't let up/down close a compose unless the compose content is focused.
Fixes #1447.

(imported from commit 73603050680c526be3764dbaaa8ed747b76ead56)
2013-07-05 15:00:08 -04:00
Kevin Mehall 97b7b6ee33 Don't try to test message visibility when it's not in the current stream.
Fixes the JS traceback "'null' is not an object" introduced in b67e52d.

Testing: Receive a message when narrowed to a different subject, with
the window focused.

(imported from commit 54b9e7924a2bf66ba5cc9799fc3687a084496465)
2013-07-05 11:29:03 -04:00
Kevin Mehall 49e3ba7cb3 Make sure a message is in the list before trying to select it.
Fixes the JS traceback "Selected message id not in MessageList"
introduced by b67e52d

Testing:
  * Narrow to a subject and send a PM
  * Narrow to a PM recipient and send a stream message
  * Narrow to a subject and send a stream message to a different subject

(imported from commit 1171c3f97813dc7db891042906762be8afb2a1b5)
2013-07-05 11:26:18 -04:00
Tim Abbott 20c1e1bb8c Fix regexp for mit.edu on javascript side as well.
(imported from commit cf1bf6c78b7116a49436fe0de98abc4aad74e611)
2013-07-03 18:39:44 -04:00
Jeff Arnold b96f41a991 Honor the case of the user's subject in the first autocomplete option
(imported from commit 7820fc7c8c45498407f857c20755f1bcdc292e1f)
2013-07-03 18:08:46 -04:00
Waseem Daher 51f9ace595 Revert "Chevron icon on each message now causes a dropdown menu; hover on message for info"
This reverts commit f8fbf70c8502370a78159e24f3cf9589fb9d384f, since
we're waiting on some Firefox and no-hover fixes.

(imported from commit 6b13f5bb9d907303ab311afd7da584bc06538c91)
2013-07-03 17:44:35 -04:00
Steve Howell ccd759cc3f Remove dead code related to showing bots.
(The dead code made sense in the very early phases of sketching out
the feature, but it's no longer executed.)

(imported from commit 464145f227ddb25f0554bbbade0b0e3e0e399bc3)
2013-07-03 17:28:10 -04:00
Steve Howell 949d6bfc8c Clean up HTML construction for bot avatars.
(imported from commit ef9122ac739163d97b3142c7e300ce595eefa6f7)
2013-07-03 17:28:10 -04:00
Kevin Mehall 5999df005e Wrap option lists onto multiple lines where previous commits made them long
(imported from commit 856bd9f0082ef1a6e8d537316330c40266f2f25c)
2013-07-03 17:10:15 -04:00
Kevin Mehall 56bd11fa7f Don't mark messages read when the pointer lands on them when narrowing.
This is slightly inconsistent, but keeps the unread count from decreasing
when narrowing and un-narrowing.

(imported from commit 185e8653c31a312c166e784b335ae7ae7e9b78e9)
2013-07-03 17:10:15 -04:00
Kevin Mehall 0f6bdafea3 Mark all messages in view as read when you hit the bottom.
Trac #1428

(imported from commit f40d890091528969ae4e4db80adb019cbce60fef)
2013-07-03 17:10:15 -04:00
Kevin Mehall e6b2acefe2 Move message_is_visible to viewport.js
(imported from commit 9f05f8f2f00badb67325994825a904bde6958d73)
2013-07-03 17:10:15 -04:00
Kevin Mehall 22c1a66da8 Don't mark messages as read by visibility.
Trac #1428

(imported from commit b67e52d7434220e397ca20ffa49915de6633519c)
2013-07-03 17:10:15 -04:00
Kevin Mehall 318d66ed9e Apply CSS class .unread to unread message rows.
Trac #1428

(imported from commit e19d75ecd6164b9643411b4740a10527952acc0c)
2013-07-03 17:10:15 -04:00
Steve Howell 009d7b8174 Shrink avatars to 35px in the Your bots table.
I tried 30px at first, but I think a slightly bigger avatar helps
fill out the table a bit.  It should be easier to tweek these in
CSS now, although Allen agrees with me that the tabular display
may be short lived when we add edit/delete features.

(imported from commit b4d69cddf63fa122374e20731a5755e7dec86304)
2013-07-03 11:49:04 -04:00
Jessica McKellar 078defaf15 Regardless of how you get to it, run the tutorial un-narrowed, in the Home view.
(imported from commit 9e57d098b9a4064388c12969fd77663c96597986)
2013-07-02 18:26:18 -04:00
Jessica McKellar 4567bcea1a Add fake message timestamp info needed for new date separators.
(imported from commit 20a29af1f140385f37fc1dff4e278304a2c16c4a)
2013-07-02 18:26:18 -04:00
Jessica McKellar 58780f0637 Disable hotkeys during the tutorial.
We don't want you accidentally arrowing around.

(imported from commit 6a1d18c40833007439c5c54849598438f04b13b1)
2013-07-02 18:26:18 -04:00
Jessica McKellar 5db6d16b4a subs: remove unused tutorial functions.
(imported from commit 666bcae369f64848c778eccf3fc97ae39986c353)
2013-07-02 18:26:17 -04:00
Jessica McKellar 14e27e7583 Add the new tutorial steps.
(imported from commit 9269acbcf58332002b1d45c0134ccb2db980f05c)
2013-07-02 18:26:17 -04:00
Jessica McKellar 5688ee5e57 Provide a function to set the get_updates timeout to 0 for the tutorial.
(imported from commit c904360ffe6fe3cacc9de37d523501a0d45f7176)
2013-07-02 18:26:17 -04:00
Jessica McKellar 672a2ef9ac get_updates: factor out success work into a function.
It has ballooned to screenfuls of code, and this refactor will help
with the tutorial.

(imported from commit 05d18558911ee7ce58b0de43eedf164b495d47ae)
2013-07-02 18:26:17 -04:00
Jessica McKellar 8d73f2d80f Load fake tutorial messages on tutorial start.
(imported from commit aa58f134d86662f090db52f9fdfd815e69f42235)
2013-07-02 18:26:16 -04:00
Jessica McKellar e2fe16af84 subs: export the ability to check and set stream colors.
We'll need this to temporarily set stream colors for the fake tutorial
messages.

(imported from commit 3a2943ccf061cf414d95dc89f3221f9986da9c64)
2013-07-02 18:26:16 -04:00
Jessica McKellar c7d289e328 Rip out old tutorial.
(imported from commit a8f2b246f23500e93a56e028e22aa1196c017d8e)
2013-07-02 18:26:16 -04:00
Jessica McKellar bc3837f440 compose: remove tutorial check on sent messages.
We did this to check if you sent a message that would progress the
tutorial. Since the tutorial is getting overhauled we don't need this
anymore.

(imported from commit 25ee55ab034fff42a220ddd7b222b3f7459af3a1)
2013-07-02 18:26:16 -04:00
Kevin Mehall dce1f7f729 Parse @-mentions in bugdown and style them.
* This makes bugdown.convert take a `message` parameter. Properties
    for parsed mentions are added to the message object by the `Pattern`
    for use in do_send_messages.

  * Refactor repeated markdown rendering code into `Message` model methods.

(imported from commit 4f0ed5570104c0210f984b6de21e9048e2b53fa0)
2013-07-02 18:20:26 -04:00
Tim Abbott f473cb5fbe Use bulk operations in notify_subscription_{added_removed}.
After fixing the high numbers of database queries earlier in this
branch, I found that sending 500 RabbitMQ messages for a bulk change
in subscriptions was consuming more than half the time for these (and
then we'd end up with 500 events in a queue).  To handle this, we
create a "user X subscribed to these N streams" event, rather than
sending one event for each individual subscription.

(imported from commit 44a34a9fab9b67e9f0da6fee53335d8c5030392b)
2013-07-02 10:50:29 -04:00
Jeff Arnold 45116a0b61 For mit.edu, include unclasses and .d classes in narrowed views
(imported from commit e21aab715c949d4348c447e6e135281b47e06b98)
2013-07-02 10:50:29 -04:00
Tim Abbott dc54a24766 Add util.escape_regexp.
(imported from commit 3ba7caa0d444a64b228bcb5f5c658c8363ddfbf5)
2013-07-02 10:50:29 -04:00
Kevin Mehall 4b6b8cb3f9 Rename timerender.render_time to render_date.
It only renders the date part now.

(imported from commit 6cbfb4175a8ed1b69b99a6f16ee9eaa2cb36e0de)
2013-07-02 10:13:57 -04:00
Kevin Mehall 6b07c2cf27 Don't re-use "Last edited:" strings.
These contain timerender spans with unique IDs. If this string is cached
and re-used in a narrowed view, there are elements with duplicate IDs,
and only one of them is updated at midnight.

(imported from commit 29469fb5f0d8a9b7fe7988849d2936c49d4a038d)
2013-07-02 10:13:57 -04:00
Kevin Mehall 2857d0b4e1 Show time again in "Last edited" message.
As of f69d01b and e4a9f80, timerender only deals with the date part.
Since the time does not change when the friendly dates are updated,
just append the time outside of the span.timerender.

(imported from commit 18ec93550782c6fa8447ebc608f95da79d28dc8d)
2013-07-02 10:13:56 -04:00
Kevin Mehall 0f839522a7 Increase shown subjects to 8 (+ any unread), per discussion on
corporate > singlehop.

(imported from commit e4c28670e33ca0ea6ecb59d1ce94efb28e86e23a)
2013-07-01 13:35:00 -04:00
Kevin Mehall 371b3827d2 Show unread subjects in stream sidebar.
Trac #1403.

This shows the 5 most recent subjects, as well as any others with unread messages. This
requires tracking all subjects and filtering at display time, rather than filtering when
building the subject list.

(imported from commit 8bda7d50e6785a6e70abea4b3af4d03a16d076d3)
2013-07-01 13:35:00 -04:00
Steve Howell 1e246ba32d Use our own buttons and text field for uploading bot avatars.
(The file-input widgets that come with browsers are ugly and
nonstandard across browsers, so it is a common technique to
have your own button that controls the file upload, and it
delegates to a hidden copy of the browser file-input widget.
We also allow you to clear the file.)

(imported from commit b55ef655e75746330dc3cc396cb908670e5019cc)
2013-07-01 11:27:37 -04:00
Steve Howell b06f34b55b Use portrait alignment for adding-bots form.
The add-bots form used to have a landscape alignment, as it was
integrated into the same HTML table that showed your existing bots.
This became unwieldy once we allowed users to upload avatars.

(imported from commit 246a35be77ce1679d595271e6911dc339a6813ab)
2013-07-01 11:27:36 -04:00
Steve Howell 43864edb14 Validate file types for bot avatar image uploads.
(imported from commit e250faa727c33267ff57b5956def766ff9d43c29)
2013-07-01 11:27:36 -04:00
Steve Howell bb4aafb7b0 Allow drag&drop for setting bot avatar image.
(imported from commit e480c1a5efdd08621e80ef3e8653beb5a9f095d8)
2013-07-01 11:27:36 -04:00
Steve Howell 2d888dbb23 Allow user to upload an image for their bot's avatar (front end).
(imported from commit e1de0df38fc06fabab8a715ba7bbee71d8bde7b9)
2013-07-01 11:27:36 -04:00
Jessica McKellar 88f26e013a When you have unread PMs, flash that you do in the favicon.
(imported from commit 064c1596c6413ba805d2a4b98b48926ee3f6f015)
2013-07-01 10:20:21 -04:00
Waseem Daher d9aca91662 When you change your name, properly update it in the presence list.
This fixes Trac #1163.

(imported from commit 065f33484004635104d59d3a004cc25c12fa1d2b)
2013-06-30 14:23:02 -04:00
Tim Abbott a237963c90 Fix buggy calculations of which messages get a footer.
(imported from commit 14c942e8297b2385690bb3e679cca729afd9c52b)
2013-06-28 17:54:43 -04:00
acrefoot b62d7acbc7 W3C Notifications to allow Desktop Notifications in FF too.
Caveats:

- Since Chrome has trouble using W3C Notification when it's not
  initiated by a user gesture, we try to use webkitNotification first.
- FF doesn't allow iconUrl to be of a different origin, so it won't display
  our gravatars

(imported from commit c4f99ce6927a0d203d9f220d50b06737779bd7f8)
2013-06-28 17:30:57 -04:00
Kevin Mehall 541004e4b3 Remove the date separator at the top when we scroll up and load more messages from the same day.
(imported from commit 31e4c45c77d06d4b3fd2433c858fd37bb9d907a4)
2013-06-28 17:19:05 -04:00
Kevin Mehall 41aa72ba2c Refactor/simplify timerender update code given that now all dates
that need update will update at the next midnight.

(imported from commit e4a9f801ab8ac9a3661fb66cb2c5eed7f92b6d8a)
2013-06-28 17:19:05 -04:00
Kevin Mehall 51489a4852 Collapse sender when it's the same as previous, even when far apart in time.
Trac #1393.

(imported from commit 443f39fd34eb4d6c76e73d058fb55cc0058a2e8c)
2013-06-28 17:19:05 -04:00
Kevin Mehall a9bd7377a2 Show date in a bar separating messages rather than on each message.
Trac #1393.

(imported from commit f69d01bd8149f4549694db1ff517a2d0929ffc6a)
2013-06-28 17:19:05 -04:00
acrefoot bea702dd17 Chevron icon on each message now causes a dropdown menu; hover on message for info
As does the hotkey "i". It's somewhat less appropriate because it's all actions,
but it's where our "info" menu used to be, and we can workshop a better one. "a"
feels weird to me, but maybe it's just me.

You can also hover on the .message_content to see a popover with extra message details

This is for Trac #1334.

(imported from commit f8fbf70c8502370a78159e24f3cf9589fb9d384f)
2013-06-28 12:24:03 -04:00
Allen Rabinovich d9f5b98aea Put recipient bar color in the message's left column.
Previously, we'd highlighted the top of the block. The theory here is
that it will make things less visually cluttered/noisy, which should
improve readability.

(imported from commit f94ec6b8e55aef9c2413718aea23b1124f5308e7)
2013-06-28 10:52:05 -04:00
Allen Rabinovich 445b07397f Make message template know if it is the last one in a block.
This allows us to do some nice styling on the final message in a group
(in this commit series, this leads to some gently rounded corners.)

(imported from commit 86e7e8586dd4ee3cd8d4ce3be43fd2abab3f1d16)
2013-06-28 10:52:05 -04:00
Scott Feeney 40aa6bc667 Add chevrons to items on the stream page
(See Trac ticket #1383)

(imported from commit 15e8db20da8f6293150bd89f3616f09444e10568)
2013-06-27 21:35:58 -04:00
Steve Howell 0f3b6cd863 Show a user's bots in the order they were created.
Showing a user's bots in alphabetical order leads to a mildly
confusing experience when we append a new bot to the end of the
table, but then you hit refresh, and the new bot goes to a different
position.  Since any given user is unlikely to have zillions of
bots, I don't think we need alphabetical order to help them find
old bots.

(imported from commit 4f19dbd7a016e7d867e88248190849dcd52c6d71)
2013-06-27 17:10:05 -04:00
Zev Benjamin 6144f18101 Enable metrics for all production realms
(imported from commit 7ee3728ff37c244d90efd76ee69555691cf5ba97)
2013-06-27 15:57:55 -04:00
Waseem Daher 287fc22b91 Show full notification title in our fake notifications.
(imported from commit 7472ba8e6aad87f398552b80c6b9c19af5df9d38)
2013-06-27 14:22:31 -04:00
Tim Abbott 1ec0ee0fd6 [manual] API add_subscriptions: Change arguments to support options.
Since in the future we might want requests to add subscriptions to
include things like colors, in_home_view, etc., we're changing the
data format for the add_subscriptions API call to pass each stream as
a dictionary, giving a convenient place to put any added options.

The manual step required here is updating the API version in AFS
available for use with the zephyr_mirror.py system.

(imported from commit 364960cca582a0658f0d334668822045c001b92c)
2013-06-25 16:34:45 -04:00
Tim Abbott 9924faaabd [manual] API get_public_streams: Return streams in a dictionary.
This way we can return properties of the streams other than just their
names in future versions of the API without breaking old clients.

The manual step required is to deploy the updated version of
sync-public-streams on zmirror.humbughq.com when we deploy this code
to prod.

(imported from commit 42b86d8daa5729f52c9961dd912c5776a25ab0b4)
2013-06-25 16:34:44 -04:00
Tim Abbott f7363af887 Don't send desktop notifications for messages you sent to a stream.
Previously, we were only checking whether the message was sent by you
for PMs, not for streams that you marked as notifiable.

(imported from commit 668e102e885aa347cceff376c1873c1c62aff997)
2013-06-25 13:46:48 -04:00
Jeff Arnold c8e34c2bfa Make the first subject autocomplete option be what the user typed
(imported from commit af9f5cfce09a071eb461f93c8c47128897162de2)
2013-06-25 10:28:14 -04:00
Tim Abbott 8f0fbfb562 Fix message_is_notifiable to not include messages sent by user.
(imported from commit 196696da1350bba176985acce4abe36d5cedd24f)
2013-06-24 13:56:45 -04:00
Zev Benjamin 90f4b1f227 Preserve the hash when reloading
Previously, if you were narrowed when we reloaded you, you'd be
kicked out to the home view.

(imported from commit c00f1b92c9a4f559998463e141a402b69873fd56)
2013-06-21 16:24:12 -04:00
acrefoot a37b08db58 In-Browser Notifications
Some browsers don't support desktop notifications. Some people haven't allowed permissions
for humbug to have desktop notifications. This is a poor man's attempt at desktop notifications.

We are adding the bootstrap-notify package (http://nijikokun.github.io/bootstrap-notify/)

Resolves Trac #1336.

(imported from commit 6a54f7d1875e765dabd32d94ada8ebe4474a3d71)
2013-06-21 11:44:25 -04:00
Jessica McKellar 05bbfb42a9 Make bankrupting more resilient against regular pointer updates being in flight.
(imported from commit 90e1dc16e7d3295b6ed3f5993fe82ac4fcd2d7cc)
2013-06-21 11:00:44 -04:00
Jessica McKellar 24b41351a6 Clean up the message we display while bankrupting you.
(imported from commit 007c97eded421a021cd6aefb7f38fe8f4946b26c)
2013-06-21 11:00:44 -04:00
Jessica McKellar e0b109c6ae Remove the bankruptcy button on the Settings page.
(imported from commit 3f67422df3e96b0902b315c8d055c607e07bc533)
2013-06-21 11:00:43 -04:00
Jessica McKellar 30ab99d765 Offer to bankrupt a user if they are way behind.
(imported from commit 5483bb548a55e6cbf788b71a8885b3c990b94b77)
2013-06-21 11:00:43 -04:00
Tim Abbott 5eca964f0e onboarding: Only update onboarding checklist state if it changed.
I noticed in our server logs that some users were sending
update_onboarding_steps requests to the server every time they sent a
message -- because they hadn't finished the onboarding process.

(imported from commit 8e1751a3344149f386022d96e7893e687d6631e8)
2013-06-21 10:42:32 -04:00