mirror of https://github.com/zer0bin-dev/zer0bin
🐛 fix: #57 fixed
This commit is contained in:
parent
b5978aab45
commit
1dabd0a670
|
@ -38,7 +38,7 @@ html(lang='en')
|
|||
a.logo.noselect(href='/') zer0bin
|
||||
.buttons.noselect
|
||||
button#save-button.btn(aria-label='Save')
|
||||
button#copy-button.btn(aria-label='Copy')
|
||||
button#duplicate-button.btn(aria-label='Duplicate')
|
||||
button#new-button.btn(aria-label='New paste')
|
||||
|
||||
button#markdown-button.btn(aria-label='Markdown')
|
||||
|
|
|
@ -20,7 +20,7 @@ import { IconDefinition } from "@ant-design/icons-svg/lib/types"
|
|||
|
||||
const saveButton = <HTMLButtonElement>document.getElementById("save-button")
|
||||
const newButton = <HTMLButtonElement>document.getElementById("new-button")
|
||||
const copyButton = <HTMLButtonElement>document.getElementById("copy-button")
|
||||
const copyButton = <HTMLButtonElement>document.getElementById("duplicate-button")
|
||||
const hideButton = <HTMLButtonElement>document.getElementById("hide-button")
|
||||
const githubButton = <HTMLButtonElement>document.getElementById("github-button")
|
||||
const shareButton = <HTMLButtonElement>document.getElementById("share-button")
|
||||
|
@ -85,7 +85,7 @@ tippy("#new-button", {
|
|||
allowHTML: true,
|
||||
})
|
||||
|
||||
tippy("#copy-button", {
|
||||
tippy("#duplicate-button", {
|
||||
content: "Duplicate paste<br><span class='keybind'>Ctrl + D</span>",
|
||||
placement: "bottom",
|
||||
animation: "scale",
|
||||
|
|
|
@ -33,7 +33,7 @@ const viewCounter = <HTMLSpanElement>(
|
|||
)
|
||||
const saveButton = <HTMLButtonElement>document.getElementById("save-button")
|
||||
const newButton = <HTMLButtonElement>document.getElementById("new-button")
|
||||
const copyButton = <HTMLButtonElement>document.getElementById("copy-button")
|
||||
const copyButton = <HTMLButtonElement>document.getElementById("duplicate-button")
|
||||
const hideButton = <HTMLButtonElement>document.getElementById("hide-button")
|
||||
const shareButton = <HTMLButtonElement>document.getElementById("share-button")
|
||||
const markdownButton = <HTMLButtonElement>(
|
||||
|
@ -273,15 +273,22 @@ saveButton.addEventListener("click", async function () {
|
|||
|
||||
document.addEventListener("keydown", (e) => {
|
||||
if (e.ctrlKey && e.key === "s") {
|
||||
if(saveButton.disabled) { return; }
|
||||
|
||||
e.preventDefault()
|
||||
savePaste()
|
||||
} else if (e.ctrlKey && e.key === "n") {
|
||||
if(newButton.disabled) { return; }
|
||||
|
||||
e.preventDefault()
|
||||
newPaste()
|
||||
} else if (e.ctrlKey && e.key === "d") {
|
||||
if (duplicatePaste.disabled) { return; }
|
||||
|
||||
e.preventDefault()
|
||||
duplicatePaste()
|
||||
} else if (e.ctrlKey && e.key === "m") {
|
||||
|
||||
e.preventDefault()
|
||||
toggleMarkdown()
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue