aboutsummaryrefslogtreecommitdiff
path: root/src/content/actions/mark.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/content/actions/mark.js')
-rw-r--r--src/content/actions/mark.js46
1 files changed, 46 insertions, 0 deletions
diff --git a/src/content/actions/mark.js b/src/content/actions/mark.js
new file mode 100644
index 0000000..712a811
--- /dev/null
+++ b/src/content/actions/mark.js
@@ -0,0 +1,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,
+};