diff options
| author | Carl Helmertz | 2012-08-06 21:58:02 +0200 | 
|---|---|---|
| committer | Carl Helmertz | 2012-08-06 22:09:09 +0200 | 
| commit | 72e7d2783997df7e3971daca10a71bbebee552fd (patch) | |
| tree | eb07f85820633d5de9ef8ec2f8d961ceec18ce90 /content_scripts | |
| parent | a697646163a5ab9ec6096591b8184a29fa49f2e9 (diff) | |
| download | vimium-72e7d2783997df7e3971daca10a71bbebee552fd.tar.bz2 | |
vomnibar: New tabs for 'O' and 'B'
'B' is a new command for searching for a bookmark and opens it in a new
tab.
'O' now searches through history and bookmarks and opens the selected
item in a new tab. Previously, it started vomnibar with the current URI
selected and opened the selection in the same tab.
This fixes #594.
Signed-off-by: Carl Helmertz <helmertz@gmail.com>
Diffstat (limited to 'content_scripts')
| -rw-r--r-- | content_scripts/vomnibar.coffee | 10 | 
1 files changed, 7 insertions, 3 deletions
| diff --git a/content_scripts/vomnibar.coffee b/content_scripts/vomnibar.coffee index 0b96d2bb..9c1e7a31 100644 --- a/content_scripts/vomnibar.coffee +++ b/content_scripts/vomnibar.coffee @@ -10,22 +10,24 @@ Vomnibar =    #    # Activate the Vomnibox.    # -  activateWithCompleter: (completerName, refreshInterval, initialQueryValue, selectFirstResult) -> +  activateWithCompleter: (completerName, refreshInterval, initialQueryValue, selectFirstResult, forceNewTab) ->      completer = @getCompleter(completerName)      @vomnibarUI = new VomnibarUI() unless @vomnibarUI      completer.refresh()      @vomnibarUI.setInitialSelectionValue(if selectFirstResult then 0 else -1)      @vomnibarUI.setCompleter(completer)      @vomnibarUI.setRefreshInterval(refreshInterval) +    @vomnibarUI.setForceNewTab(forceNewTab)      @vomnibarUI.show()      if (initialQueryValue)        @vomnibarUI.setQuery(initialQueryValue)        @vomnibarUI.update()    activate: -> @activateWithCompleter("omni", 100) -  activateWithCurrentUrl: -> @activateWithCompleter("omni", 100, window.location.toString()) +  activateInNewTab: -> @activateWithCompleter("omni", 100, null, true, true)    activateTabSelection: -> @activateWithCompleter("tabs", 0, null, true)    activateBookmarks: -> @activateWithCompleter("bookmarks", 0, null, true) +  activateBookmarksInNewTab: -> @activateWithCompleter("bookmarks", 0, null, true, true)    getUI: -> @vomnibarUI @@ -45,6 +47,8 @@ class VomnibarUI    setRefreshInterval: (refreshInterval) -> @refreshInterval = refreshInterval +  setForceNewTab: (forceNewTab) -> @forceNewTab = forceNewTab +    show: ->      @box.style.display = "block"      @input.focus() @@ -92,7 +96,7 @@ class VomnibarUI      action = @actionFromKeyEvent(event)      return true unless action # pass through -    openInNewTab = (event.shiftKey || KeyboardUtils.isPrimaryModifierKey(event)) +    openInNewTab = @forceNewTab || (event.shiftKey || KeyboardUtils.isPrimaryModifierKey(event))      if (action == "dismiss")        @hide()      else if (action == "up") | 
