aboutsummaryrefslogtreecommitdiffstats
path: root/pages/vomnibar.coffee
AgeCommit message (Collapse)Author
2018-07-03Hide Vomnibar in case of click on entire document instead of click on ↵ris58h
document.body.
2018-02-18Refactor URL launching from Vomnibar.Stephen Blott
It's slightly strange how the classes and objects are structured in the Vomnibar. However, this refactors the code for launching URLs (including Javascript URLs) such that we're not repeating the logix in two separate places.
2018-02-18allow javascript: URLs for custom search engines.Stephen Blott
For example, search the current site: cd: javascript:location='http://www.google.com/search?num=100&q=site:'+escape(location.hostname)+'+%s' Apparently an example like this has been on the Wiki for four years, but it has not been supported. However, the change is so trivial that it's worth doing anyway. Fixes #2956.
2018-02-04Handle <Enter> on keypress (not keydown) in Vomnibar and HUD.Stephen Blott
Proposing this as a simpler alternative to #2934. Additionally, this puts the logic for fixing #2915 in a single place. Credit to @regmarmcem for figuring out the source of #2915. Mention @regmarmcem. Fixes #2915. Replaces #2934.
2018-01-28on vomnibar hiding, blur input firstgdh1995
This should fix an IME status issue (#2924).
2017-09-29Manually inject custom user CSS into our own frames/pagesmrmr1993
2017-04-18Avoid repeating Backspace and Delete keys.Stephen Blott
2017-04-18Remove use of keyCodes entirely.Stephen Blott
event.keyCode` is depricated: - https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/keyCode
2017-04-18Move keyboard utils to keydown and migrate normal/visual modes.Stephen Blott
2016-04-29Vomnibar, on tab: require there to be completions.Stephen Blott
Do the following: - `b`, `Tab` The Vomnibar crashes. The problem is that we're advancing the selection even though there are no suggestions available. Here, we require there to be a suggestion or suggestions before advancing the selection.
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-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-26selected wasn't being used here.Stephen Blott
2015-09-09Alt modifier in vomnibar opens in new tab.Stephen Blott
2015-06-03Tweak vomnibar custom search behaviour.Stephen Blott
With this, if we're in custom search mode and the cursor is at the start of the vomnibar input and the user types <Delete>, then we exit custom search mode and reinstate the keyword (and arrange for the cursor to be in the right place). This makes it possible to change (or just disable) the custom search engine without having to first wholly delete the query.
2015-05-29Prepopulate @customSearchMode in vomnibar.Stephen Blott
This avoids a flicker whereby the keyword is first inserted into the input, then removed.
2015-05-29Merge branch 'completion-on-custom-search-only' into ↵Stephen Blott
completion-on-custom-search-only-merge Conflicts: background_scripts/completion.coffee
2015-05-28Custom-only: fix long-standing race condition.Stephen Blott
In omni mode, the vomnibar suggestions are updated asynchronously. Therefore, the contents of the primary custom search-engine suggestion may be behind the actual contents of the comnibar input. So, we reconstruct the custom search-engine query on "enter". (This fixes a long-standing race condition.)
2015-05-28Custom-only: strip non-custom search code.Stephen Blott
2015-05-27Tap-to-open only in omni-mode vomnibar.Stephen Blott
Do not use tab-to-open the vominibar in tabs mode. (It doesn't make any sense.)
2015-05-17TabToOpen: tidy up pre-PR.Stephen Blott
2015-05-17TabToOpen: reactivate custom search engines.Stephen Blott
When the user begins editing the inserted text from a custom-search-engine suggestion, we reactivate the original custom-search-engine mode.
2015-05-17TabToOpen: reactivate previous custom search engine.Stephen Blott
Note: There's still an unpleasant flicker when this happens. TBD: Fix this.
2015-05-17TabToOpen: tweaksStephen Blott
2015-05-17TabToOpen: tab to open vomnibar.Stephen Blott
`o` then `Tab` opens the vomnibar completionlist with history completions (the only completions) ranked by recently only. Hence, the most recent requests are at the top. This is a (far) simpler approach than #1662 which catches the most important use case (repeat a search with an edited query).
2015-05-15Give the vomnibar a (kind of) history (autoSelect).Stephen Blott
If we insert the text of hostory completions into the vomnibar input, then when the completions change, we'll pick up the arbitrary text of whatever happens to be the current selection. So we need to always reset the selection when the vomnibar updates. This eliminates the need for the previous autoSelect logic.
2015-05-14Two lines which should have been removed in #1659.Stephen Blott
Omitting to remove these lines has the effect of disabling the left/right keys in the vomnibar.
2015-05-13Search completion; complete rework of UX.Stephen Blott
This is a major reworking of how the search-completion systems works. Previously, the goal had been to emulate roughly how chrome itself handles completions. This has turned out to be a bad idea: - It creates issues around what it means to hit <Enter> in the vomnibar. - And the contents of the vomnibar change asynchronously (because we fetch completions asynchronously), so it creates the possibility that the effect of <Enter> changes depending on how long the user waits before typing <Enter>. All of that is bad. This commit changes things: - In normal omni mode, the vomnibar looks and behaves pretty much like it always has, just with some extra completion suggestions thrown in. - And in custom-search-engine mode it also behaves mostly as it has previously, but (again, possibly) with some extra completion suggestions thrown in, and with many useless suggestions excluded. This is all far more Vimium-like than Chrome-like.
2015-05-13Search completion; implement <Enter> timer.Stephen Blott
With suggested completions appearing in the vomnibar, the meaning of <Enter> can change when the completion list is updated, which happens asynchronously. The user can end up selecting something they didn't intend to ... which is bad. This implements a temporary fix. When the completion list updates (and the update might affect what the user expects <Enter> to do), we block <Enter> for a short time (250ms). That's pretty bad too. These UX issues around search completion are proving difficult to get right. I will open an issue to discuss them soon.
2015-05-13Search completion; yet another reworking.Stephen Blott
I'm having difficulty getting all aspects of the UX right for all combinations of modes. This is the latest attempt. The main goal is to mimic Chrome to the greatest extent possible. There will be more to come, but I think this is an improvement.
2015-05-13Search completion; rework handling when no selection.Stephen Blott
This makes the behaviour consistent between custom and non-custom searches when there is no selection in the vomnibar (omni-mode only). Approach: - When there is no selection in the vomnibar, we *always* send the query to to background completer (that is, both for default searches and for custom searches) and ask the completer to provide only the primary suggestion. The primary suggestion is just what you get if you append the query terms to the search URL (default or custom). We then immediately open the first response. The round trip for default searches isn't strictly necessary. However, this uniform approach disentangles some nasty logic in the vomnibar when we're trying to handle several cases (default or custom search, with or without prompted text, with or without any suggestions at all). The extra round trip simplifies the logic to such a great extend that it's worth it.
2015-05-12Rework some aspects of search engine completion.Stephen Blott
- We arrange that: - for custom search engines, or - for other searches where there is at least one match that match is at the top of the list (relevancy 1). This top suggestion will the suggestion which will be used to popuplated the promted text in the vomnibar. If we arrange that it's at the top of the list, then it is also the text that we get in the vomnibar if we hit <Tab>. This leaves us in the position where: - If the user wants just the text they've typed, then they hit <Enter>. - If they want all of the text in the input (including the prompted text), then they hit <Tab>, <Enter>. This is a very natural UX. It feels like <Tab> is filling in the prompted text, although all it's really doing is choosing a suggestion (the first one), as it always has done. There is one small catch. We need to avoid a clash with the domain completer, which also likes to force its suggestion to the top of the list. There's a test for that case. Basically, we can apply this trick if it's a custom search, or if the user has finished typing the first query term.
2015-05-12Prevent immediate re-completionStephen Blott
This prevents an immediate re-completion after the user has repositioned the cursor with the arrow keys (which is an odd UX).
2015-05-12Fix bad UX for <Enter> with prompted text.Stephen Blott
The existing behaviour is poor UX. Also, add <Alt-Enter> binding. This is a poor choice. We'll need to think about this.
2015-05-12In vomnibar, <Enter> excludes prompted text.Stephen Blott
This changes the behaviour of <Enter> in the vomnibar when a prompted text is present (i.e. text from a suggestion which the user has not yet typed. Now, that text is no longer included in the query launched with <Enter>. After a little experience, I'd say that's a pretty bad UX. This also adds a <Ctrl-Enter> binding to launch the query with the prompted text included.
2015-05-11Search completion; fix typos and small bugs.Stephen Blott
Bugs: - The serch-engine completer wasn't being configured correctly for the case when we don't have a completion engine. - Handle Control-Shift-Left/Right in vomnibar. Also: better comments.
2015-05-11Search completion; better left/right controls.Stephen Blott
2015-05-11Search completion; add bindings for Ctrl-Left/Right.Stephen Blott
2015-05-11Search completion; pre-merge tweaks.Stephen Blott
2015-05-11Search completion; fix synchronization issue.Stephen Blott
2015-05-11Search completion; disable on redundant whitespace.Stephen Blott
2015-05-11Merge branch 'search-engine-completion-v2' into search-engine-completion-v5Stephen Blott
2015-05-11Search completion; disable on redundant whitespace.Stephen Blott
2015-05-10Search completion; alternative vomnibar completion.Stephen Blott
2015-05-10Search completion; alternative vomnibar completion.Stephen Blott
2015-05-10Search completion; refactor search-engine detection.Stephen Blott
2015-05-10Search completion; and even more minor tweaks.Stephen Blott
2015-05-10Search completion; fix for multiple spaces in input.Stephen Blott
2015-05-10Search completion; even more minor tweaks.Stephen Blott
2015-05-10Search completion; even more minor tweaks.Stephen Blott