aboutsummaryrefslogtreecommitdiff
path: root/src/content/presenters/FindPresenter.ts
diff options
context:
space:
mode:
authorShin'ya Ueoka <ueokande@i-beam.org>2021-05-15 18:03:43 +0900
committerShin'ya Ueoka <ueokande@i-beam.org>2021-07-05 21:32:43 +0900
commit21a0f2294b51f6ce78134384d34f302fb2cb8614 (patch)
treec9841c3bee7966e383221ff90ac04db009eab35e /src/content/presenters/FindPresenter.ts
parent038de72896e748df4e63352b4bbbae24d8a851ce (diff)
Remove legacy find
Diffstat (limited to 'src/content/presenters/FindPresenter.ts')
-rw-r--r--src/content/presenters/FindPresenter.ts29
1 files changed, 0 insertions, 29 deletions
diff --git a/src/content/presenters/FindPresenter.ts b/src/content/presenters/FindPresenter.ts
deleted file mode 100644
index b25190c..0000000
--- a/src/content/presenters/FindPresenter.ts
+++ /dev/null
@@ -1,29 +0,0 @@
-export default interface FindPresenter {
- find(keyword: string, backwards: boolean): boolean;
-
- clearSelection(): void;
-}
-
-export class FindPresenterImpl implements FindPresenter {
- find(keyword: string, backwards: boolean): boolean {
- const caseSensitive = false;
- const wrapScan = true;
-
- // NOTE: aWholeWord dows not implemented, and aSearchInFrames does not work
- // because of same origin policy
- const found = window.find(keyword, caseSensitive, backwards, wrapScan);
- if (found) {
- return found;
- }
- this.clearSelection();
-
- return window.find(keyword, caseSensitive, backwards, wrapScan);
- }
-
- clearSelection(): void {
- const sel = window.getSelection();
- if (sel) {
- sel.removeAllRanges();
- }
- }
-}