Commit Graph

2217 Commits

Author SHA1 Message Date
Zev Benjamin 347b222c79 Make the loading more messages indicator absolutely positioned
It now appears on top of message contents.

(imported from commit ac72a38f2a3062f7107db8125e11de78e40d927e)
2013-07-15 11:13:53 -04:00
Zev Benjamin c13c7f9661 Add support for absolutely positioned loading indicators
(imported from commit 749b1e866610c686c27cd0a5a492a04dc4d00bf6)
2013-07-15 11:13:53 -04:00
Zev Benjamin 3f7d01428c Only try to destroy a loading indicator once
This didn't /seem/ to be hurting anything before, but we really
shouldn't be doing it more than once.

(imported from commit 8d4ad7f8376227db723259ec9293262233b0a69a)
2013-07-15 11:13:53 -04:00
Zev Benjamin be0c29252e Make make_loading_indicator take its optional text via an options argument
(imported from commit 935f9049c00183f52bad80d54520f81efceb3e49)
2013-07-15 11:13:53 -04:00
Jessica McKellar b372c516cc Update the minimum message size, which is used in visible message calculations.
(imported from commit 196036b34596657c5a81250a05e1d650c41324b8)
2013-07-15 10:53:04 -04:00
Jessica McKellar 1acca8edfa Rewrite within_viewport much more cheaply using getBoundingClientRect.
(imported from commit b7a4434d426a258f89a276f472e71b04c1997df7)
2013-07-15 10:53:04 -04:00
Jessica McKellar 3ddf0187b9 Remove the narrow/unarrow opacity animation.
It increases the time to narrow without really helping indicate that
you are narrowed.

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

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

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

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

This resolves Trac ticket #1503.

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

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

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

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

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

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

(imported from commit d2e27dd4d8452df6ac48d44551802d7e65519115)
2013-07-12 14:33:39 -04:00
Leo Franchi e5b855d883 Add a bulk invite page for the first user in a realm
(imported from commit cf85c9d475209da4591e2f06f142008fb19ac9d5)
2013-07-12 13:07:02 -04:00
Scott Feeney ffa8541818 Remove vestigial parts of old minify code
(imported from commit 692e292528a1697687f1b3024c58371b2cf9b5c9)
2013-07-12 11:59:11 -04:00
Scott Feeney 2c33320746 Reuse minified JS from previous deploys
This is a big change affecting lots of areas:

* Pipeline no longer deals with JS (though it still minifies CSS)
* A new script, tools/minify-js (called from update-prod-static),
  minifies JavaScripts
* A command-line argument --prev-deploy, if passed to minify-js or
  update-prod-static, is used to copy minified JS from a previous
  deploy (i.e., a previous git checkout), if the source files have
  not changed
* update-deployment passes --prev-deploy
* Scripts are now included with the minified_js template tag, rather
  than Pipeline's compressed_js

Also, as a side benefit of this commit, our Handlebars templates will
no longer be copied into prod-static/ and accessible in production.

Unminification is probably broken, but, per Zev and Trac ticket #1377,
it wasn't working perfectly before this change either.

(Based on code review, this commit has been revised to:
 * Warn if git returns an error in minify-js
 * Add missing output redirects in update-prod-static
 * Use DEPLOY_ROOT instead of manually constructing that directory
 * Use old style formatting)

(imported from commit e67722ea252756db8519d5c0bd6a421d59374185)
2013-07-12 11:59:04 -04:00
Kevin Mehall 7f7843020d Show server errors in the message edit form.
Refactor common code from compose into a util function.

Trac #1455, #1448

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

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

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

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

(imported from commit 67e2d7f91ad62d8d7a2e212ee7c7121bd73f010b)
2013-07-11 16:48:23 -04:00
Waseem Daher b2fa0d4b9f Don't have huge left-and-right margins in less-wide windows.
Having a margin of 20px on both sides is rather overkill, especially
when the screen isn't super-wide. (And when it is super-wide, we can
control the width with max-width anyway.)

This actually doesn't really free up that much space -- the main
constraint actually seems to be the width of the column itself -- but
psychologically I feel like it feels a bit better.

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

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

Trac #1468

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

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

Trac #1464

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

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

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

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

(imported from commit ebb8a23bf34c52f9495aa88ceca8eb4458d50be1)
2013-07-10 13:21:08 -04:00
Kevin Mehall 54d85c68e2 Avoid the focus border around modals.
(imported from commit 9f0111f9d858ab2f058e2c75c8cb00a3716cdfed)
2013-07-10 12:31:32 -04:00
Kevin Mehall c190be38fe Make modals shrink to keep buttons on the screen.
This works down to about 330px height, and is probably about the
best you can do with current browsers in pure CSS.

See also: http://caniuse.com/#feat=viewport-units

Trac #786, Trac #1416

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

Trac #1476

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

(imported from commit f5f58844a9c2da4b4433489be1772263f3aba350)
2013-07-10 11:09:56 -04:00