if language is not english, the rules button should re-open the modal instead of opening rules.html
This commit is contained in:
parent
2377e4aceb
commit
9cd578e453
|
|
@ -186,7 +186,7 @@
|
|||
<a href="https://computernewb.com/collab-vm/faq/" class="nav-link"><i class="fa-solid fa-circle-question"></i> <span id="faqBtnText"></span></a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="https://computernewb.com/collab-vm/rules" class="nav-link"><i class="fa-solid fa-clipboard-check"></i> <span id="rulesBtnText"></span></a>
|
||||
<a id="rulesBtn" href="https://computernewb.com/collab-vm/rules" class="nav-link"><i class="fa-solid fa-clipboard-check"></i> <span id="rulesBtnText"></span></a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="https://discord.gg/a4kqb4mGyX" class="nav-link"><i class="fa-brands fa-discord"></i> Discord</a>
|
||||
|
|
|
|||
|
|
@ -142,6 +142,8 @@ export class I18n {
|
|||
private lang: Language = fallbackLanguage;
|
||||
private languageDropdown: HTMLSpanElement = document.getElementById('languageDropdown') as HTMLSpanElement;
|
||||
|
||||
CurrentLanguage = () => this.langId;
|
||||
|
||||
// the ID of the language
|
||||
private langId: string = fallbackId;
|
||||
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ const elements = {
|
|||
vmview: document.getElementById('vmview') as HTMLDivElement,
|
||||
vmDisplay: document.getElementById('vmDisplay') as HTMLDivElement,
|
||||
homeBtn: document.getElementById('homeBtn') as HTMLAnchorElement,
|
||||
rulesBtn: document.getElementById('rulesBtn') as HTMLAnchorElement,
|
||||
chatList: document.getElementById('chatList') as HTMLTableSectionElement,
|
||||
chatListDiv: document.getElementById('chatListDiv') as HTMLDivElement,
|
||||
userlist: document.getElementById('userlist') as HTMLTableSectionElement,
|
||||
|
|
@ -1268,10 +1269,10 @@ document.addEventListener('DOMContentLoaded', async () => {
|
|||
await loadList();
|
||||
|
||||
// Welcome modal
|
||||
let welcomeModal = new bootstrap.Modal(document.getElementById('welcomeModal') as HTMLDivElement);
|
||||
let noWelcomeModal = window.localStorage.getItem('no-welcome-modal');
|
||||
if (noWelcomeModal !== '1') {
|
||||
let welcomeModalDismissBtn = document.getElementById('welcomeModalDismiss') as HTMLButtonElement;
|
||||
let welcomeModal = new bootstrap.Modal(document.getElementById('welcomeModal') as HTMLDivElement);
|
||||
welcomeModalDismissBtn.addEventListener('click', () => {
|
||||
window.localStorage.setItem('no-welcome-modal', '1');
|
||||
});
|
||||
|
|
@ -1281,4 +1282,10 @@ document.addEventListener('DOMContentLoaded', async () => {
|
|||
welcomeModalDismissBtn.disabled = false;
|
||||
}, 5000);
|
||||
}
|
||||
elements.rulesBtn.addEventListener('click', e => {
|
||||
if (TheI18n.CurrentLanguage() !== "en-us") {
|
||||
e.preventDefault();
|
||||
welcomeModal.show();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user