Commit Graph

116 Commits

Author SHA1 Message Date
Tim Abbott 10be8d2a12 compose: Fix loss of message fading on renarrow.
Previously, if you renarrowed, all message fading would be cleared
until you close and then reopen the compose box.

Fixes #1024.

(imported from commit 57981ba29ab597c4c84ca6e4e9d04a8284f49117)
2013-03-13 11:10:51 -04:00
Tim Abbott 012f0566a1 compose: Fade all relevant messages on the page, not just neighbors.
(imported from commit 69e11a980b9cbd69753754b9a42248ef0f3d5a21)
2013-03-13 11:10:51 -04:00
Zev Benjamin fb0dd60857 Simply compose.check_stream_existence now that one of its return values isn't used
(imported from commit 8c910032e8ffd12b9691138ce03ceb096156e3f2)
2013-03-13 10:55:33 -04:00
Zev Benjamin 054d377709 Make stream existance error actually go somewhere
The referenced element where the error was supposed to go was removed
in 66fd42914e4fc33719c4f21ad401748989f20b49.  Now the error message uses
the regular compose error message area.

(imported from commit c82a6d863fa327ba982157d0b0607545d7e65cb7)
2013-03-13 10:55:33 -04:00
Waseem Daher 932aeb86b5 Add a tiny visual indicator that the message is sending.
This fixes Trac #1035.

(imported from commit f8d179f6f5e59922fdc5391624c6efb3da59395d)
2013-03-06 12:09:00 -05:00
Luke Faraone 82d6039fdc Correct selector to apply to the descendants of .message_comp.
Previously we did the equivalent of a $('.message_comp').child('input'),
which does not search beyond the first level.

In addition, using a comma in a selector is essentially an AND, which
means the narrow search only applied to elements of the 'input' class.
So when debugging we saw a bunch of elements being selected and that hid
the bug for a bit.

Now we do a .find instead which will ensure we blur the correct
elements.

This closes trac #1045.

(imported from commit f44383ee9fc93406d031589ef914f5a003334ea7)
2013-03-06 11:22:04 -05:00
Tim Abbott 8160795cdc compose: Only blur text boxes in compose box on hide.
Previously, we blurred all input/text boxes, including e.g. the search
box.  This probably won't impact normal operation, but this can be a
problem for our automated frontend tests which tend to have different
timing than real life.

(imported from commit ea84312bea2aae99d51b48cede0746e7a5b6e76e)
2013-03-05 15:48:34 -05:00
Zev Benjamin 95309539bc Move same_{stream_and_subject,recipient,sender} into the util module
(imported from commit 0d79bc3ae29be16eba59acea8bc5fda2aba1d4de)
2013-03-05 12:45:12 -05:00
Tim Abbott 12bb641e9f Fade new messages that arrive while compose is open.
This might need to change after we merge zev's message list branch, but
it fixes the bug and performs well and isn't a lot of code.

And it has the nice property that it'll only fade messages within the
neighbors range, so there's no need to update the unfading code to
support this.

(imported from commit c562d7335bc5635c960321e1451e4ba0f4452ee9)
2013-03-04 17:29:16 -05:00
Keegan McAllister ac1c111489 Fill in default recipient when composing while narrowed
Fixes #977.

(imported from commit 1abe26d94d5179a3dd1e970224a36c63bba9ff48)
2013-03-01 14:10:51 -05:00
Jessica McKellar bfbdb94ecf reply fading: get the table from current_msg_list.
(imported from commit 88e504b989a6ee66d162edb424d27765bd5f2ba8)
2013-03-01 13:29:04 -05:00
Jessica McKellar c516ce98e9 Calculate neighbors for replying-to messages fades based on window height.
(imported from commit 522025f16655fc1aa9776f08e991aab05a407ad4)
2013-03-01 13:29:04 -05:00
Jessica McKellar 4e193377dd Fade out messages surrounding a reply message, to make mixing harder.
(imported from commit da150ad2f0877d058e1a60deb7a7632e52bd3533)
2013-02-27 15:02:47 -05:00
Jessica McKellar 015cfb594e compose: remove a recent bit of error handling for subscribe-and-send.
(imported from commit c22ae573904a4532386291e540b8a23dca389a82)
2013-02-21 22:31:25 -05:00
Jessica McKellar 41aa91d300 compose: give users an action to take on subscription errors.
(imported from commit 62b2500bb1993f70b8218cd58fb335de25b18480)
2013-02-21 22:31:25 -05:00
Luke O'Malley eec2487b9e Remove sub-and-send javascript and add 'X' to all error messages
(imported from commit 66fd42914e4fc33719c4f21ad401748989f20b49)
2013-02-21 22:31:23 -05:00
Keegan McAllister 56d183ea06 Remove lurk mode from web client and API examples
See #796.

(imported from commit e238ce571c3f30d8312b630df7048ad1d9cad6d2)
2013-02-21 15:11:10 -05:00
Zev Benjamin 9e9b4c8541 Make MessageList.selected_id an accessor method
(imported from commit 144d12ba8be2de02900ef06c3413f660144de8bf)
2013-02-21 13:29:17 -05:00
Zev Benjamin e9b915c2b9 Remove global selected_message_id and persistent_message_id variables
Each message list now has a selected message id.

(imported from commit 041abc54ea42c636c30e39df4a2e838bb830e1aa)
2013-02-21 13:29:17 -05:00
Waseem Daher af1327230a tutorial: A first draft of a tutorial.
Here I have a sketchy but functional framework for dealing with
all of the async stuff that a tutorial requires, and an early
draft of what such a tutorial might look like.

I could probably go and remove the first-run message, but I'll
keep it around for now in the unlikely event that something I
haven't anticipated goes wrong in starting up the tutorial.

(imported from commit de9779a66a1b3fe790082decb324c90ec180b39b)
2013-02-20 23:04:50 +00:00
Keegan McAllister ebbbc4d8c2 Apply stream bar color class to the compose window as well
(imported from commit 3c3f3d1073a95ceff74a571f1b2c985a7b820c8e)
2013-02-19 15:33:35 -05:00
Waseem Daher 2b7b39fe1f Make 'New stream' and 'New PM' buttons work when not on home tab.
This fixes Trac #898.

Prior to this commit, we only changed the tab to #home in
compose.start; i.e. when a compose was not already in progress. This
means that if the composebox was open and we were on the settings
page, clicking one of these buttons would not work.

(imported from commit aa88a605cdcb61d5b6a1ece6292001c5f5a19c66)
2013-02-17 17:45:53 -05:00
Tim Abbott 874309b959 Fix sending to stream names that are JSON strings.
(imported from commit 51ca1b577796a6f438d5bba4a9e8e0af3293b423)
2013-02-13 13:08:40 -05:00
Jessica McKellar ce0c43329b compose: split check_stream_for_send into into request and UI response functions.
In preparation for re-using the /json/subscriptions/exists request on
the subscriptions page.

(imported from commit 76eca95b952c4b60e583a050be711023ee5fedac)
2013-02-05 10:01:45 -05:00
Jacob Hurwitz 61acc58947 Add a notifications bar when there are additional messages out of view
(imported from commit 38fa78f63fd520d0b1f09921ba064cba010a6f99)
2013-02-02 01:16:25 -05:00
Keegan McAllister 02fd0fbb06 Don't strip leading/trailing whitespace from the compose box
Fixes #719, "Indenting four spaces doesn't create a code block in the first
paragraph".

(imported from commit 697535b2d25d7191b565d26b601bb98722794978)
2013-01-28 18:37:48 -05:00
Reid Barton 07edc87cb9 Fix subscribe-and-send
When not in lurk mode, lurk_stream is undefined which caused
lurk_stream.toLowerCase() to fail.

(imported from commit 63ce79083b55a37cb0455871237a76d724fbbbea)
2013-01-17 15:37:36 -05:00
Reid Barton 949dcbfbc7 Fix inverted logic for autofocus field in set_mode
This meant that the "New stream message" button would focus the wrong
text field.

(imported from commit 5e34f0fb936b94b8c1515e915e8059d19feba45e)
2013-01-16 16:04:17 -05:00
Reid Barton 2797a41fd8 Automatically subscribe on send when lurking
(imported from commit 636c07346e766615a0012e4532f35d328bb7984d)
2013-01-16 14:19:06 -05:00
Reid Barton 64ebbc6c73 Restrict lurk mode compose box stream to the lurk stream
(imported from commit f187f619fc77645a294ab4cb90baf802f55d3326)
2013-01-16 14:19:06 -05:00
Waseem Daher 7a6068c3ad Colorize the stream bar in the composebox based on where we're writing.
(imported from commit 8e9bddf465661826d63fe0f79e3f1bd6b903cf4d)
2013-01-15 17:22:47 -05:00
Waseem Daher 5b473a18c3 Have the "New stream/new PM" buttons no longer clear message contents.
If you're currently composing a message and you click one of those, it
now no longer clears out your old message contents, making it more
analogous to the job the old selector used to play.

(imported from commit b935a3bf307bdbd82f1ee7db31d3a3c89c623195)
2013-01-14 13:00:43 -05:00
Tyler Hallada b6e1024b69 Display composebox again upon server errors
Also removed .show()s for the alert on does-not-exist and not-subscribed, where
a blank error would display. This should fix the underlying issue with #166:
that hiding the composebox before send_message() was called would hide server
errors.

(imported from commit a8a50cdf82ddf1d15f1e405432ff3bbfdb7a491a)
2013-01-07 17:03:34 -05:00
Jeff Arnold 4feae6b202 Make the back button work for the settings and subscriptions pages
(imported from commit 650c884abc9514cdfc934ae01e0a490f5f681292)
2012-12-20 14:45:11 -05:00
Tyler Hallada d179de07f6 Clear the composebox on open instead of close
Variables like stream, subject, and message were getting cleared from the DOM
when the compose box was closed. The "Create and send" button was trying to
access these variables to create a new stream, but they were gone. Now they
are cleared when a new compose is started.

Fixes trac ticket #568.

(imported from commit 39ccaaeacb3f92f4b1d771be1b34ff660e0d5883)
2012-12-19 15:07:04 -05:00
Zev Benjamin 695d9a4dc6 Change get_updates_params.reload_pending to reload.is_pending() as the former no longer exists
(imported from commit fdc59a27230cb49adee2f5444e440aaa84103e5e)
2012-12-11 16:40:26 -05:00
Tim Abbott 72b9f25cbd Don't try to scroll to show composebox when no messages are showing.
(imported from commit 3835c7de0f3cad777b1fd5b609e9dc71635422ac)
2012-12-05 14:06:57 -05:00
Jeff Arnold 8d4ddeb57d Keep text in the compose box when another stream/subj is clicked on
(imported from commit f063c92c4378074a7b27e45787dd1591fdde98b7)
2012-12-05 13:12:52 -05:00
Jessica McKellar 37968bc9c7 If necessary, scroll to avoid occluding the message to which you are replying.
(imported from commit adf23d647a3d462d6236d8f1039da89a31b782d5)
2012-11-30 14:32:41 -05:00
Keegan McAllister c25d1ea8e7 Guard against incorrect use of compose.set_mode
(imported from commit 294441f2b9107ce2488866764c3d30c35133a14a)
2012-11-29 16:51:32 -05:00
Keegan McAllister 1047bf49b4 Replace compose.toggle_mode with compose.set_mode
This fixes a bug where you could click on the already-selected mode button, and
it would switch modes without changing which button is selected.

(imported from commit 263ee0b52ba844c52a3a60968bb1bbff73482412)
2012-11-29 16:51:32 -05:00
Keegan McAllister d55ccd32af Remove state machine code from hotkey.js
With the removal of process_compose_hotkey, the state machine now has only one
state.  Everything else is based on things like "is a text box focused right
now", which is probably a better approach.

(imported from commit 0e39c03956d28e30d2bdbf3b285410ad0cacca3e)
2012-11-29 16:51:32 -05:00
Zev Benjamin d8783cd0c0 Move reload in progress check from compose.show to compose.start
(imported from commit 8b84b24ca50a3bd149d67b868dd94908c0354022)
2012-11-26 14:42:27 -05:00
Zev Benjamin 85e2bf9030 Remove dead code. We keep the message type and client name in JS instead of the DOM now
(imported from commit 79834160c53a5f7d99918d629fde311aa99fe280)
2012-11-26 14:42:27 -05:00
Zev Benjamin 507a730f77 Make compose.show a private function
(imported from commit 32457fd7f045e9eb3febaed3de2dd1a4aebc9422)
2012-11-26 14:42:27 -05:00
Zev Benjamin e35ec6e022 Stop using Bootstrap tabs for compose
(imported from commit 39dfbf9c427aaf3a85507e26ffeb1257da3dc435)
2012-11-26 14:42:27 -05:00
Zev Benjamin 886bda2a45 Use accessors in compose.start
(imported from commit 82cc5dd5892b06a8490fcd40033212f28dca32b3)
2012-11-26 14:42:27 -05:00
Zev Benjamin 90e0fc6259 Module pattern for ui.js
(imported from commit 951984ec1006e93a0ffc7e299b52fa02c10eb976)
2012-11-19 23:31:22 -05:00
Tim Abbott 50995dc6b7 Fix showing the subscribe-and-send dialogue when you're subscribed.
This doesn't fully fix the problems related to not syncing
subscriptions to browser clients, but it does fix the instance that
everyone experiences.

(imported from commit be2bc31a7c4443c1678321f1a938496e2632c0d3)
2012-11-15 17:15:59 -05:00
Tim Abbott 411a7f6b4f [manual] send_message: Rename recipient/stream fields to 'to'.
This commit changes APIs and requires and update of all zephyr
mirroring bots to deploy properly.

(imported from commit 2672d2d07269379f7a865644aaeb6796d54183e1)
2012-11-15 15:30:06 -05:00