Skip to content

Commit

Permalink
add copy to clipboard option for link creation
Browse files Browse the repository at this point in the history
  • Loading branch information
glendc committed Oct 23, 2023
1 parent 85b880e commit 31595ba
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions static/js/hyperscript.min.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
<meta property="og:image" content="/og-image">

<script src="/static/js/htmx.min.js?v=1.9.6"></script>
<script src="/static/js/hyperscript.min.js?v=0.9.11"></script>
<script type="module" src="/static/js/bckt.js?v=0.1.0"></script>

<link rel="stylesheet" href="/static/css/missing.min.css?v=1.1.1" />
Expand Down
11 changes: 9 additions & 2 deletions templates/content/link_ok.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,15 @@
<a href="{{ long }}" style="overflow-wrap: anywhere;">{{ long }}</a> can be found shortened
as <a href="{{ short }}" hx-boost="false">{{ short }}</a>.
</p>
<p>
<a href="/" class="<button> good big" style="margin: 10px 0 0 0; float: right;" autofocus>↩ go back</a>
<section class="tool-bar" style="float: right;">
<button
_="on click navigator.clipboard.writeText(window.location.origin + '{{ short }}')"
class="big"
autofocus
>
📋 Copy Shortlink To Clipboard
</button>
<a href="/" class="<button> good big">↩ go back</a>
</p>
</div>
{% endblock %}

0 comments on commit 31595ba

Please sign in to comment.