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)
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)
Disable the hotkeys that act on the current message, except Enter
immediately shows the cursor without moving it.
(imported from commit 74fb298c711e61ae98c210d0ed11c875ce6ba591)
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)
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)
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)
The core simplification here is that zephyr.js no longer has:
* the global home_unread_messages
* the function unread_in_current_view() [which used the global]
The logic that used to be in zephyr is now in its proper home
of unread.js, which has these changes:
* the structure returned from unread.get_counts() includes
a new member called unread_in_current_view
* there's a helper function unread.num_unread_current_messages()
Deprecating zephyr.unread_in_current_view() affected two callers:
* notifications.update_title_count()
* notifications_bar.update()
The above functions used to call back to zephyr to get counts, but
there was no nice way to enforce that they were getting counts
at the right time in the code flow, because they depended on
functions like process_visible_unread_messages() to orchestrate
updating internal unread counts before pushing out counts to the DOM.
Now both of those function take a parameter with the unread count,
and we then had to change all of their callers appropriately. This
went hand in hand with another goal, which is that we want all the
unread-counts logic to funnel though basically one place, which
is zephyr.update_unread_counts(). So now that function always
calls notifications_bar.update() [NEW] as well as calling into
the modules unread.js, stream_list.js, and notifications.js [OLD].
Adding the call to notifications_bar.update() in update_unread_counts()
made it so that some other places in the code no longer needed to call
notifications_bar.update(), so you'll see some lines of code
removed. There are also cases where notifications.update_title_count()
was called redundantly, since the callers were already reaching
update_unread_counts() via other calls.
Finally, in ui.resizehandler, you'll see a simple case where the call
to notifications_bar.update() is preceded by an explicit call
to unread.get_counts().
(imported from commit ce84b9c8076c1f9bb20a61209913f0cb0dae098c)
Now that this functionality is accessible from the right sidebar, we
don't really need it here.
(imported from commit 34eaef4e1200f9fc673a681f0be87d8008033e83)
Currently, this is accessed by clicking anywhere in the sidebar region
other than the text of the person's name itself, which does the
existing narrow behaviour. Later we can make it do something clever
with hovering pulling out the popover or something, but that's
potentially a significant design project I think this is good enough
to be useful.
(imported from commit a2cc5dc851661117a6d438ca48a1ce7585d4eb63)
The bug we experienced here was that if you loaded the page in a
narrowed view, and then un-narrowed before the first block of messages
for the home view arrived via load_old_messages, then
narrow.deactivate() would re-select ID -1 in home_msg_list. This ends
up calling recenter_view() on the message, which in turn tries to
access the message with message id -1, which fails.
We do sometimes re-select a message ID in order to recenter the view
properly when we prepend messages to a message list, so we can't make
this always a nop; instead we add a check for id -1 in the
message_selected.zephyr event handler.
(imported from commit 66f84a586e59d99aaf0e4ba2cda9fe597b033145)
This reverts commit 13fb245f86ab84b1d2faea9d2a1f2145cd4aa907.
(Waseem wanted to hold off on adding more hot keys.)
(imported from commit 97c25ffa01fd7058fc90a278887d85b7d82a268a)
Re-focuses on the compose box after a send, but only if
the compose-box was opened by responding to the message
at the cursor (by hitting "r", enter, or clicking on the message)
(imported from commit 8e7560c8ea31397b57b2bc3e2e7d9dd996226a6f)
This parallels clicking on a stream name, which narrows you to that
stream. This also gives you a discoverable way to narrow to PMs with a
particular person.
(imported from commit 6c706f0643f6a8ec20ac38360153227ec2f645ae)
This sets up the keys t and b to anchor your pointer to the top
and bottom of the viewport. It empowers keyboard users who
are otherwise at the mercy of Barnowl recentering, but of
course it doesn't affect users who don't want to opt in.
(imported from commit 13fb245f86ab84b1d2faea9d2a1f2145cd4aa907)
* Modify the narrow icon in FontAwesome to make it better align to the pixel grid and display well on Windows+Chrome.
* Move the message controls to the right
* Hide the message info icon until the message is hovered / selected
* Switch the star to a gray version
* Increase the size of the gravatar
* Adjust the spacing
* Add the right-side message pointer
* Fix private message background colors and mention colors
* Modify star count test to account for new stars
* Bug fixes for stream subscription messages and other miscellanea.
(imported from commit 3d3d9de7e03f3658c5c78b492051b2b7f795487d)
Use tab_bar_underpadding to find out the top of viewport
that we can view. Also, eliminate effective_page_size().
(imported from commit 0e2d777790552e77d635989e496f3446cefccb1e)
The only known outstanding bug with this is that it doesn't properly
handle the updating of a message's highlighting/presence in a narrowed
view (e.g. in theory, a message should disappear if it is edited such
that its subject doesn't match your narrow or it no longer matches
your search). I think I'll just open a trac ticket about that once
this is merged, since it's a little hairy to deal with and kinda a
marginal use case.
Also it's not pretty, but that should be easy to tweak once we get the
framework merged.
Conflicts:
tools/jslint/check-all.js
(imported from commit 2d0e3a440bcd885546bd8e28aff97bf379649950)
Specifically:
* Leave the avatar image as inline and round it.
* Move timestamp to the left column.
* Replace the "Info" link with a permanent info sign.
* Move the pointer bar to the left.
* Remove borders
* Change selection background colors, and PM colors.
* Introduce the "narrowing" icon into our FontAwesome set.
* Modify the tests to account for the new "narrowing" icon and fixed a bug in star-finding.
* Clean up CSS and add a more prominent color to private messages
(imported from commit 8a8d6de8acccc52c0d16f5d1ce31aabdc72c88c8)
This allows us to load our own code before most dependencies are
loaded. Our compiled Handlebars files still need the Handlebars
runtime, so we can't move all of our minified code before
dependencies yet.
(imported from commit e2d0fa13f05a08fc3c2519790f7382e5eef6eca2)
Created a function message_viewport_info() to return more accurate
effective viewport info and called it from process_visible_unread_messages().
Also killed off a tiny bit of dead code in process_visible_unread_messages().
(imported from commit 985fcf2fb447dbf1026e2de37574c255a9bd6196)
This works fine on prod, but after a new install-server, the closure
compiler complains about a side-effect-free for loop init.
(imported from commit aa0e4d788abe4c819d4d912d6a526fab4f676675)
This commit takes control of keyboard-based pagination away
from the browser, so that we can use the effective viewport
size as the amount to page, as well as keeping a little bit
of overlap from page to page. There had been issues with
pagination for a while, but the introduction of the always-open
composebox particularly aggravated the situation.
(imported from commit 45b9b7d5a6b322230c9d55e1be0b763dbce06e2e)