mirror of
https://github.com/hrfee/jfa-go.git
synced 2024-12-22 17:10:10 +00:00
discord: pad, underline invite link
This commit is contained in:
parent
094f7cea94
commit
68aedf07ae
49
html/account-linking.html
Normal file
49
html/account-linking.html
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
{{ if .discordEnabled }}
|
||||||
|
<div id="modal-discord" class="modal">
|
||||||
|
<div class="card relative mx-auto my-[10%] w-4/5 lg:w-1/3">
|
||||||
|
<span class="heading mb-4">{{ .strings.linkDiscord }}</span>
|
||||||
|
<p class="content mb-4"> {{ .discordSendPINMessage }}</p>
|
||||||
|
<h1 class="text-center text-2xl mb-2 pin"></h1>
|
||||||
|
<div class="row center">
|
||||||
|
<a id="discord-invite" class="my-5 hover:underline"></a>
|
||||||
|
</div>
|
||||||
|
<span class="button ~info @low full-width center mt-4" id="discord-waiting">{{ .strings.success }}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{{ end }}
|
||||||
|
{{ if .telegramEnabled }}
|
||||||
|
<div id="modal-telegram" class="modal">
|
||||||
|
<div class="card relative mx-auto my-[10%] w-4/5 lg:w-1/3">
|
||||||
|
<span class="heading mb-4">{{ .strings.linkTelegram }}</span>
|
||||||
|
<p class="content mb-4">{{ .strings.sendPIN }}</p>
|
||||||
|
<p class="text-center text-2xl mb-2">{{ .telegramPIN }}</p>
|
||||||
|
<a class="subheading link-center" href="{{ .telegramURL }}" target="_blank">
|
||||||
|
<span class="shield ~info mr-4">
|
||||||
|
<span class="icon">
|
||||||
|
<i class="ri-telegram-line"></i>
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
@{{ .telegramUsername }}
|
||||||
|
</a>
|
||||||
|
<span class="button ~info @low full-width center mt-4" id="telegram-waiting">{{ .strings.success }}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{{ end }}
|
||||||
|
{{ if .matrixEnabled }}
|
||||||
|
<div id="modal-matrix" class="modal">
|
||||||
|
<div class="card relative mx-auto my-[10%] w-4/5 lg:w-1/3">
|
||||||
|
<span class="heading mb-4">{{ .strings.linkMatrix }}</span>
|
||||||
|
<p class="content mb-4"> {{ .strings.matrixEnterUser }}</p>
|
||||||
|
<input type="text" class="input ~neutral @high" placeholder="@user:riot.im" id="matrix-userid">
|
||||||
|
<div class="subheading link-center mt-4">
|
||||||
|
<span class="shield ~info mr-4">
|
||||||
|
<span class="icon">
|
||||||
|
<i class="ri-chat-3-line"></i>
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
{{ .matrixUser }}
|
||||||
|
</div>
|
||||||
|
<span class="button ~info @low full-width center mt-4" id="matrix-send">{{ .strings.submit }}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{{ end }}
|
@ -26,53 +26,7 @@
|
|||||||
<p class="content mb-4">{{ .strings.confirmationRequiredMessage }}</p>
|
<p class="content mb-4">{{ .strings.confirmationRequiredMessage }}</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{ if .telegramEnabled }}
|
{{ template "account-linking.html" . }}
|
||||||
<div id="modal-telegram" class="modal">
|
|
||||||
<div class="card relative mx-auto my-[10%] w-4/5 lg:w-1/3">
|
|
||||||
<span class="heading mb-4">{{ .strings.linkTelegram }}</span>
|
|
||||||
<p class="content mb-4">{{ .strings.sendPIN }}</p>
|
|
||||||
<p class="text-center text-2xl mb-2">{{ .telegramPIN }}</p>
|
|
||||||
<a class="subheading link-center" href="{{ .telegramURL }}" target="_blank">
|
|
||||||
<span class="shield ~info mr-4">
|
|
||||||
<span class="icon">
|
|
||||||
<i class="ri-telegram-line"></i>
|
|
||||||
</span>
|
|
||||||
</span>
|
|
||||||
@{{ .telegramUsername }}
|
|
||||||
</a>
|
|
||||||
<span class="button ~info @low full-width center mt-4" id="telegram-waiting">{{ .strings.success }}</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{{ end }}
|
|
||||||
{{ if .discordEnabled }}
|
|
||||||
<div id="modal-discord" class="modal">
|
|
||||||
<div class="card relative mx-auto my-[10%] w-4/5 lg:w-1/3">
|
|
||||||
<span class="heading mb-4">{{ .strings.linkDiscord }}</span>
|
|
||||||
<p class="content mb-4"> {{ .discordSendPINMessage }}</p>
|
|
||||||
<h1 class="text-center text-2xl mb-2 pin"></h1>
|
|
||||||
<a id="discord-invite"></a>
|
|
||||||
<span class="button ~info @low full-width center mt-4" id="discord-waiting">{{ .strings.success }}</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{{ end }}
|
|
||||||
{{ if .matrixEnabled }}
|
|
||||||
<div id="modal-matrix" class="modal">
|
|
||||||
<div class="card relative mx-auto my-[10%] w-4/5 lg:w-1/3">
|
|
||||||
<span class="heading mb-4">{{ .strings.linkMatrix }}</span>
|
|
||||||
<p class="content mb-4"> {{ .strings.matrixEnterUser }}</p>
|
|
||||||
<input type="text" class="input ~neutral @high" placeholder="@user:riot.im" id="matrix-userid">
|
|
||||||
<div class="subheading link-center mt-4">
|
|
||||||
<span class="shield ~info mr-4">
|
|
||||||
<span class="icon">
|
|
||||||
<i class="ri-chat-3-line"></i>
|
|
||||||
</span>
|
|
||||||
</span>
|
|
||||||
{{ .matrixUser }}
|
|
||||||
</div>
|
|
||||||
<span class="button ~info @low full-width center mt-4" id="matrix-send">{{ .strings.submit }}</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{{ end }}
|
|
||||||
<div class="top-4 left-4 absolute">
|
<div class="top-4 left-4 absolute">
|
||||||
<span class="dropdown" tabindex="0" id="lang-dropdown">
|
<span class="dropdown" tabindex="0" id="lang-dropdown">
|
||||||
<span class="button ~urge dropdown-button">
|
<span class="button ~urge dropdown-button">
|
||||||
|
@ -41,49 +41,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="modal-discord" class="modal">
|
{{ template "account-linking.html" . }}
|
||||||
<div class="card relative mx-auto my-[10%] w-4/5 lg:w-1/3">
|
|
||||||
<span class="heading mb-4">{{ .strings.linkDiscord }}</span>
|
|
||||||
<p class="content mb-4"> {{ .discordSendPINMessage }}</p>
|
|
||||||
<h1 class="text-center text-2xl mb-2 pin"></h1>
|
|
||||||
<div class="row center">
|
|
||||||
<a id="discord-invite"></a>
|
|
||||||
</div>
|
|
||||||
<span class="button ~info @low full-width center mt-4" id="discord-waiting">{{ .strings.success }}</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div id="modal-telegram" class="modal">
|
|
||||||
<div class="card relative mx-auto my-[10%] w-4/5 lg:w-1/3">
|
|
||||||
<span class="heading mb-4">{{ .strings.linkTelegram }}</span>
|
|
||||||
<p class="content mb-4">{{ .strings.sendPIN }}</p>
|
|
||||||
<p class="text-center text-2xl mb-2">{{ .telegramPIN }}</p>
|
|
||||||
<a class="subheading link-center" href="{{ .telegramURL }}" target="_blank">
|
|
||||||
<span class="shield ~info mr-4">
|
|
||||||
<span class="icon">
|
|
||||||
<i class="ri-telegram-line"></i>
|
|
||||||
</span>
|
|
||||||
</span>
|
|
||||||
@{{ .telegramUsername }}
|
|
||||||
</a>
|
|
||||||
<span class="button ~info @low full-width center mt-4" id="telegram-waiting">{{ .strings.success }}</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div id="modal-matrix" class="modal">
|
|
||||||
<div class="card relative mx-auto my-[10%] w-4/5 lg:w-1/3">
|
|
||||||
<span class="heading mb-4">{{ .strings.linkMatrix }}</span>
|
|
||||||
<p class="content mb-4"> {{ .strings.matrixEnterUser }}</p>
|
|
||||||
<input type="text" class="input ~neutral @high" placeholder="@user:riot.im" id="matrix-userid">
|
|
||||||
<div class="subheading link-center mt-4">
|
|
||||||
<span class="shield ~info mr-4">
|
|
||||||
<span class="icon">
|
|
||||||
<i class="ri-chat-3-line"></i>
|
|
||||||
</span>
|
|
||||||
</span>
|
|
||||||
{{ .matrixUser }}
|
|
||||||
</div>
|
|
||||||
<span class="button ~info @low full-width center mt-4" id="matrix-send">{{ .strings.submit }}</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div id="notification-box"></div>
|
<div id="notification-box"></div>
|
||||||
<div class="top-4 left-4 absolute">
|
<div class="top-4 left-4 absolute">
|
||||||
<span class="dropdown" tabindex="0" id="lang-dropdown">
|
<span class="dropdown" tabindex="0" id="lang-dropdown">
|
||||||
|
@ -20,7 +20,8 @@
|
|||||||
"sendPIN": "Send the PIN below to the bot, then come back here to link your account.",
|
"sendPIN": "Send the PIN below to the bot, then come back here to link your account.",
|
||||||
"sendPINDiscord": "Type {command} in {server_channel} on Discord, then send the PIN below.",
|
"sendPINDiscord": "Type {command} in {server_channel} on Discord, then send the PIN below.",
|
||||||
"matrixEnterUser": "Enter your User ID, press submit, and a PIN will be sent to you. Enter it here to continue.",
|
"matrixEnterUser": "Enter your User ID, press submit, and a PIN will be sent to you. Enter it here to continue.",
|
||||||
"welcomeUser": "Welcome, {user}!"
|
"welcomeUser": "Welcome, {user}!",
|
||||||
|
"joinTheServer": "Join the server:"
|
||||||
},
|
},
|
||||||
"notifications": {
|
"notifications": {
|
||||||
"errorUserExists": "User already exists.",
|
"errorUserExists": "User already exists.",
|
||||||
|
@ -75,13 +75,15 @@ export class Discord {
|
|||||||
const link = document.getElementById("discord-invite") as HTMLAnchorElement;
|
const link = document.getElementById("discord-invite") as HTMLAnchorElement;
|
||||||
link.href = inv.invite;
|
link.href = inv.invite;
|
||||||
link.target = "_blank";
|
link.target = "_blank";
|
||||||
|
let innerHTML = `<span class="mr-2">${window.lang.strings("joinTheServer")}</span>`;
|
||||||
if (inv.icon != "") {
|
if (inv.icon != "") {
|
||||||
link.innerHTML = `<span class="img-circle lg mr-4"><img class="img-circle" src="${inv.icon}" width="64" height="64"></span>${window.discordServerName}`;
|
innerHTML += `<span class="img-circle lg mr-4"><img class="img-circle" src="${inv.icon}" width="64" height="64"></span>${window.discordServerName}`;
|
||||||
} else {
|
} else {
|
||||||
link.innerHTML = `
|
innerHTML += `
|
||||||
<span class="shield mr-4 bg-discord"><i class="ri-discord-fill ri-xl text-white"></i></span>${window.discordServerName}
|
<span class="shield mr-4 bg-discord"><i class="ri-discord-fill ri-xl text-white"></i></span>${window.discordServerName}
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
link.innerHTML = innerHTML;
|
||||||
});
|
});
|
||||||
|
|
||||||
private _checkVerified = () => {
|
private _checkVerified = () => {
|
||||||
|
@ -35,9 +35,15 @@ window.modals = {} as Modals;
|
|||||||
(() => {
|
(() => {
|
||||||
window.modals.login = new Modal(document.getElementById("modal-login"), true);
|
window.modals.login = new Modal(document.getElementById("modal-login"), true);
|
||||||
window.modals.email = new Modal(document.getElementById("modal-email"), false);
|
window.modals.email = new Modal(document.getElementById("modal-email"), false);
|
||||||
|
if (window.discordEnabled) {
|
||||||
window.modals.discord = new Modal(document.getElementById("modal-discord"), false);
|
window.modals.discord = new Modal(document.getElementById("modal-discord"), false);
|
||||||
|
}
|
||||||
|
if (window.telegramEnabled) {
|
||||||
window.modals.telegram = new Modal(document.getElementById("modal-telegram"), false);
|
window.modals.telegram = new Modal(document.getElementById("modal-telegram"), false);
|
||||||
|
}
|
||||||
|
if (window.matrixEnabled) {
|
||||||
window.modals.matrix = new Modal(document.getElementById("modal-matrix"), false);
|
window.modals.matrix = new Modal(document.getElementById("modal-matrix"), false);
|
||||||
|
}
|
||||||
})();
|
})();
|
||||||
|
|
||||||
window.notifications = new notificationBox(document.getElementById('notification-box') as HTMLDivElement, 5);
|
window.notifications = new notificationBox(document.getElementById('notification-box') as HTMLDivElement, 5);
|
||||||
|
Loading…
Reference in New Issue
Block a user