diff --git a/frontend/index.pug b/frontend/index.pug
index 68f83f5..035a98c 100755
--- a/frontend/index.pug
+++ b/frontend/index.pug
@@ -46,13 +46,13 @@ html(lang='en')
//- - }
button#new-button.btn(aria-label='New paste')
button#copy-button.btn(aria-label='Copy')
+ button#share-button.btn(aria-label='Share')
a(href='https://github.com/zer0bin-dev/zer0bin' aria-label='GitHub repo')
button#github-button.btn(aria-label='GitHub')
span.viewcounter.noselect#viewcounter-label(style='visibility: hidden; display: none') Views:
span.viewcounter.noselect#viewcounter-count(style='visibility: hidden; display: none')
.bottom-button-wrapper
- button#share-button.btn(aria-label='Share' style='visibility: hidden')
button#hide-button.btn(aria-label='Hide')
.scrollbar-container
diff --git a/frontend/src/icons.ts b/frontend/src/icons.ts
index c035d1b..a0795e7 100644
--- a/frontend/src/icons.ts
+++ b/frontend/src/icons.ts
@@ -93,6 +93,14 @@ tippy("#copy-button", {
allowHTML: true,
})
+tippy("#share-button", {
+ content: `Share paste
Copies URL`,
+ placement: "top",
+ animation: "scale",
+ theme: "rosepine",
+ allowHTML: true,
+})
+
tippy("#github-button", {
content: `GitHub
${renderIconDefinitionToSVGElement(StarOutlined, {
@@ -116,14 +124,6 @@ tippy("#hide-button", {
allowHTML: true,
})
-tippy("#share-button", {
- content: "Share paste",
- placement: "top",
- animation: "scale",
- theme: "rosepine",
- allowHTML: true,
-})
-
const observer = new MutationObserver(callback)
function callback() {
diff --git a/frontend/src/index.ts b/frontend/src/index.ts
index 6dcd0f7..fea6fa3 100755
--- a/frontend/src/index.ts
+++ b/frontend/src/index.ts
@@ -117,6 +117,7 @@ function newPaste() {
enable(saveButton)
disable(newButton)
disable(copyButton)
+ disable(shareButton)
enable(singleViewButton)
editor.value = ""
@@ -128,7 +129,6 @@ function newPaste() {
hide(codeViewPre)
hide(viewCounterLabel)
hide(viewCounter)
- hide(shareButton)
viewCounterLabel.style.display = "none"
viewCounter.style.display = "none"
}
@@ -167,7 +167,7 @@ function viewPaste(content: string, views: string, singleView: boolean) {
addMessage("This is a single-view paste!")
}
- show(shareButton)
+ enable(shareButton)
shareButton.addEventListener("click", function () {
const url = window.location.toString()
if (navigator.canShare) {