This commit is contained in:
parent
640fbef200
commit
cb0bf74025
10
index.ts
10
index.ts
|
@ -196,6 +196,8 @@ function layout(content: string): string {
|
|||
· <a href="${ISSUE_REPORT}">Report an Issue</a>
|
||||
</p>
|
||||
</footer>
|
||||
<script src="/clipboard.min.js"></script>
|
||||
<script src="/scripts.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
`.trim();
|
||||
|
@ -222,10 +224,14 @@ function newInbox(): string {
|
|||
function created(identifier: string): string {
|
||||
return html`
|
||||
<p>
|
||||
Sign up for the newsletter with<br /><code>${feedEmail(identifier)}</code>
|
||||
Sign up for the newsletter with<br /><code class="copyable"
|
||||
>${feedEmail(identifier)}</code
|
||||
>
|
||||
</p>
|
||||
<p>
|
||||
Subscribe to the Atom feed at<br /><code>${feedURL(identifier)}</code>
|
||||
Subscribe to the Atom feed at<br /><code class="copyable"
|
||||
>${feedURL(identifier)}</code
|
||||
>
|
||||
</p>
|
||||
<p>
|
||||
Don’t share these addresses.<br />They contain an identifier that other
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,11 @@
|
|||
for (const copyable of document.querySelectorAll(".copyable"))
|
||||
copyable.insertAdjacentHTML(
|
||||
"afterend",
|
||||
`<br><button class="copy-button" data-clipboard-text="${copyable.innerText}">Copy</button>`
|
||||
);
|
||||
new ClipboardJS(".copy-button").on("success", (event) => {
|
||||
event.trigger.innerText = "Copied";
|
||||
window.setTimeout(() => {
|
||||
event.trigger.innerText = "Copy";
|
||||
}, 500);
|
||||
});
|
Loading…
Reference in New Issue