feat: copy live URLs to clipboard instead of opening them
This commit is contained in:
+13
-3
@@ -93,9 +93,9 @@
|
||||
<li class="nav-item"><a class="nav-link" href="/programs/jazz">Jazz FM</a></li>
|
||||
</ul>
|
||||
<div class="d-flex gap-2">
|
||||
<a href="/live/radio357" class="btn btn-outline-info btn-sm" target="_blank" title="Bezpośredni stream premium Radia 357 (wyższa jakość, brak reklam)">Stream 357</a>
|
||||
<a href="/live/rns" class="btn btn-outline-info btn-sm" target="_blank" title="Bezpośredni stream premium RNŚ (wyższa jakość, brak reklam)">Stream RNŚ</a>
|
||||
<a href="/feeds/Podcasts.opml" class="btn btn-outline-warning btn-sm" target="_blank">Master OPML</a>
|
||||
<button onclick="copyToClipboard('/live/radio357', this)" class="btn btn-outline-info btn-sm" title="Kopiuj bezpośredni stream premium Radia 357">Stream 357</button>
|
||||
<button onclick="copyToClipboard('/live/rns', this)" class="btn btn-outline-info btn-sm" title="Kopiuj bezpośredni stream premium RNŚ">Stream RNŚ</button>
|
||||
<button onclick="copyToClipboard('/feeds/Podcasts.opml', this)" class="btn btn-outline-warning btn-sm">Master OPML</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -104,5 +104,15 @@
|
||||
{% block content %}{% endblock %}
|
||||
</div>
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
|
||||
<script>
|
||||
function copyToClipboard(path, btn) {
|
||||
const fullUrl = window.location.origin + path;
|
||||
navigator.clipboard.writeText(fullUrl).then(() => {
|
||||
const originalText = btn.innerText;
|
||||
btn.innerText = 'Skopiowano!';
|
||||
setTimeout(() => { btn.innerText = originalText; }, 2000);
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user