This commit is contained in:
Leandro Facchinetti 2020-12-12 02:37:21 +00:00
parent 640fbef200
commit cb0bf74025
3 changed files with 26 additions and 2 deletions

View File

@ -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>
Dont share these addresses.<br />They contain an identifier that other

7
static/clipboard.min.js vendored Normal file

File diff suppressed because one or more lines are too long

11
static/scripts.js Normal file
View File

@ -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);
});