From 3ba6beca8936c98227eeac20daa78bde548e1845 Mon Sep 17 00:00:00 2001 From: Kitteh Date: Sat, 17 Apr 2021 11:30:10 +0100 Subject: [PATCH] Remove global changePage --- src/main.js | 1 - src/pages/KeyValue/KeyValueDelete.js | 2 +- src/pages/KeyValue/KeyValueNew.js | 2 +- src/pages/KeyValue/KeyValueSecrets.js | 2 +- src/pages/KeyValue/KeyValueSecretsEdit.js | 2 +- src/pages/KeyValue/KeyValueVersions.js | 2 +- src/pages/KeyValue/KeyValueView.js | 2 +- src/pages/Login.js | 2 +- src/pages/TOTP/TOTPView.js | 2 +- src/pages/Template.js | 2 +- src/pages/Transit/TransitDecrypt.js | 2 +- src/pages/Transit/TransitEncrypt.js | 2 +- src/pages/Transit/TransitView.js | 2 +- src/pages/Unseal.js | 1 - 14 files changed, 12 insertions(+), 14 deletions(-) diff --git a/src/main.js b/src/main.js index fafce16..91640ba 100644 --- a/src/main.js +++ b/src/main.js @@ -61,7 +61,6 @@ const pages = { var pageState = new PageState(); window.pageState = pageState; window.realPages = pages; -window.changePage = changePage; function ListItem(children) { return makeElement({ diff --git a/src/pages/KeyValue/KeyValueDelete.js b/src/pages/KeyValue/KeyValueDelete.js index 2b4dc9b..7f99c97 100644 --- a/src/pages/KeyValue/KeyValueDelete.js +++ b/src/pages/KeyValue/KeyValueDelete.js @@ -1,6 +1,6 @@ import { Page } from "../../types/Page.js"; import { deleteSecret } from "../../api.js"; -import { setPageContent, setTitleElement } from "../../pageUtils.js"; +import { setPageContent, setTitleElement, changePage } from "../../pageUtils.js"; import { makeElement } from "../../htmlUtils.js"; export class KeyValueDeletePage extends Page { diff --git a/src/pages/KeyValue/KeyValueNew.js b/src/pages/KeyValue/KeyValueNew.js index 4451fcc..d2cc668 100644 --- a/src/pages/KeyValue/KeyValueNew.js +++ b/src/pages/KeyValue/KeyValueNew.js @@ -1,6 +1,6 @@ import { Page } from "../../types/Page.js"; import { createOrUpdateSecret } from "../../api.js"; -import { setPageContent, setTitleElement, setErrorText } from "../../pageUtils.js"; +import { setPageContent, setTitleElement, setErrorText, changePage } from "../../pageUtils.js"; import { makeElement } from "../../htmlUtils.js"; export class KeyValueNewPage extends Page { diff --git a/src/pages/KeyValue/KeyValueSecrets.js b/src/pages/KeyValue/KeyValueSecrets.js index f275fb4..a1f6c3f 100644 --- a/src/pages/KeyValue/KeyValueSecrets.js +++ b/src/pages/KeyValue/KeyValueSecrets.js @@ -1,6 +1,6 @@ import { Page } from "../../types/Page.js"; import { getSecret, undeleteSecret, getCapabilities } from "../../api.js"; -import { setPageContent, setTitleElement } from "../../pageUtils.js"; +import { setPageContent, setTitleElement, changePage } from "../../pageUtils.js"; import { CopyableInputBox } from "../../elements/CopyableInputBox.js"; import { makeElement } from "../../htmlUtils.js"; import Prism from "prismjs"; diff --git a/src/pages/KeyValue/KeyValueSecretsEdit.js b/src/pages/KeyValue/KeyValueSecretsEdit.js index fcb3bd4..80ea306 100644 --- a/src/pages/KeyValue/KeyValueSecretsEdit.js +++ b/src/pages/KeyValue/KeyValueSecretsEdit.js @@ -1,7 +1,7 @@ import { Page } from "../../types/Page.js"; import { getSecret, createOrUpdateSecret } from "../../api.js"; import { verifyJSONString } from "../../utils.js"; -import { setPageContent, setTitleElement, setErrorText } from "../../pageUtils.js"; +import { setPageContent, setTitleElement, setErrorText, changePage } from "../../pageUtils.js"; import { makeElement } from "../../htmlUtils.js"; import { CodeJar } from "codejar"; diff --git a/src/pages/KeyValue/KeyValueVersions.js b/src/pages/KeyValue/KeyValueVersions.js index 94f36c8..ad11511 100644 --- a/src/pages/KeyValue/KeyValueVersions.js +++ b/src/pages/KeyValue/KeyValueVersions.js @@ -1,6 +1,6 @@ import { Page } from "../../types/Page.js"; import { getSecretMetadata } from "../../api.js"; -import { setPageContent, setTitleElement } from "../../pageUtils.js"; +import { setPageContent, setTitleElement, changePage } from "../../pageUtils.js"; import { makeElement } from "../../htmlUtils.js"; export class KeyValueVersionsPage extends Page { diff --git a/src/pages/KeyValue/KeyValueView.js b/src/pages/KeyValue/KeyValueView.js index 86f1e87..a2465a1 100644 --- a/src/pages/KeyValue/KeyValueView.js +++ b/src/pages/KeyValue/KeyValueView.js @@ -1,6 +1,6 @@ import { Page } from "../../types/Page.js"; import { DoesNotExistError, getSecrets } from "../../api.js"; -import { setErrorText, setTitleElement } from "../../pageUtils.js"; +import { setErrorText, setTitleElement, changePage } from "../../pageUtils.js"; import { makeElement } from "../../htmlUtils.js"; export class KeyValueViewPage extends Page { diff --git a/src/pages/Login.js b/src/pages/Login.js index 0272987..281706c 100644 --- a/src/pages/Login.js +++ b/src/pages/Login.js @@ -1,6 +1,6 @@ import { Page } from "../types/Page.js"; import { lookupSelf, usernameLogin } from "../api.js"; -import { setPageContent, setErrorText } from "../pageUtils.js"; +import { setPageContent, setErrorText, changePage } from "../pageUtils.js"; import { makeElement } from "../htmlUtils.js"; import { Margin } from "../elements/Margin.js"; import { MarginInline } from "../elements/MarginInline.js"; diff --git a/src/pages/TOTP/TOTPView.js b/src/pages/TOTP/TOTPView.js index 2db42d1..2141ad9 100644 --- a/src/pages/TOTP/TOTPView.js +++ b/src/pages/TOTP/TOTPView.js @@ -1,6 +1,6 @@ import { Page } from "../../types/Page.js"; import { getTOTPKeys, getTOTPCode } from "../../api.js"; -import { setTitleElement, setPageContent } from "../../pageUtils.js"; +import { setTitleElement, setPageContent, changePage } from "../../pageUtils.js"; import { CopyableInputBox } from "../../elements/CopyableInputBox.js"; import { makeElement } from "../../htmlUtils.js"; diff --git a/src/pages/Template.js b/src/pages/Template.js index 0cf8f6f..abeaa7e 100644 --- a/src/pages/Template.js +++ b/src/pages/Template.js @@ -1,5 +1,5 @@ import { Page } from "../types/Page.js"; -import { setPageContent, setTitleElement } from "../pageUtils.js"; +import { setPageContent, setTitleElement, changePage } from "../pageUtils.js"; import { makeElement } from "../htmlUtils.js"; export class TemplatePage extends Page { diff --git a/src/pages/Transit/TransitDecrypt.js b/src/pages/Transit/TransitDecrypt.js index 8d9572a..8220603 100644 --- a/src/pages/Transit/TransitDecrypt.js +++ b/src/pages/Transit/TransitDecrypt.js @@ -1,6 +1,6 @@ import { Page } from "../../types/Page.js"; import { transitDecrypt } from "../../api.js"; -import { setPageContent, setTitleElement, setErrorText } from "../../pageUtils.js"; +import { setPageContent, setTitleElement, setErrorText, changePage } from "../../pageUtils.js"; import { makeElement } from "../../htmlUtils.js"; import { Margin } from "../../elements/Margin.js"; import { CopyableModal } from "../../elements/CopyableModal.js"; diff --git a/src/pages/Transit/TransitEncrypt.js b/src/pages/Transit/TransitEncrypt.js index 8d5ff75..131f689 100644 --- a/src/pages/Transit/TransitEncrypt.js +++ b/src/pages/Transit/TransitEncrypt.js @@ -1,6 +1,6 @@ import { Page } from "../../types/Page.js"; import { transitEncrypt } from "../../api.js"; -import { setPageContent, setTitleElement, setErrorText } from "../../pageUtils.js"; +import { setPageContent, setTitleElement, setErrorText, changePage } from "../../pageUtils.js"; import { makeElement } from "../../htmlUtils.js"; import { Margin } from "../../elements/Margin.js"; import { CopyableModal } from "../../elements/CopyableModal.js"; diff --git a/src/pages/Transit/TransitView.js b/src/pages/Transit/TransitView.js index 308fda6..c560704 100644 --- a/src/pages/Transit/TransitView.js +++ b/src/pages/Transit/TransitView.js @@ -1,6 +1,6 @@ import { Page } from "../../types/Page.js"; import { DoesNotExistError, getTransitKeys } from "../../api.js"; -import { setErrorText, setTitleElement } from "../../pageUtils.js"; +import { setErrorText, setTitleElement, changePage } from "../../pageUtils.js"; import { makeElement } from "../../htmlUtils.js"; export class TransitViewPage extends Page { diff --git a/src/pages/Unseal.js b/src/pages/Unseal.js index 06d3832..ba8c3fd 100644 --- a/src/pages/Unseal.js +++ b/src/pages/Unseal.js @@ -2,7 +2,6 @@ import { Page } from "../types/Page.js"; import { submitUnsealKey, getSealStatus } from "../api.js"; import { setPageContent, setErrorText, changePage } from "../pageUtils.js"; import { makeElement } from "../htmlUtils.js"; -import { Margin } from "../elements/Margin.js"; import { MarginInline } from "../elements/MarginInline.js"; export class UnsealPage extends Page {