Commit Graph

28 Commits

Author SHA1 Message Date
Armaan Ahluwalia 6d255efe4c app: Prepare JS files for consumption by webpack.
This commit prepares the frontend code to be consumed by webpack.

It is a hack: In theory, modules should be declaring and importing the
modules they depend on and the globals they expose directly.

However, that requires significant per-module work, which we don't
really want to block moving our toolchain to webpack on.

So we expose the modules by setting window.varName = varName; as
needed in the js files.
2018-07-05 10:53:36 +02:00
Shubham Dhama 80a2d5bc59 eslint: Enable `conditionalAssign` config of no-trailing-spaces rule. 2018-06-11 07:51:24 -04:00
Shubham Dhama dcb6254a4e eslint: Enable `no-extra-parens` rule.
Following sub-configuration is disabled:
                "nestedBinaryExpressions": false,
2018-06-11 07:51:24 -04:00
Joshua Pan dcee398622 onboarding: Redesign intro_reply hotspot in bottom whitespace.
This is a trial to have the first reply hotspot in the bottom
whitespace (and stick there until "Got it!"  is pressed).

Tweaked by tabbott to clean it up a bit.  Still needs more work on the
visuals.
2018-05-23 14:22:19 -07:00
Tim Abbott 063d11b139 js: Standardize indentation of switch/case statements.
This gets my current draft eslint indentation configuration passing
cleaning on static/js.
2018-05-06 19:35:18 -07:00
Tim Abbott 7ab8a8e820 js: Fix a bunch of indentation issues found by eslint.
This is preparation for enabling an eslint indentation configuration.
90% of these changes are just fixes for indentation errors that have
snuck into the codebase over the years; the others are more
significant reformatting to make eslint happy (that are not otherwise
actually improvements).

The one area that we do not attempt to work on here is the
"switch/case" indentation.
2018-05-06 16:25:02 -07:00
Shubham Dhama b34b8cdb97 hotspots: Fix real-time sync for dismissing hotspots.
This closes all the hotspots which aren't included in the event.hotspots.
This means we treat all the hotspots in event.hotspots as the hotspot
which need to be shown.

Fixes: #8690.
2018-03-18 10:22:09 -07:00
Shubham Dhama 120ebc8f13 hotspots: Move the code for closing hotspot icon to hotspots.js. 2018-03-18 10:22:09 -07:00
Shubham Padia 8722c755e3 onboarding: Add bouncing ? next to hotspots.
Fixes #8124.
Adds bouncing question mark with twice the frequency of the
pulse.
2018-03-01 20:23:51 -08:00
Rishi Gupta ac48772732 hotspots.js: Fix timeout millisecond conversion. 2017-09-15 04:14:52 -07:00
Rishi Gupta a8deedbbb6 hotspots: Replace stream_settings with intro_streams and intro_topics. 2017-09-15 04:14:52 -07:00
Rishi Gupta 0677bd2a6d hotspots: Rename and update new_topic_button. 2017-09-15 04:14:52 -07:00
Rishi Gupta 4a383544af hotspots: Rename and update click_to_reply. 2017-09-15 04:14:52 -07:00
Rishi Gupta c985791773 hotspots.js: Inline map_hotspots_to_DOM.
The function is confusing and added unnecessary complexity, given that it is
only called in one place, and is not a function that should be exposed to
other modules.
2017-09-15 04:14:52 -07:00
Rishi Gupta 546384ce30 hotspots.js: Refactor place_icon for clarity. 2017-09-15 04:14:52 -07:00
Rishi Gupta 91819fa694 hotspots.js: Give names to long selectors in place_icon. 2017-09-15 04:14:52 -07:00
Rishi Gupta 9f7b310a3e hotspots.js: Do not place_popover if icon is not visible.
Attempting to do so throws an exception if hotspot.location.element can't be
found.
2017-09-15 04:14:52 -07:00
Rishi Gupta 836a2c502e hotspots.js: Clean up icon positioning code.
Also will allow more fine-grained positioning.
2017-09-15 04:14:52 -07:00
Rishi Gupta 09b4927578 hotspots.js: Fix hotspots not appearing.
The original had two bugs in this line of code that cancelled each other
out. 4d0f304 fixed one, causing hotspots to no longer appear. This commit
fixes the second.
2017-08-29 14:08:45 -07:00
Harshit Bansal cd2f41dbb1 popovers: Extend the `compute_placement()` function.
This commit extends the `compute_placement()` function in
`popovers.js` to take into account height/width of popover as well as
positioning preference. If vertical positioning is desired and the
popover fits in either 'top/bottom' positions then we don't check for
`left/right' positions. Earlier the behavior was to prefer
'left/right'positions over 'top/bottom' positions, which resulted in
the emoji picker popping incorrectly to the left.
2017-08-27 12:27:53 -07:00
Max Schaefer 4d0f304048 js: Fix two misphrased conditions. 2017-08-22 09:37:15 -07:00
Jack Zhang c69b5d7d65 hotkey: Add support for hotspots on enter. 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
Jack Zhang 5a8b1e6253 hotspots: Implement hotspots frontend. 2017-07-28 16:34:15 -07:00
Rishi Gupta dbac262509 hotspots: Change hotspots to have a name and a description. 2017-06-13 12:59:33 -07:00
Amy Liu 6f061beb46 hotspots: Add backend support for tutorial hotspots.
This commit adds the backend support for a new style of tutorial which
allows for highlighting of multiple areas of the page with hotspots that
disappear when clicked by the user.
2017-03-29 11:34:32 -07:00