diff options
author | Shin'ya Ueoka <ueokande@i-beam.org> | 2018-11-18 18:47:35 +0900 |
---|---|---|
committer | Shin'ya Ueoka <ueokande@i-beam.org> | 2018-11-18 18:47:35 +0900 |
commit | 63b93ce1ca16e93563453e5caba451886fa3c01d (patch) | |
tree | bf31b6519fe10f0150ecc8c6da55c7576e9677c0 /src/content/actions/find.js | |
parent | 822033613061696e89725beb97265aad2bdffaa7 (diff) |
Use webextension message to console
Diffstat (limited to 'src/content/actions/find.js')
-rw-r--r-- | src/content/actions/find.js | 25 |
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 { |