aboutsummaryrefslogtreecommitdiff
path: root/src/content/presenters/NavigationPresenter.ts
diff options
context:
space:
mode:
authorShin'ya Ueoka <ueokande@i-beam.org>2019-05-26 16:24:14 +0900
committerGitHub <noreply@github.com>2019-05-26 16:24:14 +0900
commitcd584c8e243bafa8fc284279f716e8113607cd65 (patch)
treebc39bc30369f149e4ba4b6dc9c353b2906c4ef90 /src/content/presenters/NavigationPresenter.ts
parent07897df636ca3e732490d53fd2acf947738bf16e (diff)
parent34a96cdc9c5d7c8a11c6f1ae512fbc97724f61c4 (diff)
Merge pull request #592 from ueokande/repeat-last-operation
Add "repeat last operation" command
Diffstat (limited to 'src/content/presenters/NavigationPresenter.ts')
-rw-r--r--src/content/presenters/NavigationPresenter.ts27
1 files changed, 0 insertions, 27 deletions
diff --git a/src/content/presenters/NavigationPresenter.ts b/src/content/presenters/NavigationPresenter.ts
index c141112..11d96ec 100644
--- a/src/content/presenters/NavigationPresenter.ts
+++ b/src/content/presenters/NavigationPresenter.ts
@@ -6,10 +6,6 @@ export default interface NavigationPresenter {
openLinkPrev(): void;
openLinkNext(): void;
-
- openParent(): void;
-
- openRoot(): void;
}
const REL_PATTERN: {[key: string]: RegExp} = {
@@ -51,29 +47,6 @@ export class NavigationPresenterImpl implements NavigationPresenter {
this.linkRel('next');
}
- openParent(): void {
- const loc = window.location;
- if (loc.hash !== '') {
- loc.hash = '';
- return;
- } else if (loc.search !== '') {
- loc.search = '';
- return;
- }
-
- const basenamePattern = /\/[^/]+$/;
- const lastDirPattern = /\/[^/]+\/$/;
- if (basenamePattern.test(loc.pathname)) {
- loc.pathname = loc.pathname.replace(basenamePattern, '/');
- } else if (lastDirPattern.test(loc.pathname)) {
- loc.pathname = loc.pathname.replace(lastDirPattern, '/');
- }
- }
-
- openRoot(): void {
- window.location.href = window.location.origin;
- }
-
// Code common to linkPrev and linkNext which navigates to the specified page.
private linkRel(rel: 'prev' | 'next'): void {
let link = selectLast<HTMLLinkElement>(`link[rel~=${rel}][href]`);