Commit Graph

372 Commits

Author SHA1 Message Date
Steve Howell b98cd55ddb Add ui_report shim. 2017-03-19 11:05:44 -07:00
Steve Howell c67aebf633 Move keep_pointer_in_view() to message_viewport.js. 2017-03-19 10:56:09 -07:00
Steve Howell ab34b5ee9f Extract ui_init.js. 2017-03-19 10:56:09 -07:00
Tim Abbott ed90879602 js: Extract lightbox.js from ui.js. 2017-03-18 13:54:11 -07:00
Steve Howell a51caceea5 refactor: Extract unread_ops.js
This module mostly contains the mark_* functions that
update the server with info about unread counts.
2017-03-18 10:35:52 -07:00
Brock Whittaker d17a3531b3 Fix ui.home_tab_obscured call to not block scroll events.
This fixes the a call being made in ui.js that prevents all scroll
events from occurring while a modal is displayed.

This used to be necessary back in 2012 as modals didn't require
scrolling and would affect background scrolling, however it isn't
required anymore.
2017-03-16 14:23:34 -07:00
Brock Whittaker 966e161fb2 Fix ui.home_tab_obscured to detect modals open.
All open modals now should have the selector ".overlay.show",
so checking if a modal is open is as simple as checking the length
of the selection ".overlay.show".

Fixes #3655.
2017-03-15 15:45:10 -07:00
Brock Whittaker 3bc2ed6dc9 Switch "invite users" to new component overlay.
Fixes #4036.
2017-03-15 12:29:09 -07:00
Brock Whittaker b0e5aeb313 Consolidate JavaScript modal closing in modals.js.
This consolidates all actions to close modals into modals.js and
triggers the correct cleaning/collapsing function dependent on what the
data-overlay attribute is labeled as.

It also ensures these all have an e.stopPropagation().

Fixes #4029.
2017-03-15 12:27:44 -07:00
Tim Abbott 5e39ccd642 js: Rename viewport.js to message_viewport.js.
This fixes the mobile web experience for Chrome on iOS.

Apparently, Chrome-on-iOS silently has a `viewport` module that
overrides and user-defined module by that name, causing all of our
code that accesses the viewport module to not work on that platform.
We fix this by renaming it.
2017-03-10 14:59:59 -08:00
Brock Whittaker 4d5aa3ddc9 Restyle and refactor .message_controls for better UX.
This refactors the .message_controls to stop relying on absolute
positioning and strange CSS, and throws them inline.

This also restyles so they hang to the right of the time which is now
always present.

Fixes: #3761.
2017-03-06 22:24:21 -08:00
Tim Abbott e86ed89986 page_params: scope presence_disabled in realm. 2017-02-28 14:58:53 -08:00
Elliott Jin 4092aab620 unread: Refactor to move DOM element updates into UI layer. 2017-02-11 08:36:39 -08:00
Elliott Jin ef7d4e417c unread: Refactor to move bankruptcy modal into UI layer. 2017-02-11 08:36:39 -08:00
brockwhittaker 1a28564ed4 Switch information overlay to key-based toggle.
This switches the overlay to a key based system where it uses the
toggle keys to open the correct modals.
2017-02-10 15:18:41 -08:00
brockwhittaker 2ef8e425d1 Change information overlay to use toggle component.
This switches from a custom tab interface to the toggle component
layout.
2017-02-10 15:18:41 -08:00
Brock Whittaker 1500e93092 Convert overlay modals to unified modal system.
This converts three modals:

1. Markdown Help
2. Keyword Shortcuts
3. Search Operators

Into a system in which they all appear in the same overlay now.
2017-02-10 15:18:41 -08:00
Tim Abbott b52f606c3a Revert "deps: Upgrade and move `jquery-mousewheel` from `static/third` to `npm`"
Apparently, the updated version of this has a serious scrolling
performance problem in the left sidebar that basically makes scrolling
in that area unusable.

This reverts commit b683b2d3c3.
2017-01-26 13:42:00 -08:00
Tim Abbott a3b51bb9d2 Fix JS error syncing starred out-of-view messages.
Previously, if one starred very old messages (or ones in a stream
you're not subscribed to), your other open browsers would likely throw
an exception syncing the message flag.
2017-01-22 20:39:05 -08:00
Steve Howell e7e2e388c5 Move small_avatar_url() to people.js. 2017-01-21 21:45:12 -08:00
Rafid Aslam b683b2d3c3 deps: Upgrade and move `jquery-mousewheel` from `static/third` to `npm`
- Remove `jquery-mousewheel` from `static/third` and fetch it from npm.
- Upgrade `jquery-mousewheel` to 3.1.6.
- Bump up the `PROVISION_VERSION` to 4.5.
- Change some js code to comply with this `jquery-mousewheel` version.

Part of #1709.
2017-01-19 17:24:53 -08:00
JefftheBest1 69f9c300b8 ui: Change grey to gray in ui.js comment. 2017-01-14 12:36:06 -08:00
Tim Abbott 998dff9e50 lint: Add dangling commas in JavaScript objects. 2017-01-11 15:23:42 -08:00
Brock Whittaker 50f6681319 Fix z-index Issues.
This fixes the z-index issue with the navbar along with hiding any
popovers when you enter into the lightbox.

Fixes #3078.
2017-01-03 15:33:54 -08:00
Tim Abbott ec3e5e844a reactions: Clean up popovers and hover logic.
Previously, the emoji reactions popovers were keyed off the
edit_content area, which is problematic because that area was
created/deleted on hover, resulting in orphaned popovers (which
wouldn't close properly normally).  That had been hackishly addressed
in the original PR with the overbroad `$('.popover').remove();`.  To
remove that, we fix the actions popover to always be based on an
element that exists in the page.

There probably more to do here, but this is good enough to merge emoji
reactions and iterate from here.
2016-12-30 21:42:54 -08:00
Arpith Siromoney 9c64a08cad Add frontend support for emoji reactions.
This commit replaces the placeholder "clipboard" button with a reaction button.
This is done on any message that can't be edited. Also, on messages sent by
the user the actions popover (toggled by the down chevron icon) contains
an option to add a reaction.

When clicked, a popover with a search bar and a list of emojis is displayed.
If the right sidebar is collapsed (the viewport is small), the popover is placed
to the left of the button.
Focus is set to the search bar. Typing in the search bar filters emojis.

Emojis with which the user has reacted to this message are highlighted.
Clicking them sends an API request to remove that reaction.
Clicking on non-highlighted emojis sends an API request to add a reaction.
When the popover loses focus it is closed.

The frontend listens for reaction events. When an add-reaction event is
received, the emoji is displayed at the bottom of the message with a
count initialized to 1. If there was an existing reaction to the message with
the same emoji, the count is incremented.

Old messages fetched from the server contain reactions.
They are displayed (along with title and count) at the bottom
of each message.

When clicking the emoji reaction at the bottom of the message, if the
user has already reacted with that emoji to this message, the reaction
is removed and the count is decremented. Otherwise, a reaction is added
and the count is incremented.

Hovering over the emoji reaction at the bottom of the message displays
a list of users who have reacted with this emoji along with the
emoji name.

Hovering over the emoji reactions at the bottom of the message displays
a button to add a reaction.

Fixes #541.
2016-12-30 21:42:54 -08:00
Arpith Siromoney 5639f21188 Add missing exports to js modules 2016-12-29 06:01:33 -08:00
Rafid Aslam 45f39be37f lint: Fix many no-unused-vars eslint rule violations.
These have been carefully audited by tabbott to ensure they are
unlikely to cause regressions.
2016-12-14 21:34:51 -08:00
Brock Whittaker 660144a79d Blur the active element on settings/streams modal exit.
This blurs any focused element so that you can’t accidentally enter
into anything on a hidden modal.
2016-12-14 15:37:43 -08:00
AZtheAsian 9c0ebc7359 eslint: change no-else-return to error and fix violations 2016-12-02 14:43:09 -08:00
AZtheAsian ed0bc831be eslint: change one-var from warning to error and fix violations 2016-12-02 11:25:16 -07:00
Tommy Ip b3f4feb996 eslint: change max-len from warning to error and fix violations. 2016-12-02 14:16:33 +00:00
aakash-cr7 79b4ac8155 Add tooltips to buttons appearing when message is not delivered. 2016-11-26 10:13:48 -08:00
Brock Whittaker 9582079cd9 edit: Fix "View source" icon being orphaned post-hover.
It turns out it wasn’t a one-liner, it was actually a -2-liner. :)
2016-11-16 14:03:54 -08:00
Brock Whittaker d45c050994 message_edit: Restyle message_controls options to have better spacing.
This restyles the message_controls options to center them horizontally
while fixing them closer to the right side of the edge, along with just
replacing the edit button with a preview source button once editing is
disabled.
2016-11-10 19:47:26 -08:00
Brock Whittaker 5497416a36 Move edit button to underneath message timestamp.
This moves the edit button to underneath the timestamp such that when
you hover over a message now the timestamp hides itself and the edit
button appears (if editing is allowed).

Fixes #1733 and other annoying issues with this field.
2016-11-10 19:45:09 -08:00
Tim Abbott 6daf2b1e46 js: Move pointer initialization code out of zulip.js. 2016-11-05 11:33:04 -07:00
Tim Abbott d76f9b09a3 unread: Move consider_bankruptcy into unread module. 2016-11-05 11:33:04 -07:00
Brock Whittaker 2ce601ebd1 Fix Multiple Lightbox Issues.
This fixes the following issues:
1. Photos are no longer resized larger than their native resolution.
2. Photos with transparency now have a checkerboard behind them to
signal an alpha of less than one.
2016-10-25 14:51:35 -07:00
Brock Whittaker bb23d6ed60 lightbox: Fix focus state when exiting lightbox.
Previously, exiting the lightbox and then hitting enter reopened the
lightbox with a null image.

Fixes #1982.
2016-10-25 14:48:34 -07:00
Rishi Gupta 879f2a1e2e message editing: Refactor editability computation to use editability_types.
We compute the editability of messages in several places around the
frontend; standardize the definitions and store in
message_edit.get_editability. This commit should not change app behavior.
2016-10-22 18:52:49 -07:00
Brock Whittaker 10f7146ddd Change Lightbox to Support YouTube Videos.
The lightbox will now distinguish between whether or not something is a
photo and a YouTube video by the class name of the message inline
preview. It embeds the YouTube video in the lightbox as an iFrame
rather than previewing the video screenshot.
2016-10-18 14:45:47 -07:00
Ilona Brand 4bf908c2d6 Add emoji map to the compose box.
- Expand a box full of emojis into the
compose window for users to graphically select emojis.

- Append an emoji to the end of the message when a user
clicks the emoji in the emoji box.

- Trap the escape key to always close the emoji box
before closing anything else if the box is open.

- Fixes: #147.
2016-10-10 16:12:25 -07:00
Brock Whittaker 339249602f Remove Blur on lightbox background.
This removes the blur feature as the background of the info settings
container is now #FFF.
2016-09-30 16:42:26 -07:00
Brock Whittaker 87afe61860 Add overlay lightbox for displaying inline image previews.
This adds an event listener (by way of delegation) to the
.message_inline_image elements that pops up the overlay and hides it
when the overlay exit is clicked.

Fixes #654.
2016-09-27 17:50:51 -07:00
Brock Whittaker e52d618f1b Switching from $.parseJSON to JSON.parse.
There are no modern browsers that do not have built in JSON parsing
abilities. We do not need $.parseJSON as it now just serves as a call
to JSON.parse.
2016-08-25 14:22:48 -07:00
Tim Abbott c17676b00c Cleanup MIT hardcoding for disabling presence. 2016-07-26 20:30:12 -07:00
Rishi Gupta d529a94e4d Add realm setting to time-limit editing of message content.
This is controlled through the admin tab and a new field in the Realms table.
Notes:
* The admin tab setting takes a value in minutes, whereas the backend stores it
  in seconds.
* This setting is unused when allow_message_editing is false.
* There is some generosity in how the limit is enforced. For instance, if the
  user sees the hovering edit button, we ensure they have at least 5 seconds to
  click it, and if the user gets to the message edit form, we ensure they have
  at least 10 seconds to make the edit, by relaxing the limit.
* This commit also includes a countdown timer in the message edit form.

Resolves #903.
2016-07-15 13:55:49 -07:00
Rishi Gupta 43c2f35776 Add realm setting to disable message editing.
This is controlled through the admin tab and a new field in the Realms
table.  This mirrors the behavior of the old hardcoded setting
feature_flags.disable_message_editing.  Partially resolves #903.
2016-07-10 11:57:24 -07:00
Michael Cordover a51ec44005 Search streams from left sidebar (resolves #565).
Assigns hotkey 'w' to search streams.
Only show search box when active. Activate with hotkey or by clicking
STREAMS.
Filter matches at the beginning of words in stream name.
Behaviour is otherwise almost identical to user search.
Casper tests.
2016-06-23 17:21:57 -07:00
Tim Abbott 02e6d267f1 [third] Replace jquery-caret with newer implementation.
Apparently, there are like 5 independently developed jquery-caret
plugins, none of which are great.  The previous one we were using was
last modified in 2010.  This new one comes from
https://github.com/acdvorak/jquery.caret and at least doesn't use
deprecated jQuery syntax and has a repository on GitHub.

This plugin is way larger than it needs to be for what it does, but we
can deal with that later.
2016-06-14 16:36:51 -07:00
Vishnu Ks 89d743787e Move recenter_view to viewport.js. 2016-05-27 01:03:21 -07:00
Vishnu Ks dc577343fe Move last_viewport_movement_direction to viewport. 2016-05-27 01:03:21 -07:00
Vishnu Ks fe4a03fd01 Move narrowed_msg_list to message_list.js. 2016-04-26 10:25:11 -07:00
Vishnu Ks 35b0af2852 Move all_msg_list to message_list.js. 2016-04-21 17:46:21 -07:00
Vishnu Ks 3179434f93 Move keep_pointer_in_view to pointer.js. 2016-04-19 15:23:45 -07:00
Vishnu Ks 35f70e9dac Move 5 legacy global variables to pointer.js.
Move recenter_pointer_on_display, suppress_scroll_pointer_update,
fast_forward_pointer, furthest_read, and server_furthest_read to
a new pointer module in pointer.js.
2016-04-12 10:56:54 -07:00
Vishnu Ks 2ac5271091 Move global variable have_scrolled_away_from_top to ui.js. 2016-04-10 10:55:16 -07:00
Kumar 4eced69228 Make subscriptions page error bar visible even when scrolled down.
Previously, the Zulip subscriptions page's error bar would always be
at the very top of the scrollable view, and thus would likely be out
of view when an error happened.  This fixes it by having the error bar
always placed below the search box (and thus visible regardless of
where in the scrollable streams view we are).

Fixes: #515.

[commit message and comments expanded by tabbott]
2016-04-08 21:04:43 -07:00
Elizabeth Sander 2ba01f4900 Defer permission for notifications until after tutorial.
In the process, remove old mozilla notifications hack since the
notifications_api shim should handle that case correctly.

Fixes #17.
2015-10-26 09:44:15 -07:00
Tim Abbott f340778798 Ensure gear_menu.js is initialized before hashchange.js.
This fixes a bug where loading directly to /#settings didn't work.

(imported from commit 4472373749a01db669e68866c7ce1a7a7c280ed6)
2015-09-19 23:23:01 -07:00
David Roe 3ac95ddc1a Add UserProfile flag to control whether we have a left side userlist.
Previously this was hardcoded for a single customer.

(imported from commit a6b7095050aa10cef976541505d9b09a35453f48)
2015-09-19 23:22:59 -07:00
David Roe 9590d988c5 Clean up code duplication in settings.js error reporting.
We can save a bunch of code by using the handle ui.js error reporting
helpers.

(imported from commit 7e993cae6e314c84d4ba8eaefd2ff7711c4bc19d)
2015-09-19 23:16:05 -07:00
Steve Howell e5467d3268 Move ui.js click handlers to click_handlers.js
(imported from commit adfeb1f152cca473bc4c6ba5ccd142b38947b335)
2014-03-14 20:48:59 -04:00
Steve Howell 16faed0a83 Create copy_and_paste.js (with code from ui.js).
(imported from commit 37a06af5489e7da5196e5710f384d1f5a7ee7578)
2014-03-14 20:48:59 -04:00
Steve Howell c5993c2d2d Create gear_menu.js (with code from ui.js).
(imported from commit fc4d058d49d5d4aaaa20ef6237ea3e927eac03e3)
2014-03-14 20:48:58 -04:00
Steve Howell 405c3d7626 Created floating_recipient_bar.js (with code from ui.js).
(imported from commit 2b6631938b0fc8e39c14aacd92f9f1670b68b199)
2014-03-14 20:48:58 -04:00
Steve Howell f8b71fa497 Created condense.js (with code taken from ui.js).
(imported from commit 72b27b48614a7c396170d46936646e52757e2743)
2014-03-14 20:48:58 -04:00
Steve Howell 84b59d4335 Created scroll_bar.js (with code taken from ui.js).
(imported from commit 0c4e8538031ceb1a0f50eea9a34e315e23e7d9ff)
2014-03-14 20:48:56 -04:00
Steve Howell be2a1c2893 Move resizing code to resize.js.
(imported from commit b6df0007307872751e1a4200af740076e08b5c11)
2014-03-14 20:48:55 -04:00
Leo Franchi f760567b96 Fix topic edits that are initiated from the FRB.
Grab the id of the selected row, whether it's a message, recipient bar, or FRB

(imported from commit 93b9c282d4220ba9bb271733ded4d90d5c051c75)
2014-03-14 20:48:55 -04:00
Steve Howell 50bc5401a4 Moved loading_indicator functions to loading.js.
util.make_loading_indicator -> loading.make_indicator
util.destroy_loading_indicator -> loading.destroy_indicator

(imported from commit 8a171622a6096476dd040912d3f1460d53159f20)
2014-03-14 20:48:52 -04:00
Zev Benjamin f45f0b1df6 Get message row safely in the presence of local ids
(imported from commit 4f8c4742206a9fcba4eb19653152aeb4919159bd)
2014-03-11 13:06:22 -04:00
acrefoot 43d866dd71 fixup copy and paste logic
Our restructuring of the messages (especially grouping) seems to be the culprit for message copy and paste

(imported from commit 14632a67f55efea4f1b53cc718a4f655ac83b387)
2014-03-11 13:06:19 -04:00
Steve Howell bc9a9db9b3 Select message if you click on its pencil icon.
This addresses #2351.  While I could see the argument for
wanting to edit a message without changing your selection,
I think it's just very surprising behavior and inconsistent
with the rest of the UI.

(imported from commit 3bb4faca0656258b76bfaafbd7f4a645810578f6)
2014-03-11 13:06:18 -04:00
Jason Michalski c753dfc9a8 Move reload initiation to an explicit initialize function
The reload initiation is required to run before other parts of the site
are started so that page_params will be setup correctly. This moves that
initiation out of an on ready handler to an explicit initialize call
near where the rest of the app is started.

(imported from commit b8994311299327aa3cfa57e3d9e92124a47123f4)
2014-03-03 18:17:15 -05:00
Jessica McKellar 87635b9e32 Convert settings from static HTML to a template.
This will make life much easier for handling update events.

(imported from commit 66b101eb5fae89b4eec6fc797fee8be26ac99bfb)
2014-03-03 16:08:32 -05:00
Jessica McKellar 07bb7b2fee Give users the option to propagate global stream changes.
This helps the common case of not liking our default of having audible
and desktop notifications enabled, and not making users adjust the
settings on every existing stream to fix it.

(imported from commit be75edb2c1385d1bd9a289416e2dffd8007f5e0a)
2014-03-03 16:08:32 -05:00
Jessica McKellar e0bd15669a Don't post checkbox data directly to /json/notify_settings/change.
They have weird properties like not sending anything for unchecked
boxes, which makes it hard to wrap a client-agnostic API around.

(imported from commit fef73a57a55b218b55dab6be3453dd6eac73c789)
2014-03-03 16:08:32 -05:00
Jessica McKellar 7829e809c7 Factor notification settings success and error callbacks into functions.
(imported from commit 3bce060ac6ecbad075dbdb8b9ec5514b191f0f95)
2014-03-03 16:08:31 -05:00
Jessica McKellar d89696291f Remove Notification (?) explanation popover.
(imported from commit f261f87c9571a76b8b0e2538ccb3bb4826ef449e)
2014-03-03 16:08:31 -05:00
Jessica McKellar c673b3b0b1 Pass global stream notification settings between frontend and backend.
(imported from commit 28ec021e8e5166d3b270c81c5a4ad543d2185aa5)
2014-03-03 16:08:30 -05:00
Allen Rabinovich 2d0b9e2aa2 Make right side chevrons visible, lighten usernames, adjust stream list scrolling speed
(imported from commit 8068bdf1ae7fd817fda36d7e32ea94e850ab5675)
2014-03-01 15:11:45 -07:00
acrefoot 7a97d01719 Fix broken viewport.message_viewport_info() calculations
`#tab_bar_underpadding` overlaps some with `.message_header`,
so adding `#tab_bar_underpadding.bottom + .message_header.height`
gave us a nonsense message viewport top.

Doing the calculation this way is more robust, as long as:
1) `$(".floating_recipient").offset().top` continues to give us a sensical number
   and is the last element just before the top of the viewport.
2)  nothing appears between the composebox and viewport.

In this commit I also removed the other couple of places where the #tab_bar_underpadding
was being used as a viewport reference, that no longer makes sense.

(imported from commit c7f35e41309900c581d5e2329c1becf161d501d3)
2014-03-01 11:52:46 -05:00
Allen Rabinovich ba0d3605ae Fix stream list scrollbar visibility
(imported from commit ef1f860ecd7f3ae908a69ac7c35a45d959505966)
2014-02-28 16:27:13 -05:00
Allen Rabinovich 99036efa06 Disable keyboard scrolling in sidebar
(imported from commit eca509a90df175d21d85eb409c0db9c8fbb931ea)
2014-02-27 20:25:41 -05:00
Allen Rabinovich 1eae686443 Add slim scrollbar to stream list
(imported from commit 58b64081db68fe9b1d2addcaece10167332d1a1b)
2014-02-27 20:25:41 -05:00
Allen Rabinovich efe8fe4650 Fix right sidebar offset to prevent it from overlapping the chevron
(imported from commit f5b979c30fa813ab5ac93382a68828415d7e0040)
2014-02-27 20:25:30 -05:00
Leo Franchi fe826cdf2b Grab the message id from the FRB when narrowing
(imported from commit 5b33a1ef09b70bf4f244fe0305a3da3f1d027391)
2014-02-27 20:25:26 -05:00
Leo Franchi 0dbcdb94af Set the zid of the FRB parent to be a valid row id
(imported from commit 31c559270a1f848e11b45f5ebeea68eaf7385ce4)
2014-02-27 20:25:25 -05:00
Allen Rabinovich 1686d27633 Tweaks and changes to adjust for new message block markup
(imported from commit 78210c2b98976243ee1b516bd9400a3071dd8cd9)
2014-02-27 20:25:25 -05:00
Leo Franchi 568c33f294 Render messages as groups of divs instead of individual rows
Now that we no longer use tables for our message list, we can
more logically group messages together.

(imported from commit 9923a092f91a45fe3ef06f2f00e23e4e3fb62a37)
2014-02-27 20:25:23 -05:00
Leo Franchi 748e5b6da6 Remove disabled summarization code
This experiment has been disabled for everyone for a while: if we
bring something like this back, it is not likely to be exactly the same,
and will be different enough to require a different implementation.

As it is, the summarization code was making a few code paths (rendering
especially) more complex, and is worth removing for simplicity's sake.

(imported from commit 6ac8cdc9f7077a5a1da01ab4268aba3db0bc43f8)
2014-02-27 20:25:23 -05:00
Steve Howell 2dd3776bc1 Consider .user-list-filter in right sidebar calculations.
(imported from commit f94100ba78d5756f20729ab6d752bc48af68ea3c)
2014-02-19 15:16:37 -05:00
Steve Howell 2ce57fa5b9 Make sure Group PMs show in right sidebar.
If you have a lot more individual users in your realm than group
PMs in your recent history, we were squeezing out the Group PMS.
We now max out the ratio for any sub-section in the right sidebar,
as well as bumping up the min.

(imported from commit f7c44367f2a518d27406993cb6358cc96d1aae92)
2014-02-19 12:45:49 -05:00
Allen Rabinovich d0572f50fb Miscellaneous style fixes for narrow window mode
(imported from commit f0a33be1640b2cb8810a0e7af52f453421cf0fe4)
2014-02-18 12:50:32 -07:00
Allen Rabinovich 01a04c3169 Add offsets to fixed elements based on the width of the browser scrollbar.
(imported from commit 2026725165dead381d0b99181ef84a67a5bd6626)
2014-02-18 12:50:31 -07:00
Allen Rabinovich 48476fcbc5 Code cleanup: remove commented code and console logs
(imported from commit 20058b87775653f2d526c2d3249549402bc36807)
2014-02-18 12:50:30 -07:00
Allen Rabinovich 235baf5187 Fix showing the private message floating recipient bar
(imported from commit 1ee76153dfe72627cbe43ea07b746407e5461da7)
2014-02-18 12:50:30 -07:00
Allen Rabinovich 78a3da7fbe Fix issues with message editing and status message layouts
(imported from commit 3ec5c6ccf6c20a6c102075887b6ff36afc613bdd)
2014-02-18 12:50:30 -07:00
Allen Rabinovich dbdc0a9721 Switch message pane headers to new design
(imported from commit f640641553779450f9d9d15e5586ef38e068367b)
2014-02-18 12:50:29 -07:00
Allen Rabinovich e7e2f3a79c Modify crumbbar style to look like an arrowbar
Also:
  * Change fixed element positioning and fix bugs
  * Move settings dropdown back to the right and add left padding to left sidebar

(imported from commit fcf903b59617687f94618a01ce7544b69f408130)
2014-02-18 12:50:29 -07:00
Allen Rabinovich 29250a6692 Move crumbbar to header and change visual appearance
(imported from commit 435e3b46b615f6c496be10b7d170ed3e4201787d)
2014-02-18 12:50:29 -07:00
Tim Abbott d7e4429bb7 Revert "Add adjustments for browsers with fixed scrollbar"
This reverts commit 462a3eb5e6b83f9d8091b83e3f8dc458236938ed.

We're reverting this to see if it is the cause of our recent CSS
performance issues.

(imported from commit 6a0b041cfcb6770bbfda0d354444bad2d64459ab)
2014-02-13 16:41:03 -05:00
Tim Abbott 36e2929ee2 Revert "Add radix arguments to parseInt calls"
This reverts commit fd77a988f1aa5bbdf430fbbb710dc9774fa85aaa.

(imported from commit 3865250797dd2ae8ebc9d26f491b0decf1786e21)
2014-02-13 16:41:02 -05:00
Allen Rabinovich 15da5628a9 Add radix arguments to parseInt calls
(imported from commit fd77a988f1aa5bbdf430fbbb710dc9774fa85aaa)
2014-02-12 11:24:27 -07:00
Allen Rabinovich addfcbfc30 Add adjustments for browsers with fixed scrollbar
(imported from commit 462a3eb5e6b83f9d8091b83e3f8dc458236938ed)
2014-02-12 10:47:54 -05:00
Tim Abbott 1bd9e5809c Restore the browser's scroll position on server-initiated reload.
(imported from commit 934659c0f1a2c014cfd2811fe49ea31abad262b2)
2014-02-06 10:25:35 -05:00
Jason Michalski 515e64175f Add extra logging when the selected row can not be found in the cache
The leading theories this will test are:

1) MessageList._items becomes unsorted and the binary search starts
returning the wrong index from selected_idx.

2) MessageListView.render is not rendering the message or it is not
being inserted into the cache.

(imported from commit 926b7d7bf9df338320a8cba6241038176ce4b47d)
2014-02-05 10:27:33 -05:00
Tim Abbott 8c733fde8f Use message_store rather than all_msg_list to get messages by id.
There are 2 uses of all_msg_list previous to this commit:

(1) The contiguous block of messages to be used for constructing the
initial state of narrows.

(2) A way to look up an arbitrary message by ID that may or may not be
in the home view to check if we have it locally.

We eliminate all applications of use case (2), replacing them with
queries on message_store, since they are in fact wrong -- any messages
that are outside the contiguous time period of all_msg_list would not
appear in all_msg_list and thus would incorrectly not be returned.

(imported from commit e2e2efe919242331bbc44abc6c50b16e3ab1336e)
2014-02-03 13:32:02 -05:00
Leo Franchi 0a9f54369a Disable desktop-app emoji handler. It breaks copying of formatted text
(imported from commit 14c9ee7ba61d4913da2d2e8c677739b573252525)
2014-02-03 13:07:43 -05:00
Leo Franchi f8a9f36dfa Don't use our copy handler when editing a message
(imported from commit 49e7001d8aa9af4f482b62332da03faad784074f)
2014-02-03 13:07:42 -05:00
Jason Michalski bb0784d9aa Remove tags from selectors to conform to the style guide
(imported from commit 14233e3ec8ca72cae6baa5fcb4e4068bd1524823)
2014-02-01 20:29:15 -05:00
Jason Michalski 80d2ecdd1e Enable custom copy handler when selection starts on a stream header
When users select messages starting with stream header we should format
the text as using the custom copy handler.

(imported from commit 4f9851939484d046619c3e53c71c47ad64797670)
2014-02-01 20:29:15 -05:00
Tim Abbott 88fbd5d16a Split out new module message_store.js.
(imported from commit 57cf3f2b8e74d7c56e3baf75859d5b3646282225)
2014-01-31 15:57:28 -05:00
Tim Abbott 004fd0eab8 Move unread-related functions from zulip.js to unread.js.
(imported from commit efc0dd84c2cd30b0203b906af6991475d8a63985)
2014-01-31 14:59:03 -05:00
Tim Abbott c8d57fcafb Split out message_flags.js.
(imported from commit 52afa76fa71141630e325e558cb9c6955d8c03d5)
2014-01-31 14:59:03 -05:00
Tim Abbott 6e5e5596fd Remove deferred installation of scroll handler.
This is no longer required, now that we're no longer scrolling the
main body of the page.

(imported from commit c2aa0d403c8fd0679b3110fe8e7684d46a7557fa)
2014-01-31 11:15:14 -05:00
Tim Abbott 1eb294ed11 Rename get_updates to get_events in the frontend.
We did this rename on the backend ages ago.

(imported from commit 11bdf6aa08d932fe2586de282f6174e3dba7267a)
2014-01-30 17:23:52 -05:00
Tim Abbott a7b1b29bf0 Move get_updates into a module.
(imported from commit 9a6c0ab1e76dd96abad8626bc5b1fdbd234b2645)
2014-01-30 15:57:28 -05:00
Jason Michalski 9cc1dc242c Move the mouse handlers from window to app
(imported from commit 0331496a578c47f73b6c9e81d8a79e26e8d7a9a3)
2014-01-30 01:48:15 -05:00
Tim Abbott abbe0f781f Don't wait 1 second before syncing updates manually controlled flags.
(imported from commit 8526f5d77aee078b5bc282da093009e19f016a44)
2014-01-30 12:48:36 -05:00
Tim Abbott 20457d695d Fix starring/unstarring of messages.
This got broken in the local echo refactoring -- we accidentally
switched the update_starred function to be a toggle, which meant that
the message would be marked as starred and then unmarked as starred
moments later, due to the two update_starred calls for the initiating
browser (one from when the click happens, the second from when the
event returns from the server).

(imported from commit 8f83729fe5477cf052124c1c56ed9189b85b885c)
2014-01-30 12:48:36 -05:00
Leo Franchi 1666403850 Find message objects in any lists when updating, as update might come from server
(imported from commit fa70180c9a228bff39efd846d465d0f1fa9bb4e7)
2014-01-28 17:31:02 -05:00
Leo Franchi ea04d027cf Don't allow editing of local-only messages
(imported from commit 4fcac6b4b7a5f917944934d06eae757d7cca8170)
2014-01-24 14:01:19 -05:00
Leo Franchi c0d56c822f Use the batched_flag_updater in ui.js as well as zulip.js
(imported from commit 6dea64d068d013471baf4022a8041f54da5c111e)
2014-01-23 16:28:57 -05:00
Leo Franchi 883122b129 Allow editing of locally echoed messages that failed to be sent
(imported from commit eff8d55af7a1ff123ed2a2e45e58ff74de96beac)
2014-01-23 16:28:55 -05:00
Leo Franchi c3f798297e Show message failure message on hover of error
(imported from commit 8379c3c35c612d3609d2ab378eb6ca2f7ec120b1)
2014-01-23 16:28:55 -05:00
Leo Franchi 00f64113e9 Support locally echoing messages when sending
(imported from commit 00b5c5f9b933d119553c32cadff0f17b9f7c2879)
2014-01-23 16:28:55 -05:00
Tim Abbott 8fa49388c0 Sync the starred message flag to browsers without reload.
(imported from commit e685104275f471d1cd9b94e1803c26f714628f36)
2014-01-23 13:21:59 -05:00
Tim Abbott 59cd1663df Rename confusing update_message_* functions in ui.js.
(imported from commit eeb2b1f92deb807676a75f1263d994a8c606b249)
2014-01-23 13:21:59 -05:00
Tim Abbott 59b0af835e Use clearer variable name for toggle_star argument.
(imported from commit 6cc604b0cbe8a3a16ff4772e811af1fb4b41aa1e)
2014-01-23 13:21:59 -05:00
Steve Howell 887c2059b1 Make the Administration menu item be show/hide-driven.
Always render the Administration menu item from the back end, but
make it be hidden by default until the page is loaded.  Then, the
client can un-hide it as needed.

(imported from commit 66e607eec430d7179b4d5ac3f5416f5be8ac26c9)
2014-01-22 14:43:29 -05:00
Tim Abbott 7f174213ed Add an idempotent flag to the channel module.
(imported from commit d5b867d2a8f176cae76c8b68435c4fab318d998b)
2014-01-10 21:39:00 -05:00
acrefoot 0d08acaa1b Transition from tables to divs for the message list.
This breaks our casperjs tests.

(imported from commit c63181c73a24eed4a80bfa56966d1f0871c5edb2)
2013-12-19 18:28:11 -05:00
Tim Abbott 795930c803 Add channel module wrapping our various JSON requests to the server.
(imported from commit 6489938678551ad8594822363ae6d1c9ae295496)
2013-12-19 16:52:47 -05:00
Waseem Daher fa17fb0da1 Place "autoscroll" option in a "Zulip Labs" section.
(imported from commit 31e8d0b5c1454932398cf732c0c4ad0702e5274b)
2013-12-16 10:43:49 -05:00
acrefoot 07501cd12c only show 'auto-scroll forever' setting for zulip.com and customer28.invalid
(imported from commit 329ea6a4f715a093a1ab56777964ca751300ac0c)
2013-12-13 11:50:11 -05:00
acrefoot 59bbe33954 Cinch up whitespace during some cases. This is for when enable_autoscroll_past_unread is set
basically this tries to turn scroll-the-world into not-scroll-the-world
This is not very good--maybe Allen has a better idea. The best solution would be to
turn off scroll-the-world. Look for it after the tables->divs change happens.

(imported from commit ae0b6976bca57986f95022f2470bc7117eda7fa3)
2013-12-13 11:50:11 -05:00
acrefoot 1bd420f12c Show auto-scroll forever setting in /#settings
(imported from commit fa66cbe52836f230e551f25c47bd755b705387d2)
2013-12-13 11:50:11 -05:00
Steve Howell da69fc19de Fix width checks for skinny mode.
We now use window.innerWidth to check for CUSTOMER7's skinny
mode, which empirically seems to be more consistent with
CSS's max-width @media settings.

I tested under FF, Safari, and Chrome.

(imported from commit d440998634633c11b471fe732104be252c979cd4)
2013-12-12 15:41:17 -05:00
Steve Howell 009d1ed88a DRY up check for feature_flags.left_side_userlist.
(imported from commit d7cbb1eee0e83ddf811451e10dd6dcd03c86ffd0)
2013-12-12 15:41:16 -05:00
Steve Howell b53513a5e7 Uncondense messages that have recently become "short."
It's possible for a message to be considered "long" at one point,
and then if you narrow to it later, it should be considered "short",
because either the screen's wider or taller.  This commit makes
sure that we remove the "condensed" flag from short messages,
and it also fixes the "More..." click handler's assumption that
could-be-condensed will always be true for condensed messages.

(imported from commit 77e4a1ad299c09f12e5609a972d5668472bd4a81)
2013-12-12 15:38:38 -05:00
Steve Howell 7427fb8d98 Cache message heights for ui.condense_and_collapse().
Cache the height of messages to speed up ui.condense_and_collapse()
to make narrows work more quickly.  The height of the message
determines whether it is auto-condensed or not.  We clear specific
cache entries when messages get edited, and we reset the entire
cache when the window width changes.

(imported from commit 7c12070a3eb3e2e1a2dfeb8d9109f3404a46c032)
2013-12-12 15:38:38 -05:00
Allen Rabinovich c51a2355ee Make white background permanent
(imported from commit a9164b8f800cbc992ec72e9125a5adb08bb97615)
2013-12-10 11:30:28 -07:00
Steve Howell e4f917aa9c Remove "Invite coworkers" link from left sidebar for CUSTOMER7.
(imported from commit 3955b7e10a639fef67948bc49b2f535acd5bc765)
2013-12-06 17:17:26 -05:00
Steve Howell 1c5d642672 Show Group PMs in CUSTOMER7's left sidebar.
(imported from commit ee8068e1cb0408a6bc42381333d05d4d09689d35)
2013-12-06 17:17:26 -05:00
Steve Howell f607b24ee5 Make size_blocks work for > 2 blocks.
This changes the algorithm slightly for the 2-block case, because
I simplified the logic to just divvy up the space naively based
on the relative size of the blocks.

(imported from commit 9498edd916f65e07fb64d138276691d0d5cc0e55)
2013-12-06 17:17:26 -05:00
Steve Howell 90d97a39c6 Extract ui.confine_to_range().
(imported from commit d95fd01e9783d01908a1155e260bac52339eb6ca)
2013-12-06 17:17:26 -05:00
Steve Howell c1dcf38b0a Use size_blocks() in ui.left_userlist_get_new_heights().
This is a functional change.  Before this change, the stream
list and user list were allowed to take equal space in the left
sidebar; now, we take the size of each list in deciding which
proportion each block gets.

(imported from commit febedcb0518353825e18a6ebe60d1883b98bc78d)
2013-12-06 17:17:25 -05:00