Commit Graph

5309 Commits

Author SHA1 Message Date
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 90e8281acc Fix bulk invite page to use new minifier
(imported from commit 5e965da26107f925eb6d04548059689a6f9542cf)
2013-07-12 13:42:26 -04:00
Scott Feeney 7859f8cfab Remove (Chrome only) text from Desktop notifications option
(imported from commit 2020c34e96f518e8e75e5818ee46af52f1333e6f)
2013-07-12 13:33:26 -04:00
Scott Feeney 27f120e01f Fix use of old JS compression tag in login template
Instead of `compressed_js` in the `compress` library, we now use
`minified_js` from the `minified_js` library. (CSS is not affected by
the change.)

(imported from commit 07aea9efbc83d30b354a7e044070563e93f7525a)
2013-07-12 13:33:13 -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
Leo Franchi bd837936ce Refactor json_invite_users into do_invite_users
(imported from commit 053274a1fcfbb93fba27d136b246b65b3491f549)
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 3942907eec Fix pathname in an update-deployment error message
(imported from commit 1f21593056d4a272c0ad9f7f16ed5664f9d393f1)
2013-07-12 11:59:11 -04:00
Scott Feeney 0f734fad2b Don't generate minified_assets.json
The new minification process no longer needs it.

(imported from commit cd192120f74f58b10165807903b3318ae0a2c2b6)
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
Scott Feeney 88d070e182 Convert update-prod-static from shell to Python
(imported from commit 6c362367776bbfa678632adde2379d6e8c0096f3)
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
Kevin Mehall 77aeee118b Check that message subject and content are nonempty on edit.
Fixes: Trac #1455, #1448
See also: Trac #213

(imported from commit 0d839da13ac22e1648b0d2a7cf09d1c1218b98ae)
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
Scott Feeney ccec989036 Set page_params.staging on anything that isn't a prod deploy
Until now, page_params.staging has been dependent on whether DEBUG =
True. On your local server, page_params.staging is true unless you set
DEBUG to False to test minification, in which case, it's false. This
situation still counts as staging IMHO, and the new behavior will be
more useful for testing as well as consistent.

Quick reference chart:

Is page_params.staging true...  without this commit?    with this commit?
                                --------------------    -----------------
On a local server, DEBUG=True          Yes                    Yes
On a local server, DEBUG=False          No                    Yes
On staging                             Yes                    Yes
On production                           No                     No

(imported from commit 6ea960e7945844dde0fbedbe901062508312b051)
2013-07-12 11:33:16 -04:00
Luke Faraone bc7ee2bd45 Make python-django-guardian a dependency according to puppet.
(imported from commit 05c53f714b0ac3e5f86d946c8ab6fb2eaac8827b)
2013-07-12 11:29:11 -04:00
Luke Faraone f70e7fadea Miscellaneous updates to install-server for wheezy compatibility.
We switch to always specifying HostKeyAlgorithms=ssh-rsa because of a ECDSA
key bug in the Debian images which results in the fingerprint not being
printed to the console. Our config later forces RSA after we do a puppet
apply, so we might as well start using RSA from the beginning.

We start out sshing in as "admin", and delete the user (moving keys over to
"root") at the beginning.

We switch to the ops repo instead of backports, and drop the installation
of puppet from backports.

We no longer install humbug-self-signed.key on our servers; instead real
certificates must be installed manually.

(imported from commit cbabe65a4e0ef37df1fece6eaec053a2368f6ef5)
2013-07-12 11:29:11 -04:00
Luke Faraone 011690e727 install-server's hostname check should be for 'is zulip in the domain?'
(imported from commit c2004edb46b5d9503899c56f13ad597f1972c3e1)
2013-07-12 11:29:02 -04:00
Leo Franchi eb0f8bda09 Ensure the last_reminder datatetime is tz-aware
I don't fully understand the need for this, but I have seen some
tracebacks on app that complain:

File "/home/humbug/humbug-deployments/2013-07-11-19-28-10/zephyr/lib/actions.py", line 1289, in handle_missedmessage_emails
    timestamp - user_profile.last_reminder < waitperiod):
TypeError: can't subtract offset-naive and offset-aware datetimes

Since timestamp in this case comes from timestamp_to_datetime
that explicitly sets the tzinfo, we know it's tz-aware. The only
other possibility is that user_profile.last_reminder is **not**
tz-aware, though I am not sure why that would be the case.

(imported from commit 67e33f4510e91fa9de504f0c610515581312c98b)
2013-07-12 09:57:09 -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
Kevin Mehall 219a72b3a0 bugdown linkify: Improve handling of email addresses.
* Allow email addresses surrounded by <>
  * Reject things that look like email addresses that have a path after them

This requires adding a new branch to the regex specifically for email addresses.

  * Fix comment whitespace

(imported from commit 0383cd4067ae9ee31f3802e6777a200ba1cbccd6)
2013-07-11 15:00:10 -04:00
Kevin Mehall 67f908e08c bugdown linkify: Fix links that have symbols directly before them.
Be more restrictive on what characters can be part of a URL and what
characters can precede a URL to prevent linkifying other strings that
come just before a valid URL. Allow : and , before a URL.

(imported from commit f072980b39ff652edf20de0585f256f072d04e88)
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
Waseem Daher 0adf687bfd Formatting help: Make the bulleted list a little more explicit.
(imported from commit 5a9c68949d285d12f6a44982722cf42f26cab285)
2013-07-11 14:35:50 -04:00
Waseem Daher 17013e950b Formatting help: Update @-mentions.
(imported from commit 08ec8b83afbdc46f2d693c0ee4d60b989b85b62e)
2013-07-11 14:35:50 -04:00
Waseem Daher d1780825bb Reverse order in formatting help.
This is how Reddit does it, and in a way I actually find
it more intuitive -- it's more x => y.

(imported from commit 79e06f8d85d07eea417b9e1ff2d792c3af3f6acc)
2013-07-11 14:35:50 -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
Leo Franchi 2d4ba0ed4b Set Reply-To to noreply@ explicitly in all required cases
It seems that even though we set the From to be <noreply@humbughq.com>
it's possible that when sending mail via Google it automatically sets
the From: field to be humbug@humbughq.com. Here we set Reply-To to noreply@
in all cases explicitly in order to avoid having replies sent to our
inboxes.

(imported from commit 5fa643be2b78fd632e310836bf1be862d6f1d333)
2013-07-10 17:38:37 -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