Commit Graph

2071 Commits

Author SHA1 Message Date
Waseem Daher e5dbf4240e Hide the popover title area if it is empty.
This makes our popovers-as-menus look a bit better.

(imported from commit 53b8be0a4f16fc7a7884b3fcb276a9ab85fe6f24)
2013-06-20 18:42:06 -04:00
Tim Abbott 6cc45b89b1 Revert "Hide pointer until a hotkey is used"
This reverts commit fec64815c879f9704847795cc163e2b517b4190d.

We've decided this experiment didn't work out.

(imported from commit 04f38e15c8ef19fbaa022a06bbcca3b0c67ec5ad)
2013-06-20 18:02:18 -04:00
Tim Abbott c87e12ad41 Revert "Tweak hotkey behavior when pointer isn't shown."
This reverts commit 74fb298c711e61ae98c210d0ed11c875ce6ba591.

We've decided this experiment didn't work out.

(imported from commit 8acd3a030b692f9397155a20a9f89e63ed6a6cf7)
2013-06-20 18:02:18 -04:00
Leo Franchi 468bbf216d Add a new window.bridge call for unread pms
(imported from commit 098c31dbd69c4c020e4c093095e4c78723db0bb1)
2013-06-20 16:23:30 -04:00
Allen Rabinovich e0c05ea7a9 Prevent buttons from stacking in a narrow window by removing their text labels
(imported from commit ab1526e12d7fea0dd791ae02f419ab65d7430e30)
2013-06-20 09:24:40 -07:00
Zev Benjamin 0e330e7d7e Add mixpanel badge to the front page
Displaying the badge gets us a bunch of free mixpanel data points/month.

We only display the badge on the login page (which `/` redirects to)
and not on other portico pages.

(imported from commit 75871173a10ae888fdb7c92fe8e20586ce60c6bf)
2013-06-20 12:21:42 -04:00
Zev Benjamin d8f1413bc4 Rework bottom navbar styling
This just makes the markup on each list item more consistent.

(imported from commit d12f6ef503b6da10c39aaaadcf2c6d359e9d0d47)
2013-06-20 12:21:42 -04:00
Zev Benjamin 8921621621 Make our portico bottom copyright and navigation stick to the bottom of the page
We use the technique described here:
http://ryanfait.com/resources/footer-stick-to-bottom-of-page/

(imported from commit 108f3c9cc4ce9dbf483ff76d6f9a6a014077da56)
2013-06-20 12:21:42 -04:00
Allen Rabinovich 8ea3dc285d Fix for an overlapping scrollbar in streams list
(imported from commit f07114e06745b9dd7e8b31eec61d21a1914c22c6)
2013-06-20 08:43:32 -07:00
Scott Feeney f06c0fbdc8 Only focus textbox if streams page opened directly
If you click on "Streams" from the gear menu, we want to focus the
textbox to create a new stream. But if the Streams page is brought up
programmatically (e.g. to jump to a specific stream's settings), this
commit makes it not focus the textbox.

(imported from commit 900bdafb701180eac1d284120a91ea2a84d7177b)
2013-06-19 18:31:06 -04:00
Scott Feeney a7eaddefa5 Fix race condition for sidebar "Stream settings"
The sidebar link now uses a one-time event handler for a custom event,
subs_page_loaded.zephyr. If the streams page is already open, we can't
rely on the event so we expand the stream in question immediately.

(imported from commit 3c22e1791d238a3be4a73edcfb5456e392cee608)
2013-06-19 18:31:05 -04:00
Allen Rabinovich adaf5e502a A dark header with a more compact search field and no message composition buttons in responsive view
Removing dead CSS code, loading a bigger gravatar for Retina displays

(imported from commit 0feb79b46b0c275d4a220a4dec733584e0204023)
2013-06-19 15:23:52 -07:00
Steve Howell b055698317 Work around possible jQuery issue in building buddy list.
(imported from commit 17ad22f0bb3b30333cb9675cb710b9b5e2141198)
2013-06-19 16:35:35 -04:00
Zev Benjamin 418c8c2deb viewport.js: Use its own proxy functions internally instead of directly calling $(window) methods
(imported from commit 89e90d30ee41b63f1f8ca7e3d0d92b682a97583d)
2013-06-19 16:35:35 -04:00
Zev Benjamin 338a0fb4ce Reduce code duplication in viewport.js
This also gets rid of an inconsistency in the use of jwindow vs. $(window).

(imported from commit a42e47ef0dd9eaf9aaa4d4e2eedb466d77ec3385)
2013-06-19 16:35:35 -04:00
Scott Feeney scott@humbughq.com 42d2c40464 Add link to stream settings from sidebar popover
(Trac #1375)

(imported from commit 92fdbc9906f1394f3ae484a91919226224f43631)
2013-06-18 18:03:38 -04:00
Scott Feeney scott@humbughq.com 0119423d27 Make a code comment clearer (subscription settings)
(imported from commit 085cdc43371fbdf9b0e93f7de13bda9264e41c92)
2013-06-18 18:03:38 -04:00
Kevin Mehall 9322e63d32 Refactor typeahead for user names (PM and @reply).
Get data directly from the main user list, rather than maintaining a
separate list just for autocomplete.

Fixes trac #1362 -- Does not depend on historical messages, so
will do the correct autocomplete after a single reload.

(imported from commit 6b35a709dba3384530082e8cfacf0151f9e0eb26)
2013-06-18 17:52:39 -04:00
Kevin Mehall fbed3e23a8 [third] Patch bootstrap-typeahead to handle objects that aren't strings.
Based on https://github.com/twitter/bootstrap/issues/6579. Doesn't
look like upstream is going to fix that or its 6 duplicates any
time soon.

(imported from commit b3e887d929cc42124aeb1f13abd7503f38f92a1f)
2013-06-18 17:52:39 -04:00
Zev Benjamin dd939ed7fe Disable the collection of metrics when not deployed
We were using up a lot of events in our dev environments.

(imported from commit 8413ecfa835cce0a231bdf437f37ad8cf12a9133)
2013-06-18 17:07:36 -04:00
Zev Benjamin aff42f0c73 Revert "Add a bunch of debugging support for mixpanel"
This reverts commit c5050f66d985eb76e38117b2668594fedfc10702.

(imported from commit ea1c92f73e8fd4ce2816e7af94b5d3a55edc8a7e)
2013-06-18 17:07:36 -04:00
Zev Benjamin 22a6cd3dd7 Send mixpanel events on window resize and page load about the window size
(imported from commit 9c2859513af52510802da4eb94496d54625775f2)
2013-06-18 17:07:36 -04:00
Zev Benjamin c9bf69189a Use mixpanel.register to reduce code repetition
(imported from commit 13ac43ce4a5539ce8accb5315bc28e7ad872435c)
2013-06-18 17:07:36 -04:00
Zev Benjamin 94daecd039 Send only 10% of the events we generate to mixpanel
(imported from commit f5b1b68f81346a90998a8ab6e789151b0e55dba1)
2013-06-18 17:07:36 -04:00
Zev Benjamin 08097d6788 Don't always claim that the application has been updated when reloading
I don't love the default reloading message, but I'm not sure how to
tell the user why we need to reload in several cases.

(imported from commit 5f2eecdb0d83f31bd60673b247e8aac8f08ce20f)
2013-06-18 16:36:02 -04:00
Zev Benjamin eb62a31bb8 Use a different error message for get_events and get_old_messages
(imported from commit 191f46b482d0bf4adf60967cdfebb0d7dbcf82f8)
2013-06-18 16:36:02 -04:00
Leo Franchi 7705400de2 Properly set stream highlight when toggling in home view
(imported from commit 2aa810f5ca0eb8d62bcf87dc93608c56cf4956f3)
2013-06-18 16:05:23 -04:00
Steve Howell a46a371677 DRY up sent-by-me checks with messages.sent_by_me.
This is a pure refactoring.  We set messages.sent_by_me inside
add_message_metadata(), which gets called early in a message's
lifetime.

(imported from commit 2f6270f92ecdf0e4a64401030f86d89a8fb7be2e)
2013-06-18 16:01:09 -04:00
Steve Howell 943a29dc34 Show correct avatar for desktop notifications.
This updates desktop notifications to use avatar_url from the
server (in case users have uploaded their own avatar).  It
also removes the unneeded stamp parameter from the URL, and
it unifies URL handling with message_list.

(imported from commit 6bb43a25c01cc3d26f30fc167780a477d1c5d023)
2013-06-18 16:01:09 -04:00
Kevin Mehall 6106f8008a Refactor variable names in fading code.
(imported from commit 25e2240f30d86f98d50c36302afbfef43fb4a60e)
2013-06-18 10:40:07 -04:00
Kevin Mehall 97754b3641 Optmimize and simplify update_faded_messages().
Trigger a repaint only on the messages that change fade state,
rather than repainting all messages.

(imported from commit d3a225448c004a4b467e51ceb97fda06a7a6f04b)
2013-06-18 10:06:58 -04:00
Kevin Mehall dc6dd71658 When fading tests for matching messages, normalize huddle lists
(imported from commit 805e62c1a57e754c225b743c7d801d8b33da5ed4)
2013-06-18 10:06:58 -04:00
Kevin Mehall b1b4c1a625 Update fade on every change to recipient fields. Trac #1261.
(imported from commit 2b966765bef3e7e4d8cd2ee6ad55a05ba1f23ab2)
2013-06-18 10:06:58 -04:00
Leo Franchi 2795b362a8 Complete subscription list with any missing subscribed streams
(imported from commit c433a921465af7422d481d6aaf7b0d2fc732a8fe)
2013-06-17 15:26:53 -04:00
Tim Abbott c824901e2e Load fewer messages from the server when narrowing.
This should substantially improve narrowing performance, while still
delivering enough messages that one should only need to contact the
server again if the user scrolls up a significant distance.

(imported from commit 2b0af0e5b9d3a449e7f195a87d57d517b47f0b3a)
2013-06-17 13:48:06 -04:00
Steve Howell 438e412772 Hide more things when you "close" the compose box.
This change backs off from the always-open-compose-box paradigm,
so that when a user "closes" the compose box, they can no longer
type text, attach files, etc., and instead, they have buttons
to reopen the compose box.

(This change does not affect the feature that when you're in reply
mode, the compose box stays open.)

(imported from commit 32305d5b35f457a83f126a2265defdd98e885a2b)
2013-06-17 10:21:49 -04:00
acrefoot 11e44c68ce quickfix whitespace on the composebox
(imported from commit 431a7bc2ac1192416f3c2bc7cbeaeac802a0ec62)
2013-06-14 17:03:41 -04:00
Kevin Mehall b06c2f7ccf Tweak hotkey behavior when pointer isn't shown.
Disable the hotkeys that act on the current message, except Enter
immediately shows the cursor without moving it.

(imported from commit 74fb298c711e61ae98c210d0ed11c875ce6ba591)
2013-06-14 13:50:03 -04:00
Kevin Mehall 0cd90cbe4a Add a close button to the compose dialog (since users may not know to use Esc)
(imported from commit 47dca0b2c76449be1d885b74c1cf6b036aa459c7)
2013-06-14 13:47:57 -04:00
Kevin Mehall 6cb7baf598 Hide pointer until a hotkey is used
(imported from commit fec64815c879f9704847795cc163e2b517b4190d)
2013-06-14 13:47:07 -04:00
Kevin Mehall e80d1f4ad0 Another try at fixing tabbing into the compose box, Trac #1245.
Hopefully this time with fewer stack overflows. It sets the flag
that will break the cycle *before* triggering another focus event.

(imported from commit 5e3ed74f1eeab8a18e36525ae7c8f1f1c756eb58)
2013-06-14 13:19:10 -04:00
Zev Benjamin 501a58c8f9 Proxy the console object when the browser doesn't provide it
Some versions of IE (specifically on Windows Media Center PC, it
seems) lack a console object.  For such browsers, we just black hole
any output we would have sent to the console.

(imported from commit 30151c60a68a47990bf8f9be4476b716352befab)
2013-06-14 11:45:57 -04:00
Steve Howell acc338da0e Remove redundant checks that messages were sent by user.
When a user sends a message, it should be considered to be "read"
by that same user, but all that logic is handled on the back end
now, so we can remove some of the front end code related to
saying that a message is unread.

(imported from commit e4263f86c666882db42d7ae3d399196803d700cd)
2013-06-14 11:10:59 -04:00
Leo Franchi 3fd7c44331 Tweak desktop app JS to support Cocoa WebScript
(imported from commit 6b0c3442f92cffedbd210530479a13d4af5ea266)
2013-06-14 10:46:26 -04:00
Tim Abbott 8678148ad1 narrow: Simplify narrow operand processing code.
(imported from commit 9b353c3fab0d5c6532e844c9de45f10a7c6dc068)
2013-06-14 10:45:05 -04:00
Tim Abbott 6f57f62866 Convert tab_bar.js to not make positional assumptions about operators.
(imported from commit 4ae492951ec21b034b64be1296215862b25e44bd)
2013-06-14 10:45:05 -04:00
Tim Abbott 7642b5bf30 narrow: Fix positional assumptions about order of narrow operators.
This cleans up most of our blocks of code that assume in any narrow
that the only operators present are the ones of interest and that they
always appear in the expected order.

(imported from commit 038707aefbe125b0c14f823fa93472fd40302e20)
2013-06-14 10:45:05 -04:00
Steve Howell 83c80e1ba5 Change ? to & in gravatar URL query string.
(imported from commit f12738d1f8dc5b367eee32240ac0a29fb6255d1e)
2013-06-13 17:26:09 -04:00
Steve Howell 4093021f97 Stop polling for gravatar changes after the first update.
This is essentially a bug fix.  It was pretty clear that the
original author intended to stop polling once the gravatar was
updated, but they checked for the updated flag before the callback
completed, instead of inside the success callback, so it wouldn't
stop polling regardless of the update.

(imported from commit 7998c6890a26a008810b8a6d8e7998a53c6e175d)
2013-06-13 17:24:05 -04:00
Tim Abbott deb89a9c9e Fix display of invite-only streams in new design.
(imported from commit 9960acc7a5c9415c137a36b2e0ac8296346e922b)
2013-06-13 13:09:22 -04:00
acrefoot 9e8b997508 Set sidebar_li attribute when updating stream colors
Before, sidebar_li, used in rebuilding the streams list
during a sort, was set to some HTML rendered from a template.
Now it's set to a jquery object that is updated when the DOM is
updated.

This resolves Trac #1310

(imported from commit ba96d9da4deebf2f674f2c093e81b3f0032a3fe4)
2013-06-13 11:31:35 -04:00
Leo Franchi c97ce3a082 Handle unsubscribing from not-in-home-view streams gracefully
This change makes it so we now keep track of full stream information
for both subscribed and unsubscribed streams in our frontend. Previously,
any unsubscribed streams had no associated data.

(imported from commit c445b19abe11c43c710c264fffcf3af5097deb6c)
2013-06-13 10:06:35 -04:00
Leo Franchi 969e0dd827 Clean up subs.have by splitting it into logical pieces
(imported from commit 0fe55aa62ccc95cae5c9aba565b0e4c04692fb46)
2013-06-13 10:06:34 -04:00
Zev Benjamin 33fed064e2 Prepend the minified static file header using a custom Storage class
(imported from commit 2b67a6d94de1693bdb8a91f455b92375692f4c41)
2013-06-12 17:46:38 -04:00
Luke Faraone 2d0e803799 Make an audible notification through the desktop bridge if possible.
(imported from commit fefaf528f6cc9da3f124da15c25f41211b394b12)
2013-06-12 17:06:42 -04:00
Allen Rabinovich a222efff66 Fix overflow in stream list and clean up dropdown toggle.
This fixes Trac #1328.

(imported from commit 497147d71c529d0fcfdcb9199c850823b1a4778d)
2013-06-12 16:35:48 -04:00
Waseem Daher 2927b3c3b6 Replace "info" with "chevron down" for message context.
(imported from commit a12d3ce9adfe6b3c019f252f9361a9f6da59ebaf)
2013-06-12 16:35:36 -04:00
Waseem Daher 275d851c56 Draw our left sidebar dropdown arrow in a more reasonable place.
It was previously way way too indented.

(imported from commit c40980451a8851321496c744d379b0d95e19a0f8)
2013-06-12 16:35:36 -04:00
Waseem Daher fda6bfdd4e Make skinny navbar gravatar more consistent with our visual styling.
(imported from commit b9a84dd490bddbdfea85668ad1fcf3c29da2c837)
2013-06-12 16:35:35 -04:00
Waseem Daher 9d62c49c83 Make left sidebar gravatar more consistent with our visual styling.
(imported from commit 0a859184d89fbcfb3ab4e7311f3b86a2f9d89d88)
2013-06-12 16:34:59 -04:00
Allen Rabinovich b7694e5109 Widen the message feed.
(imported from commit 76816ff7b43748d4a16c4b7a5def5ec68262dec3)
2013-06-12 16:34:18 -04:00
Allen Rabinovich d729cb49ce Replace some of the skinny navbar glyphicons with vector icons.
(imported from commit c94a7fa3e0cd303933b2a3824e9f9526b891fa5d)
2013-06-12 16:34:17 -04:00
Allen Rabinovich 743ccda154 Change stream/subject separator to a right chevron (>).
(imported from commit ae64fdc2cac57857431b8962feff40c7be3aaa7f)
2013-06-12 16:34:17 -04:00
Tim Abbott a0bdefb71d Fix 'undefined is not an object' traceback with update_active_status.
This seems to only happen with Firefox for some reason.  We've had
similar issues with other ajax endpoints, so this is probably not the
long-term solution, but I'd like to get this traceback fixed now.

(imported from commit aa552fb56882ae2c73e352c7baf9532a88c5cf0a)
2013-06-12 16:21:10 -04:00
Steve Howell d740d7c082 Show user-uploaded avatars on the website.
Show user-uploaded avatars on the website for users who have
UserProfile.avatar_source == 'U'.  (Continue to show gravatars
for other users.)  This includes the home page, the visible-phone
div, and the settings page.

This fix does NOT address a few things:
* There is no GUI to actually upload user images yet on the website.
* The !gravatar syntax in bugdown will continue to show gravatar images
  only.
* We are not changing identicon behavior.

(imported from commit 9f5ac0bbe21ba56528048233aab2430e4dd431aa)
2013-06-12 15:34:51 -04:00
Kevin Mehall a2dc6eb082 Don't hide the compose error immediately after showing it. Trac #1360.
(imported from commit 45d1bc7f771d553d370fcab837abf70aec4f4c11)
2013-06-12 14:26:36 -04:00
Leo Franchi 8f75beb9ec Shrink and move connection error to sidebar
(imported from commit 08d7a0106a1faeece81398eeb6a7aa5d8b55ef23)
2013-06-11 17:33:17 -04:00
Leo Franchi 71e14674aa Be more judicious in our showing of errors
Don't show an error banner for any uncaught JS exception, as often the app
will continue to work fine, and there's no way to dismiss it other than
reloading the page.

Also, don't show a transient "could not connect to humbug" error if
the check-for-messages-in-narrow request fails.

(imported from commit 2c634ba088b58c17fa5b2e3353b0589d40b8e357)
2013-06-11 17:33:17 -04:00
Kevin Mehall 5b4493926f Clicking a message that is being edited should not open the
main compose dialog for a reply.

(imported from commit 0a91b3c2ddba12ec33daf993dd13c1e7a7f4065c)
2013-06-11 13:53:59 -04:00
Kevin Mehall b906112c87 Use buttons instead of links in message edit form for the correct
default keyboard behavior. Trac #1322

(imported from commit 2724022f7aa8286b72145dd442c93501f201f6ef)
2013-06-11 13:53:59 -04:00
Kevin Mehall 1989974d43 Fix comment to describe the file it's in rather than a file it may
have been copied from.

(imported from commit 889b5d421c43c62d17a108ae112eff4b7807539f)
2013-06-11 13:53:59 -04:00
Kevin Mehall a08ce5023c Revert "Start compose when box gains focus, whether by click or tab. Trac #1245."
It makes the stream and subject sometimes not auto-fill when replying.

This reverts commit 86603aefbbcd5f766b0c397583483810948046de.

(imported from commit 934e991566fa7a082ab8e2ba661ec973bce46b85)
2013-06-11 13:33:17 -04:00
Kevin Mehall 63babd642c Start compose when box gains focus, whether by click or tab. Trac #1245.
(imported from commit 0c67f6b4eb2387b5e85bcff6d8ea9ed8889ffaea)
2013-06-11 13:17:43 -04:00
Steve Howell c2ab6428b8 Handle shifted hotkeys better.
Treat shift-space like page-up.  Let the browser handle
shift-page-up, shift-escape, and similar keystrokes.

(imported from commit 31d5c5eb1dd4af7228c5e7794fb4cffc4bd8e88b)
2013-06-11 11:49:53 -04:00
Steve Howell 19adec9d2c Make hotkey.js less error prone to modify.
I extracted get_event_name(), which should help isolate
the problem of identifying keys from the specific mechanics of
dispatching actions for given keystroke events.

(imported from commit 058c0749016dc17cce554788e10ccb32438e9dfe)
2013-06-11 11:49:53 -04:00
Leo Franchi 76c9e27a76 Disable composebox experiments on prod
(imported from commit a553320e7d775978ee31af0f8920cbfeb705f5cb)
2013-06-11 11:41:34 -04:00
Tim Abbott 96ad1dd379 Properly escape stream/subject in left sidebar recent subjects narrows.
(imported from commit 4154d0dcd69af66b3a6bb07678c64e5eb39e6b07)
2013-06-10 17:26:21 -04:00
Kevin Mehall da11e2e8df Make error messages visible (trac #1294).
ce4e860a introduced CSS `.alert{display:none;}` because alerts are
always included in `/signup/` and shown by JS. Use a new `.alert-hidden`
class for this purpose to avoid breaking other pages.

(imported from commit 199ba35dd3356bd4093aac2a54181331b3993ee8)
2013-06-10 16:42:43 -04:00
acrefoot 10d63dff9a stop emails regarding bad hotkey parsing
Why are our tests so incomplete?

(imported from commit 8d94a95f514edeb6ddb74774224fee062af3b5df)
2013-06-10 15:34:11 -04:00
acrefoot b3be518b5a Fix previous hotkey fix
re-enable 'j' and 'k' hotkeys.

(imported from commit 61a9025c4b0560f9f6ce4e9699e191c40106fcde)
2013-06-10 15:19:11 -04:00
Luke Faraone 95a45b8c97 Update name of bridge.notify → bridge.desktopNotification.
The function is getting renamed on the bridge due to a conflict.

(imported from commit 086866d3b08b1cfb8a46ffcc59902175a98aa8e8)
2013-06-10 14:58:13 -04:00
Waseem Daher eaad981def Remove font size menu.
This, in effect, reverts ff0c27ccb177ddc69a31bf8997d31e7cfb5b78b5.
The rationale here is that actually we look pretty good with the
browser's own zoom/font-size-resize in Chrome and Firefox, and it's
better to let the browser handle these kinds of changes than us.

(imported from commit 5949b57bdaf20d4fdf2bbd7ed89d1285a8b8e453)
2013-06-10 14:57:29 -04:00
Leo Franchi 0fa857d524 Add a fixed: option to bootstrap.popover and use it
(imported from commit fe8768b8a320df7670c204880bffb3932568cc5e)
2013-06-10 14:25:28 -04:00
acrefoot b27bb3fc33 Check e.which on hotkey events for charCode != 0
"(" and "↓" share the same e.which, but only "(" has a non-zero
charCode. This commit will start checking for non-zero charCodes
for directional keys.

(imported from commit bcb8c3c5ef2c13708fd04cca5f4d8b0f65beaa84)
2013-06-10 12:39:39 -04:00
acrefoot da361b9208 jbarnold composebox UI experiment
1) When you send a message, restore the focus to the composebox, targeted at the same recipient
2) If the composebox is completely empty and you press up or down, have that close the composebox and take the appropriate action
3) If you started the compose via a reply option (r, enter, click), don't refocus the composebox if the cursor has changed.

(imported from commit 84545e49d06959eb62e7fd2b22e1387383df6d1d)
2013-06-07 17:39:31 -04:00
Steve Howell f213c3d223 Fix today's regression with ever-growing subject pane.
I tried to remove the line of code that removes the old
subjects as part of rebuilding the new ones, but that line
of code is still needed in places.

(imported from commit 97621553c267a79f33d34537a67101464bdac434)
2013-06-07 16:33:33 -04:00
Steve Howell 0c8ede3bc5 Collapse subject list when narrowing to PMs or @-mentions.
Previously, we would only collapse the old subject list if
the new narrow had a stream operator.

(imported from commit 664f984d932d0968a9b901f2a09272e11138843d)
2013-06-07 14:27:09 -04:00
Steve Howell 0087ad1131 Allow subject counts to increase from zero.
Before this fix, you could expand a stream, and then any
subjects that already had a zero count could not be
incremented when new messages came in, until you rebuilt
the subject list again.

(imported from commit 98c95e201f6ec745d7c857da6f42495c8bf88ee0)
2013-06-07 12:28:06 -04:00
Steve Howell cc8a04cb71 Update unread counts for Uppercase Subjects.
(I also introduced a couple local variables that would have
made this and similar problems a bit more convenient to debug.)

(imported from commit 6793c16ffb17514fd9b5a069d384d2c74dac6111)
2013-06-07 12:07:23 -04:00
Steve Howell 224fcebfc9 Extract viewport.is_below_visible_bottom().
This encapsulates logic about things covering the viewport
inside of viewport.js.

(imported from commit 429e979fb0ab288d94064b75280a8b053f9a2aa4)
2013-06-07 12:03:07 -04:00
Tim Abbott f41d9c8c5d Fix traceback when clicking on right sidebar unread counts numbers.
If you clicked on the unread counts span inside the right sidebar
links, e.target would not be the link itself but instead the count
span inside the link, so the extraction of the user's email address
was incorrect.

(imported from commit 559d93622078e4d909f60de794df3f039ea7e5f2)
2013-06-06 17:50:33 -04:00
Tim Abbott dbeaeeaa3f Fix buggy computation of a user's name for user actions popover.
(imported from commit 4ee8aab9ece6ebf699c706cf0368180e714dcd6f)
2013-06-06 14:18:49 -04:00
Leo Franchi 68b890ac0a Make name completion pop above instead of below, and increase to 5 maximum names
(imported from commit e663b8e6815c282c6233cd8ed560a82dccc6c507)
2013-06-06 14:11:27 -04:00
Steve Howell 1cd113db10 Move message_viewport_info() from ui.js to viewport.js
The message_viewport_info() function encapsulates our logic
around the compose box and other elements blocking the viewport,
so viewport.js seems like a more logical home for it.  It also
makes ui.js, one of our largest modules, a little bit smaller.

(imported from commit 7838668b28175e161b87a6d7a8124b73012f0ff3)
2013-06-06 11:59:45 -04:00
Leo Franchi 29d0b923d1 Ensure we get strings out of .data()
(imported from commit e6fb4b658f6b3505e017e5582ac5eb0ede58d1c4)
2013-06-06 11:26:14 -04:00
Leo Franchi bfd2952876 Don't assume 2nd-operator subject means first-operator is a stream
(imported from commit e60ec8387dd843fe504fd5d82808ffd42470518a)
2013-06-06 11:26:14 -04:00
Steve Howell 5a826040d8 Clean up code for unread counts and notifications.
The core simplification here is that zephyr.js no longer has:

  * the global home_unread_messages
  * the function unread_in_current_view() [which used the global]

The logic that used to be in zephyr is now in its proper home
of unread.js, which has these changes:

  * the structure returned from unread.get_counts() includes
    a new member called unread_in_current_view
  * there's a helper function unread.num_unread_current_messages()

Deprecating zephyr.unread_in_current_view() affected two callers:

 * notifications.update_title_count()
 * notifications_bar.update()

The above functions used to call back to zephyr to get counts, but
there was no nice way to enforce that they were getting counts
at the right time in the code flow, because they depended on
functions like process_visible_unread_messages() to orchestrate
updating internal unread counts before pushing out counts to the DOM.

Now both of those function take a parameter with the unread count,
and we then had to change all of their callers appropriately. This
went hand in hand with another goal, which is that we want all the
unread-counts logic to funnel though basically one place, which
is zephyr.update_unread_counts().  So now that function always
calls notifications_bar.update() [NEW] as well as calling into
the modules unread.js, stream_list.js, and notifications.js [OLD].

Adding the call to notifications_bar.update() in update_unread_counts()
made it so that some other places in the code no longer needed to call
notifications_bar.update(), so you'll see some lines of code
removed.  There are also cases where notifications.update_title_count()
was called redundantly, since the callers were already reaching
update_unread_counts() via other calls.

Finally, in ui.resizehandler, you'll see a simple case where the call
to notifications_bar.update() is preceded by an explicit call
to unread.get_counts().

(imported from commit ce84b9c8076c1f9bb20a61209913f0cb0dae098c)
2013-06-05 17:47:34 -04:00
acrefoot d021aebf54 Update API Docs to talk about Bots and how to create them
Since we've made it easy to use bots instead of creating entirely new user accounts
for things which act as bots, we've needed to update the documentation. This commit covers
the static html documentation we have on humbug's API.

(imported from commit 4ddbf0331588b0f463a9920b4cd363b68e811ca5)
2013-06-05 17:17:00 -04:00
Waseem Daher a58876e733 Make all "a"s have cursor: pointer by default.
In specific, this solves the problem of the links in the stream
"right-click menu" not having the little hand icon, uncovered
in our last usability study.

But even better, it also sets a more sane default -- if you're
an "a" and you *don't* want the hand, you have to explicitly
remove it.

(imported from commit 38c0b42f3b7fd5b2b3dff99e8c4c4a2e8aa62833)
2013-06-05 17:08:00 -04:00
Tim Abbott a2a696dacf Add unread counts to the user sidebar.
Because of spacing issues in the right sidebar, the unread counts
appear to the left of the person's name, not the right.

It's kinda awesome that this is only 20 lines of code.

(imported from commit f5a4ea27bc4cd2e8157746ce7524a600b638930b)
2013-06-05 16:44:49 -04:00