Get data directly from the main user list, rather than maintaining a
separate list just for autocomplete.
Fixes trac #1362 -- Does not depend on historical messages, so
will do the correct autocomplete after a single reload.
(imported from commit 6b35a709dba3384530082e8cfacf0151f9e0eb26)
Based on https://github.com/twitter/bootstrap/issues/6579. Doesn't
look like upstream is going to fix that or its 6 duplicates any
time soon.
(imported from commit b3e887d929cc42124aeb1f13abd7503f38f92a1f)
Wrapping render_to_response never actually worked correctly. On the
login page, mixpanel_token would be missing, but we wouldn't get an
error because it is surrounded by double quotes, which meant that it
was still valid Javascript.
(imported from commit 820ee42fab8f679983e5a3a4309a2feaf690f20f)
I don't love the default reloading message, but I'm not sure how to
tell the user why we need to reload in several cases.
(imported from commit 5f2eecdb0d83f31bd60673b247e8aac8f08ce20f)
This is a pure refactoring. We set messages.sent_by_me inside
add_message_metadata(), which gets called early in a message's
lifetime.
(imported from commit 2f6270f92ecdf0e4a64401030f86d89a8fb7be2e)
This updates desktop notifications to use avatar_url from the
server (in case users have uploaded their own avatar). It
also removes the unneeded stamp parameter from the URL, and
it unifies URL handling with message_list.
(imported from commit 6bb43a25c01cc3d26f30fc167780a477d1c5d023)
Trigger a repaint only on the messages that change fade state,
rather than repainting all messages.
(imported from commit d3a225448c004a4b467e51ceb97fda06a7a6f04b)
This should substantially improve narrowing performance, while still
delivering enough messages that one should only need to contact the
server again if the user scrolls up a significant distance.
(imported from commit 2b0af0e5b9d3a449e7f195a87d57d517b47f0b3a)
This change backs off from the always-open-compose-box paradigm,
so that when a user "closes" the compose box, they can no longer
type text, attach files, etc., and instead, they have buttons
to reopen the compose box.
(This change does not affect the feature that when you're in reply
mode, the compose box stays open.)
(imported from commit 32305d5b35f457a83f126a2265defdd98e885a2b)
Disable the hotkeys that act on the current message, except Enter
immediately shows the cursor without moving it.
(imported from commit 74fb298c711e61ae98c210d0ed11c875ce6ba591)
Hopefully this time with fewer stack overflows. It sets the flag
that will break the cycle *before* triggering another focus event.
(imported from commit 5e3ed74f1eeab8a18e36525ae7c8f1f1c756eb58)
Some versions of IE (specifically on Windows Media Center PC, it
seems) lack a console object. For such browsers, we just black hole
any output we would have sent to the console.
(imported from commit 30151c60a68a47990bf8f9be4476b716352befab)
When a user sends a message, it should be considered to be "read"
by that same user, but all that logic is handled on the back end
now, so we can remove some of the front end code related to
saying that a message is unread.
(imported from commit e4263f86c666882db42d7ae3d399196803d700cd)
This cleans up most of our blocks of code that assume in any narrow
that the only operators present are the ones of interest and that they
always appear in the expected order.
(imported from commit 038707aefbe125b0c14f823fa93472fd40302e20)
This is essentially a bug fix. It was pretty clear that the
original author intended to stop polling once the gravatar was
updated, but they checked for the updated flag before the callback
completed, instead of inside the success callback, so it wouldn't
stop polling regardless of the update.
(imported from commit 7998c6890a26a008810b8a6d8e7998a53c6e175d)
Before, sidebar_li, used in rebuilding the streams list
during a sort, was set to some HTML rendered from a template.
Now it's set to a jquery object that is updated when the DOM is
updated.
This resolves Trac #1310
(imported from commit ba96d9da4deebf2f674f2c093e81b3f0032a3fe4)
This change makes it so we now keep track of full stream information
for both subscribed and unsubscribed streams in our frontend. Previously,
any unsubscribed streams had no associated data.
(imported from commit c445b19abe11c43c710c264fffcf3af5097deb6c)
This seems to only happen with Firefox for some reason. We've had
similar issues with other ajax endpoints, so this is probably not the
long-term solution, but I'd like to get this traceback fixed now.
(imported from commit aa552fb56882ae2c73e352c7baf9532a88c5cf0a)
Show user-uploaded avatars on the website for users who have
UserProfile.avatar_source == 'U'. (Continue to show gravatars
for other users.) This includes the home page, the visible-phone
div, and the settings page.
This fix does NOT address a few things:
* There is no GUI to actually upload user images yet on the website.
* The !gravatar syntax in bugdown will continue to show gravatar images
only.
* We are not changing identicon behavior.
(imported from commit 9f5ac0bbe21ba56528048233aab2430e4dd431aa)
I moved the list of internal users out of populate_db.py and
into settings.py, and I removed some dead code related to sqlite.
(imported from commit 1e080716dc296c05f51cdd229911082469de64bd)
Don't show an error banner for any uncaught JS exception, as often the app
will continue to work fine, and there's no way to dismiss it other than
reloading the page.
Also, don't show a transient "could not connect to humbug" error if
the check-for-messages-in-narrow request fails.
(imported from commit 2c634ba088b58c17fa5b2e3353b0589d40b8e357)
It makes the stream and subject sometimes not auto-fill when replying.
This reverts commit 86603aefbbcd5f766b0c397583483810948046de.
(imported from commit 934e991566fa7a082ab8e2ba661ec973bce46b85)
Treat shift-space like page-up. Let the browser handle
shift-page-up, shift-escape, and similar keystrokes.
(imported from commit 31d5c5eb1dd4af7228c5e7794fb4cffc4bd8e88b)
I extracted get_event_name(), which should help isolate
the problem of identifying keys from the specific mechanics of
dispatching actions for given keystroke events.
(imported from commit 058c0749016dc17cce554788e10ccb32438e9dfe)
ce4e860a introduced CSS `.alert{display:none;}` because alerts are
always included in `/signup/` and shown by JS. Use a new `.alert-hidden`
class for this purpose to avoid breaking other pages.
(imported from commit 199ba35dd3356bd4093aac2a54181331b3993ee8)
The new file can't be called logging.py because then it would be
annoying to import the system logging module within it.
(imported from commit 71d116e4be98d45b09dda049a43142a82647b727)
This, in effect, reverts ff0c27ccb177ddc69a31bf8997d31e7cfb5b78b5.
The rationale here is that actually we look pretty good with the
browser's own zoom/font-size-resize in Chrome and Firefox, and it's
better to let the browser handle these kinds of changes than us.
(imported from commit 5949b57bdaf20d4fdf2bbd7ed89d1285a8b8e453)
"(" and "↓" share the same e.which, but only "(" has a non-zero
charCode. This commit will start checking for non-zero charCodes
for directional keys.
(imported from commit bcb8c3c5ef2c13708fd04cca5f4d8b0f65beaa84)
1) When you send a message, restore the focus to the composebox, targeted at the same recipient
2) If the composebox is completely empty and you press up or down, have that close the composebox and take the appropriate action
3) If you started the compose via a reply option (r, enter, click), don't refocus the composebox if the cursor has changed.
(imported from commit 84545e49d06959eb62e7fd2b22e1387383df6d1d)
I tried to remove the line of code that removes the old
subjects as part of rebuilding the new ones, but that line
of code is still needed in places.
(imported from commit 97621553c267a79f33d34537a67101464bdac434)
Previously, we would only collapse the old subject list if
the new narrow had a stream operator.
(imported from commit 664f984d932d0968a9b901f2a09272e11138843d)
Before this fix, you could expand a stream, and then any
subjects that already had a zero count could not be
incremented when new messages came in, until you rebuilt
the subject list again.
(imported from commit 98c95e201f6ec745d7c857da6f42495c8bf88ee0)
(I also introduced a couple local variables that would have
made this and similar problems a bit more convenient to debug.)
(imported from commit 6793c16ffb17514fd9b5a069d384d2c74dac6111)
If you clicked on the unread counts span inside the right sidebar
links, e.target would not be the link itself but instead the count
span inside the link, so the extraction of the user's email address
was incorrect.
(imported from commit 559d93622078e4d909f60de794df3f039ea7e5f2)
The message_viewport_info() function encapsulates our logic
around the compose box and other elements blocking the viewport,
so viewport.js seems like a more logical home for it. It also
makes ui.js, one of our largest modules, a little bit smaller.
(imported from commit 7838668b28175e161b87a6d7a8124b73012f0ff3)