aboutsummaryrefslogtreecommitdiff
path: root/src/actions
diff options
context:
space:
mode:
authorShin'ya Ueoka <ueokande@i-beam.org>2017-09-30 16:20:16 +0900
committerShin'ya Ueoka <ueokande@i-beam.org>2017-09-30 16:20:16 +0900
commit1145eb34784c1450b920f8e7d672934ef6a98d45 (patch)
treef076a7f2366af89177f2bbc45a6cf8866407f3d5 /src/actions
parentc2a5a41cb6bc7780db580e6325e25b6a81729851 (diff)
parentc5efeda78cdf39e3eda1eabc5f89b601b1fcdb6e (diff)
Merge branch 'configurable-keymap'
Diffstat (limited to 'src/actions')
-rw-r--r--src/actions/index.js1
-rw-r--r--src/actions/input.js9
-rw-r--r--src/actions/operation.js18
3 files changed, 18 insertions, 10 deletions
diff --git a/src/actions/index.js b/src/actions/index.js
index 977b3c2..7b79864 100644
--- a/src/actions/index.js
+++ b/src/actions/index.js
@@ -8,4 +8,5 @@ export default {
// User input
INPUT_KEY_PRESS: 'input.key,press',
INPUT_CLEAR_KEYS: 'input.clear.keys',
+ INPUT_SET_KEYMAPS: 'input.set,keymaps',
};
diff --git a/src/actions/input.js b/src/actions/input.js
index 07948a1..de6de4e 100644
--- a/src/actions/input.js
+++ b/src/actions/input.js
@@ -14,4 +14,11 @@ const clearKeys = () => {
};
};
-export { keyPress, clearKeys };
+const setKeymaps = (keymaps) => {
+ return {
+ type: actions.INPUT_SET_KEYMAPS,
+ keymaps: keymaps
+ };
+};
+
+export { keyPress, clearKeys, setKeymaps };
diff --git a/src/actions/operation.js b/src/actions/operation.js
index 50329f8..5646c1c 100644
--- a/src/actions/operation.js
+++ b/src/actions/operation.js
@@ -6,15 +6,15 @@ import * as zooms from '../background/zooms';
const exec = (operation, tab) => {
switch (operation.type) {
- case operations.TABS_CLOSE:
+ case operations.TAB_CLOSE:
return tabs.closeTab(tab.id);
- case operations.TABS_REOPEN:
+ case operations.TAB_REOPEN:
return tabs.reopenTab();
- case operations.TABS_PREV:
+ case operations.TAB_PREV:
return tabs.selectPrevTab(tab.index, operation.count);
- case operations.TABS_NEXT:
+ case operations.TAB_NEXT:
return tabs.selectNextTab(tab.index, operation.count);
- case operations.TABS_RELOAD:
+ case operations.TAB_RELOAD:
return tabs.reload(tab, operation.cache);
case operations.ZOOM_IN:
return zooms.zoomIn();
@@ -22,21 +22,21 @@ const exec = (operation, tab) => {
return zooms.zoomOut();
case operations.ZOOM_NEUTRAL:
return zooms.neutral();
- case operations.COMMAND_OPEN:
+ case operations.COMMAND_SHOW:
return consoleActions.showCommand('');
- case operations.COMMAND_TABS_OPEN:
+ case operations.COMMAND_SHOW_OPEN:
if (operation.alter) {
// alter url
return consoleActions.showCommand('open ' + tab.url);
}
return consoleActions.showCommand('open ');
- case operations.COMMAND_TABS_NEW:
+ case operations.COMMAND_SHOW_TABOPEN:
if (operation.alter) {
// alter url
return consoleActions.showCommand('tabopen ' + tab.url);
}
return consoleActions.showCommand('tabopen ');
- case operations.COMMAND_BUFFER:
+ case operations.COMMAND_SHOW_BUFFER:
return consoleActions.showCommand('buffer ');
default:
return browser.tabs.sendMessage(tab.id, {