Commit Graph

178 Commits

Author SHA1 Message Date
Tim Abbott 12013cd7b7 Fix collapsing of huddle messages.
(imported from commit 31391a278f5fe70ab56379bf7cc3fad2d0663007)
2012-09-21 16:44:30 -04:00
Waseem Daher 5a164f19c2 Clean up subscription functions.
Now that 'manage_subscriptions' only removes subscriptions,
let's name it that. Also, since both functions now only
act on one subscription at a time, use them in the singular.

(imported from commit 52cfc7b36eb1533da7aec1bc3a6e460151a56da8)
2012-09-21 16:30:29 -04:00
Waseem Daher a27edbce7d Restyle subscriptions page.
(imported from commit 41339c5af38ae5ea4801fc1e23b7184c277145f3)
2012-09-21 16:04:44 -04:00
Tim Abbott ed46a453ba Add (mostly unstyled) settings page.
(imported from commit 492c5f498c2fec452e6c724555bc4a5a2c4c151a)
2012-09-21 14:47:26 -04:00
Tim Abbott fc12e6ffbb Fix collapsing with new email addresses instead of usernames.
(imported from commit 26a2391ac1f965f78feaff5092b42cf49f57215f)
2012-09-21 11:15:08 -04:00
Tim Abbott ee8f28a084 Use email addresses as unique identifiers rather than usernames.
Note that this code still assumes one's email address (stripped of
domain) is unique.

(imported from commit e98f96601ad109811978fc00b1165e97d8f7b185)
2012-09-21 09:43:22 -04:00
Luke Faraone 1050300ded Render Huddle titles the way Waseem detailed in his original mockup.
This actually involved refactoring a good bit of existing code; we
in this commit introduce a new property of zephyr called .reply_to, which
is the fully rendered-to-string and pretty-printable version of the person
to which any reply should be addressed.

This is useful for grouping personals, where if you simply went by the
.display_recipient or .sender you would have to check them against
eachother.

We also introduce a new narrow_classish command, which is triggered on
clicking on the "Huddle with…" text. This method intelligently determines
which sort of narrowing to do; we essentially moved out code from the 'r'
key handling section and put it in its own function.

(imported from commit 2406ee0f6f83b990eec83190d2e8858865c06238)
2012-09-20 16:36:49 -04:00
Keegan McAllister fbec2b8d76 Use DOM ids in get_zephyr
This greatly reduces lag on mouseover selection.

(imported from commit 7d9bc0ebce2aa9781c316033d3e9d21e9da6ee3f)
2012-09-20 15:23:41 -04:00
Keegan McAllister 1dabe1cf81 Give each zephyr row a unique DOM id
(imported from commit 4530d0bbbfc94fb86ebba9c6d73074de38e4a78a)
2012-09-20 15:23:41 -04:00
Keegan McAllister 48fea66e34 More consistent naming for #table and #filtered_table
(imported from commit 966ab97522a79fb5cf6dc1e215487ceba01f6d11)
2012-09-20 15:23:41 -04:00
Keegan McAllister d4985ef5f4 Optimize select_zephyr_by_id for the already-selected case
Saves a call to get_zephyr.

(imported from commit 9ce9f2af7e4d8eb5e3a76a3c0ddbfb7f5896a583)
2012-09-20 15:23:41 -04:00
Keegan McAllister a00227c864 Implicitly choose the selected zephyr for showing email address
I erroneously switched halfway in ce4f6289491722d4c1aa84fe8b88b3a5932a3f2a, so
let's just do it for real.

(imported from commit 4c09a7805f6e2322cbbab2f8534e9d362acdc826)
2012-09-20 15:23:39 -04:00
Keegan McAllister 8d994bdb21 Make sure only one email address is displayed at a time
(imported from commit 51b5b2268a154d1136b03185d6658fad7f2922aa)
2012-09-20 15:22:08 -04:00
Keegan McAllister 81ff352ac3 Simplify bookend creation
(imported from commit 8faf260037b7e0508d9e4acea24687ebc06ea0ef)
2012-09-20 00:08:46 -04:00
Keegan McAllister 7d894d8dd1 Merge update_pointer and select_zephyr
Having both is confusing.

(imported from commit becd1ac7a8bab583c4fafdd77256c57f3dc98ea1)
2012-09-19 17:55:58 -04:00
Keegan McAllister 5ff4d22859 Note get_zephyr performance
(imported from commit 215a457d30f5a355d18882a9703ff671248b054f)
2012-09-19 17:55:58 -04:00
Keegan McAllister c3f3a1ef14 Cache the selected zephyr jQuery object
(imported from commit ce4f6289491722d4c1aa84fe8b88b3a5932a3f2a)
2012-09-19 17:35:18 -04:00
Keegan McAllister 5ba760a8f3 Use the zephyr IDs we already have
(imported from commit 6506f30be02cd4d4ee660709fbf8b7530a9276a9)
2012-09-19 16:43:45 -04:00
Keegan McAllister af5282abd4 Add client-side debugging tools
(imported from commit faa87e85f366e91fe33e0f24e00ae1197403605d)
2012-09-19 16:25:23 -04:00
Keegan McAllister 72b98d1d01 Hotkeys: don't go from zephyr to zid and back
(imported from commit e7e80bdc2e0af5dfe9ec4f885cae814543c038de)
2012-09-19 16:25:23 -04:00
Luke Faraone c0805e4846 Remove spurious lines at the top, add lines to the bottom of the view.
We previously weren't actually applying collapsed_parent to any zephyrs,
switching from .children to .find fixes this.

We also don't add a bookend in front of the first zephyr.

Also, borders are handled by the zephyr trs themselves as opposed to the
bookend tr.

(imported from commit 8bdc9bd812833288c85c13a102459a5ef1e36225)
2012-09-19 13:15:12 -04:00
Luke Faraone fed4cd3891 Limit № of autocomplete results so the list doesn't fall off the screen
(imported from commit 311376c1dec35a16ddfb66fc01161501c2eafff0)
2012-09-19 13:11:13 -04:00
Luke Faraone 72eb05dfc5 Switch to Boostrap Typeahead instead of JQuery-UI Autocomplete.
This reduces the number of CSS/JS files we need to load, which is awesome.

(imported from commit 3d34276a185e61f698163402cff2fd2c75ce0bd7)
2012-09-19 11:51:53 -04:00
Luke Faraone b634d26017 Post the newly selected zephyr ID, rather than the old zephyr ID.
Previously update_pointer POSTed the selected_zephyr_id, which in reality
was the ID of the zephyr we just moved off of, rather than the current
zephyr we just higlighted.

(imported from commit 2b143b34d3042a789b3f6a999117115dd6243782)
2012-09-19 11:13:43 -04:00
Jessica McKellar 3ec50a921d Fix loading subscriptions on the live site.
For some reason on both my and Waseem's local instances the lack of a
trailing slash was not an issue, but this does fix the issue on the
live site.

This could be because we are running Django 1.4.1 and the deployment
server is running 1.4.0.

(imported from commit 613732d75f204fd654247382088d92879780560b)
2012-09-19 10:21:34 -04:00
Luke Faraone 7d4693a063 Unbreak adding messages in get_updates_longpoll.
(imported from commit 4dbf0b151c7ac243f23b74feeb85dac2b410c7b9)
2012-09-18 18:02:53 -04:00
Luke Faraone 5b32048ade Implement borders using CSS rather than brs, style the way Waseem wants.
(imported from commit f4e23721a6eb0ffdd2d6e859b28417f0fdfbfe87)
2012-09-18 17:19:29 -04:00
Luke Faraone c5d1897ab3 Reimplement collapsing, for realsies this time.
We no longer break random things! Its pretty grand, actually.

This reworks and reverts commit fbadd6e854722e41cccd2535748ee47f4efd657b.

Conflicts:
	zephyr/static/js/zephyr.js

(imported from commit 534a120290855d3bf2cf979ac174267c2d07bf68)
2012-09-18 15:56:01 -04:00
Jessica McKellar a8484cb967 Remove subscriptions with an AJAX request.
(imported from commit d34154b31a38ac66cc8f97785c312c98dd53286c)
2012-09-18 12:33:07 -04:00
Jessica McKellar 2126e38ae2 Get and display new subscriptions with an AJAX request.
(imported from commit c9efa7596898ac4b74ec9184ae773566eda65ec3)
2012-09-18 12:32:52 -04:00
Waseem Daher a70e8dee4d Refactor our different pages into separate templates.
They are all included by index.html in different divs.

(imported from commit bd8b485516007075d33c2614b1de9f08999e927c)
2012-09-18 12:26:29 -04:00
Waseem Daher 5ebac29508 Switch back to 'Home' view when composing new message.
For now the idea is that if you're in the search view (or the
subscriptions view) and you click 'New Message', we should
snap you back to the main view.

This may or may not be the right behavior in the long term.

(imported from commit 43c24e1af9e80225ff9be8a62f4c8c925960436a)
2012-09-18 12:15:24 -04:00
Waseem Daher 5f49616753 Refactor: Put the zephyr <tr>s in the template.
(imported from commit 8a822d7c8463c248d536f97f07bfb19ca242b83f)
2012-09-18 10:46:11 -04:00
Waseem Daher d5bdd84ab7 Colorize the view differently when in narrowed mode.
(imported from commit c7b2d23386ff0895caaea8e9f6e3c116e6744c53)
2012-09-17 17:04:39 -04:00
Keegan McAllister 7152fe2f73 Format messages with Markdown
(imported from commit 014a4dddd4d3db61d85c6f6bf1987aff6093fb52)
2012-09-17 15:24:41 -04:00
Jessica McKellar 72168b8275 Put focus on class field when you click New Message to compose.
Previously no focus was set and the shown tab was whichever tab you'd
last seen.

(imported from commit 2ca731373327aa71de7472220725b518cb1861d0)
2012-09-17 14:39:32 -04:00
Jessica McKellar 3d2de1fa7c Snap back to where you were in the home view upon un-narrowing.
(imported from commit 72458f4006890c392e5ca557f7178260bff7c7f9)
2012-09-17 13:26:09 -04:00
Jessica McKellar 8e1ce1c371 Shorten the compose box fade and collapse time.
(imported from commit 136f0fc02da291c85a4f4b169217a273ff496faf)
2012-09-17 13:26:09 -04:00
Luke Faraone 8a89c56b7b Iterate through an array without using 'in', remove extra spacing.
This corrects some additional bugs introduced in 9128ddd and a5f06bd
identified by Keegan.

We previously used "for i in"-style looping, which is sub-optimal. Move
to a different style.

We also had a weird spacing thing I introduced in a previous commit,
which has now been fixed.

(imported from commit 7334d8ee703564bedeb0ea939b0d64ad2d5fceba)
2012-09-17 13:12:24 -04:00
Luke Faraone de5ff99c21 Don't generate both zephyr_json and zephyr_dict_json on the server.
Previously we were iterating through all zephyrs twice on the server, now
we are moving part of that to the client so the client has an index of
Zephyrs that it generates itself as part of add_message.

(imported from commit c07a6c36911fa2eae6f216c34331be34b2aa8178)
2012-09-17 13:12:22 -04:00
Luke Faraone 50dd1c31b8 Don't directly use showToggle, instead calling upon show_compose.
(imported from commit 4f3f81edf0c19abf34cbc5f39e25bdbad50c6d9a)
2012-09-17 13:11:49 -04:00
Jessica McKellar 69cc5c02dc Make clicking anywhere in a zephyr start a reply.
Previously you had to be inside the content span.

(imported from commit 0570ddeb9bc948d278b0b1859b4a041b81ff184d)
2012-09-17 11:16:53 -04:00
Jessica McKellar e8a6fee147 Fix the ability to send zephyrs when there are no previous zephyrs.
Previously, select_zephyr was erroring out, preventing New Message
from working.

(imported from commit 570a777318a7078c0c326042876b94dcc496011f)
2012-09-17 10:42:45 -04:00
Jessica McKellar ccfc9f5889 Only register the callback for subbing to a class once.
(imported from commit a6c41f79ea8c6e2f6a6ff5a6b41b98fd53ad4e82)
2012-09-14 15:44:55 -04:00
Jessica McKellar d7f453dfb3 Only register the callback for creating a new class once.
Previously, when trying to send a zephyr to a new class, you would
actually send N zephyrs, where N is the number of times you'd created
a new class.

(imported from commit 2c36b0282c8c2291e05b5ad952f5b25e3f43d406)
2012-09-14 15:44:55 -04:00
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 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
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 8b691ec0b2 Don't update pointer when it hasn't actually changed
(imported from commit 41c8b1cd2a586bb9d82b0ff194c076e93f34d98a)
2012-09-13 16:29:47 -04:00