Commit Graph

226 Commits

Author SHA1 Message Date
Jessica McKellar a12f582d92 Don't let people try to send zephyrs to empty class names.
Also strip leading and trailing whitespace, so 'Bar' and 'Bar' aren't
separate classes.

(imported from commit a39c220d1a4c4d179f4adbf5e1391436eda32f4f)
2012-09-14 15:44:54 -04:00
Jessica McKellar ebfc684a6e css: Add missing semicolon.
(imported from commit 055cae0fdb00db656b4fcea9a384c0f2a3af58fc)
2012-09-14 15:44:54 -04:00
Jessica McKellar 9a7dc0e50b Only hide the compose box on a successful zephyr.
(imported from commit a83e26ce42ae6b80872dd81ed10d5318c193f1ef)
2012-09-14 15:44:54 -04:00
Jessica McKellar 56ea3d12d5 Clear the compose box after successfully sending a zephyr.
You don't care about that content anymore. We probably want to clear
even more aggressively than this.

(imported from commit 29f6910a12e1b722f5801db644b04f54cf5bfd63)
2012-09-14 15:44:54 -04:00
Waseem Daher ea586ac581 Restyle compose window slightly, add close button.
I still don't love it visually, but it's getting there.
Some obvious issues:
 Personals window is totally unstyled
 Clicking 'new message' should perhaps give you a fresh new window
  not something prepopulated with old stuff. Think about this.

(imported from commit 8b28fd084d550db404eabbe63c056fa6866c0697)
2012-09-14 12:22:25 -04:00
Waseem Daher bee291afaa Restyle the narrow bar slightly.
Put a little 'x' by the class or class-instance indicator, to make
it more analogous to the planned behavior of the view-in-context
search box.

(imported from commit fa01001cffa6a6094ba5fbdcbdc965addb2efa1c)
2012-09-14 11:40:56 -04:00
Keegan McAllister 5711e953f9 Remove redundant font spec for emails
(imported from commit 335608864107bb3c4b611ba4ba09bfd67e62e562)
2012-09-13 17:45:44 -04:00
Keegan McAllister 67b337ce07 Get rid of selectors like span.foo
Just write .foo.  We shouldn't have to care what type of tag it is.

(imported from commit 86c4eeecbe4f5c9875002e3fd81757cd49050268)
2012-09-13 16:32:21 -04:00
Keegan McAllister 7638dc7279 Less confusing names for some classes
(imported from commit 15475d7dc98702a3935b1eb8a1373ab222913a7c)
2012-09-13 16:32:21 -04:00
Keegan McAllister 1674dea775 Restyle email addresses in zephyrs
(imported from commit 7176758240da9f5b85370bf02d7ea5c9991a44a2)
2012-09-13 16:32:16 -04:00
Keegan McAllister 8b691ec0b2 Don't update pointer when it hasn't actually changed
(imported from commit 41c8b1cd2a586bb9d82b0ff194c076e93f34d98a)
2012-09-13 16:29:47 -04:00
Keegan McAllister d7a5fa3d99 Add some padding on email
(imported from commit 59746e712cf9a5f75bb9dbf3f9a4257a7667dbab)
2012-09-13 16:29:47 -04:00
Keegan McAllister 02fa8e5f17 Whitespace
(imported from commit fa47eddc4978927e3d9d5c913a3a7638535691d3)
2012-09-13 16:29:47 -04:00
Keegan McAllister 3694ecaf4c Only display email while hovering on fullname
(imported from commit 0f366deb69ba49bfda998dd993e32de0d29affe4)
2012-09-13 16:29:47 -04:00
Luke Faraone 17537ffe17 Use zephyr_dict as the authoritative source for data about zephyrs.
Previously we would extract zephyr data from a TR. In the NWO where
sometimes this data is ommitted, we instead need to use the zephyr_dict
object.

(imported from commit a5f06bdadc4fbe13f1718d6dcb41046d0ed040cd)
2012-09-13 14:36:54 -04:00
Luke Faraone 4821175dd5 Provide both a sequential list of zephyrs and an associative array.
The purpose of this is to ensure that we can reference a zephyr by its ID
and get all the data about the zephyr; in the future we may not have all
such data stored in TRs as we do now.

(imported from commit 9128ddd01b46396fd276124ca1e6430538d3dd63)
2012-09-13 14:31:02 -04:00
Waseem Daher fa8dd00f15 Shrink timestamp size slightly.
(imported from commit b4c0a20a4008d8f0f96421e1fa246cb31d3ccc3f)
2012-09-13 13:15:20 -04:00
Keegan McAllister afa608fad8 Only display email on the selected zephyr
(imported from commit fc0ca119abaf31f74e7ad384c6821bfeaedaae87)
2012-09-13 11:58:59 -04:00
Keegan McAllister ea42342031 Distinguish the selected zephyr in CSS
(imported from commit 42e243ff95de5427e78dbc532dfe9e50e9677438)
2012-09-13 11:57:26 -04:00
Keegan McAllister a8dcf09f1e Use get_zephyr
(imported from commit 160eb772992cb18450b859637935f1039c576832)
2012-09-13 11:44:51 -04:00
Keegan McAllister 16b8258924 Fix bad merge
(imported from commit 6d6a4e7da0e3e3dacd732cde19009b427aa813cb)
2012-09-13 11:42:23 -04:00
Jessica McKellar 09bb68e52c Have the pointer follow the mouse.
(imported from commit cfd6bcd7ba506c440f74bd7e40eaacadc06b10c8)
2012-09-13 11:06:29 -04:00
Jessica McKellar 08904cae43 Clicking on a zephyr pops up the compose window and prepares a response.
(imported from commit 00139f7b0c6d1ded198064689f1a1bd8038e72f9)
2012-09-13 11:06:28 -04:00
Waseem Daher 3e5008b143 Remove searchbar from narrowed view.
Today I'm of the mindset that searching is a fundamentally
distinct operation than narrowing, so this reflects that.
(There would be a separate screen and UI for searching,
 I guess.)

(imported from commit 432a4088612dafd06184bec228b63056961325dd)
2012-09-13 10:36:29 -04:00
Keegan McAllister 51e109d043 Show full date hovering over timestamp
(imported from commit 486cd85b4ec21ad8468ced207c541372f341c200)
2012-09-13 01:00:28 -04:00
Keegan McAllister c3c675a872 Fix the size of profile pictures
This fixes a transient display glitch while the image is loading.

(imported from commit a153de8ebb07eaa89a7a0eb215f15a88e950a1f4)
2012-09-12 21:58:12 -04:00
Keegan McAllister b0d8f30d91 Make Esc hide the compose pane in every hotkey mode
(imported from commit 487f19265053780a322ea741a08b3bf318821574)
2012-09-12 18:06:28 -04:00
Keegan McAllister a236e29afa Factor out hiding/showing compose pane
And avoid slideToggle, so that we don't have to care about the current state.

(imported from commit 52ddcfda50baa297c56114574600c5a5e0ee47f2)
2012-09-12 18:06:28 -04:00
Waseem Daher e8a1ecad94 Renaming some divs for additional clarity.
unhide -> show_all_messages
narrow_indicator -> currently_narrowed_to
narrow -> searchbox

This is a little clearer about what these buttons/functions
do, which will be useful as we add a little more complexity
associated with searching.

(imported from commit b51e745ea71c212d6735e04011eaea5e71bf6d5a)
2012-09-12 17:31:48 -04:00
Keegan McAllister 7d4fd5b14f Zero-pad hour and minute
(imported from commit 404600ce3cb2233acb1b2e69cdd87c64604d9826)
2012-09-12 17:07:13 -04:00
Keegan McAllister ae5137b5c9 Show timestamps on zephyrs
We use the browser's local timezone.

(imported from commit 6ed6444df6edf2093b9399adb1511dd3ee80def3)
2012-09-12 17:00:02 -04:00
Keegan McAllister f47b88ccc8 Don't take up space with the hidden username span
(imported from commit 9ae4953a583947c259a20ce5f7c25c0216b2cc51)
2012-09-12 16:24:42 -04:00
Keegan McAllister 714eec5594 Select zephyr rows by class
This fixes the bug where the reply box is hidden when narrowed.

(imported from commit 0673b9063818946b7da70f6109ca17403240737d)
2012-09-12 11:47:56 -04:00
Waseem Daher 3f42c8422f Experimentally add a search bar.
I'm not exactly sure that this is the interface we'll want for
this, but it's the start of an experiment.

(imported from commit ea18a9b05106546475bc151229955ddafd8e7b8e)
2012-09-12 11:19:33 -04:00
Waseem Daher 85398abba3 My take on a prettier pointer.
(imported from commit 7d0c37c85781bdd48efb4cf9cec49bb6df7f0954)
2012-09-11 17:38:05 -04:00
Waseem Daher 9a7993a954 Cause class and instance names not to wrap.
This looks ugly, uglier than the alternative, but I want
to encourage us to figure out how to deal with this case
rather than allowing it to wrap.

(imported from commit 9ef9cedeca2e27a0db996083e2e528f3daec3f43)
2012-09-11 16:57:03 -04:00
Waseem Daher 5ca1ac55d6 Make classes and instances always take up 100px.
Setting both max-width and min-width really feels like
a hack -- surely I can just set "width" and be done
with it?

(imported from commit 7650419c5ae8bb7ce3a3d6bd7dabbfb42390586f)
2012-09-11 16:53:30 -04:00
Jessica McKellar f5e8f025b7 Bring back preparing a personal when you click on a user.
(imported from commit b9081cb77dafa590605ee3a0892b359cc7ac6d06)
2012-09-11 16:35:01 -04:00
Jessica McKellar 49af4ec000 Don't hide the New Message button when you click on it.
It's not part of the original WaseemUI scheme, and it doesn't ever
reappear.

(imported from commit 3417fae31fc8d1b87d0d8b463548c24f5c2d260c)
2012-09-11 16:35:01 -04:00
Jessica McKellar f52ec24926 For now, compose zephyrs to usernames.
We'll eventually need to normalize emails, autocompleted names,
etc. to one entity we use when talking to the server about senders and
personals recipients, but for now since we've hardcoded usernames
everywhere, just use those.

(imported from commit 4a0e033b301b8dec55d97157eb4993982f6b2641)
2012-09-11 16:35:01 -04:00
Jessica McKellar bfdf2bef57 [schema] Collect and display names and e-mail addresses.
(imported from commit aa6bceb05fcd5b456c03288cbfed65b14050fe88)
2012-09-11 16:34:53 -04:00
Jessica McKellar 06711afa51 Add a block of whitespace at the bottom of the zephyr feed.
That way you can see new zephyrs as they come in.

(imported from commit 6b72a7f2116130edc0444f601423453801ddb6b5)
2012-09-11 16:27:12 -04:00
Waseem Daher cca0e8f521 Restyle narrowbar slightly.
I have some serious concerns with this implementation,
but I think it's still an incremental improvement.

(imported from commit 6ed8d2545c727e25bf85b98a1528dbf3d155bc92)
2012-09-11 16:20:16 -04:00
Keegan McAllister b4103798f5 Speed up narrowing
(imported from commit e1f06866ebc7d3dae3a5813565002853a6f6d8ba)
2012-09-11 15:37:09 -04:00
Luke Faraone 34a7ad5be0 Revert "Collapse duplicate instance names, add breaks."
This reverts commit 8c47682cd80fec0d221a519abc593f4d83dc90b5.

I accidentally broke.. a lot of things in my last commit. Lets fix those
issues before pushing to master again.

(imported from commit fbadd6e854722e41cccd2535748ee47f4efd657b)
2012-09-11 15:19:51 -04:00
Keegan McAllister a5d105dbae Move styles out of index.html
(imported from commit 8b3732ff67af71dac49886004370b6d4759b140f)
2012-09-11 14:38:33 -04:00
Keegan McAllister 75c34a7f1b Fix a bunch of code style problems
(imported from commit 473ae8fdd64783f7a0989b17cae39826de42d30d)
2012-09-11 14:38:33 -04:00
Luke Faraone c5238e4af5 Collapse duplicate instance names, add breaks.
(imported from commit 8c47682cd80fec0d221a519abc593f4d83dc90b5)
2012-09-11 14:37:24 -04:00
Keegan McAllister 00e3f9d948 Right-align zephyr table within its div
(imported from commit 59365d0ef466bf08fe1cf9ddcac5558579962c84)
2012-09-11 13:46:47 -04:00
Keegan McAllister 8b1b5ddbdb Hide horizontal scrollbar
(imported from commit 5510657c7adfb189e1a332c8f6f2eab9840a8080)
2012-09-11 13:08:18 -04:00
Keegan McAllister bcdfafb37f Tweak class/instance display, esp. for long names
(imported from commit e8b73f2f772e18ea72fbbfb68107659d0b9adb8c)
2012-09-11 13:06:07 -04:00
Keegan McAllister 84cfca1ea0 Shrink messagebox further
(imported from commit 4184f19aec54b764bc205bef067426d90e67d843)
2012-09-11 12:48:57 -04:00
Luke Faraone 34b594b96b Reimplement the narrow bar.
(imported from commit 19e41c1238dff404813a21b9dc318458d5f29c64)
2012-09-11 12:12:02 -04:00
Keegan McAllister 65c6f2dfcb Set messagebox max-width as well
(imported from commit 0ada0fcabf23f38caf7b7cfa7173cc9822d2eefb)
2012-09-11 12:05:28 -04:00
Keegan McAllister e5ac53674a Use fixed table layout
(imported from commit 12eb4882b03e6cf4b633334481a82da70b868ce1)
2012-09-11 11:56:34 -04:00
Keegan McAllister 1c539ac828 Fit compose box to zephyr list
(imported from commit 7b17e637b14ec5b97a890d4c16422259adec8c4c)
2012-09-11 11:51:28 -04:00
Keegan McAllister 7da13a873e Fix size of messagebox
(imported from commit ea236a85cf8a5556242cce79d1911a3744fdf7b4)
2012-09-11 11:49:33 -04:00
Keegan McAllister 8db9a7c1d6 Adjust hover color to match Bootstrap
(imported from commit f43a9d07ce027932e4a22d2fb9efe7711883f318)
2012-09-11 11:49:13 -04:00
Keegan McAllister ad27472b05 Indicate clickable labels
(imported from commit aebd6171bbe45d8e8055ca22526ab919b6e348e1)
2012-09-11 11:32:04 -04:00
Keegan McAllister 8440fdd838 Use a fixed width Zephyr list
This is about the same size as Twitter.

(imported from commit b171b0202dfaaf14c535824a4bc2df06d18a1e51)
2012-09-11 11:16:32 -04:00
Luke Faraone 1da8c16367 Make "new message" open the compose window.
(imported from commit d63f4915f884dfa2bc11653d17782e5ee4c6191e)
2012-09-11 10:54:25 -04:00
Waseem Daher 0958e380d0 ...but add the padding only on the top.
(imported from commit 2459b639d40aaac44d71a8f754481f90348e72ac)
2012-09-10 15:16:17 -04:00
Waseem Daher f847931dbd ...but add padding so it lines up.
(imported from commit 5d174cd0c72233702dc1681e0118f2da4bb912f2)
2012-09-10 15:14:46 -04:00
Waseem Daher e1b7efe988 Vertically align the pointer.
(imported from commit 5ba1586eb1576439b4f0665cf85ba1f59a197c23)
2012-09-10 15:14:01 -04:00
Waseem Daher 7c10832118 Restyle zephyr window slightly.
Eliminate huge left margin, and don't let long class or instance
names totally break the layout.

(imported from commit 69237d29a60241bdadda0469c4e08aa1d987222a)
2012-09-10 15:06:08 -04:00
Keegan McAllister 7b8544a53f Get class/instance for narrowing more uniformly
(imported from commit 1e9622cb93cf5954cf94f38c77c191524a6e72bc)
2012-09-10 14:46:03 -04:00
Luke Faraone 37c226e6b6 Remove spurios padding on instances.
(imported from commit fbcbbe3f0973bbac74574f59d076b010f38951b5)
2012-09-10 14:37:36 -04:00
Luke Faraone cfc42b1d82 Implement portions of Waseem's new UI.
This is mostly working; things that need to be implemented:
 - Ask users for their Real Name
 - Personal replies need skinning
 - Miscl UI changes to match mockups

(imported from commit 3638cf5ec2ba2306004ba6db6fa4c25c47f76517)
2012-09-10 14:32:42 -04:00
Keegan McAllister afee8630aa Implement hotkey state as a state machine
(imported from commit d4f52cbc6bc9e66643e89c5b49a2201e4c938265)
2012-09-10 11:36:17 -04:00
Keegan McAllister 2798f83dbe Use switch-case for hotkeys
(imported from commit c269119d6e1034508303b1c67f5e7a59376674da)
2012-09-10 11:36:17 -04:00
Keegan McAllister e3307aff39 Factor out hotkey processing
(imported from commit bb7a7269b39481cbe831a9a5872b4e32f0f04234)
2012-09-10 11:36:17 -04:00
Keegan McAllister 11b5a8e193 Add JSLint options
(imported from commit ff01274558cf1145a6ab057218bc16bac5628b2e)
2012-09-07 15:15:16 -04:00
Keegan McAllister b4c2aba14d Reparenthesize an expression
This was supposed to be (x && (y || z)) but was written as
(x && y || z) i.e. ((x && y) || z).

(imported from commit c2d6d385f71e6bc4b8933f6426d88aeee0123f66)
2012-09-07 15:07:50 -04:00
Keegan McAllister 52b6ed0ba4 Move scroll_to_selected definition before first use
(imported from commit 22f3274f8f636950784f241b9b61dc3785b370b0)
2012-09-07 15:07:50 -04:00
Keegan McAllister 8c9d29842d Fix formatting of nested functions
(imported from commit 7777d6bcc3d249d6c5dd51305c88220e5ec6e469)
2012-09-07 15:07:50 -04:00
Keegan McAllister c31e7903e9 Missing semicolons
(imported from commit 76bfb622f5e6a90b4c14dc4db78ab16e7a935df0)
2012-09-07 15:07:50 -04:00
Keegan McAllister b7d7d3da26 Declare all variables at the top of each function
Javascript has function scope only, not block scope, so the block use of 'var'
is misleading.

(imported from commit 6763fa241408e5893392f622fd92b2664a993ed0)
2012-09-07 15:07:43 -04:00
Keegan McAllister fd7a7aaff4 Javascript: Use !== and === instead of != and ==
!= and == will perform type coercions, which can hide bugs.

(imported from commit 42d3d990a659b62e196f3755c176f83f80c9e319)
2012-09-07 15:07:43 -04:00
Keegan McAllister 1211995d2e Fix indentation
(imported from commit 8f4880ceaa2e84fa842ba195ebe40800fc168eab)
2012-09-07 15:07:38 -04:00
Keegan McAllister 7659937586 Inline a global constant which is now only used in one place
(imported from commit 2c288202f5c46ff62f6044cd23f092e4175d498a)
2012-09-06 17:01:19 -04:00
Keegan McAllister 115334c82a Don't bracket $.get with $.ajaxSetup
Instead, use the more general $.ajax which can take these options directly.

(imported from commit bb915e7d25cb6ac675d098903f7e7b57bde5006e)
2012-09-06 15:48:15 -04:00
Keegan McAllister 474f08198b Send zephyr template inline with index.html using django-jstemplate
(imported from commit 58cc8a50d463548aa283658dbe0aae366ecab39f)
2012-09-06 15:48:15 -04:00
Keegan McAllister fce5643d15 Handle Zephyr body clicks like the other clickable elements
(imported from commit 97da4b22aea4e23dd0227b0179481cb3b5f7a65e)
2012-09-06 15:48:15 -04:00
Keegan McAllister 6f269051d1 Partially consolidate the code which knows that zephyrs are <tr>s
(imported from commit ca2a208af9f1d3cc8a3f3980f55a5c008d28147a)
2012-09-06 15:48:15 -04:00
Keegan McAllister 689ab1efd6 Misc stylistic consistency
(imported from commit 624a07f50544d96f9e3c3b417b00369641bd3ae1)
2012-09-06 15:48:15 -04:00
Keegan McAllister 59ab88f886 Rename current_view -> apply_view
And related cleanups.

(imported from commit 4b1a7e7ef19b17c0887e2864f7cc2121eeda361e)
2012-09-06 15:48:15 -04:00
Keegan McAllister 1fa40e515c Style fixes
(imported from commit 311600ad8627d7060f235f59852d77f73a951e81)
2012-09-06 15:48:15 -04:00
Keegan McAllister 5e5b5986af Don't pass the global selected_zephyr_id through the narrow functions
(imported from commit a19232052913f45a6f8d3c08dd8761a6a2b5ec99)
2012-09-06 15:48:15 -04:00
Keegan McAllister a9f45e6e0e Have select_zephyr ensure that we point at a visible zephyr
(imported from commit 91e485742a040cf6c3454d1f55993a6c77a8ca09)
2012-09-06 15:48:15 -04:00
Keegan McAllister 74c97e7d59 Remove duplication between do_narrow and select_zephyr
(imported from commit 84c3e5a0d5682fd8790bd6e277e05e54a47d9aac)
2012-09-06 15:48:15 -04:00
Keegan McAllister d78e1f1bcb Remember the selected zephyr in a Javascript variable rather than querying the DOM
And related cleanups.

(imported from commit aa64980b4e66a64e92735c736159a8e2f717ea09)
2012-09-06 15:48:15 -04:00
Keegan McAllister 03d2a087a7 Organize global variables a bit
(imported from commit d3ad323bad4cda98e55a54ed3c9aec81ccd4008b)
2012-09-06 15:48:15 -04:00
Keegan McAllister 84e618a902 Use 'var' at top level consistently.
This has no effect but is stylistically consistent.

(imported from commit 71d7f615ea140195cc5081fb331677bc5d856fed)
2012-09-06 15:48:15 -04:00
Keegan McAllister 8f1cee0b88 Move third-party components into static/third/
(imported from commit 709c78a6e41afcd4202a8264c9103ac7827158ec)
2012-09-06 15:48:15 -04:00
Luke Faraone 3d1e956069 Don't check for class existence if we're not sending to a class.
(imported from commit 832de3f899d90ee727cebeede061de6a409b7845)
2012-09-06 15:19:56 -04:00
Luke Faraone f6b481546f Offer to subscribe / create classes if user zwrites to a non-subbed class
Here we check if a class exists. If not, we prompt the user to create, sub,
and send his message to the class. If the class exists but we're not subbed
we prompt the user to sub.

This commit also added a decorator to views.py and refactored out some
redundant code.

(imported from commit 7234ef6c080f2a6de6ff0922635dddd90032f7fe)
2012-09-06 14:33:55 -04:00
Tim Abbott 31ece4d3aa Fix narrowing by instance.
(imported from commit 824f0c113b9b6970bd451f4b0c3285dd3b88d9c4)
2012-09-06 11:17:39 -04:00
Keegan McAllister 4dd1567426 Keep third-party jQuery style in the jquery dir
(imported from commit 9e34277b90c13b3ce71521fe0657014f186fc1c3)
2012-09-06 11:00:34 -04:00
Jessica McKellar cede8e59fb Return a 400 and error message instead of 500ing on a personal to an invalid user.
(imported from commit b8cdf342f2919aa0dbd2e30764c7662b6756aa57)
2012-09-05 18:01:06 -04:00
Keegan McAllister 0788f2efe6 get_updates_longpoll: Retry indefinitely, with exponential backoff
The client still won't recognize when it's reconnected, if there is no traffic.
Probably we should have the server send periodic heartbeat messages to the
clients, and make the clients look for them.

(imported from commit 4dab3ddf20bf3c48a65b9395c1e24b635b70aa81)
2012-09-05 16:37:20 -04:00