From e15de17598b222f16c2eb9c4aa2e47610bc61ed9 Mon Sep 17 00:00:00 2001 From: Shin'ya Ueoka Date: Wed, 6 Sep 2017 21:42:12 +0900 Subject: use action as object --- src/background/key-queue.js | 58 ++++++++++++++++++++++----------------------- 1 file changed, 29 insertions(+), 29 deletions(-) (limited to 'src/background/key-queue.js') diff --git a/src/background/key-queue.js b/src/background/key-queue.js index d7f0984..b2f5a34 100644 --- a/src/background/key-queue.js +++ b/src/background/key-queue.js @@ -1,35 +1,35 @@ import * as actions from '../shared/actions'; const DEFAULT_KEYMAP = { - ':': [ actions.CMD_OPEN ], - 'o': [ actions.CMD_TABS_OPEN, false ], - 'O': [ actions.CMD_TABS_OPEN, true ], - 'b': [ actions.CMD_BUFFER ], - 'k': [ actions.SCROLL_LINES, -1 ], - 'j': [ actions.SCROLL_LINES, 1 ], - '': [ actions.SCROLL_LINES, -1 ], - '': [ actions.SCROLL_LINES, 1 ], - '': [ actions.SCROLL_PAGES, -0.5 ], - '': [ actions.SCROLL_PAGES, 0.5 ], - '': [ actions.SCROLL_PAGES, -1 ], - '': [ actions.SCROLL_PAGES, 1 ], - 'gg': [ actions.SCROLL_TOP ], - 'G': [ actions.SCROLL_BOTTOM ], - '0': [ actions.SCROLL_LEFT ], - '$': [ actions.SCROLL_RIGHT ], - 'd': [ actions.TABS_CLOSE ], - 'u': [ actions.TABS_REOPEN], - 'h': [ actions.TABS_PREV, 1 ], - 'l': [ actions.TABS_NEXT, 1 ], - 'r': [ actions.TABS_RELOAD, false ], - 'R': [ actions.TABS_RELOAD, true ], - 'zi': [ actions.ZOOM_IN ], - 'zo': [ actions.ZOOM_OUT ], - 'zz': [ actions.ZOOM_NEUTRAL], - 'f': [ actions.FOLLOW_START, false ], - 'F': [ actions.FOLLOW_START, true ], - 'H': [ actions.HISTORY_PREV ], - 'L': [ actions.HISTORY_NEXT ], + ':': { type: actions.CMD_OPEN }, + 'o': { type: actions.CMD_TABS_OPEN, alter: false }, + 'O': { type: actions.CMD_TABS_OPEN, alter: true }, + 'b': { type: actions.CMD_BUFFER }, + 'k': { type: actions.SCROLL_LINES, count: -1 }, + 'j': { type: actions.SCROLL_LINES, count: 1 }, + '': { type: actions.SCROLL_LINES, count: -1 }, + '': { type: actions.SCROLL_LINES, count: 1 }, + '': { type: actions.SCROLL_PAGES, count: -0.5 }, + '': { type: actions.SCROLL_PAGES, count: 0.5 }, + '': { type: actions.SCROLL_PAGES, count: -1 }, + '': { type: actions.SCROLL_PAGES, count: 1 }, + 'gg': { type: actions.SCROLL_TOP }, + 'G': { type: actions.SCROLL_BOTTOM }, + '0': { type: actions.SCROLL_LEFT }, + '$': { type: actions.SCROLL_RIGHT }, + 'd': { type: actions.TABS_CLOSE }, + 'u': { type: actions.TABS_REOPEN }, + 'h': { type: actions.TABS_PREV, count: 1 }, + 'l': { type: actions.TABS_NEXT, count: 1 }, + 'r': { type: actions.TABS_RELOAD, cache: false }, + 'R': { type: actions.TABS_RELOAD, cache: true }, + 'zi': { type: actions.ZOOM_IN }, + 'zo': { type: actions.ZOOM_OUT }, + 'zz': { type: actions.ZOOM_NEUTRAL }, + 'f': { type: actions.FOLLOW_START, newTab: false }, + 'F': { type: actions.FOLLOW_START, newTab: true }, + 'H': { type: actions.HISTORY_PREV }, + 'L': { type: actions.HISTORY_NEXT }, } export default class KeyQueue { -- cgit v1.2.3