From f88ccb3390b9efff6512e5c0e7d2235ba8b859ed Mon Sep 17 00:00:00 2001 From: Timo Sand Date: Sat, 16 Feb 2013 21:33:57 +0000 Subject: Added duplicateTab call --- background_scripts/main.coffee | 1 + 1 file changed, 1 insertion(+) (limited to 'background_scripts') diff --git a/background_scripts/main.coffee b/background_scripts/main.coffee index d9229f12..e6951102 100644 --- a/background_scripts/main.coffee +++ b/background_scripts/main.coffee @@ -218,6 +218,7 @@ repeatFunction = (func, totalCount, currentCount, frameId) -> # mapped in commands.coffee. BackgroundCommands = createTab: (callback) -> chrome.tabs.create({ url: "chrome://newtab" }, (tab) -> callback()) + duplicateTab: (callback) -> chrome.tabs.duplicate(chrome.tabs.getCurrent(), (tab) -> callback()) nextTab: (callback) -> selectTab(callback, "next") previousTab: (callback) -> selectTab(callback, "previous") firstTab: (callback) -> selectTab(callback, "first") -- cgit v1.2.3 From 6d931314a9cd20a3583da291f1466e3845c6b29f Mon Sep 17 00:00:00 2001 From: Timo Sand Date: Sat, 16 Feb 2013 21:45:25 +0000 Subject: Added commands for duplicate tab --- background_scripts/commands.coffee | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'background_scripts') diff --git a/background_scripts/commands.coffee b/background_scripts/commands.coffee index d7c332f9..c6a3a770 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", "duplicateTab", "removeTab", "restoreTab"] misc: ["showHelp"] @@ -161,6 +161,7 @@ defaultKeyMappings = "g$": "lastTab" "t": "createTab" + "yt": "duplicateTab" "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 }] + duplicateTab: ["Duplicate current tab", { background: true }] removeTab: ["Close current tab", { background: true }] restoreTab: ["Restore closed tab", { background: true }] -- cgit v1.2.3 From f7c3245778e21570fa4adb9d4f1f7a3723317383 Mon Sep 17 00:00:00 2001 From: Timo Sand Date: Sat, 16 Feb 2013 22:09:27 +0000 Subject: Finalized duplicateTab feature --- background_scripts/main.coffee | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'background_scripts') diff --git a/background_scripts/main.coffee b/background_scripts/main.coffee index e6951102..03c2277a 100644 --- a/background_scripts/main.coffee +++ b/background_scripts/main.coffee @@ -218,7 +218,10 @@ repeatFunction = (func, totalCount, currentCount, frameId) -> # mapped in commands.coffee. BackgroundCommands = createTab: (callback) -> chrome.tabs.create({ url: "chrome://newtab" }, (tab) -> callback()) - duplicateTab: (callback) -> chrome.tabs.duplicate(chrome.tabs.getCurrent(), (tab) -> callback()) + duplicateTab: (callback) -> + chrome.tabs.getSelected(null, (tab) -> + chrome.tabs.duplicate(tab.id) + selectionChangedHandlers.push(callback)) nextTab: (callback) -> selectTab(callback, "next") previousTab: (callback) -> selectTab(callback, "previous") firstTab: (callback) -> selectTab(callback, "first") -- cgit v1.2.3