aboutsummaryrefslogtreecommitdiff
path: root/src/content/actions/mark.js
blob: 712a8114c9a307bd85fa22a7737156fe0dbd04c4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import actions from 'content/actions';
import messages from 'shared/messages';

const startSet = () => {
  return { type: actions.MARK_START_SET };
};

const startJump = () => {
  return { type: actions.MARK_START_JUMP };
};

const cancel = () => {
  return { type: actions.MARK_CANCEL };
};

const setLocal = (key, x, y) => {
  return {
    type: actions.MARK_SET_LOCAL,
    key,
    x,
    y,
  };
};

const setGlobal = (key, x, y) => {
  browser.runtime.sendMessage({
    type: messages.MARK_SET_GLOBAL,
    key,
    x,
    y,
  });
  return { type: '' };
};

const jumpGlobal = (key) => {
  browser.runtime.sendMessage({
    type: messages.MARK_JUMP_GLOBAL,
    key,
  });
  return { type: '' };
};

export {
  startSet, startJump, cancel, setLocal,
  setGlobal, jumpGlobal,
};