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_guest": "Gast einladen",
|
||||||
"invite_duration": "Link gültig für (Minuten):",
|
"invite_duration": "Link gültig für (Minuten):",
|
||||||
"generate_link": "Link generieren",
|
"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_guest": "Invite Guest",
|
||||||
"invite_duration": "Link valid for (minutes):",
|
"invite_duration": "Link valid for (minutes):",
|
||||||
"generate_link": "Generate Link",
|
"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">
|
<input type="number" id="inviteDuration" min="1" max="1440" value="60">
|
||||||
<br>
|
<br>
|
||||||
<button class="btn" onclick="generateInviteLink()">{{ translations['generate_link'] if translations['generate_link'] else 'Generate Link' }}</button>
|
<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>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
function openInvitePopup() {
|
function openInvitePopup() {
|
||||||
document.getElementById('invitePopup').style.display = 'flex';
|
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() {
|
function closeInvitePopup() {
|
||||||
document.getElementById('invitePopup').style.display = 'none';
|
document.getElementById('invitePopup').style.display = 'none';
|
||||||
@@ -198,15 +204,25 @@ function generateInviteLink() {
|
|||||||
// Extrahiere den Link aus dem HTML (da /invite ein Template rendert)
|
// Extrahiere den Link aus dem HTML (da /invite ein Template rendert)
|
||||||
const match = html.match(/href="([^"]+)"/);
|
const match = html.match(/href="([^"]+)"/);
|
||||||
if (match) {
|
if (match) {
|
||||||
document.getElementById('inviteLinkResult').innerHTML =
|
document.getElementById('inviteLinkInput').value = match[1];
|
||||||
`<div style="margin-top:10px;">
|
document.getElementById('inviteLinkInput').style.display = '';
|
||||||
<strong>{{ translations['invite_link'] if translations['invite_link'] else 'Invite Link:' }}</strong><br>
|
document.getElementById('copyInviteBtn').style.display = '';
|
||||||
<a href="${match[1]}" target="_blank" style="color:#1DB954;">${match[1]}</a>
|
|
||||||
</div>`;
|
|
||||||
} else {
|
} 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>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
Reference in New Issue
Block a user