Commit Graph

2217 Commits

Author SHA1 Message Date
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
Zev Benjamin f38fb33388 Lighten edit diff colors
(imported from commit a2f5778890cbc031f1b95f55a91689e5ee5332e3)
2013-06-05 14:26:46 -04:00
Steve Howell 8be0ea972a Cosmetic: move function up in file.
This just moves keep_pointer_in_view() to be adjacent to recenter_view()
in the file.

(imported from commit 27056e2a949ffef262ac21130436f7303fd2935f)
2013-06-05 13:50:02 -04:00
Steve Howell 042cd8f222 Handle large/gigantic messages when recentering.
(imported from commit d57e702f504a9a3e6b7049a19217671902df4ab7)
2013-06-05 13:50:01 -04:00
Steve Howell 4c8a293750 Scroll more like barnowl again. (but closer to the edges)
We are moving back to a barnowl-ish scrolling algorithm for
the arrow keys, where when you have a message selected toward
the bottom of the screen, hitting down arrow and up arrow
effectively puts the originally selected message at the center
of the screen.  In order to avoid unnecessary scrolls, we
are making it so that you can move the pointer closer to the
edges.

(imported from commit c08233d6d2034a04469b8f424b39d94a230cafe0)
2013-06-05 13:50:01 -04:00
Leo Franchi 5a8cc44ba8 Don't autoselect all users in create stream listing
(imported from commit dae00c632d860386255d063db295d707b396b18a)
2013-06-05 12:57:47 -04:00
Leo Franchi b5cadeca73 Backport bootstrap-typeahead click fix to make clicking on autocomplete more reliable
This is the patch described here:

https://github.com/twitter/bootstrap/issues/2715
92189b87ad

That commit has not been upstreamed to bootstrap due to bureaucracy issues.

(imported from commit 3c4a109b58f403569a41f5048ab347a800f029c2)
2013-06-05 12:02:08 -04:00
Steve Howell c7ab489260 Remove dead code in notifications_bar.
I removed references to the following:
    on_custom
    custom_message
    current_message
    show_custom_message()
    clear_customer_message()

(They were not being used anywhere.)  Also, show() does not
receive a msg parameter any more.

(imported from commit 8ec347b40fc9fa582317d68e85c98258cf3fba2f)
2013-06-05 09:35:21 -04:00
Tim Abbott 34e2edb220 Change tutorial instructions for how to reply.
(imported from commit 5204ff60763da990ea27d572adb6810324c0d764)
2013-06-05 09:29:27 -04:00
Zev Benjamin 0c20f48636 Show changes to edited messages using color highlighting
I didn't use red and green for fear of it not being visible to
color-blind users.  We may need to tweak the colors.

(imported from commit 59c4f1dac549a248783e4c3b3ec472d8cb690df5)
2013-06-04 18:15:45 -04:00
Zev Benjamin 835dd6673a Only reselect the selected message on rerender if it's not -1
We could get into this situation when someone is doing a search and
someone else edits a message while the results are still loading.

(imported from commit 99e371fd75c7ae7dc98a0c03bc434e434da44b94)
2013-06-04 16:21:56 -04:00
Zev Benjamin 1d2c1a00bc Improve error reporting for trying to select an unknown message
(imported from commit 4fdc09d11e35eeed2510de6668d5a982c915f8c0)
2013-06-04 16:21:56 -04:00
Zev Benjamin d95ea89f54 Fix a "can't read property 'id' of undefined" user error
`current_msg_list.get(id)` and `rows.get(id,
current_msg_list.table_name)` are not interchangable in terms of
checking for whether we have a message.  The former checks whether
the message is in the current message list while the latter checks
whether the message is in the current message list and currently
rendered.  `message_edit.end` only operates on rendered messages.

(imported from commit 203ee612bfd0aa94571dde9b601e948b3c6f6cbb)
2013-06-04 15:39:51 -04:00
Zev Benjamin 6bd61f458d Don't throw an exception if someone edits a very old message
Previously, if you didn't have a message that someone else had edited
in your message list, you would get an exception because we weren't
checking whether we actually had the message or not.

(imported from commit 33a5c6e7fe95b5397a32df5c7b5f6714d71e1e5f)
2013-06-04 15:38:42 -04:00
Luke Faraone a73e86cd9f Keep the desktop client updated as to the app's new message count.
(imported from commit c8deb2a773ee5c82f9d2decdced936f2f18dd4e0)
2013-06-03 13:10:25 -07:00
Luke Faraone c5d3ca0247 Send notifications over the JS→C++ bridge if it exists.
When determining if desktop notifications are enabled, we can check whether
there is a "window.bridge" element.

Now when it comes time to actually send out notifications, we can just test
again for the existence of "window.bridge" and if so, shunt the data over
it.

(imported from commit 8104c91ea9da7bc485c86a3c21edc88905d2f47b)
2013-06-03 13:10:18 -07:00
Steve Howell 3ee4161ace Allow pointer in more places.
Before this fix, the code would restrict the pointer to be above
either the 1/2 mark or 2/3 mark of the page, depending on your
scrolling direction.  This fix makes it so that the system leaves
your scroll and pointer alone when between the 1/5 mark and 4/5
mark.  This means the user can read more messages on the screen
at a time before getting paginated.

(imported from commit 98f6319bf63181dd331e037ac20a0c15518725ea)
2013-06-03 11:04:01 -04:00
Steve Howell 40ce4e0acc Streamline recentering code.
When you make a call to set_message_position(), you already
know that the pointer is gonna be onscreen, so set the flag
to suppress scroll pointer updates.  This should be faster and
also avoid future confusing bugs where recenter_view() and
keep_pointer_in_view() run for the same event.

(Both callers to recenter_view pass in the selected message,
and then the calls to set_message_position() set the scrollTop
so that the selected message shows onscreen.)

(imported from commit f1a6f189b7899b280a6316ea7eb03f015d3d4ae3)
2013-06-03 10:41:04 -04:00
Steve Howell e558b5bf23 Fix whitespace in code.
(imported from commit 4bb750f886ccffc22d54140c10d39f0f91725156)
2013-05-31 14:19:47 -04:00
Steve Howell cd13488959 Show fade effect in left pane for new mentions.
This also changes the color for the blink effect when you
get private messages.  For simplicity sake, we use the
same color for private messages and mentions.

(imported from commit 46b0f7af1dccefe575004e7676990e5c854a3dcc)
2013-05-31 14:07:34 -04:00
Jessica McKellar b895780c7c Make narrow.operators always return an array.
Previously it could return an array or boolean, and this inconsistent
interface had several latent bugs where consumers of the API only
considered it returning one or the other type.

This also fixes a specific bug a user triggered by being narrowed to
nothing (/#narrow) and clicking in the compose box.

(imported from commit 64ca2a37a9f288066f89b0ddec6638e010704eb0)
2013-05-31 13:51:53 -04:00
acrefoot 6ae117ea5f Re-focus on the compose box after a send, auto-move cursor
Re-focuses on the compose box after a send, under these conditions:
1) narrowed to stream+subject -or- responding to PM/huddle
2) compose was initiated by clicking on a message or hitting "r"/"enter"
3) cursor has not moved since you've started the composition

Additionally, if you are thus narrowed, we will move your cursor when you've sent
a message to that message, assuming that such a message initially appears visible.

(imported from commit 373c858081694e6fc9994639340a847d66edb566)
2013-05-31 13:43:05 -04:00
Steve Howell 66b93d5cfd Fix barnowl style scrolling w/r/t fixed elements.
This change fixes the barnowl scrolling so that the ratios of
1/5, 1/2, and 2/3 are all relative to the visible viewport.

The core part of the fix is that we need to call
ui.message_viewport_info() to get the correct offsets for
the top/height of the actually visible viewport  Because
this function is fairly expensive, I didn't want the
helper functions needlessly re-calling it.  I could
have passed the helper functions the structure, but at
that point it was simpler to inline their functionality.

(imported from commit fb10d99313d568e85acfa70703c4651466acbc21)
2013-05-31 12:51:50 -04:00
Tim Abbott 6100d61f8f Remove 'narrow to messages sent by' from message popover.
Now that this functionality is accessible from the right sidebar, we
don't really need it here.

(imported from commit 34eaef4e1200f9fc673a681f0be87d8008033e83)
2013-05-31 12:24:33 -04:00
Tim Abbott 4558c5e008 Fix tab bar handling of search for 'sender:'.
(imported from commit c054ffee10943a4e6835d4466d57818df6efc7e4)
2013-05-31 12:24:32 -04:00
Tim Abbott 3be4a010e8 Add a sidebar actions popover for the right/user sidebar.
Currently, this is accessed by clicking anywhere in the sidebar region
other than the text of the person's name itself, which does the
existing narrow behaviour.  Later we can make it do something clever
with hovering pulling out the popover or something, but that's
potentially a significant design project I think this is good enough
to be useful.

(imported from commit a2cc5dc851661117a6d438ca48a1ce7585d4eb63)
2013-05-31 12:24:32 -04:00
Tim Abbott 878cd4cf3e Move stream sidebar rows into a handlebars template.
(imported from commit f1f2acecec0a0a1ff86bffc2a0244e015535ce86)
2013-05-31 12:24:32 -04:00
Tim Abbott 4e3ea12dc1 Rename stream sidebar variables/functions to be less generic.
(imported from commit 1d9fe6cd8da513b7a283c08862ce887159fe498e)
2013-05-31 12:24:31 -04:00
Tim Abbott 7d20a697d6 Move user presence sidebar to a handlebars template.
(imported from commit 1f505bbda4ed67da94db8d97e8e58cb2c462d056)
2013-05-31 12:24:31 -04:00
Tim Abbott 74cfadfb74 Rename sidebar_stream_actions to stream_sidebar_actions.
I think it's more intuitive.

(imported from commit bd9939a994e1f9f93fd71d9c71963debfedfff89)
2013-05-31 12:24:31 -04:00
Leo Franchi 56af48cd50 Split wildcard mentions from personal mentions, only email on personals
(imported from commit 18971d9e40dd2c93ef9c30edc963da33e3c65309)
2013-05-31 12:24:31 -04:00
Leo Franchi 0524c14c8c Ignore leading spaces in search box
(imported from commit 098a8f288c8264cc804b737f804b866c64c0ff5b)
2013-05-31 12:24:30 -04:00
Jessica McKellar f6be3289c1 tutorial: fix out of date references to message formatting and feedback locations.
(imported from commit 8f5b088a4a26d34d5f0c7280b50892763144e4da)
2013-05-30 17:43:55 -04:00
Jessica McKellar e4c0438936 onboarding: center the Done button on the sticky app popover.
(imported from commit e64432d94ef5b3f74527d7d4b5782ccac9ff9520)
2013-05-30 17:43:55 -04:00
Jessica McKellar f51d0ce001 onboarding: only show the app popover on mouseover once.
(imported from commit 45d9c7de583e3243e0e65f09392fb15ad5ea2043)
2013-05-30 17:43:55 -04:00
Steve Howell bbd2322586 Show unread counts for mentions in left pane.
(imported from commit b4511b1d95f58010904c97f55d6189dd2a97cf1b)
2013-05-30 16:59:22 -04:00
Steve Howell 468de0a29f Fix autoscroll mousemove bug.
We had a couple places where autoscroll would
mysteriously midway through scrolling, and it
was because scrolling generates mousemove
events.

(imported from commit 666e5e5af81fdcc5cc56c314d1264dbec970c067)
2013-05-30 15:04:42 -04:00
Steve Howell 3f1b3af002 Add "Mentioning messages" to the upper left sidebar.
Treat "mentioned" messages like "starred" messages for narrowing.

Lots of ugly copy/paste here.  There might be opportunity for
some cleanup in places.

(imported from commit e7629890d42643c0000e1cc85422b2a0690f2cc4)
2013-05-30 14:45:01 -04:00
Keegan McAllister 0df77527f1 Remove files minified by upstream
We now don't use these at all, and they are likely to confuse us later e.g.
when modifying third-party files.

(imported from commit 2034949111466b22b1830ec087f30fa34445fcbd)
2013-05-30 13:51:47 -04:00
Zev Benjamin 441e4296e0 Add copyright notices to third-party files
These will get slurped into the minified files we generate.

(imported from commit 46375d6d8c382bf681c192d2e6a0cb6d941bdac0)
2013-05-30 13:51:47 -04:00
Keegan McAllister 5e2c493ea5 Remove CSS/JS comments that were making their way into minified code
We will provide our own copyright and license comments in the files
that need them

Also remove the byte-order mark from spectrum.css.  It would appear in the
middle of the file, and there's no need in UTF-8 anyway.

(imported from commit dc32113e88bc6533f37f3378ffeac26f2050d0e7)
2013-05-30 13:51:47 -04:00
Zev Benjamin 6e0a5e0293 Add notice of inclusion of third-party code
(imported from commit 62d141e6ebd3368bd1cb3154d6903f9408f2b77c)
2013-05-30 13:51:47 -04:00
Keegan McAllister 371d0dbaa0 Identify app.js source map using a special comment
If we're going to minify third party code, the size heuristic may not hold
anymore.

(imported from commit 78ada1fee1446e78b3b1ad299ee3e975d1cd9002)
2013-05-30 13:51:46 -04:00
Keegan McAllister 16883781f8 Import non-minified xdate.dev.js
(imported from commit 0466815f429afd604460e9995ea5eb0d9e665d90)
2013-05-30 13:51:46 -04:00
Keegan McAllister 86835295d6 Import non-minified jquery.ba-throttle-debounce.js
(imported from commit b0c8651ef65f243049dd600b21af4a233630d462)
2013-05-30 13:51:46 -04:00
Keegan McAllister befbb04bda Import non-minified spin.js
...and upgrade spin.min.js to match.

(imported from commit 653dfd1a720e01e03f2a9d89581d0dd45b6eed14)
2013-05-30 13:51:46 -04:00
Keegan McAllister 7d5f2cb2cd Switch away from CDN for jquery and jquery-validate
We're going to minify these together with everything else.

(imported from commit 929538ac119a82a0d96446a48da90c162a317417)
2013-05-30 13:51:46 -04:00
Keegan McAllister 243ccf10d0 Normalize directory names for jQuery plugins
(imported from commit 46a4c97f176066fcb56e7943f7b3c25cdc089e4d)
2013-05-30 13:51:46 -04:00
Tim Abbott 1cf2d993a6 Fix un-narrowing while the home view messages are still loading.
The bug we experienced here was that if you loaded the page in a
narrowed view, and then un-narrowed before the first block of messages
for the home view arrived via load_old_messages, then
narrow.deactivate() would re-select ID -1 in home_msg_list.  This ends
up calling recenter_view() on the message, which in turn tries to
access the message with message id -1, which fails.

We do sometimes re-select a message ID in order to recenter the view
properly when we prepend messages to a message list, so we can't make
this always a nop; instead we add a check for id -1 in the
message_selected.zephyr event handler.

(imported from commit 66f84a586e59d99aaf0e4ba2cda9fe597b033145)
2013-05-30 10:29:04 -04:00
Steve Howell b34fc4d78f Fix intermittent bug w/page downs at bottom of feed.
There was an off-by-one error in how we determine when
the message list was scrolled all the way to the bottom,
and this undermined our handlers for page down and scrolling
to get the pointer all the way to the bottom.

(imported from commit f80d11582b40726246e69c817a502b311081c730)
2013-05-29 18:42:38 -04:00
Steve Howell fc2c5eb70a Revert "Experimental navigation: t and b keys"
This reverts commit 13fb245f86ab84b1d2faea9d2a1f2145cd4aa907.

(Waseem wanted to hold off on adding more hot keys.)

(imported from commit 97c25ffa01fd7058fc90a278887d85b7d82a268a)
2013-05-29 18:10:43 -04:00
Jessica McKellar 80b13bdb73 Fix incorrect space character in several e-mail prompts.
(imported from commit 41bdbce2225a5eb5ab4057467d599d1341fcd9a5)
2013-05-29 15:23:26 -04:00
Jessica McKellar d845605221 integrations: add SVN documentation.
(imported from commit 54e47c9e0aba7aecda6e868eb46bcf169b792ea9)
2013-05-29 15:23:26 -04:00
Jessica McKellar 606e64b4d5 features: document message editing and missed message e-mails.
(imported from commit 991a2489092820f2fd76438abfdc24d957791de5)
2013-05-29 15:23:26 -04:00
acrefoot c58ac9cc0c Re-focus on the compose box after a send
Re-focuses on the compose box after a send, but only if
the compose-box was opened by responding to the message
at the cursor (by hitting "r", enter, or clicking on the message)

(imported from commit 8e7560c8ea31397b57b2bc3e2e7d9dd996226a6f)
2013-05-29 13:07:45 -04:00
Steve Howell b3cb196452 Stabilize pointer after reply-to clicks..
The reply-to autoscroll was using a flag that was redundant
to suppress_scroll_pointer_update and then updating it prematurely,
which caused the pointer to move when you clicked on a message to
reply to it.  Now the pointer goes to the message you replied to.

(imported from commit e2f49fd6bd0da9a3f4b58c0eb08192ef0ee9abf0)
2013-05-29 10:11:39 -04:00
Tim Abbott ab093e7d9a message_edit: Fix traceback saving message edits.
Now that we sometimes call message_edit.end() twice, we need to check
if we've already cleaned it up.

(imported from commit 4e0efa14ba78df0a86b2ae97b99fa1be6197df88)
2013-05-29 10:11:08 -04:00
Steve Howell 975b984aee Slow down pointer adjustments at the bottom of the messages.
The main point of this fix is to move some more scroll-related code
into viewport.js, but it also fixes a bug where the size of #main_div
was not accurately representing the full height of the message list.
Making the calculation more accurate narrows the window where we
do pointer adjustements on mousewheel moves.

(imported from commit 5d821f459284c4dbd5ff8056001e54caf4355f1d)
2013-05-28 17:23:22 -04:00
Allen Rabinovich acbff5682f Add paragraph spacing, a slightly larger gravatar, +1px to line-height, and a bit more padding between messages.
(imported from commit c495c0f747e671318e737ddfaea5ff801fc12a97)
2013-05-28 13:54:52 -07:00
Tim Abbott 968ef85ff8 Display the blank for new bots below existing bots.
(imported from commit 813fbf969d0fef508db1dc4acd02c1fc98f427fb)
2013-05-28 16:41:31 -04:00
Tim Abbott e33812d1ff Style the notification settings section.
(imported from commit 319c55993e9a9f88d61eeba31db8cea37b0cb7e7)
2013-05-28 16:41:30 -04:00
Tim Abbott 3427bbaf1c Change sizes so the bot username columns line wrap less often.
Because having the -bot@humbughq.com part of the bot username wrap to
the next line is confusing, we try to avoid that happening.

(imported from commit 777da8770be5398ef255e8c3ddf5b3c308489fae)
2013-05-28 16:41:30 -04:00
Steve Howell b045d4e503 Uncover replied-to message by proper amount after clicking.
Fix min-height before doing the calculation of how much a
replied-to message is being covered by the compose box.  This
change also removes an outdated call to slideDown.

(imported from commit e5a3f35bbacff16dffae62c9e9f6bbc7978a13c1)
2013-05-28 13:45:43 -04:00
Jessica McKellar c50e05bc68 Focus on the correct textbox when you initiate a compose when narrowed.
The logic for this already existed, but start() was getting called
twice, once from compose.set_mode and once from the click handler, and
the result was the focus always being in the stream input box.

(imported from commit 9a832a118856b5705524975a4412b7e6e547ef5c)
2013-05-28 12:49:54 -04:00
Jessica McKellar 1ac44f0356 Expand the compose box in the correct mode when narrowed to PMs.
(imported from commit 68e4bb3091b855dafda8df3ca10737abb5d2f337)
2013-05-28 12:49:53 -04:00
Jessica McKellar c1a067857b Make clicking on a presence list name narrow you to those PMs.
This parallels clicking on a stream name, which narrows you to that
stream. This also gives you a discoverable way to narrow to PMs with a
particular person.

(imported from commit 6c706f0643f6a8ec20ac38360153227ec2f645ae)
2013-05-28 12:48:40 -04:00
Steve Howell 11430a58b7 Experimental navigation: t and b keys
This sets up the keys t and b to anchor your pointer to the top
and bottom of the viewport.  It empowers keyboard users who
are otherwise at the mercy of Barnowl recentering, but of
course it doesn't affect users who don't want to opt in.

(imported from commit 13fb245f86ab84b1d2faea9d2a1f2145cd4aa907)
2013-05-28 10:33:54 -04:00
Steve Howell 9cedca4dc5 Don't stop the autoscrolls for reply-to. Refactored.
The functional change here is that our code to stop
autoscrolling on certain events, particularly mousemove,
now only runs during system initiated autoscroll events.
If the user had been replying to a message, then the feature
to stop autoscroll was too aggressive.

This patch also starts to put more scrolling-related code
into viewport.js, which will hopefully prevent some code
duplication and give us a single place to control things like
stopping animated scrolls.

(imported from commit e7d5946b0ac7fcfda2eff1d0e2b58a78b44ecc1a)
2013-05-28 10:25:06 -04:00
Leo Franchi 10501c08cc Remove client-side mention calculation as it's done server-side via message flags
(imported from commit 603aa8aef69d486a8acda953ec72cdeeb7476dd7)
2013-05-24 21:23:58 -04:00
Leo Franchi b548538a98 [manual] Send UserMessage flags in get_events updates
This commit must be deployed in a separate step from the previous [manual]
commit

(imported from commit c6f00e217062790fce8380f61f82ea8824fb3722)
2013-05-24 21:23:58 -04:00
Waseem Daher c749323e84 Restore old color scheme.
That way, we can test out the design vs. the colors independently.

(imported from commit 72fd049dc565cedaf30de646818a284f148e6c01)
2013-05-24 21:23:57 -04:00
Allen Rabinovich e95187299e Adding a better style for message body gravatars
(imported from commit 092549851782c81390ea2efc90929191b951b997)
2013-05-24 21:23:57 -04:00
Zev Benjamin a74590ea12 Remove mixpanel wrapper
We can use mixpanel.disable, instead.

(imported from commit 1da1513de2f9e19b0c3149bb412030feba960f87)
2013-05-24 21:23:57 -04:00
Allen Rabinovich 70d4d9cb7e Modify some messagebox colors and put the timestamp and icons into one line
* Change the highlight colors for private and mention messages
   * Put timestamp and message controls into a single line
   * Modify layout to allow more flexibility in control placement
   * Lighten narrowed view background color
   * Adjust composition area columns

(imported from commit c7edca358b079da0ca76fa26d998946574bded6a)
2013-05-24 21:23:56 -04:00
Tim Abbott 8479b4f0cd [schema] Record and display whether a message was edited.
We also record the historical edits to the message in this JSON format:

 [{"prev_content": "new test message 14", "timestamp": 1369157249},
  {"prev_content": "new test message 13", "timestamp": 1369157118}]

but we don't actually do anything with the information as of yet.

(imported from commit 2d5ca449b87b33ad035ab0e076a22e150c8e7267)
2013-05-24 21:23:55 -04:00
Leo Franchi de8f43fec1 Add all unknown people to people_dict, even if they have only been PMed with
(imported from commit 01ca442127d5289a2cdfa5e9630aa928bea0b6eb)
2013-05-23 10:39:47 -04:00
Leo Franchi 98d8095391 Don't require people_dict to contain everyone you PM with
(imported from commit 003a5bf601366986c0f65d0e945d8e390ad581cd)
2013-05-23 10:15:58 -04:00
Leo Franchi 3be1acebaa Use canonicalized names when processing unread counts
(imported from commit 9a4a1d48221f10489a9dcf3ab2532b73b0c26e4e)
2013-05-23 09:56:43 -04:00
Leo Franchi c12fd08050 Use same canonicalization for stream names when calculating recent subjects
(imported from commit d934f67cb469728162b8ae48b5fc63805bf18d8f)
2013-05-23 09:56:43 -04:00
Allen Rabinovich f69762e612 Modify message box layout and spacing.
* Modify the narrow icon in FontAwesome to make it better align to the pixel grid and display well on Windows+Chrome.
   * Move the message controls to the right
   * Hide the message info icon until the message is hovered / selected
   * Switch the star to a gray version
   * Increase the size of the gravatar
   * Adjust the spacing
   * Add the right-side message pointer
   * Fix private message background colors and mention colors
   * Modify star count test to account for new stars
   * Bug fixes for stream subscription messages and other miscellanea.

(imported from commit 3d3d9de7e03f3658c5c78b492051b2b7f795487d)
2013-05-22 21:55:15 -04:00
Steve Howell 7cdbb0e6b0 Make auto-scrolling less aggressive.
This goes back to only scrolling by the size of the new
message, and it avoids scrolling in certain use cases.

(imported from commit f9e6380b779bb21283ba889715712b6b51633838)
2013-05-22 18:22:09 -04:00
Leo Franchi 2ea52d4200 Don't cut off the empty feed noticed under the tab bar
(imported from commit 1cb77a077665f821df1b62a544ee3652a7560b82)
2013-05-22 18:12:50 -04:00
Leo Franchi 3b7ddd72cf Don't throw an exception if we get an undefined stream
(imported from commit b6bbaf1fa14bec5fc43016f81e15caa32a9fb948)
2013-05-22 18:12:49 -04:00
Zev Benjamin 991630c031 Record basic versions of the operators used in narrows for metrics
(imported from commit 5c7cb3a62ebf0b2c1f0d8e9cae8d845cde9baf56)
2013-05-22 16:20:48 -04:00
Zev Benjamin 2ab5c7dd76 Fix race involving mixpanel load order
Previously, we were referencing the mixpanel objects only once, at
page load time, which meant that there was a race between metrics.js
loading and mixpanel completely loading.  Mixpanel starts with stub
methods and then replaces them once it fully loads, asynchronously.
If metrics.js ran before mixpanel loaded, we'd end up wrapping the
stub methods instead of the real versions.  Adding a layer of
indirection ensures that we always get the right method.

(imported from commit 6a8cfbf249168443956895b7a7e29bf7bb4222aa)
2013-05-22 16:20:48 -04:00
Tim Abbott d8527057d4 Fix compose to stream button in actions popover.
I apparently screwed up my check for whether we were using the old
data-name field, and switching the other stuff to use data-id (which
is needed for the color stuff) is probably not worth it.

(imported from commit 1b925bbcca5beb5dc9dadbcf703cbb07ca511a0c)
2013-05-22 14:38:44 -04:00
Tim Abbott e5e53747f5 Shrink the streams page rows slightly.
I think they look a lot better when sized so that the
Subscribe/Unsubscribe button and the labels on the left are both
centered within their respective rows (and also within the blue
regions that hovering over the row displays), and this seems to cause
that to happen within a wide range of font sizes.

(imported from commit d586aecee4b16540ad480509b5b888bd8de02cf0)
2013-05-22 14:21:26 -04:00
Tim Abbott a34d640eb3 Rename message_edit.cancel to message_edit.end.
(imported from commit 5c720100afbf1e86c09eb2567f465c42353f95ec)
2013-05-22 13:04:37 -04:00
Tim Abbott e68c6bb1da Fix race where message editing might be cancelled after rerendering.
(imported from commit 989f1eace526d351cdbd9e15de594964de09a770)
2013-05-22 13:04:32 -04:00
Tim Abbott d0df3d9b37 Revert "Fix that you have to save an edited message twice to complete the edit."
This reverts commit 87226d857845c6f16cb3bc0d6ab5bb748aca5987.

This meant that if for some reason there's a server error or network
failure trying to send in your edit, your changes are silently lost.

(imported from commit 2b5d19716fef1565b061a2b6c7cecc54f183b6f3)
2013-05-22 13:04:32 -04:00
Tim Abbott 4f464d4a5d Be more explicit about which stream in left sidebar popovers.
It's not as clear as it could be which stream you clicked on from the
location of the popovers, so it's worth making the popover clear about
which stream you're modifying.

(imported from commit 289b2e70eab582f4ec12d62410e095fd632f6582)
2013-05-22 12:10:16 -04:00
Tim Abbott 67f84b06f7 Add support for changing colors in the stream popovers.
(imported from commit 30593148500a78c36baec87af5868d8c5a173d96)
2013-05-22 12:10:16 -04:00
Waseem Daher 7ead4c4a1f signup: Make postal stripes work in Safari.
(imported from commit dcafc608ea0b818f3a58e795de4d1c98abe2d493)
2013-05-22 11:32:19 -04:00
Waseem Daher d0bda35911 signup: Add postage.
(imported from commit 826a3d7e9996ccd5c27f44d00572a4a51ea893a5)
2013-05-22 11:32:18 -04:00
Waseem Daher 6656869a92 signup: Rotate through cute placeholder names.
(imported from commit 59c1523d35cd80e904a173fefc614da2543b391d)
2013-05-22 11:32:18 -04:00
Zev Benjamin b565b2adc9 Add a bunch of debugging support for mixpanel
Currently, some browsers don't seem to be sending metrics information
to mixpanel.  This commit will make said browsers noisy, but should
help debug what's going on.

(imported from commit c5050f66d985eb76e38117b2668594fedfc10702)
2013-05-22 10:43:57 -04:00
Zev Benjamin 10dbfd0985 Record narrow metrics
(imported from commit d312115d384dd1f33e05dcd1b3f1dadc86e3fdf3)
2013-05-21 17:56:49 -04:00
Zev Benjamin d35c8f0c81 Track what user action triggered a narrow
(imported from commit 2b110dc27334e4b823810bfef13c3d10d36b3886)
2013-05-21 17:56:49 -04:00
Zev Benjamin d1ac16ee3f Record compose metrics
(imported from commit 194a7d36650cf3e1e52f0dad3f453942179de122)
2013-05-21 17:56:49 -04:00
Zev Benjamin c60a500a8f Track what user action triggered a compose
(imported from commit 3e23dd1f7e9e3a742b0c3b9e1b0eeb85cfa4c736)
2013-05-21 17:56:49 -04:00
Zev Benjamin a4bda36ab4 Add a wrapper to mixpanel so that we can selectively enable metrics collection
(imported from commit 1d72f2e98c4c756a8a988d08731282e4195b8e1a)
2013-05-21 17:56:49 -04:00
Waseem Daher 179b9a7e1f Make our landing page look good on wide monitors.
Constrain the meat of the page to the center 1440px or so.
This is achieved in a slightly more hackish way than I'd like,
but I think it's mostly necessary if you want the long color
bars that extend beyond that main area.

(I encourage you to view this diff with -w)

(imported from commit 10bf4462411146090b0147218d51cc444c3c91a2)
2013-05-21 17:39:14 -04:00
Steve Howell 5e64b9e90b Fix screen geometry for the tab bar.
Use tab_bar_underpadding to find out the top of viewport
that we can view.  Also, eliminate effective_page_size().

(imported from commit 0e2d777790552e77d635989e496f3446cefccb1e)
2013-05-21 14:45:38 -04:00
Jessica McKellar 3e30ccfc74 Style the message edit form.
(imported from commit ddbdb3b90c421ed25b781a172a8fac2581ffb65c)
2013-05-21 14:19:56 -04:00
Jessica McKellar d8afec5cf2 Turn the edit message Save and Cancel links into buttons.
(imported from commit 7892b48269181ca7b7998ac2693202e7cdd24197)
2013-05-21 14:19:56 -04:00
Jessica McKellar 8609c59781 Only show edit subject hint on messages you sent.
(imported from commit 613a023bf22b07f879864690142e9d5e0a56f0ef)
2013-05-21 14:19:56 -04:00
Jessica McKellar f4b99c8177 Fix that you have to save an edited message twice to complete the edit.
(imported from commit 87226d857845c6f16cb3bc0d6ab5bb748aca5987)
2013-05-21 11:04:56 -04:00
Jessica McKellar a6a3110bfb Encourage users to edit placeholder subjects with an edit icon.
(imported from commit 0bfe67876b237ea2fb4f523b23b9cdbbd9a4027a)
2013-05-21 11:04:56 -04:00
Jessica McKellar a3b6758315 Give a placeholder subject when users don't supply one.
(imported from commit ac6f0f7029c6a96c4c20562b02bee656436c70b2)
2013-05-21 11:04:54 -04:00
Jessica McKellar 17842cebd7 Make the subject box even smaller, to encourage shorter subjects.
(imported from commit b01d23db926972fa1618ef830936d65806d6c18d)
2013-05-21 10:24:47 -04:00
Leo Franchi 53415e6986 Restore narrow icon in crumbbar
(imported from commit 0c54d158f0035bb0e483a981b57e59a4e885e36a)
2013-05-20 23:55:03 -04:00
Steve Howell 33dd01885a Fix autoscroll to use ui.message_viewport_info().
This will make it automatically work if we add new tab
bar like things.  The current version of ui.message_viewport_info()
is slightly broken; that's a separate fix.

(imported from commit fa1906b738433223831250e3191dfd8e87d67daf)
2013-05-20 23:55:03 -04:00
Steve Howell 8738f330c5 Fix lint error in unread.js.
(imported from commit 2b6736dfbd03cb8de93ab9e38f471430bdcf6d61)
2013-05-20 23:42:22 -04:00
Steve Howell 62d6360a48 Extracted model code out to unread.js.
Most of the model logic pertaining to unread counts had been in
zephyr.js, along with a couple global variables.  Now the code
is encapsulated in unread.js.  It was a pretty straightforward
extraction with some minor method name changes.  Also, a small
bit of the logic had also been in stream_list.js.

Conflicts:
	tools/jslint/check-all.js

(imported from commit f0abdd48f26ab20c5beaef203479eb5a70dacfff)
2013-05-20 23:42:11 -04:00
Steve Howell c587a18646 Animate "Private messages" when new private messages come in.
Set the background behind "Private messages" to green whenever
a user's unread count goes up for private messages.  Remove
the background after 3s.  Advanced browsers will fade the
green in and out over 6s (3s up, 3s down).

(imported from commit 80ed9661d9eec1d697f3259854037d7e145615cd)
2013-05-20 23:41:40 -04:00
Tim Abbott fc5949d9b7 Properly quote subject value in message edit form.
(imported from commit aa81b300c4528ffe751348578008c8bee22ac6ae)
2013-05-20 23:41:35 -04:00
Tim Abbott 2bdecd130a Add user interface frontend for editing messages.
The only known outstanding bug with this is that it doesn't properly
handle the updating of a message's highlighting/presence in a narrowed
view (e.g. in theory, a message should disappear if it is edited such
that its subject doesn't match your narrow or it no longer matches
your search).  I think I'll just open a trac ticket about that once
this is merged, since it's a little hairy to deal with and kinda a
marginal use case.

Also it's not pretty, but that should be easy to tweak once we get the
framework merged.

Conflicts:
	tools/jslint/check-all.js

(imported from commit 2d0e3a440bcd885546bd8e28aff97bf379649950)
2013-05-20 23:40:57 -04:00
Tim Abbott d467a93877 Add support for updating messages after they've been received.
Currently the interface for editing messages is limited to a
command-line API tool; it's great for testing with e.g.:

./api/examples/edit-message --message=348135 --content="test $(date +%s)" --site=http://localhost:9991 --subject="test"

The next commit will add a user interface for actually doing the editing.

(imported from commit bdd408cec2946f31c2292e44f724f96ed5938791)
2013-05-20 23:40:26 -04:00
Luke Faraone 83508e8136 Enable two additional vector icons.
(imported from commit a14bc26114ab65afa65011366017162a99cdaf62)
2013-05-20 23:40:21 -04:00
Allen Rabinovich 93a2e23e96 Change the layout of the message boxes in the message pane and make other message-related adjustments.
Specifically:
   * Leave the avatar image as inline and round it.
   * Move timestamp to the left column.
   * Replace the "Info" link with a permanent info sign.
   * Move the pointer bar to the left.
   * Remove borders
   * Change selection background colors, and PM colors.
   * Introduce the "narrowing" icon into our FontAwesome set.
   * Modify the tests to account for the new "narrowing" icon and fixed a bug in star-finding.
   * Clean up CSS and add a more prominent color to private messages

(imported from commit 8a8d6de8acccc52c0d16f5d1ce31aabdc72c88c8)
2013-05-20 23:40:17 -04:00
Allen Rabinovich dc738d01a4 Added new "narrow" icon to FontAwesome and placed it in the message headers and composition pane header.
(imported from commit e8f927f464f78b680a03e1647128541abe872cde)
2013-05-20 23:40:12 -04:00
Steve Howell bafbc777e8 Allow scrolling during compose.
(imported from commit 0e39ba2048e7f0d2d91cc48f13e07fc69a5c4fc1)
2013-05-20 23:37:57 -04:00
Steve Howell 4ce6a6ea25 Fix auto-scrolling by not calling within_viewport.
The geometry used by within_viewport() is a little off to
begin with, but we don't want to check it at all in this
situation, because if the last messages falls out of the
viewport, we still want to scroll.  The relevant thing
to check is that available_space_for_scroll exceeds zero.

(imported from commit a0a6f0d23db2eab8d9f22fc9ad523031cf7f7ec2)
2013-05-20 23:37:57 -04:00
Steve Howell ecd3903007 Fix geometry for autoscrolling (part 1).
The prior code was subtracting out the compose box from the
calculation of available_place_for_scroll, which didn't make
sense when the compose box is at the bottom of the screen
and you're scrolling the current message up.  You could see
the symptom pretty clearly by seeing autoscroll stop exactly
the height of the compose box from the top.

(imported from commit cfceb85c8be80cca957ac4a3ad0bbf0de7425c48)
2013-05-20 23:37:57 -04:00
Steve Howell c2104e36c9 Fix geometry calculation for visible unread messages.
(imported from commit 91e5a6b83919c4cd935ea5e7586d84cc7a559cf6)
2013-05-20 23:37:57 -04:00
Leo Franchi a6486a1fa0 Add a tab bar at the top of the Message list to aid navigation
The intent is that this will also make it easier to tell when you are narrowed.

(imported from commit 5e37721fbad304d30fc725aacf2cc9e6560e9da2)
2013-05-20 23:37:57 -04:00
Luke Faraone 7ff3cd49af Update CSS to ensure that only the icons in the sidebar are coloured black.
(imported from commit 67e7cb12bec5361f75b80f25b5a5b821007042d1)
2013-05-20 23:29:56 -04:00
Luke Faraone 1bffb146f8 Revert "Make all fontawesome fonts black by default."
Otherwise the stars and info icons are no longer green.

This reverts commit f0571fc9e3005a4f2975174f230f77fed17adcfd.

(imported from commit fdf3c54dbba53917fe300ddbb641408edaddc44f)
2013-05-20 23:29:56 -04:00
Steve Howell 69977ce825 Fix unread count in favicon when focusing window.
This fixes a pretty subtle bug where the window-focus handler
wasn't updating the unread counts in the title, but it was
hard to notice, because as soon as you moved the mouse, the
problem fixed itself.

Apart from fixing the bug, this patch eliminates the expensive
mouseover handler, which is a big win.

The fix to the window-focus involved some unrelated cleanup.  I
decoupled update_title_count() from received_messages(), as the
former method will probably live somewhere else soon.

Also, in order to get window-focus to update the title count,
I went pretty deep in the stack and added a call to
update_title_count() inside of update_unread_counts().  This
fixes window-focus as well as restoring that behavior to
code paths that were calling received_messages().

You'll see that call to update_title_count() is now adjacent
to the call to update_dom_with_unread_counts(), which is
fairly sensible, but then are calls to similar methods like
notifications.received_messages() that happen higher up in
the call chain, which seems kind of inconsistent to me.  I
also don't like the fact that you have to go through a
mostly model-based function to get to view-based stuff, so
there are some refactorings coming.

(imported from commit 2261450f205f1aa81d30194b371a1c5ac6a7bdec)
2013-05-20 23:29:56 -04:00
Waseem Daher 4480693f1a Signup page to collect beta customer info.
(imported from commit ce4e860aa6781aa74ca954c79ae133aa50a057f1)
2013-05-20 23:29:55 -04:00
Waseem Daher 8862efc964 Add a Humbug landing page at /hello.
Windows, Mac, iPhone, Browser icons from http://www.endlessicons.com/ and modified
Macbook Air image from http://psdsonar.com/macbook-air-free-psd/ and modified
Linux icon from Wikimedia Commons and modified
Android icon from Wikimedia Commons and modified

(imported from commit 3cf8617cf49a833b706a2ff78b986e28c21e26cc)
2013-05-20 23:29:55 -04:00
Steve Howell f146362ea9 Simplified streamlist code.
I renamed set_count_internal to update_count_in_dom, because "internal"
was redundant in terms of saying the function was private, and it misled
me into thinking it was internal-only in impact, but it actually updates
the DOM.

I also removed the synchronous callback functions, since they both
led to simply hiding the count_span and clearing the text of the
value_span.

(imported from commit dea27d6414dc1b33818b24662f8246d687530b71)
2013-05-20 23:29:54 -04:00
Zev Benjamin 26b1192445 Defer some Javascript initialization code until the DOM is ready
This allows us to load our own code before most dependencies are
loaded.  Our compiled Handlebars files still need the Handlebars
runtime, so we can't move all of our minified code before
dependencies yet.

(imported from commit e2d0fa13f05a08fc3c2519790f7382e5eef6eca2)
2013-05-20 23:29:53 -04:00
Zev Benjamin f0f6af2b45 Don't try to show the user blueslip messages if ui.js hasn't been loaded yet
The user will probably get another error message later, anyway.

(imported from commit 4f52925600826366a8349fefc85d43b6e1923087)
2013-05-20 23:29:53 -04:00
Tim Abbott 1df794efdc Don't use all_msg_list to memoize add_message_metadata.
The problem is that if you load a browser window in a stream narrow,
add_message_metadata will be called for the messages in the narrowed
view before it is called for the messages going into the main view
(thus inserting them into all_msg_list), resulting in duplicate
copies of messages.

This would be mostly OK except that we call
process_message_for_recent_subjects inside add_message_metadata, and
that function assumes it is only called once on each message
(otherwise it'll double-count the message).

(imported from commit a3e7f85874100cd93a6d07684605da04d9cc80c7)
2013-05-20 23:29:53 -04:00
Steve Howell 64fffc5b23 Account for navbar/composebox/etc. in determining visible messages.
Created a function message_viewport_info() to return more accurate
effective viewport info and called it from process_visible_unread_messages().
Also killed off a tiny bit of dead code in process_visible_unread_messages().

(imported from commit 985fcf2fb447dbf1026e2de37574c255a9bd6196)
2013-05-20 23:29:53 -04:00
Steve Howell e744c0ced6 Ensure we process visible messages on narrowing event.
Whenever we get a narrowing event, it's possible for new messages
to appear visible, and we need to call process_visible_unread_messages().
This has been a bug, but it's mostly obscured by the fact that we
call process_visible_unread_messages() as part of focus/scrolling
events.

(imported from commit b9447977f8e2272d45865ca67b436cacafd58a03)
2013-05-20 23:29:53 -04:00
Luke Faraone 3f37f88255 Grey out sidebar streams if they're not in the home view.
(imported from commit 4fdd1cb13ba36264803facb59ecf05c40056a59a)
2013-05-20 23:29:53 -04:00
Luke Faraone f9b82f2ab8 Add a dropdown menu to the sidebar.
This allows you to compose to a stream, narrow, or hide it from your home
view.

(imported from commit 183eb85af3401de592bae61a61409ffcc116eb45)
2013-05-20 23:29:52 -04:00
Luke Faraone e3163e8cc2 Make all fontawesome fonts black by default.
This makes it consistent with Bootstrap's halflings.

(imported from commit c8f958ca973175b6a7941b534ac13ccab231da9d)
2013-05-20 23:29:52 -04:00
Luke Faraone 6dc3ef5ea8 Break out toggling a stream in the home view into a separate export.
(imported from commit 175b5f47685e60100d6fb7c4f9c4c18ffbe12cbe)
2013-05-20 23:29:52 -04:00
acrefoot 6b8e9a738f No more wordwrap on pre blocks for humbugs with code in them
(imported from commit e894133c2e1dc3934ec5cadc2341e38ed537a96a)
2013-05-17 01:02:35 -04:00
Zev Benjamin 60e479bdf1 search: Parse quoted strings as single tokens
(imported from commit 252f2657881ad4184a2564d16bf11558613efead)
2013-05-17 01:02:34 -04:00
Zev Benjamin aa761aad1a Placate the closure compiler
This works fine on prod, but after a new install-server, the closure
compiler complains about a side-effect-free for loop init.

(imported from commit aa0e4d788abe4c819d4d912d6a526fab4f676675)
2013-05-17 01:02:34 -04:00
acrefoot 47c8062e2f Compose box doesn't reply, and remove new stream/PM buttons
This removes the large "New stream message" and "New private message"
from the left sidebar. It also makes the default action when clicking
inside the composebox the same as the "New stream message" button used to
do (instead of replying to the stream-subject pair at the current cursor).

(imported from commit 316f03a35b781aca4c42555f74b99c4332ff42de)
2013-05-17 01:02:33 -04:00
Allen Rabinovich 93b66737ce Update Source Sans to include all available glyphs, and fix the block quote thin font issue.
(imported from commit c9c82268ac08d3b603021b35c1075118a02b06eb)
2013-05-17 01:02:32 -04:00
Steve Howell 763782a6f0 Isolate stream_list.js's DOM manipulation when updating unread counts.
This refactoring basically splits off two functions from update_unread_counts(),
which then becomes a simple three-liner.

The function get_unread_counts() is extracted, and it's purely functional
computation.  It paves the way for a more pull-based approach to getting "unread"
counts, where other parts of the program can just call it to get values as
needed without worrying about side effects.  It is staying in zephyr.js for
now.

The other function is stream_list.update_dom_with_unread_counts(), which
has a new home in stream_list.js.  It handles all the DOM manipulation
aspect of unread counts in the left pane, mostly by delegating to smaller
functions within stream_list.  Some of those smaller functions can now
be turned into private methods FWIW, but I'm not sure it's worth the
trouble.

(imported from commit 799f9ebbaed8d530829a4741ef14be04bd8abf5a)
2013-05-14 15:21:27 -04:00
Steve Howell f024a7ab14 Call process_loaded_for_unread() more directly.
This is a prefactoring to eventually eliminate the home_unread_messages
global variable.  More commits to follow.

In order to set up process_loaded_for_unread() not to modify
global variable to get its job done, we want to pull it out of
add_messages(), so that add_messages() doesn't have to pass back
state to the 9 different places in the codebase where it's called.
There are only 2 places where process_loaded_for_unread() get
called after this commit.

In order to facilitate pulling up process_loaded_for_unread(), I
made it so that the contract for add_messages() was to accept
already-hydrated messages.  This way I could hydrate the messages
before calling process_loaded_for_unread() without have to
worry about double-caching them in add_messages.  This will
slightly improve performance, but it was mostly done for code
clarity.

(imported from commit ad5aaad5b1f22c31647370f4c9dcb5f89d7d99a7)
2013-05-14 15:21:27 -04:00
Jessica McKellar 8a3f51dca0 Put a prominent Feedback icon to the right of your feed.
(imported from commit a18cb1f73d342a683515270956305ce387b3af19)
2013-05-14 13:43:58 -04:00
Tim Abbott a4c5c24029 Use the event system to sync onboarding steps across browser tabs.
(imported from commit 29311390133aca8f3a3d79fbe06dbbcabc4fb6ea)
2013-05-14 10:27:40 -04:00
Jessica McKellar 976ceb2a1d Display onboarding steps, waiting until after the tutorial for new users.
(imported from commit 2b6a1cfdad98349995c48c376caede64ed391241)
2013-05-14 10:27:40 -04:00
Jessica McKellar bd9d7bb2dc Update onboarding checklist on message sends.
(imported from commit 0d7f8b53432b22c7d3593fe51e7f0cdd8e13c8ba)
2013-05-14 10:27:40 -04:00
Jessica McKellar f37540bbda Add onboarding UI functions for displaying and completing setup items.
(imported from commit 9ba9cb09d5ad2845ceeda436f89f7d22a19c3fbc)
2013-05-14 10:27:40 -04:00
Jessica McKellar 76a57e78ed Enumerate onboarding steps client-side, and give a way to update them.
(imported from commit 0a993976e898cdb20ebb814a19d520572ef8b7e6)
2013-05-14 10:27:39 -04:00
Jessica McKellar bfdf3bceae templates: Add a popover with tab pinning instructions.
We'll pop this up in an onboarding checklist step.

(imported from commit b3ef325bc7551de814f8dd88e5c18775218eb54e)
2013-05-14 10:27:39 -04:00
Jessica McKellar 4dd0a3d1be Add space for an onboarding checklist in the right sidebar.
(imported from commit 69f1c14f4050de8e527a7044f5f9cf90bc7b4a59)
2013-05-14 10:27:39 -04:00
Jessica McKellar 0304014274 fonts: Enumerate empty and full checkmarks.
We'll use this in an onboarding checklist.

(imported from commit 511602b0afb7a024fc2137617ac22475a600b981)
2013-05-14 10:27:39 -04:00
Tim Abbott f87e62a8f3 Show unread counts for the home view in the left sidebar.
(imported from commit e56da93c45dff30ae150b0da676bab2278d25718)
2013-05-13 11:58:58 -04:00
Tim Abbott 14feac48e7 All PMs are in the home view.
(imported from commit c5e1a06fe39322f6065f2e56ef00b5f2f0e8aaf0)
2013-05-13 11:58:58 -04:00
Tim Abbott 8f29a39991 Remove the newer_than_pointer_count hack in unread accounting.
This was a workaround for a number of other bugs we had, but at this
point just serves to make debugging more difficult.

(imported from commit 6662b7854c265bd8016f6c8ce75a095731211a45)
2013-05-13 11:58:58 -04:00
Tim Abbott b7e682b157 Fix home view unread counts being 1 lower than they should be.
(imported from commit c9f9a623e862eaf9cb38626318df855ef7bad993)
2013-05-13 11:58:58 -04:00
Tim Abbott 91f8768fb7 Fix private message unread counts never displaying.
(imported from commit fda193ceba36dba2cd7b0694e15d1b927365dc26)
2013-05-13 11:58:58 -04:00
Zev Benjamin 43794983e7 Fix a bug where the stream list would not get resorted if you unsubscribed and then subscribed from a stream
(imported from commit 9bde14f49d05062478fb5f356c24b29bedcdf3fc)
2013-05-13 11:44:56 -04:00
Zev Benjamin 7b3f5ed14c Add interface for creating and viewing bots
We really should not be storing bot API keys in the DOM and should
require some sort of additional authentication before showing them,
but this seems reasonable for a first pass.

(imported from commit c7d75aa52e21894bf53917457e771c18de38bbcc)
2013-05-11 02:38:32 -04:00
Jessica McKellar 237b1077ed Factor out recurring message flag update AJAX request.
(imported from commit 7c0986b33ce57f7a1c58500a0006daeaaea0c87b)
2013-05-10 18:00:57 -04:00
Jessica McKellar c7555c6cf9 Add support for completely collapsing messages through the info popover.
(imported from commit 0a01c4cc8f99019233659c175d73826e16cc95ee)
2013-05-10 18:00:57 -04:00
Waseem Daher e0f1949cb4 Grow the composebox when we click on it.
The idea here being: if there's only one line, it discourages
me from writing a long message (and also makes me think that
enter will send).

(imported from commit 424d8d305d1965ce3199ce3227dac94b395945bc)
2013-05-10 16:22:17 -04:00
Steve Howell 898a69f42a Fix Pagination when user hits PgUp/PgDn/Space. (ticket 1237)
This commit takes control of keyboard-based pagination away
from the browser, so that we can use the effective viewport
size as the amount to page, as well as keeping a little bit
of overlap from page to page.  There had been issues with
pagination for a while, but the introduction of the always-open
composebox particularly aggravated the situation.

(imported from commit 45b9b7d5a6b322230c9d55e1be0b763dbce06e2e)
2013-05-10 15:36:24 -04:00
Jessica McKellar 7ed8f2420a Align Enter sends message with checkbox.
This also saves us a little bit of vertical space.

(imported from commit b7740f93259eb4678bac9370f1090d2c02954be7)
2013-05-10 15:28:14 -04:00
Jessica McKellar 7e0dc7ab30 Make the compose box take less vertical space.
(imported from commit ca28485d3def93e9c8b3e4a257f05ff4fb74ea18)
2013-05-10 15:28:14 -04:00
Jessica McKellar dd837c3c9b Don't let closing a modal clear your compose content.
This is the easy way out -- our compose logic needs a refactor
eventually.

(imported from commit c82fc31cadbe9edbd50aba6f8446b4ba9a311055)
2013-05-10 15:28:14 -04:00
Steve Howell b35c102815 Fix typo regression on top_navbar (minor).
(imported from commit 69ac7d32db0eb382db30448c89a50319562a5881)
2013-05-10 14:13:24 -04:00
Steve Howell 85ded308e9 (Refactoring) Extracted get_new_heights() out of resizehandler()
(imported from commit 13707f0d188676b96d4cad1d091b447435a22229)
2013-05-10 13:31:47 -04:00
Leo Franchi 1267ffe542 Show unread counts next to expanded subject names
(imported from commit 6de1145cdec8d7e68395c1f9a7a95cd59136d805)
2013-05-09 10:41:32 -04:00
Tim Abbott 4968b804fa Change to the home tab when clicking stream filters in left sidebar.
(imported from commit c0cd7e233a29e2b2f2c348b8f977ea0d18e56fba)
2013-05-09 10:35:49 -04:00
Allen Rabinovich 2327bcd5ca Resetting .subscription_name line-height and adding padding-top to adjust vertical position
(imported from commit 067ac448dee9ff2fa4795ade1f99f8425d4bf28c)
2013-05-09 10:35:49 -04:00
Tim Abbott 8d6551e37d Send notifications when a message appears offscreen even if focused.
Previously we never sent desktop notifications when the browser was
focused, even if the message appeared offscreen.  After this commit
there are only a few cases when PM or other notifiable message doesn't
trigger a desktop notification:

(1) You sent it yourself
(2) It was onscreen when it arrived while your Humbug window had focus

(imported from commit e381c02c0e6794594d6934f57249a11ba2a88210)
2013-05-09 10:35:49 -04:00
Tim Abbott b1f75e8d3f Clean up notifications.received_messages.
This is trying to make the logic flow clear -- e.g. we check once, at
the beginning, for whether the message is notifiable, and the checks
for whether the various notification settings are enabled are more
parallel.

(imported from commit a68c71a53055191bc16682a85f739ed8e40ddeae)
2013-05-09 10:35:49 -04:00
Steve Howell 92d6e80d57 Fix bug with uploading the same file twice using the clip icon.
See #1234 for details.  When you upload files the old-school way
(no drag&drop), there was a bug where you couldn't upload the same
file twice, due to us intercepting the change event and not clearing
out the file list when we were done.  Tested on Chrome, but uses
a known IE workaround.

(imported from commit 8120c2e8bce41f3964f4f5c21aad3a85df0e433d)
2013-05-09 10:35:48 -04:00
Leo Franchi 4173862833 Send notification with missed message to users if they received a PM while offline
This is configurable in the user's settings on Humbug

(imported from commit 80bf6d7a6f0dc3811117548e2225865db8b533d9)
2013-05-09 10:35:48 -04:00
Steve Howell 13bc2e1859 Handle "REQUEST ENTITY TOO LARGE" during file uploads.
The filedrop library has a few canned errors, but it seems to mostly
let server errors come through.  We try to trap 413s to give a more
descriptive error than "unknown," but this is just a bandaid fix,
and we should see what's wrong with our prod configuration.

(imported from commit eac26406866d80340f24dbdca9f34408ddb92462)
2013-05-09 10:35:48 -04:00
Waseem Daher 567d04d386 Remove Glyphicons third-party dependency.
(imported from commit 4f5f4e915370f3631c558f8fd7feefc79c357e50)
2013-05-09 10:35:47 -04:00
Waseem Daher 0bcdee759e Use FontAwesome gear for settings icon.
(imported from commit fbcfd7fb94d7df34fec5dc49ab7deb366e6cf4d9)
2013-05-09 10:35:47 -04:00
Zev Benjamin 50fa22a3f9 Add utility for profiling iteration constructs
(imported from commit d4e55353475b86ba06da2d776fce2453cd33cc84)
2013-05-09 10:35:47 -04:00
Zev Benjamin 1b5fb31b2c Make viewport a module that caches height and width values
The .height() and .width() functions are actually pretty expensive for
the number of times we call them.  The viewport height and width
don't change often, though, so we can just cache them and recalculate
them on window resize.

(imported from commit 129fb8c058144125e2974f6b7967cd9f1a5c9ead)
2013-05-09 10:35:47 -04:00
Zev Benjamin 4de79cf723 Make within_viewport take the row offset and row height
The .height() and .width() functions are actually pretty expensive
for the number of times we call them.  The callers of within_viewport
already know the offset and height of the row, so we just pass them
in so the values don't have to be recalculated.

(imported from commit d1c077bd87463d695f0bbe337b6a8b04ac2d17ce)
2013-05-09 10:35:47 -04:00
Zev Benjamin 02dc15f426 Only re-render the streams list when the sort order has changed
(imported from commit 8122785097e2470e9e85f1f4c40bf1cd63264fa4)
2013-05-09 10:35:47 -04:00
Zev Benjamin 466beef6fe Optimize sort_narrow_list
The optimizations are:
* Sort over the list of subscriptions instead of the DOM li elements.
  This requires storing the li elements for each sub on the sub object.
* Do a bulk insert of the li elements instead of doing them one by one.

(imported from commit 1a987799930fc677e25f0bc2dcf66f83a4ac3163)
2013-05-09 10:35:47 -04:00
Zev Benjamin 45ba7c41e7 Don't generate a new favicon if we don't have to
(imported from commit 30e88dfddbdcd2343ce53270fece767d924c48f0)
2013-05-09 10:35:47 -04:00
Zev Benjamin ad6de0d401 Don't export several functions from stream_list.js unnecessarily
(imported from commit d8649259e07494fc70e5529e0cf627fdacc120a1)
2013-05-09 10:35:47 -04:00
Zev Benjamin 1f2529ba39 Do stream side-bar manipulation in event handlers
(imported from commit 27392dc6d05c6fa581c0370488e6baba0b11ce0f)
2013-05-09 10:35:46 -04:00
Zev Benjamin 7becd3e504 Move stream sidebar functions to their own module
(imported from commit 50771c1590eb3a0dbb151bf6a798bd14a4418857)
2013-05-09 10:35:46 -04:00
Zev Benjamin ceac6b0613 Fire events during different stages of subs.js subscription management
We now fire three events:
* subscription_add_done - fired when subs.js has finished handling a
  subscription_add event (all structures are set up, etc.)
* subscription_remove_done - fired when subs.js has finished handling a
  subscription_remove event
* sub_obj_created - fired when subs.js has created a sub object. This
  happens both when a new subscription is added and at page startup for
  all existing subscriptions

These events are fired whenever sub objects are created, even when
not tied to a subscription event.

(imported from commit a4863451f37e7fdbad480696b388ea788b01d6b9)
2013-05-09 10:35:46 -04:00
Zev Benjamin dc82d60c13 Remove no longer true comment
(imported from commit d06ce85ff76a8c9bd5691c004e9a77182ac295dd)
2013-05-09 10:35:46 -04:00
Waseem Daher 4892895d6b Additional always-visible-composebox fixups.
* Start a compose when we do a file upload
* Restore the "Formatting" and "Feedback" links.
* Dismiss composebox error messages when we defocus composebox

Realistically, the "correct" way to do this is not to have to
explicitly manage the composebox's state, as we do now -- it should
just be 100% visible and ready to send any time you click 'send'; it
shouldn't need to have first been composebox.start()ed.

(imported from commit 7f1725c229ed968a9b5500b25d600306173182a0)
2013-05-09 10:35:46 -04:00
Waseem Daher 8cb983ef5a Darken stream names in left sidebar.
(imported from commit 0ccc7940d7dabe31813d27fd7f77b7c75a11ab1c)
2013-05-09 10:35:46 -04:00
Steve Howell cee31a4f4e Fix unescaped angle brackets in search typeahead.
This was a pretty recent regression in the logic for
highlighting search typeaheads.

(imported from commit ba226f9cc7d6b09744ea07ef516fee280f23e048)
2013-05-09 10:35:46 -04:00
Allen Rabinovich 23c729a904 Switched to Source Sans Pro as the base font for the app and made a number of other cosmetic changes.
What changed:
   * Vector icons swapped in for the left sidebar buttons and filters
   * Lighter font weight in the stream filters list
   * Round color swatches in the stream filters list, with an inner shadow
   * Tighter line height in the individual messages in the message pane
   * Fixed button widths in the left sidebar (so the buttons are equal in width)

(imported from commit 337dc4a3d8e29945cfc8cfb9524ac76a7b038ad8)
2013-05-09 10:35:46 -04:00
Steve Howell 58c1110635 Put streams lower in typeaheads and kill off some dead code related to search
(imported from commit c7d50f44a4de6cc5049e51ef4b671cc49902c466)
2013-05-09 10:35:46 -04:00
Steve Howell 77d2d669de Fix highlighting for stream typeahead in compose box.
Recently the typeahead for streams in the compose box was modified so
that streams only matched queries when the query was a prefix to the
stream.  When that change was made, the old highlighting behavior
had been mistakenly left in place.  This commit fixes the highlighting.

(imported from commit b7ec33daba46978df58eb91306686a4f1a57c7fa)
2013-05-09 10:35:46 -04:00
Waseem Daher 328da1fa07 Assorted always-open-composebox fixes.
* Properly resize compose area when we cancel out of it.
* Re-enable clicking on 'reply' in popover.

(The issue with the latter is that clicking on "Reply" started
a reply and then bubbled up and triggered our code that canceled
a reply because you clicked out of the composebox.)

(imported from commit 25d0ea58b72d2ee246217baf3eb9cac58fc858f5)
2013-05-09 10:35:46 -04:00
Waseem Daher 9384870ffa Always-open composebox.
Really, the "correct" way to do this is to undo "scrolltheworld", and
then just have a compose div that always lives underneath the message
list div. (This will also allow us to deal much more reasonably with
the whole "Is the composebox in focus" thing.)

In the interest of prototyping something more rapidly, though, we
adopt the somewhat more hackish approach, with the understanding that
much of it will probably be simplified later.

(imported from commit e2754be155c522b6dac28e7b84c62bd2030217c8)
2013-05-09 10:35:46 -04:00
Steve Howell 96100bb42a Highlight search typeaheads for streams
(imported from commit e8725fe8c4f4985d46e48fdab5003e3e9def9bd1)
2013-05-09 10:35:46 -04:00
Steve Howell 667a47755e Highlight search typeaheads for senders
(imported from commit 80e16d47507b0c23103aa1e574961cc5e29cac6e)
2013-05-09 10:35:46 -04:00
Steve Howell e47b98df38 Highlight search typeaheads for private messages
(imported from commit e3c5525255c70e507f33f24fc305d4a268c87e42)
2013-05-09 10:35:46 -04:00
Steve Howell 8a8e7c22f1 Don't try to rebuild subjects for an unsubscribed stream.
(imported from commit 2fea180bd5c989cb9aac843c837200acb10ddbc6)
2013-05-09 10:35:45 -04:00
Steve Howell 64ba2864bc Match names w/prefix and turn off highlighting.
(imported from commit 4ebc4aba5d05173ad6b8176d47fdf062e23c1441)
2013-05-09 10:35:45 -04:00
Steve Howell 0f75cbd30f Match any word in stream for typeahead queries
(imported from commit bd6ee91ae880c7fb3dd118cd2f024820ced73466)
2013-05-09 10:35:45 -04:00
Steve Howell de8106d923 Refine search (sort people by # of pms, limit streams to prefix-only).
Also minor configuration changes and no need to clone list.

(imported from commit 9f9c7259ed479fc29cd66fe260d9d81017e5f48f)
2013-05-09 10:35:45 -04:00
Steve Howell 0164d9f757 Search typeahead has more suggestions and sorting.
(imported from commit 5386be57e7f0b820e1a9cbd166c9c43e5e72215b)
2013-05-09 10:35:45 -04:00
Waseem Daher a556265cf8 Only highlight "Humbug" when we actually mouse over it.
This demonstrates the important box-model difference between
margin and padding :)

(imported from commit 068414f9066da8175f07a9517a02e93cd2deebc7)
2013-05-07 11:47:13 -04:00
Zev Benjamin 26ea7e0897 Build the recent subjects list on demand
We previously kept the lists in the DOM for all streams and updated
them all when new messages arrived.  This was very expensive for
large numbers of streams, so we now just build the subject lists on
demand.

(imported from commit 937ad4322ce2014200aeae8645f79875f6af576e)
2013-05-07 11:47:13 -04:00
Zev Benjamin 8702d37028 Do narrow-related side-bar manipulation in event handlers
This commit also fixes a bug where "starred messages" wouldn't get
bolded when you narrowed to starred messages.  However, it also
introduces a regression where subjects aren't highlighted correctly
on load to a narrow which will be fixed shortly.

(imported from commit 411575d92762e41d04c1baf126c0ab1dfb4225a5)
2013-05-07 11:47:13 -04:00
Zev Benjamin ca95167da1 Move several initialization calls to after we've set up event handlers.
This will matter shortly as hashchange.initialize can call
narrow.activate(), which fires an event handler.

Really, I have no idea why we have these initialize() methods anyway
and we don't just do initialization on document.ready.

(imported from commit 3a6a80e1426b03439b95cae3f142a4b1c43125e9)
2013-05-07 11:47:13 -04:00
Zev Benjamin 43829b4288 Fire an event on narrow and unnarrow
(imported from commit f3e5e5435ea425c4d3887b43824e53a1c817fa6f)
2013-05-07 11:47:13 -04:00
Zev Benjamin beba14a86c Only call add_message_metadata once when receiving messages in a narrowed view
We memoize add_message_metadata by checking if the message is already
in the all_msg_list.  Therefore, we need to add messages to that
message list before we add it to the narrowed_msg_list.

(imported from commit 4346179376ef6f982162c02c6152a0d294bfb2c0)
2013-05-07 11:47:12 -04:00
Zev Benjamin 96129b1cf0 Speed up string comparison for sorting
The String.localeCompare function is really slow, at least partially
because it creates a locale-aware collator object each time.  So now,
when we can, we create and cache a locale-aware collator object.
However, this is not supported on most browsers, so we fall back to a
non-locale-aware comparison.  This is not ideal, but for now we are
mostly working with English-speaking customers.

(imported from commit 51aa02e3b9fe4a0ef0cb084874fe26e91c57f65e)
2013-05-07 11:47:12 -04:00
Leo Franchi 5e70253bf9 Only remove a filter when unsubscribing if subscribed
Addionally, print out a blueslip error instead of dying
if a stream id is accessed when there is no stream to get

(imported from commit 0d6466ca79312a4fb9a235f313303ac5246afb35)
2013-05-06 13:52:35 -04:00
Leo Franchi 57d5bcf1f8 Only update unread counts if you're subscribed to that stream
(imported from commit 100047ad6ca1818cdf1c19dfafd0b2e06d95e380)
2013-05-06 13:52:30 -04:00
Leo Franchi 0da2f51ddb Calculate presence information with delta between server timestamp
(imported from commit b4b367ed620878e6d01287cb1aaae0730c7475c8)
2013-05-06 13:52:23 -04:00
Jessica McKellar f6c4e6a22e Add a first pass at a features page.
(imported from commit a1ffd7b010085f842f8fc6e8af15358e913beb41)
2013-05-05 22:46:30 -04:00
Luke Faraone 6bc2d21b87 Make audible notifications a tunable.
This decouples from Chrome notifications, which gives us cross-platform
support in at least modern browsers.

We log this action so its replayable in our message logs.

This implements the model change indicated by the previous schema commit.

(imported from commit b21213cdde54f43670bbb0bf1f607147fc732b38)
2013-05-03 15:08:49 -07:00
Luke Faraone 734b91c8d4 Play a sound when you recieve a desktop notification in the app.
We test if the user supports sound in their browser, then determine which
sort of sound their browser supports.

When, whenever we show a desktop notification we also play a sound.

(imported from commit dae41e70a6e4f6ed60ffedaac546d77baee52675)
2013-05-03 15:08:48 -07:00
Steve Howell 6304a30257 Handle multiple casings of same subject in subject list. (#1227)
(imported from commit f1f675cd96a6d26c5b039d8f41c9373bc365cb45)
2013-05-03 14:28:23 -04:00
Tim Abbott 54ae352e83 Fix narrowing to a stream/subject pair when not subscribed.
(imported from commit 0ea2893dc6026df5316dd927f7d740c74dc2c02e)
2013-05-03 11:40:06 -04:00
Luke Faraone b77ca230ab Fix JS lint error in composebox_typeahead.js
(imported from commit a0008e895e439b37658d31449587d20763e52aa7)
2013-05-03 08:20:45 -07:00
Leo Franchi 9362731e4d Mark messages behind pointer as read when moving pointer
(imported from commit 7e1d3d7124aec239a8fdd24da4aab682a41ff435)
2013-05-03 11:14:47 -04:00
Leo Franchi 33eef54c5b Re-send unread message counts if XHR fails
(imported from commit 062e76ca7db177540ed4e9ab0d331b9ecc2ee5f1)
2013-05-03 11:14:46 -04:00
Steve Howell fa5a7fbf0b Force prefix match on stream typeahead in compose box.
(Also allow up to 3 matches.)

(imported from commit 88d707cedc88ab55685e6b03dbd7c87caa05057d)
2013-05-03 10:12:43 -04:00
Jeff Arnold 105fdc076b Reserve height=100 for images so that collapsing takes them into account
Addresses #1204

(imported from commit 9a1f4b13ab14c4b8fc4eab50178b9c28f477fcd7)
2013-05-02 18:53:34 -04:00
Jeff Arnold b33405d32c Make the terms page printable
(imported from commit 76e2e7e8f136c9cc1e5cc2ec6ee37bdf7212837b)
2013-05-02 16:10:03 -04:00
Tim Abbott 6b85eaf16f Only mark messages in all_msg_list as unread.
(imported from commit 8c76ee8be918beeea44e70cba702fa45abff2297)
2013-05-02 15:35:46 -04:00
Tim Abbott f6fb62ca93 Fix narrowing to stream names that don't exist.
(imported from commit 2d0ff1ffdf32eef6df56d6e9ab00c9c6e4e7ee6a)
2013-05-02 15:35:46 -04:00
Tim Abbott 03fe751005 Clarify confusing narrow-by-stream selection of active stream.
(imported from commit a90059ed62c47ac03bca0fa306adeca3ce577d43)
2013-05-02 15:35:46 -04:00
Tim Abbott 525a20de2e parse_narrow: Handle malformed narrow URLs gracefully.
Since they can't be parsed, probably the best thing to do is to send
the user to the home tab; we could add in showing an error message but
then we'd need a way to clear the error message -- better to just have
this work.

(imported from commit 67c0475ff06eb0431621eef60b9c50287a158232)
2013-05-02 15:35:46 -04:00
Tim Abbott 2c9c5f6093 Clean up code duplication when calling add_narrow_filter.
(imported from commit da397f015427e7c5b01fa1e89ba119ff87cda168)
2013-05-02 15:35:46 -04:00
Tim Abbott e7d04ff60f Fix encoding of narrows with '.' in the URIs.
(imported from commit fa624c0f810817b8093aeb4e3fb4329cad4cf9fb)
2013-05-02 15:35:45 -04:00
Steve Howell c02540bfa6 Show lock icon in compose box for invite-only streams (811)
(imported from commit c563fa605d850f39c3b3f0ae9530700f1d1b6e73)
2013-05-02 13:39:34 -04:00
Zev Benjamin ea55ed5ebb Use .attr() instead of .data() to access stream and subject names from the sidebar
The .data() method tries to coerce the value of the attribute into a
Javascript type, which is not what we want when the stream name looks
like a number or some other Javascript type.

(imported from commit a5f639d2ef98435cec6beacf3837fc185474a955)
2013-05-02 12:50:24 -04:00
Zev Benjamin 3b6713d545 Improve message_range's running time
We also now check that start != -1, as that is probably a mistake.

(imported from commit 7065ed40150fda7b373d137129c0944a8fa03fc1)
2013-05-02 12:03:18 -04:00
Zev Benjamin bea819e039 Don't mark all loaded messages before the pointer as read on page load
On page load, the scroll_finished function was being called and
scroll_start_message was -1.  This caused us to mark all messages
that we loaded through the messages initially visible as read.  This
was particularly problematic because message_range iterates over all
message ids between its two arguments.

(imported from commit d93209d466797939cc9dbdbe76d25a5b20195bd2)
2013-05-02 12:03:18 -04:00
Zev Benjamin 7c672e85a9 Look up stream sidebar elements by id
Previously we were doing quadratic work in the number of streams
because we had to iterate over all <li> elements every time we added
a new one.

(imported from commit 60cb97f77d161e9d8c3072157fa9c57c58f7af52)
2013-05-02 12:03:18 -04:00
Zev Benjamin 16cd33f756 Only pick a new color if the new subscription doesn't already have one
(imported from commit 7ccba8ab3ee52e81a8e553a43dce4c8bfc17f1fc)
2013-05-02 12:03:18 -04:00
Zev Benjamin 419f49c8be Cache the available colors instead of recomputing it each time we pick a new one
Since we pick a new color every time we add a new subscription and
recomputing the available colors was linear in the number of
subscriptions, we were doing quadratic work on page load.

(imported from commit 647ff3cb82f405755711da47701f005e7bc0023e)
2013-05-02 12:03:18 -04:00
Zev Benjamin 54bd4516ed Only update recent subjects after all messages in a batch have been processed
We were previously doing this on every message.  Because
update_recent_subjects is linear in the number of streams in the
sidebar, this became very slow when we enabled the streams sidebar
for the MIT realm.

(imported from commit 95cd71d83bbcc08cc6c5c79ca567b5d6b9b17173)
2013-05-02 12:03:18 -04:00
Zev Benjamin a640da16df Sort the streams side-bar only after all streams have been added
We were previously calling sort_narrow_list after each stream was was
added.  Because it is linear in the current length of the sidebar
list, we were doing quadratic work on page load.  When we enabled the
streams sidebar on the MIT realm, this became problematic because of
the number of subscriptions Zephyr users have.

(imported from commit d60ddc638f0a81fbce08eecd6671e9ea6ca38515)
2013-05-02 12:03:18 -04:00
Zev Benjamin ec3c0fffb7 Remove no longer true comment
(imported from commit 84c4e6bfbf16460efe5703e1a4213383a27fbe79)
2013-05-02 12:03:17 -04:00
Waseem Daher 5887d9c576 Condense messages in a fail-safe way.
Messages are now explicitly condensed by our JS, which means that if
we run into some bug where our JS doesn't run, you still see the whole
message (rather than getting a clipped message).

(As of this commit, this can happen when you, e.g. are on the
Settings page and someone sends you a message.)

(imported from commit f3bec97800ea1852c80203e73552ee545fcc7e8a)
2013-05-02 09:52:26 -04:00
Zev Benjamin e1c8d2f50f Return match_subject and match_content from messages_in_narrow()
This fixes a bug where if you were narrowed to a search and received
a new message that belonged in that search, the message would appear
to have an empty subject and content.

(imported from commit fe1dbf584d3659d57c5b70c7eb45cb22bbc9732f)
2013-05-01 21:52:04 -04:00
Leo Franchi d0b8a2fd21 Mark messages as read when using the End key
(imported from commit b2495cb27b1362d037e786db7f108540f2ce655b)
2013-05-01 17:26:19 -04:00
Waseem Daher 435098d001 Process message condensing in narrow.activate rather than hashchange.
Previously, we were having this problem where:
* You narrow to something
* That causes message_list.js:process_collapsing to run on all of the
  elements in the view, which changes some of their sizes
* That causes the pane to scroll and either push the content up or
  down, depending (since stuff on top of where you were is now a
  different size)
* That triggers keep_pointer_in_view, which moves your pointer

Moving process_collapsing into narrow.activate doesn't obviously
fix any of this, but it does seem to mitigate the issue a bit.

In particular, we (a) process it less frequently, and (b) process it
immediately after we show the narrowed view table, which seems to
reduce the raciness of the overall experience.

This does, however, introduce a regression:
* If you receive a long message when you're on
  #settings, e.g., and then go back to Home,
  the message does not properly get a [More] appended
  to it.

(imported from commit b1440d656cc7b71eca8af736f2f7b3aa7e0cca14)
2013-05-01 16:56:03 -04:00
Tim Abbott 9f0fc7c031 blueslip: Include window.location.href in error reports.
This can be useful for debugging what sort of narrow is happening in
addition to the URI decoding bug we're currently experiencing.

(imported from commit 0cb55fec4ac1afa986c747eb79236b4300c9e636)
2013-05-01 16:10:35 -04:00
Tim Abbott 57c5ea365a Enable the left sidebar for the MIT realm.
(imported from commit d69eba7fd7a95dd88892706c3d36485c71831864)
2013-04-30 18:38:13 -04:00
Tim Abbott 203fc55a7c Sort the narrow list better when there are more than 40 streams.
This shouldn't have any effect in normal realms, but for realms like
mit.edu that have large numbers of inactive streams, it will sort all
the streams that have had a recent message at the top (aka those that
aren't effectively inactive).

(imported from commit 027ce258d04b6fd58705e49f769dec7e0639bb38)
2013-04-30 18:38:13 -04:00
Zev Benjamin c08a86aeb9 Use server-highlighted subject and content when narrowed to a search
(imported from commit 0579193da040db77f9c7937d3714cb9ffeaf7ed8)
2013-04-30 11:40:27 -04:00