Commit Graph

643 Commits

Author SHA1 Message Date
Jeff Arnold d473292f5c Make enter not submit the form in private message compose box
Fixes regression introduced by 97a438

(imported from commit 2da31fb7a742a317c9d6839ef7a1a5f887746dd3)
2012-11-14 10:27:52 -05:00
Jeff Arnold db34090f1f Now that we have proper escape support, tab can autocomplete
(imported from commit 28faff5416301dbc168e6ffcd0045df582961c9d)
2012-11-13 16:15:43 -05:00
Jeff Arnold 1d818db995 Make escape close just the open typeahead on Firefox, not the compose
(imported from commit 59dc10dbf9deb1b42240ae534da4ccc1ec2ef7df)
2012-11-13 16:15:43 -05:00
Zev Benjamin bb534f7a5f Missed a usage of the old get_old_messages API
(imported from commit 15d3e4bb40f9aa64e976de636a5bef6e694e00c9)
2012-11-13 16:06:46 -05:00
Zev Benjamin 195bdb07c9 Unify huddles and personals into private messages on the send path
Personals are now just private messages between two people (which
sometimes manifests as a private message with one recipient).  The
new message type on the send path is 'private'.  Note that the receive
path still has 'personal' and 'huddle' message types.

(imported from commit 97a438ef5c0b3db4eb3e6db674ea38a081265dd3)
2012-11-13 15:40:53 -05:00
Zev Benjamin 0c1cccc880 Use plain $.ajax instead of jquery.form for sending messages
(imported from commit 46651224dfb0b1b3b4903b30cba5385025da173c)
2012-11-13 15:40:53 -05:00
Zev Benjamin 33c23c0113 Use a JSON array for recipients in send_message
(imported from commit e2184f92b708cc2e8ef3e9ae79ee4241c0aa12a1)
2012-11-13 15:40:53 -05:00
Zev Benjamin b948473a45 Simplify get_old_messages API
It now takes an anchor message id, a number of messages before, and a
number of messages after.  The result always contains the anchor
message.

(imported from commit 84d070dc8091161c86d4bbeafbdc299493890a2a)
2012-11-13 15:40:53 -05:00
Waseem Daher c8e87e0e6a Unbreak ctrl-click and shift-click in Firefox.
We had this problem where clicking a hyperlink bubbles up and causes a
click on the message, which causes the composebox to open.

We "fixed" this by setting cancelBubble (or, even better, calling
stopPropagation()).

Unfortunately, on Firefox, this fix breaks Ctrl-click and Shift-click,
because those are (apparently) implemented by adding an event listener
on link clicks, and stopPropagation prevents them from being called.

We instead work around this by handling this case in the click handler
of the parent element. (This allows the normal URL click AND Firefox's
bound event handlers for Ctrl and Shift to run.)

This resolves Trac #374.

(imported from commit 16fb3aa6fc582f1fba5009812e0b1178ce7c5bb7)
2012-11-13 13:44:31 -05:00
Keegan McAllister 9bbe12c6cd Pause for 25 ms in between successful get_updates calls
(imported from commit e86c0b653669cf86b0d8956c2c85eb7610fc342f)
2012-11-13 10:59:02 -05:00
Jeff Arnold 488370b681 Fix various compose box bugs involving typeahead and field navigation
(imported from commit 08fe92794d566163bd935d43ec5bd7eb69978f90)
2012-11-12 18:04:31 -05:00
Waseem Daher d7f146ed4f Standardize on 'e', not 'event', within hotkey.js.
Mixing these two in this file is bound to lead to a world of hurt (and
has, historically). At some point I'd like to do this across the
entire codebase.

(imported from commit 9ff029597587f9c37a0bd9f32c25a769aa1a7a20)
2012-11-11 17:56:46 -05:00
Waseem Daher cdb31303fc Remove unused function.
(imported from commit 81ba1f66128f1e7f132ae3e1da3d81ad14d7ebe0)
2012-11-11 17:56:45 -05:00
Waseem Daher c5f3018431 Simplify hotkey handling when combinations are involved.
This makes the "handle hotkeys" code path a lot simpler, and also
fixes the "copy not working" issue we were seeing on Firefox 17.

(imported from commit 8ab96d12895da2876f60da58f373372612f4ba32)
2012-11-11 17:56:41 -05:00
Waseem Daher d76442c7e4 Process the whole key event through the hotkey handler, not just the key code.
(imported from commit c356dd09f7c2620c45d5bada61c0a5b261768888)
2012-11-11 16:35:45 -05:00
Jeff Arnold 5c7419307c Fix style mistakes we didn't catch the first time
(imported from commit ae1ca10ea8559702e4e73481715239ff456eca4b)
2012-11-11 13:24:44 -05:00
Jeff Arnold e7807742cb Pressing "enter" in the compose box fields should not submit the form
Resolves Trac #333

(imported from commit 2a824c5d38a6b53a425c72f5eb3534fe26d75faf)
2012-11-11 12:28:26 -05:00
Waseem Daher da571f16ff Fix "resizing window breaks in Firefox" issue.
So, in Firefox, $(window).width() does not include the width of the
scrollbar. However, the CSS media-query max-width DOES include the
width of the scrollbar -- so the Bootstrap change and our change do
not happen at the same time.

window.innerWidth does take into account the width of the scrollbar,
though, and seems to have reasonable cross-browser support, so we use
that instead.

(If we wanted to be slicker, we could use a media query a la
https://developer.mozilla.org/en-US/docs/DOM/window.matchMedia ,
but that's not supported in IE <10.)

This resolves Trac #35.

(imported from commit ca35321c02d5e79e4f9c439a662805c016a333ed)
2012-11-10 14:52:53 -05:00
Zev Benjamin c3a17de14c Don't switch to the not-composing state if the server did not accept our message
This fixes #349

(imported from commit 4e54f3ab3e9c91c5f23ccf22269775b01550f757)
2012-11-09 18:08:31 -05:00
Zev Benjamin d41fde7d92 Rename parameter for clarity
(imported from commit c69a5a57467664631ba812c5237641e0203e1aaa)
2012-11-09 18:08:31 -05:00
Zev Benjamin d980afcf25 Actually convert to JSON instead of hacking it with string concatenation
Old browsers might not have the global JSON object, so we may have to
include something like https://github.com/douglascrockford/JSON-js
for old browsers in the future.

(imported from commit e30a291d1212f2a00b543551b3a77082c7406eec)
2012-11-09 18:08:31 -05:00
Jeff Arnold c800186553 Make tab not autocomplete on the compose box subject field
(imported from commit 7b305a3ca5ae5864255c4eca5464560f92b708b0)
2012-11-09 17:57:20 -05:00
Waseem Daher cb0f48b59d Restyle subscriptions 'undo button' slightly.
Some stylistic tweaking to the solution to Trac #127.

(imported from commit 5f9a84c91716e6e57cce2cef1d8ca0915e4b135f)
2012-11-09 17:13:15 -05:00
Luke Faraone ed1caec147 Document the selctors in signup.js per trac #327
(imported from commit b21f5c4dbdc1b4dc5dbdc5a3152fdc8cbbb872ef)
2012-11-09 15:03:08 -05:00
Jessica McKellar 3af5e246be Don't cache your personal gravatar across gravatar updates.
(imported from commit 06f82faaa350db8a64cebef24b738b5e93bebb98)
2012-11-09 12:44:09 -05:00
Jessica McKellar 3df5d0faf3 Don't disable hotkeys on buttons in general -- just the send button.
The original check has become too broad now that we have more buttons,
and specifically this lets you use the search hotkey to start a new
search after you've been searching up and down.

(imported from commit 0e691ff55ff9d4be8d406d1eb47fc2062758d28b)
2012-11-09 11:44:06 -05:00
Luke Faraone 3928f763e9 Make unsubbing an undoable action.
(imported from commit 713fdad5aa5d138b9e95a14dccaeba0d9d612c1c)
2012-11-08 14:42:50 -05:00
Jessica McKellar 1801292320 Update autocomplete lists only on case-insensitive new additions.
That way your autocomplete isn't polluted by multiple casings of the
same subject.

(imported from commit 0f28029be45bb48981f2e29ccb9f1490c1a56c94)
2012-11-07 14:51:51 -05:00
Jessica McKellar a2c6975ca2 Be case-insensitive about subjects when collapsing and narrowing.
(imported from commit 0baf20179c037c3eac82d8db20c6ec8062bb136a)
2012-11-07 14:51:51 -05:00
Keegan McAllister 3b78280786 search_button_handler: Remove unnecessary id lookup
(imported from commit e6da0cfa0b39e48c63464eaf91673c3133ad4cd4)
2012-11-07 11:51:03 -05:00
Keegan McAllister 3de0a0d1dd Use rows.id consistently
(imported from commit 58098986b90609484e4a7c10688eeb27f2c126b2)
2012-11-07 11:51:03 -05:00
Keegan McAllister 644702892b Return an int from rows.id
I believe this is more correct for our one existing user,
update_selected_message.

(imported from commit a2f1a20c0d885a4e6de49c69d930844177549cbe)
2012-11-07 11:51:03 -05:00
Luke Faraone 8bcbe55238 Clarify line in hotkey.js per trac #253
(imported from commit d5bacdd4cef2f62ba22e3a47d25c3a656cf601c0)
2012-11-07 10:43:42 -05:00
Keegan McAllister bbb70b496b send_pointer_update: Use an absolute path for /json/update_pointer
(imported from commit 8711df3f705023e763cf916a7dfbf43054d4823f)
2012-11-06 17:04:10 -05:00
Keegan McAllister 3923e2eca6 subs: Use an absolute path for /json/subscriptions/list
(imported from commit 82a2de5373e9170b27f4157c566e7ee23ba1f278)
2012-11-06 17:04:10 -05:00
Keegan McAllister 5f20d71065 Rename people_hash -> people_set
And use 'true' for consistency with stream_list_as_set.

(imported from commit 1cfb0a64eae368388cb2e0e57162d3b3d5ef88c1)
2012-11-06 17:04:10 -05:00
Keegan McAllister 22dc487a72 Rename stream_list_hash -> stream_set
This makes the intent more clear, since the values are all 'true'.

(imported from commit 1f1d6e206af9f2258b55bc77e7722158c2ffac98)
2012-11-06 17:04:10 -05:00
Keegan McAllister 651566ba16 Use an Object for associative stream_list_hash, not an array
From the Google JavaScript Style Guide:

    If you need a map/hash use Object instead of Array in these cases because
    the features that you want are actually features of Object and not of Array.
    Array just happens to extend Object (like any other object in JS and
    therefore you might as well have used Date, RegExp or String).

(imported from commit 048e7a640137f3919c0097a421b7b6c366b65cfe)
2012-11-06 17:04:10 -05:00
Keegan McAllister 4f53457f2f show_all_messages: Use .empty() instead of .html("")
(imported from commit 8df159bee6512856fd61eb5038e4b12470724553)
2012-11-06 17:04:10 -05:00
Keegan McAllister d6d34075ab Remove duplication in message validation
NB: this does change which error will be flagged if multiple conditions apply.

(imported from commit 080bf7d764f1f16ad57b365ad9aa6bc48f3cff72)
2012-11-06 17:04:10 -05:00
Keegan McAllister 366ca546e8 compose: Remove duplicated code in getters / setters
(imported from commit 3a17ef6fbcf9b8b4a31a54656152a1d37dea4fa0)
2012-11-06 17:04:10 -05:00
Keegan McAllister fcf21177fe compose.start: Reformat default opts
(imported from commit e0266265dbe81d19f3a666b2f822dffd2d8793d5)
2012-11-06 17:04:09 -05:00
Zev Benjamin 58684965da Don't show the 'load more' button when the user has no messages
(imported from commit f763535480e5efcf0d345f22e076a97ba1f5809c)
2012-11-06 16:40:52 -05:00
Zev Benjamin c21a255b37 Hide the 'load more' button sooner if there are no more messages to load
(imported from commit ac046851c3a74a6f053e5f3c3b2950526a49cc46)
2012-11-06 16:40:52 -05:00
Zev Benjamin 39db8bf5d5 Use symbolic name for constant
(imported from commit cafb513c082b1ff1cf2169d90c3e4a77a9af5a9e)
2012-11-06 16:40:52 -05:00
Zev Benjamin 9875164908 Select the first ever message the user receives
(imported from commit 0fd6fa03175d9787a5e5a93d6172309a5eb47bfc)
2012-11-06 16:40:52 -05:00
Zev Benjamin df10d184a7 Only load initial messages if we know we will have some
(imported from commit af6bec8bdcd5dc1a643662e7531a3ec75298ffa0)
2012-11-06 16:40:52 -05:00
Jessica McKellar 4cad5f6e96 settings: Update name and gravatar without a reload.
(imported from commit 961c9f64d7c39b4345ece036062854e8d474d2c0)
2012-11-06 16:33:22 -05:00
Jessica McKellar 0700b96f37 Hover the sender name on gravatar and e-mail hovers as well.
This clarifies that clicking on any of those three pieces of
information will pop up the user info tooltip.

(imported from commit 1e57550d66acbb2e8d5d244d2997bbd394c334c3)
2012-11-06 16:33:21 -05:00
Waseem Daher c654520c73 Display email on currently moused-over message.
(imported from commit ae27dc6068fefa9df7b5a03992df0253da9ec61a)
2012-11-06 16:33:21 -05:00