question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Share button for copying current URL

See original GitHub issue

I use datasette in an iframe inside another HTML file that contains other ways to represent my data (mostly leaflets maps built with R on summarized data), and the datasette iframe is a tab in that page.

This particular use prevents users to access the full URLs of their datasette views and queries, which is a shame because the way datasette handles URLs to make every view or query easy to share is awesome. I know how to get the URL from the context menu of my browser, but I don’t think many visitors would do it or even notice that datasette uses permalinks for pretty much every action they do. Would it be possible to add a “Share link” button to the interface, either in datasette itself or in a plugin?

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
simonwcommented, Feb 23, 2021

I really like the way the Share feature on Stack Overflow works: https://stackoverflow.com/questions/18934149/how-can-i-use-postgresqls-text-column-type-in-django

0reactions
simonwcommented, Jul 30, 2021

One possible treatment:

fixtures__sortable__201_rows
<style>
a.action-button {
    display: inline-block;
    border: 1.5px solid #666;
    border-radius: 0.5em;
    background-color: #ffffff;
    color: #666;
    padding: 0.1em 0.8em;
    text-decoration: none;
    margin-right: 0.3em;
    font-size: 0.85em;
}
</style>
<p>
    {% if query.sql and allow_execute_sql %}
        <a class="action-button"
            title="{{ query.sql }}"
            href="{{ urls.database(database) }}?{{ {'sql': query.sql}|urlencode|safe }}{% if query.params %}&amp;{{ query.params|urlencode|safe }}{% endif %}">
            View and edit SQL
        </a>
    {% endif %}
    <a href="#" class="action-button">Copy and share link</a>
</p>
Read more comments on GitHub >

github_iconTop Results From Across the Web

Copy current URL to clipboard - javascript - Stack Overflow
var shareBtn = document.querySelector(".share-button"); shareBtn.addEventListener('click', function( ...
Read more >
Get the Copy Link Share Button for your website - Shareaholic
Get more of your content shared and grow faster with the Copy Link Share Button installed on your website. The Copy Link Share...
Read more >
Copy Url to clipboard - CodePen
<button class="clipboard">Click me to copy current Url</button>. 4. <p>Have you already clicked?</p>. 5. </center>. 6. </div> ! CSS (SCSS). CSS (SCSS).
Read more >
How to Copy a Web Page Link or URL - Computer Hope
Copy a URL (address) on a desktop or laptop · After the address is highlighted, press Ctrl + C or Command + C...
Read more >
Natively copying url to clipboard on desktop and mobile
... a quick solution to let the user copy the current url to their clipboard. ... Here's a complete example of a ShareButton.tsx...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found