aboutsummaryrefslogtreecommitdiffstats
path: root/content_scripts/hud.coffee
AgeCommit message (Collapse)Author
2017-11-18FF: Show HUD (transparently) when pasting, manage focus changes bettermrmr1993
2017-11-18Initialize the HUD for clipboard operations if it hasn't been alreadymrmr1993
2017-11-18FF: Add copy/paste functions to the HUDmrmr1993
2017-10-27Move FindMode exit functions into FindModemrmr1993
2017-10-25FF: Share |root| global proxy, re-add the globals to window on DOMLoadmrmr1993
This is a workaround for Firefox bug 1408996.
2017-04-16Rework FindMode HUD refocusing to not depend directly on the HUDmrmr1993
2016-12-21Don't focus non-focusable node.Stephen Blott
Try the following.... - load page - `/` - type some junk which matches nothing - `Escape` We expect to leave find mode. Instead, we have to hit escape again to get out of find mode. Here, `focusNode.focus()` is not a function.
2016-04-28Fix UI-component initialization issues.Stephen Blott
This fixes some UI component initialization issues. It's a long story... The problem. - Go to this page: http://www.thejournal.ie/seanad-election-results-2016-2737768-Apr2016/ - Click one of the links from the "Most Popular" box on the right. - Navigate back (`H`) and, as the original page is loading, activate the Vomnibar. In 1.54 this renders Vimium unusable. In `master` this renders the Vomnibar unsable, but the rest of Vimium usable. It seems the source of the issue is that we're initializing UI components too soon. We need to wait until the `readyState` is "complete". With this PR: - The Vomnibar is initialised when the `readyState` is "complete" (in the top frame only, and only if Vimium is enabled). Requests arriving prior to then are silently discarded. - The HUD is also initialized only when the `readyState` is "complete"; however, requests arriving before then are queued. So, if the user immediately enters insert mode, then the "Insert mode" indicator will eventually be displayed. - The help dialog silently discards requests until the `readyState` is "complete. I'm posting this as a PR because: 1. It needs some visibility. 2. With this, if the `readyState` *never* reaches "complete", then the Vomnibar would be unusable. And that's pretty serious.
2016-04-18Simplify find-mode exit event.Stephen Blott
Previously, we were transferring a "transferable event" from the HUD UI component to the content script (when find mode exits). In addition to being unnecessary, this was triggering a warning in the console because we were reading *all* of the events keys, including one which triggers a "this is being deprecated" warning. The approach here is simpler, transfers less data and avoids triggering the warning.
2016-04-18Abandon HUD on help-dialog close.Stephen Blott
If the help dialog loses the focus and closes, then we abandon any HUD which is being displayed. This ensures that - when the help dialog is reopenned - we're not displaying an old, out-of-date HUD message.
2016-04-18Require documentReady for all UI components.Stephen Blott
This replaces c01d7eea8675f9a7d84999777e8de72244d687b6. All UI components require the document to be ready. So, here the constructor waits for DomUtils.documentReady(). The diff looks big, but mainly it's a result of changes in indentation in the constructor and in hide(). Also, hide() now uses @postMessage() to post a null message. This forces hide to use @iframePort.use(), which ensures that hide()s cannot overtake activate()s. This continues #2100.
2016-04-18Revert "UI-compnent commands must wait for the document to be ready."Stephen Blott
This reverts commit c01d7eea8675f9a7d84999777e8de72244d687b6. Preparatory to implementing an alternative approach.
2016-04-17UI-compnent commands must wait for the document to be ready.Stephen Blott
2016-04-17Do not init() the HUD until it's needed.Stephen Blott
This avoids initializing around 15 (almost all unused) HUDs on sites like GMail and Google inbox. Because the HUD is small, there is not noticable flicker.
2016-04-16Self code review re. ui-component focus handling.Stephen Blott
2016-04-16Remove dead code from the HUD initialization.Stephen Blott
2016-04-16Rework UI component focus handling.Stephen Blott
The code to handle the focus for UI components has been tweaked and adapted over time, and has become quite complicated (and brittle). This reworks it from scratch, and co-locates similar code which does related things. Fixes #2099.
2016-04-09A UI component isn't ready until it's ready.Stephen Blott
1. Do not initialize UI components until the DOm is ready. 2. Do not register UI components as ready (specifically the HUD) until the full initialization sequence is complete. This goes some way towards fixing the issue described in this comment: https://github.com/philc/vimium/issues/2081#issuecomment-205758102 It relates to link-hints mode hanging when launched during a navigation. This problem exists in 1.54, but emerged during testing of global link hints. "Some way toeards fixing..." because it is still possible to trigger issues.
2016-03-18Refactor the front-end initialisation sequence.Stephen Blott
The front-end initialisation sequence has become quite confused. This simplifies it, makes things which must be idemtpotent explicit and renames some functions to make it clear when they run. It also avoids a situation where we were possibly installing a `domReady` function to initialise the HUD multiple times. Should be a no-op functionality wise.
2016-03-06Initialize UI components only when they're needed.Stephen Blott
HUD: Initialize only when the frame receives the focus and Vimium is enabled. Vomnibar: Initialize in the top frame when Vimium is enabled in *any* frame. Warning: There may be a race condition here. Specifically, if Vimium is disabled in the main/top frame (T) but enabled in another frame (A), then the initialisation could happen in frame A before frame T is listening, so frame T would miss the initialization message (which is only sent once). Message listeners are installed early (and probably installed first in the main/top frame), and the `isEnabledForUrl` messaging takes some time, so perhaps it's OK. But it *is* a race condition. Fixes #1838.
2016-03-06Make HUD.init() idempotent.Stephen Blott
2016-02-20hideHUD option applies to insert mode only.Stephen Blott
This makes the `hideHud` option apply only to insert mode (when entered with `i`). Fixes #1953. Fixes #487. We could rename the option itself and add migration code, but that seems overkill. An alternative would be to remove this option entirely.
2015-08-26Use createElementNS for XML documents and remove XML specific codepathsmrmr1993
This implements @gdh1995's idea from #1796.
2015-06-13Refactor duplicate code.Stephen Blott
2015-06-13Refactor findInPlace.Stephen Blott
This code belongs together, so we put it together.
2015-06-11Make exiting FindMode with <esc> work as it should againmrmr1993
This undoes the effect of the breaking refactor in 73f66f25e6b8e5b5b8456074ad4fa79ba1d3ca4d, where PostFindMode was entered whenever FindMode was exited, instead of only when it was exited with <enter>.
2015-06-10Update rawQuery directly from FindMode.updateQuerymrmr1993
2015-06-10Move findModeQuery to FindMode.querymrmr1993
2015-06-10Move updateFindModeQuery to FindMode.updateQuerymrmr1993
2015-06-10Inline HUD.findModeKeydown at its sole callsitemrmr1993
2015-06-10Remove redundancy in HUD.findModeKeydownmrmr1993
2015-06-10Move findModeQueryHasResults to findModeQuery.hasResultsmrmr1993
2015-06-10Remove global findMode and pass new FindMode instances direct to the HUDmrmr1993
2015-06-10Remove unused argument to HUD.showFindModemrmr1993
2015-06-10Inline HUD.updateMatchesCount at its sole callsitemrmr1993
2015-06-10Inline showFindModeHUDForQuery at its sole callsitemrmr1993
2015-06-10Integrate performFindInPlace into FindMode as findInPlacemrmr1993
2015-06-10Move finding the element at a selection's focus to a library functionmrmr1993
2015-06-10Handle up and down keys directly in the HUDmrmr1993
2015-06-10Move FindMode's keydown to the HUDmrmr1993
2015-06-10Fix returnToViewport support for FindModemrmr1993
This was broken by the move to taking input in an iframe, since the frontend was no longer getting keydown events for text changes, and so the viewport wasn't being scrolled back to its original position until the mode was exiting.
2015-06-10Ensure focus is called on the appropriate element when closing the HUDmrmr1993
2015-06-10Accept input in the HUD iframemrmr1993
2015-06-10Make all find mode updates go via the HUD in preparation to use an inputmrmr1993
2015-06-10Decide find mode text in the HUD iframe, not in frontendmrmr1993
2015-05-31Replace settings.get with Settings.get in the frontendmrmr1993
2015-05-29Disable Tween on XML pagesmrmr1993
2015-05-13Minor fixes for #1658.Stephen Blott
- Mis-named: "handler" -> "name". - We need to reset the HUD's innerHTML on hide to avoid a flicker when HUD later becomes visible again (but with new text). - There is no longer a need to hide the HUD in order to avoid mathing the text in the HUD itself.
2015-05-13Move the HUD to an iframe, managed by UIComponentmrmr1993
2015-05-12Fix HUD on options page (temporary fix, v2).Stephen Blott
Alternative to 7004420e178416cc680416091a23dd804fb9370c.