aboutsummaryrefslogtreecommitdiffstats
path: root/content_scripts
AgeCommit message (Collapse)Author
2016-03-28Global link hints; reinstate href-based modes.Stephen Blott
2016-03-28Golbal link hints; fic tests.Stephen Blott
2016-03-28Simplify diff (again).Stephen Blott
2016-03-28Simplify diff.Stephen Blott
2016-03-28Global link hints...Stephen Blott
TODO: - fix tests
2016-03-28Move link activation to HintCoordinator.Stephen Blott
This moves the link activation logic out of LinkHintsMode and into the hint coordinator. At this point, there is (almost) no DOM-specific logic left in LinksHintMode. It only depends an a list of "elements", each of which has a rect property. The main exception to this is filtered hints. In the following commits, we're going to leave filtered hints behind - mainly to keep the diff shorter and cleaner.
2016-03-28Add HintCorrdinator stub.Stephen Blott
This adds a shim between launching a link-hints mode and creating the LinkHintsMode object. The shim is responsibly for for finding the clickable elements. This is preparatory to implementing global hints.
2016-03-28Separate ClickableElements functions from LinkHintsMode.Stephen Blott
Really, all of the code related to finding clickable elements is unrelated to LinkHintsMode. Unfortunately, it's embedded in the middle of the class. So, we can't use it from outside of the class. This is a temporary restructuring of the link-hints code. The intention is to move the lines around eventually. For now, however, we do it like this to keep the diff smaller and clearer.
2016-03-27Finally fix help-dialog focus issue.Stephen Blott
In the previous commits, I omitted to actually check that the help dialog wasn't closing on the options page. I should be good now.
2016-03-27Handle focus events for UI components.Stephen Blott
The help-dialog UI component was ignoring requests to "hide" when other frames are focused (because previously it covered the whole screen, and no other frame could get the focus). With f0911e52f0e71c6d2539bdc74a09ff2dbd5ab125, the help dialog no longer covers the whole screen, so it must listen for and react to "frameFocused" events. However, the help dialog should not "hide" when the frame that is focused is itself! This required a little extra plumbing. That plumbing is helpful, though, because it allows individual UI components to decide what to do when another frame receives the focus (as opposed to the previious version, which simply unilaterally sent a "hide" message).
2016-03-27Fix options page when help-dialog showing.Stephen Blott
This allows the user to enter key mappings on the options page with the help dialog open. Fixes #2045.
2016-03-27Fix handler return for escape.Stephen Blott
We've consumed the event here, so we should suppress it.
2016-03-27Escape closes help dialog.Stephen Blott
With the help dialog in an iframe, Escape no longer closes it if that iframe loses the focus. This fixes that. See point 2 of #2045. This is not a perfect solution: it only works if the focus ends up in the frame from which the help dialog was launched. However, that is the the common case and, in particular, it is the case which arises on the options page -- which is a particularly important use case.
2016-03-26Ensure correct sendResponse() is called.Stephen Blott
With several frames, only one frame can call sendResponse(), whichever one happens to call it first. getScrollPosition, is the only handler for which we care about the response. Here, we make sure that sendResponse() will *only* be called in the top frame - where we want it called. This fixes a possible race condition in global marks. Additionally, although it's not the primary intention here, this also avoids calling sendResponse() unnecessarily in cases where we don't use the response.
2016-03-26Rework global mark activation.Stephen Blott
There were two problems, both stemming from the fact that the notification was being displayed in the top frame, even if the mark was triggered in another frame: 1. That looks odd, because we close the HUD in one frame then open it in another. 2. As a side effect, we were moving the focus to the top frame. Here, we work out what's going to happen before sending the message to the background page. This allows us to display the message in the HUD in the frame which generated it.
2016-03-26Merge branch 'standardise-foreground-commands'Stephen Blott
Conflicts: content_scripts/vimium_frontend.coffee
2016-03-26Get frameId in background page.Stephen Blott
2016-03-26Merge pull request #2064 from smblott-github/standardise-background-commands-v2Stephen Blott
Perform background commands on the requesting tab (v2)
2016-03-26Simplify invokeCommandString().Stephen Blott
There's no need to have the previous unusual calling style (passing the arguments as a list. It looks more natural to pass tham just as regular arguments, as here.
2016-03-26passCountToCommand isn't needed.Stephen Blott
We pass the count to *all* front-end commands. All of the commands which don't use a count, just ignore it.
2016-03-26This parameter wasn't being used.Stephen Blott
2016-03-26Pass count to find commands.Stephen Blott
With this change, now *every* front-end command either accepts a count argument, or or it doesn't accept a count at all.
2016-03-26selected wasn't being used here.Stephen Blott
2016-03-25Better choice of callapse on exit.Stephen Blott
The question here is where to callapse the selection to, anchor or focus? When exiting visual mode, mimic vim. When trasitioning between visual and caret modes, do what's right to keep the selection in the same place. This also adds some related tests.
2016-03-25More selective integration with the tests.Stephen Blott
This is a better way of stubing for the tests. Previously, if anything went wrong, there would actually be a visual effect for the user (the page would scroll). This way, that cannot happen.
2016-03-25Add tests for visual mode.Stephen Blott
The coverage here is far from completem but we do catch the basics.
2016-03-21Rework cisual mode; tweaks and fixes.Stephen Blott
2016-03-21Simplify singleton handling.Stephen Blott
While working on the visual-mode code, it became apparent that our current "singleton" implementation is unnecessarily complicated. This simplifies it. The keys are now required to be strings. (Previously, they could be any object; which meant we needed to gove objects an identity. All of which was complicated.)
2016-03-21Rework visual mode.Stephen Blott
- Refactor the three visual-mode modes. - Use the key-handling framework from #2022. - Strip some legacy edit-mode code. - Rename the file (the old file name was misleading). - Add "aw" and "as", previously we had the code for this from edit mode.
2016-03-21Rename visual mode file.Stephen Blott
This previous file name was chosen when we (I) had the intention of implementing edit mode too. That initiative has been abandoned, so the file name is inappropriate. Renaming now in preparation for a significant refactoring of visual mode.
2016-03-18This isn't needed any more.Stephen Blott
2016-03-18Reduce complexity for initialising the top frame.Stephen Blott
In #2053, I omitted to notice that the top-frame (vomnibar) initialisation sequence also generates O(n^2) messages. This makes that sequence O(n).
2016-03-18Refactor mode initialisation for clarity.Stephen Blott
2016-03-18Clarify why things are exported.Stephen Blott
We have: window.XXX = XXX = -> ... in many places. This commit reduces the number of these, and moves the exports to the end, where a single comment explains why they're being exported.
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-17Logging; consistent and concise normal-mode logging.Stephen Blott
2016-03-17Minor refactoring.Stephen Blott
2016-03-17Refactor setIcon to the background page.Stephen Blott
There's no need for the setting of the icon to be driven from the content script. We first know the enabled state in the background page, so set the icon there immediately.
2016-03-17Minor refactoring.Stephen Blott
This tidies up some logic that was showing its age.
2016-03-17More tweaks for #2053.Stephen Blott
2016-03-17Tweaks for #2053.Stephen Blott
2016-03-17Simplify domReady handling.Stephen Blott
2016-03-17Tweaks.Stephen Blott
2016-03-17No need to block until `frameId?`.Stephen Blott
Now that we've moved Frame.init() back to before checkIfEnabledForUrl, there's no longer a need to check that frameId has been initialised. It must have been.
2016-03-17Move isEnabledForUrl to Frame.port.Stephen Blott
2016-03-17Open frames port pre documentReady.Stephen Blott
The intention is to move checkIfEnabledForUrl to the frames port. That needs to run pre domReady, so first -- here -- we separate the two ports.
2016-03-17Use Chrome frameIds.Stephen Blott
2016-03-17Use ports to track frames.Stephen Blott
Use `onConnect()`, the `domReady` port and `onDisconnect()` to track the frames within a tab.
2016-03-16Relocate first scrollable element.Stephen Blott
When the scrollers `activatedElement` isn't scrollable, we currently search up the DOM tree for the next scrollable thing, and stop at `document.body`. However, it can be that that isn't scrollable. When that happens, this commit searches for a scrollable element in the same way as it does when the frame initially loads. This makes it possible to restart scrolling on pages like this one: - http://redux.js.org/docs/basics/UsageWithReact.html after clicking one of index links. Inspired by example posted by @marlun in #425.
2016-03-10Tests; add alphabet-hint hint tests.Stephen Blott
This adds tests for a couple of properties that are required of alphabet hint strings.