diff --git a/src/elements/CopyableModal.js b/src/elements/CopyableModal.ts similarity index 91% rename from src/elements/CopyableModal.js rename to src/elements/CopyableModal.ts index 224360b..ba86db6 100644 --- a/src/elements/CopyableModal.js +++ b/src/elements/CopyableModal.ts @@ -4,7 +4,7 @@ import ClipboardJS from "clipboard"; import FileSaver from 'file-saver'; import i18next from 'i18next'; -export function CopyableModal(name, contentString) { +export function CopyableModal(name: string, contentString: string): Element { return makeElement({ tag: "div", class: "modal-sections", @@ -54,7 +54,7 @@ export function CopyableModal(name, contentString) { }, text: i18next.t("copy_modal_download_btn"), onclick: _ => { - var blob = new Blob([contentString], {type: "text/plain;charset=utf-8"}); + const blob = new Blob([contentString], {type: "text/plain;charset=utf-8"}); FileSaver.saveAs(blob, "result.txt"); } }), @@ -67,7 +67,7 @@ export function CopyableModal(name, contentString) { }, text: i18next.t("copy_modal_copy_btn"), thenRun: (e) => { - let clipboard = new ClipboardJS(e); + const clipboard = new ClipboardJS(e); addClipboardNotifications(clipboard); } }), diff --git a/src/pages/Transit/TransitDecrypt.js b/src/pages/Transit/TransitDecrypt.js index c4f8e50..24a1b56 100644 --- a/src/pages/Transit/TransitDecrypt.js +++ b/src/pages/Transit/TransitDecrypt.js @@ -1,4 +1,4 @@ -import { CopyableModal } from "../../elements/CopyableModal.js"; +import { CopyableModal } from "../../elements/CopyableModal"; import { Margin } from "../../elements/Margin.js"; import { Page } from "../../types/Page"; import { changePage, setErrorText, setPageContent, setTitleElement } from "../../pageUtils"; diff --git a/src/pages/Transit/TransitEncrypt.js b/src/pages/Transit/TransitEncrypt.js index b148136..76a1915 100644 --- a/src/pages/Transit/TransitEncrypt.js +++ b/src/pages/Transit/TransitEncrypt.js @@ -1,4 +1,4 @@ -import { CopyableModal } from "../../elements/CopyableModal.js"; +import { CopyableModal } from "../../elements/CopyableModal"; import { Margin } from "../../elements/Margin.js"; import { Page } from "../../types/Page"; import { changePage, setErrorText, setPageContent, setTitleElement } from "../../pageUtils";