modified: locales/de-DE.json
modified: locales/en-EN.json modified: templates/playlists.html
This commit is contained in:
@@ -44,5 +44,7 @@
|
||||
"invite_guest": "Gast einladen",
|
||||
"invite_duration": "Link gültig für (Minuten):",
|
||||
"generate_link": "Link generieren",
|
||||
"invite_link": "Einladungslink:"
|
||||
"invite_link": "Einladungslink:",
|
||||
"copy_link": "Link kopieren",
|
||||
"copied": "Kopiert!"
|
||||
}
|
||||
@@ -44,5 +44,7 @@
|
||||
"invite_guest": "Invite Guest",
|
||||
"invite_duration": "Link valid for (minutes):",
|
||||
"generate_link": "Generate Link",
|
||||
"invite_link": "Invite Link:"
|
||||
"invite_link": "Invite Link:",
|
||||
"copy_link": "Copy Link",
|
||||
"copied": "Copied!"
|
||||
}
|
||||
@@ -178,14 +178,20 @@
|
||||
<input type="number" id="inviteDuration" min="1" max="1440" value="60">
|
||||
<br>
|
||||
<button class="btn" onclick="generateInviteLink()">{{ translations['generate_link'] if translations['generate_link'] else 'Generate Link' }}</button>
|
||||
<div id="inviteLinkResult"></div>
|
||||
<div id="inviteLinkResult" style="margin-top:18px;">
|
||||
<input id="inviteLinkInput" type="text" readonly style="width:90%;padding:8px;border-radius:8px;border:1px solid #444;display:none;background:#222;color:#fff;">
|
||||
<button id="copyInviteBtn" class="btn" style="margin-top:8px;display:none;" onclick="copyInviteLink()">{{ translations['copy_link'] if translations['copy_link'] else 'Copy Link' }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function openInvitePopup() {
|
||||
document.getElementById('invitePopup').style.display = 'flex';
|
||||
document.getElementById('inviteLinkResult').innerHTML = '';
|
||||
document.getElementById('inviteLinkResult').style.display = '';
|
||||
document.getElementById('inviteLinkInput').style.display = 'none';
|
||||
document.getElementById('copyInviteBtn').style.display = 'none';
|
||||
document.getElementById('inviteLinkInput').value = '';
|
||||
}
|
||||
function closeInvitePopup() {
|
||||
document.getElementById('invitePopup').style.display = 'none';
|
||||
@@ -198,15 +204,25 @@ function generateInviteLink() {
|
||||
// Extrahiere den Link aus dem HTML (da /invite ein Template rendert)
|
||||
const match = html.match(/href="([^"]+)"/);
|
||||
if (match) {
|
||||
document.getElementById('inviteLinkResult').innerHTML =
|
||||
`<div style="margin-top:10px;">
|
||||
<strong>{{ translations['invite_link'] if translations['invite_link'] else 'Invite Link:' }}</strong><br>
|
||||
<a href="${match[1]}" target="_blank" style="color:#1DB954;">${match[1]}</a>
|
||||
</div>`;
|
||||
document.getElementById('inviteLinkInput').value = match[1];
|
||||
document.getElementById('inviteLinkInput').style.display = '';
|
||||
document.getElementById('copyInviteBtn').style.display = '';
|
||||
} else {
|
||||
document.getElementById('inviteLinkResult').innerHTML = "Error generating link.";
|
||||
document.getElementById('inviteLinkInput').value = "Error generating link.";
|
||||
document.getElementById('inviteLinkInput').style.display = '';
|
||||
document.getElementById('copyInviteBtn').style.display = 'none';
|
||||
}
|
||||
});
|
||||
}
|
||||
function copyInviteLink() {
|
||||
const input = document.getElementById('inviteLinkInput');
|
||||
input.select();
|
||||
input.setSelectionRange(0, 99999);
|
||||
document.execCommand('copy');
|
||||
document.getElementById('copyInviteBtn').innerText = "{{ translations['copied'] if translations['copied'] else 'Copied!' }}";
|
||||
setTimeout(() => {
|
||||
document.getElementById('copyInviteBtn').innerText = "{{ translations['copy_link'] if translations['copy_link'] else 'Copy Link' }}";
|
||||
}, 1200);
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
||||
Reference in New Issue
Block a user