From b406848c2b0605b0765ef12b1469e20e47080a64 Mon Sep 17 00:00:00 2001 From: Timo Sand Date: Sun, 17 Feb 2013 17:23:53 +0000 Subject: Added functionality to "float" current tab ie. open in new window --- CREDITS | 1 + background_scripts/commands.coffee | 4 +++- background_scripts/main.coffee | 4 ++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CREDITS b/CREDITS index 9d4f8259..36e75f47 100644 --- a/CREDITS +++ b/CREDITS @@ -38,5 +38,6 @@ Contributors: R.T. Lechow (github: rtlechow) Wang Ning (github:daning) Werner Laurensse (github: ab3) + Timo Sand (github: deiga) Feel free to add real names in addition to GitHub usernames. diff --git a/background_scripts/commands.coffee b/background_scripts/commands.coffee index d7c332f9..92d2a40d 100644 --- a/background_scripts/commands.coffee +++ b/background_scripts/commands.coffee @@ -98,7 +98,7 @@ Commands = historyNavigation: ["goBack", "goForward"] tabManipulation: - ["nextTab", "previousTab", "firstTab", "lastTab", "createTab", "removeTab", "restoreTab"] + ["nextTab", "previousTab", "firstTab", "lastTab", "createTab", "openTabInNewWindow", "removeTab", "restoreTab"] misc: ["showHelp"] @@ -160,6 +160,7 @@ defaultKeyMappings = "g0": "firstTab" "g$": "lastTab" + "w": "openTabInNewWindow" "t": "createTab" "x": "removeTab" "X": "restoreTab" @@ -232,6 +233,7 @@ commandDescriptions = firstTab: ["Go to the first tab", { background: true }] lastTab: ["Go to the last tab", { background: true }] createTab: ["Create new tab", { background: true }] + openTabInNewWindow: ["Open tab in new window", { background: true }] removeTab: ["Close current tab", { background: true }] restoreTab: ["Restore closed tab", { background: true }] diff --git a/background_scripts/main.coffee b/background_scripts/main.coffee index d9229f12..912117ff 100644 --- a/background_scripts/main.coffee +++ b/background_scripts/main.coffee @@ -218,6 +218,10 @@ repeatFunction = (func, totalCount, currentCount, frameId) -> # mapped in commands.coffee. BackgroundCommands = createTab: (callback) -> chrome.tabs.create({ url: "chrome://newtab" }, (tab) -> callback()) + openTabInNewWindow: (callback) -> + chrome.tabs.getSelected(null, (tab) -> + chrome.windows.create({tabId: tab.id}) + selectionChangedHandlers.push(callback)) nextTab: (callback) -> selectTab(callback, "next") previousTab: (callback) -> selectTab(callback, "previous") firstTab: (callback) -> selectTab(callback, "first") -- cgit v1.2.3 From 5f8d7647d63e22ed530ef818d312941b9b0b677c Mon Sep 17 00:00:00 2001 From: Timo Sand Date: Mon, 18 Feb 2013 09:59:11 +0000 Subject: Moved to advanced commands and renamed command for clearness --- background_scripts/commands.coffee | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/background_scripts/commands.coffee b/background_scripts/commands.coffee index 92d2a40d..dd9a938c 100644 --- a/background_scripts/commands.coffee +++ b/background_scripts/commands.coffee @@ -98,7 +98,7 @@ Commands = historyNavigation: ["goBack", "goForward"] tabManipulation: - ["nextTab", "previousTab", "firstTab", "lastTab", "createTab", "openTabInNewWindow", "removeTab", "restoreTab"] + ["nextTab", "previousTab", "firstTab", "lastTab", "createTab", "removeTab", "restoreTab"] misc: ["showHelp"] @@ -106,7 +106,7 @@ Commands = # a focused, high-signal set of commands to the new and casual user. Only those truly hungry for more power # from Vimium will uncover these gems. advancedCommands: [ - "scrollToLeft", "scrollToRight", + "scrollToLeft", "scrollToRight", "moveTabToNewWindow", "goUp", "focusInput", "LinkHints.activateModeWithQueue", "goPrevious", "goNext", "Marks.activateCreateMode", "Marks.activateGotoMode"] @@ -160,7 +160,7 @@ defaultKeyMappings = "g0": "firstTab" "g$": "lastTab" - "w": "openTabInNewWindow" + "w": "moveTabToNewWindow" "t": "createTab" "x": "removeTab" "X": "restoreTab" @@ -233,9 +233,9 @@ commandDescriptions = firstTab: ["Go to the first tab", { background: true }] lastTab: ["Go to the last tab", { background: true }] createTab: ["Create new tab", { background: true }] - openTabInNewWindow: ["Open tab in new window", { background: true }] removeTab: ["Close current tab", { background: true }] restoreTab: ["Restore closed tab", { background: true }] + moveTabToNewWindow: ["Move tab to new window", { background: true }] "Vomnibar.activate": ["Open URL, bookmark, or history entry"] "Vomnibar.activateInNewTab": ["Open URL, bookmark, history entry, in a new tab"] -- cgit v1.2.3