Commit Graph

4227 Commits

Author SHA1 Message Date
Jack Zhang 0e41ace321 Hide deprecated integrations with legacy tag. 2017-08-10 10:21:53 -07:00
Jack Zhang 3e04062da1 Show name of integration in mobile single-integration view. 2017-08-10 10:21:53 -07:00
Jack Zhang d3cc201332 Refactor /integrations state, routing, and rendering logic.
A large portion of the diff for landing-page.js is due to refactoring the
contents of integrations_search into top level UI update functions.

State flows as follows: dispatch(action) -> render(state) -> update UI

Routes now use pushState instead of hashes.

On transition between categories scrolling position is fixed,
and on transition between catalog and integration sub-pages the page
scrolls to the top.
2017-08-10 10:21:53 -07:00
Jack Zhang c0328de03d portico: Load INTEGRATIONS and CATEGORIES page data. 2017-08-10 10:21:53 -07:00
Jack Zhang 5a87f90b24 landing-page: Replace detect_path with path_parts.
path_parts returns an array of all location.pathname's `chunks`,
the strings within the path, split by slash.
2017-08-10 10:21:53 -07:00
Jack Zhang cc54fe2e30 Move integrations dropdown click handler into integration_events. 2017-08-10 10:21:53 -07:00
Jack Zhang 63ad7b6769 Rename /integrations/doc API endpoint as /integrations/doc-html. 2017-08-10 10:21:53 -07:00
Brock Whittaker 00c44379e3 Replace Doctor on Demand logo with new logo.
This updates the logo for Doctor on Demand.
2017-08-10 10:19:44 -07:00
Vaida Plankyte 9548d4635a frontend: Remove IDs from alt value of inline images. 2017-08-10 09:43:43 -07:00
Brock Whittaker 41f395caf1 your-account: Change "no changes made" error to success.
This changes the alert error "Error changing settings: No new data
supplied" to "No changes made" as a success bar.
2017-08-09 19:46:43 -07:00
Brock Whittaker 4b4283550f lightbox: Fix incorrectly displayed avatar image.
The lightbox "v" shortcut should not show a user's avatar,
so this limits the scope of images it can choose to ones inside
of the `.message_content` div.
2017-08-09 14:33:00 -07:00
Brock Whittaker 2b45c17dbc /features/: Fix wave position.
On some monitors it appears as though there's a slight gap between
the bottom of the wave and the top of the section below. This moves
the wave down a pixel to ensure the gap disappears.

Fixes: #6064.
2017-08-09 13:52:22 -07:00
Steve Howell 9cad3a009f Add topic server history, but behind a feature flag.
You can now see full topic history if you set the flag
`feature_flags.use_server_topic_history` to `true`.
2017-08-08 17:07:09 -04:00
Steve Howell 3b88e592d0 Add topic_data.get_server_history().
This isn't connected to anything yet, but you can now get
all the historical topics for a stream by calling
topic_data.get_server_history().
2017-08-08 17:07:09 -04:00
Brock Whittaker 7d80e0c78c portico: Fix #registration padding.
This fixes the registration padding to not be really large. It was an
issue of margin + padding instead of using margin for both where the
result would be max(margin1, margin2).
2017-08-08 13:21:48 -07:00
Brock Whittaker 6a406e2b70 portico: Fix tables to be striped again.
This fixes tables to be in more of a compartment and striped again
(which they lost due toe the light grey background).
2017-08-08 13:21:48 -07:00
Brock Whittaker 9f2017c1aa portico: Unify with smaller box shadows.
This unifies components with smaller, more consistent box shadows.
2017-08-08 13:21:48 -07:00
Brock Whittaker 3d4198c681 Replace `String.prototype.startsWith` with `indexOf`.
This replaces the `startsWith` string prototype method with `indexOf`
because no versions of Internet Explorer support this feature, and
it really is not difficult to just use `indexOf` instead and check
whether the starting index of the full string is 0.
2017-08-08 12:06:32 -07:00
Brock Whittaker be33266f83 Make 4xx and 5xx pages full screen.
This makes the 4xx and 5xx pages full screen by changing the
`.error_page` div to be fixed and full screen height.
2017-08-08 11:58:22 -07:00
Greg Price 8ccd8a7d27 settings: Wait for i18n setup before rendering settings nav.
Much like the parent commit and 038a2c769, but this time for the
"Settings"/"Organization" nav at the upper-left of the settings overlay.
2017-08-07 18:22:51 -07:00
Greg Price ee3ead2744 ui: Wait for i18n setup before rendering hotkeys help.
Much like 038a2c769, but for the three tabs at the top of the
`?` help overlay for keyboard shortcuts.
2017-08-07 18:22:51 -07:00
Greg Price 8ab213e3e4 locale: Update Japanese strings. 2017-08-07 16:58:10 -07:00
Jack Zhang c69b5d7d65 hotkey: Add support for hotspots on enter. 2017-08-05 18:32:37 -07:00
Jack Zhang 04fda9e51f hotspots: Decrease default hotspot icon z-index to 100.
This keeps hotspot icons positioned at the front of the message
viewport but behind sidebars (i.e. the left sidebar has a z-index
of 103). Hotspots associated with elements outside of the message
viewport should be individually adjusted at the bottom of hotspots.css.
2017-08-05 18:32:37 -07:00
Jack Zhang 1e40665e51 hotspots: Debounce hotspot placement on UI updates by 10ms.
A small delay to ensure that the event (i.e. a click) has completed
and the UI has updated before hotspot icon and popover placement
is recomputed.
2017-08-05 18:32:37 -07:00
Jack Zhang 5ce0db9f43 hotspots: Add friendly whale illustration to popover. 2017-08-05 18:32:37 -07:00
Jack Zhang bbe8f73c23 popovers: Reimplement compute_placement.
compute_placement utilizes the dimensions of the viewport, viewport location of
an element, and dimensions of an element to determine if a popover will fit
horizontally and/or veritically given its orientation. The default placement
is now viewport_center, which displays the popover, without an arrow, in the
fixed center of the viewport.

This should be particularly useful for hotspots on mobile or large popovers
that contain a lot of content. The property hotspot.location.popover can be
optionally set to fix the orientation of a popover (most likely to
VIEWPORT_CENTER).
2017-08-05 18:32:37 -07:00
Vaida Plankyte ca19cb6900 frontend: Fix stream-creation aria-label assignment. 2017-08-05 18:11:27 -07:00
Vaida Plankyte ee23e6f118 frontend: Fix default_language_modal aria-hidden assignment. 2017-08-05 18:11:27 -07:00
Brock Whittaker 4321f1f2b4 /help/: Remove "| User Documentation" string in narrow windows.
This responsively moves the header so that it doesn’t push the login,
registration nav options to the next row.
2017-08-05 17:57:07 -07:00
Brock Whittaker ef3131c77b help: Change .header nav to be on top of page elements.
WARNING: This change affects all portico pages, but it looks better.
This makes the nav sit on top and have a subtle box shadow.
2017-08-05 17:57:03 -07:00
Brock Whittaker 22eb102a8e help: Change .markdown .content to be white. 2017-08-05 17:57:02 -07:00
Brock Whittaker 3f550a940b help: Impose a max width for the .markdown .content. 2017-08-05 17:57:00 -07:00
Tim Abbott c657db77e8 lightbox_canvas: Fix use of unsupported const. 2017-08-05 16:47:11 -07:00
Brock Whittaker e22920bef6 Fix lightbox zoom issues.
This fixes the lightbox zoom issues that occurred on some browsers
due to the units of `deltaY` being in lines rathern than pixels,
making it incredibly slow to zoom.
2017-08-05 15:47:34 -07:00
Steve Howell 541156792e Add /mark_all_as_read endpoint.
This change simplifies how we mark all messages as read.  It also
speeds up the backend by taking advantage of our partial index
for unread messages.  We also use a new statsd indicator.
2017-08-04 14:10:46 -07:00
Steve Howell eafd5a731a Remove dead code: messages.flags.send_force_collapse. 2017-08-04 13:31:26 -07:00
Steve Howell cc94d6179c Remove dead code: messages.flags.send_force_expand. 2017-08-04 13:31:26 -07:00
Steve Howell 437cabe34c Just use message.unread when rendering.
By the time we render messages, we will have set message.unread,
so we don't need to calculate it from flags.

We add a line to the local-echo path to make this explicit
in that code.
2017-08-04 13:31:26 -07:00
Steve Howell f81f9a26e8 Call message.set_message_booleans() in update_messages().
When we learn about updated message, a bunch of flag/boolean
fields concern us:

    starred
    mentioned
    alerted
    is_me_message

We now set booleans consistently with how we set new incoming
messages.
2017-08-04 13:31:26 -07:00
Steve Howell 187ec3a922 Set message.unread in set_message_booleans().
The sooner we make message.unread consistent with message.flags,
the better.
2017-08-04 13:31:26 -07:00
Steve Howell abe7f4cc40 Extract message_store.set_message_booleans().
We'll want to reuse this for message updates, and we'll eventually
want to bypass this for local echo.
2017-08-04 13:31:26 -07:00
Steve Howell ff54d52589 Extract message.set_read_flag().
This code adds 'read' to message.flags and sets message.unread
to false.

It's not clear that the boolean message.unread is used in any
meaningful way, but we set it to false to avoid confusion.  The
bankruptcy code was not doing this before.

Another quirk that existed before was that you could get two
'read' flags in a message when you declared bankruptcy.  It's
also plausible that this could happen if you marked a message
as read via two different ways.  It probably did not cause
user-facing bugs, but it would be confusing for troubleshooting.

Fixes #5032.
2017-08-04 13:31:26 -07:00
Steve Howell d5681556d5 Call unread.process_loaded_messages earlier when inserting.
We want to maintain the invariant that unread.js always knows
about unread messages as soon as they are loaded.
2017-08-04 13:31:26 -07:00
Steve Howell a07bd70449 Inline message_util.do_unread_count_updates(). 2017-08-04 13:31:26 -07:00
Steve Howell 7cae3fa916 Use bucketers in unread_topic_counter. 2017-08-04 13:31:26 -07:00
Steve Howell 66c2ca9a2a unread: Add make_bucketer().
This class encapsulates reverse lookups to make deletions
O(1).  It is also a bit smarter about not creating
throwaway objects, by avoiding setdefault.
2017-08-04 13:31:26 -07:00
Steve Howell 42f3b3ec00 unread: Add make_id_set().
This is a better abstraction for a set of ids, plus all the
dictionaries are kind of confusing.
2017-08-04 13:31:26 -07:00
Steve Howell 241f095213 Extract unread_ops.process_read_messages_event().
The new method borrows some code from the event loop
and unread_ops.mark_messages_as_read, and it is now
flexible about message_ids being marked as unread
even when there is no corresponding message in the
message store.  For that scenario we still want to
update our data structures, which wasn't happening
before this change.  (Generally, this was a non-issue
up until now, but it will become a bigger issue when
we start loading unread message ids from the server.)
2017-08-04 13:31:26 -07:00
Steve Howell 00a3f6b5f2 Extract process_newly_read_message(). 2017-08-04 13:31:26 -07:00