Commit Graph

1607 Commits

Author SHA1 Message Date
Jessica McKellar 2fd3eb521c Refactor colorizing requests into a subscription properties model.
(imported from commit da4bfee4a12e941d4ec4c9f140973bb138c82c93)
2012-12-03 12:46:27 -05:00
Jessica McKellar 1dbb2c6ed5 decorators: split authenticated_json_view into POST and non-POST versions.
(imported from commit cdcfdb51c379c07e94ebc763cf925e6a73747fc0)
2012-12-03 12:46:27 -05:00
Jessica McKellar 6a316daee8 Add frontend support for colorizing streams.
(imported from commit 48395ba915d6b22d8a7a8c7fbfb5e462680cef09)
2012-12-03 12:46:27 -05:00
Jessica McKellar 505d35ac9b Add backend support for colorizing streams.
This includes JSON requests to fetch and set stream colors.

(imported from commit 92e19c9a3b72e9012df0178348068ea033b5f060)
2012-12-03 12:46:26 -05:00
Jessica McKellar 71371823f8 [schema] Add a StreamColor table.
(imported from commit 2906c30ad326373bc6265bf30dd0a70e11d69c7d)
2012-12-03 12:46:26 -05:00
Waseem Daher f71affdc11 Layout for colorizing streams.
(imported from commit 50d359ed44f46a0c666778bf510dafbb3e6e6f97)
2012-12-03 12:46:26 -05:00
Waseem Daher bbd2ea4c5a Add spectrum.js (color picker).
(imported from commit 7d25ecab2cb0126df0f165b6cce42a3b266b772c)
2012-12-03 12:46:26 -05:00
Tim Abbott 988b0ce7ba Fix missing transaction decorator in get_user_activity.
The transaction.commit() line inside the except IntegrityError clause
doesn't work unless we've entered transaction management.

(imported from commit 2ae520e05c9a19ec35af7c244631b01d4b9598d6)
2012-12-03 12:30:13 -05:00
Tim Abbott 79f8e2a6a3 get_public_streams: Return only streams someone is subscribed to.
This makes subscribing to zephyr classes for the zephyr class
mirroring bot a lot faster, since we don't need to subscribe to the
third of our streams on which no users will actually receive messages.

(imported from commit 029b7fb260b480db5599e3c9f9effc502f6d8b59)
2012-12-01 09:36:36 -05:00
Keegan McAllister aeb64959dd exunge_log: Ignore default_streams entries
(imported from commit e7b2cd62be0ba868498db286e9e1671441bf07e6)
2012-11-30 17:24:37 -05:00
Keegan McAllister 3715583d29 Implement a command to expunge old UserMessages and Messages from the database
(imported from commit a4873dfa8737c483411d12f30daaebebebf859f9)
2012-11-30 17:24:37 -05:00
Keegan McAllister c8b6e72cbf Implement a command to expunge old entries from log files
(imported from commit 28bc40bf12dd8cea0ff9b842f72e7713640e55a6)
2012-11-30 17:24:37 -05:00
Keegan McAllister 5caf67f27d Implement a framework for data retention policies
And add customer1.invalid to it.

(imported from commit 32b0293bc48abf5d9a3bd36f14f6b16d48ea6ff2)
2012-11-30 17:24:37 -05:00
Keegan McAllister 36816c46e2 Add a function to remove all Messages that are not referred to by any UserMessage
(imported from commit cdad013aed0fd8d1bc6ec8c2dcf5905390a01339)
2012-11-30 17:24:37 -05:00
Zev Benjamin c5bf05ad0a Make clicking on 'Find <search term>' work
(imported from commit 756bd6cb3533e985e031954ece9228a146c5160e)
2012-11-30 17:03:52 -05:00
Zev Benjamin 0af3199d7c Desynchronize web client reloads
(imported from commit 216df5996f597ccd47bbc80e3f2fdaae751789d0)
2012-11-30 15:04:46 -05:00
Zev Benjamin 46f4a5eb38 Add util module
(imported from commit 3844e136fb799c6f57f8823255addf00a07ef686)
2012-11-30 15:04:46 -05:00
Zev Benjamin d29c77b14c Name unconditional reload time constant and appropriately move its use
(imported from commit 5ead2dbe0f170f8b93e726de6d6ed10a985882ab)
2012-11-30 15:03:19 -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 83660d7020 mousewheel: Explain why the home_tab_active() check is outside throttled_mousewheelhandler
(imported from commit 6fd5504fb5fb0e72426fa60e051b7e912696b8c2)
2012-11-30 13:58:04 -05:00
Keegan McAllister 3ce4427614 ui.js: Whitespace fixes
(imported from commit d7bb9fe17e319f60f1cc65bdfd381dc2f5d25a3a)
2012-11-30 13:01:02 -05:00
Keegan McAllister ee17165ad5 ui.js: Simplify event setup
(imported from commit 96444a0776e6408eb7e885a630855a0f33e0b6ff)
2012-11-30 13:01:02 -05:00
Keegan McAllister 45e515cc20 Handle mousewheel events properly in modals, different tabs, and compose box
Fixes #109.

(imported from commit ebcc90deeba712296998bfaa2df46ec6be305219)
2012-11-30 13:01:01 -05:00
Keegan McAllister 11487a0fd8 Ignore hotkeys when a modal pop-up is visible
Fixes #382.

(imported from commit 50162fde211a88de5e7f410fd7b1ed0df12d6082)
2012-11-29 19:28:59 -05:00
Keegan McAllister cb7b2eec80 Prevent an animation glitch on showing the compose box
See added comment for details.

(imported from commit 0248500be07584729d03e2543100a320e0410eee)
2012-11-29 19:09:47 -05:00
Keegan McAllister 8cbb6ab95f Equalize the widths of the two columns in the formatting help table
(imported from commit f0a1c7216cfbee777eac4827209ab93c32056515)
2012-11-29 19:09:47 -05:00
Keegan McAllister 3d3e88ad2d Tweak code block examples
(imported from commit 4790e217320ad2dae0b85216321b11755b0ba88c)
2012-11-29 19:09:47 -05:00
Keegan McAllister 27a5d81134 Make the heading of a striped table more distinct
e.g. in formatting help

(imported from commit 0a4123c412689fb2f90985028bd7237fa6cdfb19)
2012-11-29 19:09:47 -05:00
Keegan McAllister 2aaeb6e44b Move the "Formatting help" link next to the send button
The tabindex on this link doesn't actually do anything, because of the Safari
tab workaround.  I added it anyway in case we remove that workaround later.

(imported from commit 11f31f2561907300b350c11732be88589d736f94)
2012-11-29 19:09:23 -05:00
Keegan McAllister f8d83af2f0 Move the send button into a <div>
So we can float other things along with it.

(imported from commit a01e554bdb3ab3187557244400954194149fb172)
2012-11-29 19:09:23 -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
Keegan McAllister 093c65fed2 Remove Tab hotkey to switch compose mode
Resolves #461.

(imported from commit 1ee64f0d6ca05064041e6619e8dbf1dc516c2c13)
2012-11-29 16:51:32 -05:00
Jeff Arnold 4c4e153ace When load_old_messages restarts itself, we need to repass all arguments
Fixes a bug introduced by e30e02c2

(imported from commit ca07eab76295ab1557f6866cff19debaec26e8c2)
2012-11-29 16:08:57 -05:00
Jeff Arnold 4a648e9e71 In the UI, call time travel "Narrow to messages around this time"
(imported from commit 4763f67c50bcf540959d9288c86ef854a4e66a1e)
2012-11-29 15:50:43 -05:00
Jeff Arnold 6670cf7b55 The load old messages "button" is now gone.
load_old_messages cares whether it is acting on behalf of a narrow
(for_narrow) not whether it is acting on behalf of a button push.

(imported from commit 16c00e015478f94f0631e211a92a7066a38135a8)
2012-11-29 14:18:38 -05:00
Jeff Arnold 50de4db2de Show the loading spinner when automatically loading more messages
(imported from commit 8025dde8696378bbb40b23a14204bfb489eb6798)
2012-11-29 14:18:38 -05:00
Waseem Daher fcc2fd5cdc Add ability to show/hide a "load more messages" spinner.
(imported from commit 611e53b2574ef50c9ab0a47fc2ebedd931a49dfd)
2012-11-29 14:18:38 -05:00
Jeff Arnold b52dbe1ca9 Auto-invoke "Load older messages" when at the top of the page
Resolves Trac #445

(imported from commit d7d96fe82e9e1cbef32e0dde284ce217e83aff55)
2012-11-29 14:18:38 -05:00
Zev Benjamin ec0fd19249 Always send back the server generation number when the client requests it
During long-polling mode, we were not passing the server generation
number back to the client even when they requested it.  This was
causing the web client to initiate reloads every time it got a
non-immediate return from a long-polling request.

(imported from commit 66c16bf5a1c18bdd975b09d672ebdb4db8d4755d)
2012-11-29 13:45:31 -05:00
Tim Abbott aba2192ec2 Restore the time-travel functionality with Waseem's UI.
This restores the time-travel functionality and fixes Waseem's laundry
list of problems with its original UI.

(imported from commit e30e02c25af994435adb815d26284b3669c945a4)
2012-11-28 22:26:31 -05:00
Tim Abbott 44235e8e7e Fix last_message_id computation catching the dummy row hack.
This was causing glitching where if you narrow so that zfilt has only
one message, and add messages on top (e.g. via get_old_messages), and
then add messages on bottom (e.g. by receiving one), we end up with
the bookend row missing.  One can make this happen with narrowing,
but, this situation happens every time with time travelling.

(imported from commit 71d85980d8aa9431a17b33e9e5111fd3f76cecf3)
2012-11-28 22:26:31 -05:00
Tim Abbott bc2ace726c Fix bad Django test suite interaction with get_client default.
authenticated_api_view and authenticated_json_view call
update_user_activity with a client generated using
@has_request_variables with a default of e.g. get_client("website").
Because that get_client call only happens once on importing the
module, if those client objects didn't exist previously in the
fixtures, then the first test will generate objects with ids 2 and 3,
and then the second test will dump the database, restore from the
fixtures, and then eventually generate client objects with ids 4 and
5.  But since the default values were only computed at module load,
we'll still end calling add_user_activity with client objects with ids
2 and 3, which don't exist in the newly restored database.

Fix this madness by just making sure those two client objects exist in
the database.

(imported from commit d940e129d077a560d9a0f96ec3daa2e16ce21c8b)
2012-11-28 17:41:39 -05:00
Tim Abbott 16b1f63800 decorators: Use @has_request_variables to extract client.
(imported from commit 8407a556fcc1922d69e593edee3897957742f3fb)
2012-11-28 17:41:39 -05:00
Tim Abbott 4024306613 Convert server_generation to an int when parsed.
(imported from commit 5a6f7454c62b98569a474881e8d2e5965336324e)
2012-11-28 17:41:39 -05:00
Tim Abbott 8a3c4f7d89 get_updates: Only return server_generation is the client sent it.
(imported from commit 185bbc8c422d62f45dfb8f4cb8464adc7f1e4078)
2012-11-28 17:41:39 -05:00
Tim Abbott a44c3ff247 get_updates: Eliminate the reload_pending parameter.
(imported from commit c7b57c4ef7fc4d6f0028f174f33ff7ff063d4b9d)
2012-11-28 17:41:38 -05:00
Tim Abbott 55181621bc Send a nonblocking get_updates request on wake-from-sleep.
(imported from commit 91c53f4294a609b1942c6753e9fba4fc4cb2f20f)
2012-11-28 17:41:38 -05:00
Tim Abbott d23a83ee81 get_updates: Replace "failures" with the new dont_block option.
(imported from commit 2b4ecb35c4f14b6c408323662ef6f39c6485c62d)
2012-11-28 17:41:38 -05:00