aboutsummaryrefslogtreecommitdiff
path: root/src/content/actions/find.js
diff options
context:
space:
mode:
authorShin'ya Ueoka <ueokande@i-beam.org>2018-12-08 10:48:25 +0900
committerGitHub <noreply@github.com>2018-12-08 10:48:25 +0900
commit9c34b961c68588d95cc942465dae55388e861ffa (patch)
tree697d1cf6ac625aacc4d3685ee37b7a051257f9ec /src/content/actions/find.js
parent97787c773f0d1b5e80beb438246b5a693dbd08aa (diff)
parent80de2149ad592c97158f1adb72b352dab3e0858e (diff)
Merge pull request #507 from ueokande/window-postmessage
Window postmessage
Diffstat (limited to 'src/content/actions/find.js')
-rw-r--r--src/content/actions/find.js25
1 files changed, 3 insertions, 22 deletions
diff --git a/src/content/actions/find.js b/src/content/actions/find.js
index b3d7e30..e08d7e5 100644
--- a/src/content/actions/find.js
+++ b/src/content/actions/find.js
@@ -9,25 +9,6 @@ import messages from 'shared/messages';
import actions from 'content/actions';
import * as consoleFrames from '../console-frames';
-const postPatternNotFound = (pattern) => {
- return consoleFrames.postError(
- window.document,
- 'Pattern not found: ' + pattern);
-};
-
-const postPatternFound = (pattern) => {
- return consoleFrames.postInfo(
- window.document,
- 'Pattern found: ' + pattern,
- );
-};
-
-const postNoPrevious = () => {
- return consoleFrames.postError(
- window.document,
- 'No previous search keywords');
-};
-
const find = (string, backwards) => {
let caseSensitive = false;
let wrapScan = true;
@@ -60,13 +41,13 @@ const findNext = async(currentKeyword, reset, backwards) => {
});
}
if (!keyword) {
- return postNoPrevious();
+ return consoleFrames.postError('No previous search keywords');
}
let found = find(keyword, backwards);
if (found) {
- postPatternFound(keyword);
+ consoleFrames.postInfo('Pattern found: ' + keyword);
} else {
- postPatternNotFound(keyword);
+ consoleFrames.postError('Pattern not found: ' + keyword);
}
return {