diff options
| author | Ilya | 2012-08-06 17:23:37 -0700 | 
|---|---|---|
| committer | Ilya | 2012-08-06 17:23:37 -0700 | 
| commit | ea048f58130b01395f2de1ab46535b8bfbbe1aa0 (patch) | |
| tree | 86c849eeebca350f103ac3fdde66a23c463c70c6 | |
| parent | a697646163a5ab9ec6096591b8184a29fa49f2e9 (diff) | |
| parent | 8c16dc36710fb9ba1934a5654bb559124db48044 (diff) | |
| download | vimium-ea048f58130b01395f2de1ab46535b8bfbbe1aa0.tar.bz2 | |
Merge pull request #610 from chelmertz/gh-594
vomnibar: New tabs for 'O' and 'B'
| -rw-r--r-- | CREDITS | 1 | ||||
| -rw-r--r-- | README.markdown | 4 | ||||
| -rw-r--r-- | background_scripts/commands.coffee | 10 | ||||
| -rw-r--r-- | content_scripts/vomnibar.coffee | 10 | 
4 files changed, 17 insertions, 8 deletions
| @@ -11,6 +11,7 @@ Contributors:    Bill Casarin <jb@jb55.com> (github: jb55)    Bill Mill (github: llimllib)    Branden Rolston <brolston@gmail.com> (github: branden) +  Carl Helmertz <helmertz@gmail.com> (github: chelmertz)    Christian Stefanescu (github: stchris)    ConradIrwin    Daniel MacDougall <dmacdougall@gmail.com> (github: dmacdougall) diff --git a/README.markdown b/README.markdown index 82fab530..c65e08a8 100644 --- a/README.markdown +++ b/README.markdown @@ -50,7 +50,9 @@ Navigating the current page:  Navigating to new pages:      o       Open URL, bookmark, or history entry -    O       Open URL, bookmark, history entry, starting with the current URL +    O       Open URL, bookmark, history entry in a new tab +    b       Open bookmark +    B       Open bookmark in a new tab  Using find: diff --git a/background_scripts/commands.coffee b/background_scripts/commands.coffee index 0fa56e1a..e3001f4f 100644 --- a/background_scripts/commands.coffee +++ b/background_scripts/commands.coffee @@ -91,8 +91,8 @@ Commands =         "openCopiedUrlInCurrentTab", "openCopiedUrlInNewTab", "goUp",         "enterInsertMode", "focusInput",         "LinkHints.activateMode", "LinkHints.activateModeToOpenInNewTab", "LinkHints.activateModeWithQueue", -       "Vomnibar.activate", "Vomnibar.activateWithCurrentUrl", "Vomnibar.activateTabSelection", -       "Vomnibar.activateBookmarks", +       "Vomnibar.activate", "Vomnibar.activateInNewTab", "Vomnibar.activateTabSelection", +       "Vomnibar.activateBookmarks", "Vomnibar.activateBookmarksInNewTab",         "goPrevious", "goNext", "nextFrame"]      findCommands: ["enterFindMode", "performFind", "performBackwardsFind"]      historyNavigation: @@ -165,11 +165,12 @@ defaultKeyMappings =    "X": "restoreTab"    "o": "Vomnibar.activate" -  "O": "Vomnibar.activateWithCurrentUrl" +  "O": "Vomnibar.activateInNewTab"    "T": "Vomnibar.activateTabSelection"    "b": "Vomnibar.activateBookmarks" +  "B": "Vomnibar.activateBookmarksInNewTab"    "gf": "nextFrame" @@ -232,9 +233,10 @@ commandDescriptions =    restoreTab: ["Restore closed tab", { background: true }]    "Vomnibar.activate": ["Open URL, bookmark, or history entry"] -  "Vomnibar.activateWithCurrentUrl": ["Open URL, bookmark, history entry, starting with the current URL"] +  "Vomnibar.activateInNewTab": ["Open URL, bookmark, history entry, in a new tab"]    "Vomnibar.activateTabSelection": ["Search through your open tabs"]    "Vomnibar.activateBookmarks": ["Open a bookmark"] +  "Vomnibar.activateBookmarksInNewTab": ["Open a bookmark in a new tab"]    nextFrame: ["Cycle forward to the next frame on the page", { background: true, passCountToFunction: true }] 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") | 
