Add possiblity to share gallerie with public link
All checks were successful
Docker / build (release) Successful in 8s
All checks were successful
Docker / build (release) Successful in 8s
This commit is contained in:
parent
ed28d4a9c4
commit
2a409b54f7
12 changed files with 206 additions and 48 deletions
24
photo21/static/copy-button.js
Normal file
24
photo21/static/copy-button.js
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
document.querySelectorAll('[data-clipboard-text]').forEach(function(btn) {
|
||||
btn.addEventListener('click', function() {
|
||||
var text = btn.dataset.clipboardText;
|
||||
if (navigator.clipboard) {
|
||||
navigator.clipboard.writeText(text);
|
||||
} else {
|
||||
var ta = document.createElement('textarea');
|
||||
ta.value = text;
|
||||
ta.style.position = 'fixed';
|
||||
ta.style.opacity = '0';
|
||||
document.body.appendChild(ta);
|
||||
ta.select();
|
||||
document.execCommand('copy');
|
||||
document.body.removeChild(ta);
|
||||
}
|
||||
var original = btn.textContent;
|
||||
btn.textContent = '✓ Copied!';
|
||||
btn.disabled = true;
|
||||
setTimeout(function() {
|
||||
btn.textContent = original;
|
||||
btn.disabled = false;
|
||||
}, 2000);
|
||||
});
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue