aboutsummaryrefslogtreecommitdiff
path: root/src/content/actions/find.js
blob: 90c9de9164a237464d7adfb5b7b3015f87142ce7 (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
//
// window.find(aString, aCaseSensitive, aBackwards, aWrapAround,
//             aWholeWord, aSearchInFrames, aShowDialog);
//
// NOTE: window.find is not standard API
// https://developer.mozilla.org/en-US/docs/Web/API/Window/find

import actions from 'content/actions';

const show = () => {
  return { type: actions.FIND_SHOW };
};

const hide = () => {
  return { type: actions.FIND_HIDE };
};

const next = (keyword) => {
  // TODO Error on no matched
  window.find(keyword, false, false, true, false, true, false);
  return {
    type: actions.FIND_SET_KEYWORD,
    keyword,
  };
};

const prev = (keyword) => {
  // TODO Error on no matched
  window.find(keyword, false, true, true, false, true, false);
  return {
    type: actions.FIND_SET_KEYWORD,
    keyword,
  };
};

export { show, hide, next, prev };