Commit Graph

96 Commits

Author SHA1 Message Date
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
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 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
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
Keegan McAllister 4cd5cdbcd6 Revert "Clean up how we deal with the message type tabs"
This reverts commit 429e055d3eca65af8bc0fe58481a7becf9ced66a.

There is some inconsistency between the names 'huddle' and 'personal' that is
breaking things.

(imported from commit 4c81853fca9d88d13ce8f23e2d6884c33cdc57d2)
2012-11-05 15:01:49 -05:00
Keegan McAllister 477bad9536 Clean up how we deal with the message type tabs
(imported from commit 429e055d3eca65af8bc0fe58481a7becf9ced66a)
2012-11-05 11:49:01 -05:00
Waseem Daher 765aa833bc Clean up jQuery selectors for the composebox send button.
(imported from commit 6bf7ee00f23290ae5e254b4964db3ed51527368b)
2012-10-31 16:36:22 -04:00
Waseem Daher e7e05d8617 Fix up some overzealous "instance->subject" renames.
(imported from commit f4ddcfd3749d374cc6abee3b1e7a5aacc3b83e16)
2012-10-30 16:48:00 -04:00
Zev Benjamin bdb0ac73a3 Manually validate before send
Validation was happening, but was not preventing sending.  We now
just manually call the validation function in compose.finish()
instead of relying on jquery.form's beforeSubmit option.

(imported from commit e094832bf8948f4c6f58cc0d0923bf0fd09db4b1)
2012-10-29 17:39:22 -04:00
Zev Benjamin 696a04743a Factor reload-related functionality into reload.js module
(imported from commit ef533f3416e8b406a03d28f67b45ca59523cef8e)
2012-10-29 17:38:44 -04:00
Zev Benjamin cee3f87585 Use compose.finish() instead of manually calling ajaxSubmit() in multiple places
(imported from commit 3bbe4a03171d9eace413b576ae2c7ccf99141bf1)
2012-10-29 13:58:40 -04:00
Keegan McAllister 899e6d1042 Resize the compose box on show
It doesn't work to do this immediately after we clear the contents, for some
reason.

(imported from commit b24e2464afc7a4703d4a679ab0b51ac150f1ce89)
2012-10-23 22:08:47 -04:00
Keegan McAllister af065005fc Automatically resize the compose box
(imported from commit 7e9cb632bdca47fee6ad0897a55d1d3c004c34b3)
2012-10-23 22:08:44 -04:00
Tim Abbott bf007776ce Fix selecting huddles using the mouse type-tabs.
(imported from commit 6b9981cf6d5a5aaf9d644a18cc04397f3cf0dead)
2012-10-20 10:35:39 -04:00
Zev Benjamin a80e08fbf3 Fix typo
It was preventing the right text area being focused on huddles

(imported from commit 8ebe457b4e5bce723e3afd9f396f97eeb0e97c46)
2012-10-19 17:04:28 -04:00
Zev Benjamin 9c2da407e6 Update the current composition type on toggle
This was preventing huddles from sending because clients thought they
were still sending a stream message.

(imported from commit 694b06cbc43adc9563327ebffccb7fa37aa36bac)
2012-10-19 17:00:27 -04:00
Zev Benjamin 337836ef54 Fix initial focus on new messages
(imported from commit 4553f6209362f684110b34e92fdba2046cfbb08e)
2012-10-19 16:17:29 -04:00