|
|
@ -194,7 +194,7 @@ class user implements User {
|
|
|
|
this._notifyDropdown.querySelector(".accounts-area-matrix").classList.add("unfocused");
|
|
|
|
this._notifyDropdown.querySelector(".accounts-area-matrix").classList.add("unfocused");
|
|
|
|
this._matrix.innerHTML = `
|
|
|
|
this._matrix.innerHTML = `
|
|
|
|
<div class="table-inline">
|
|
|
|
<div class="table-inline">
|
|
|
|
<span class="chip btn @high">${window.lang.strings("add")}</span>
|
|
|
|
<span class="chip btn @low w-100"><i class="ri-link" alt="${window.lang.strings("add")}"></i></span>
|
|
|
|
<input type="text" class="input ~neutral @low stealth-input unfocused" placeholder="@user:riot.im">
|
|
|
|
<input type="text" class="input ~neutral @low stealth-input unfocused" placeholder="@user:riot.im">
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
`;
|
|
|
|
`;
|
|
|
@ -214,15 +214,20 @@ class user implements User {
|
|
|
|
|
|
|
|
|
|
|
|
private _addMatrix = () => {
|
|
|
|
private _addMatrix = () => {
|
|
|
|
const addButton = this._matrix.querySelector(".btn") as HTMLSpanElement;
|
|
|
|
const addButton = this._matrix.querySelector(".btn") as HTMLSpanElement;
|
|
|
|
const icon = this._matrix.querySelector("i");
|
|
|
|
|
|
|
|
const input = this._matrix.querySelector("input.stealth-input") as HTMLInputElement;
|
|
|
|
const input = this._matrix.querySelector("input.stealth-input") as HTMLInputElement;
|
|
|
|
|
|
|
|
const addIcon = addButton.querySelector("i");
|
|
|
|
if (addButton.classList.contains("chip")) {
|
|
|
|
if (addButton.classList.contains("chip")) {
|
|
|
|
input.classList.remove("unfocused");
|
|
|
|
input.classList.remove("unfocused");
|
|
|
|
addButton.innerHTML = `<i class="ri-check-line"></i>`;
|
|
|
|
addIcon.classList.add("ri-check-line");
|
|
|
|
addButton.classList.remove("chip")
|
|
|
|
addIcon.classList.remove("ri-link");
|
|
|
|
if (icon) {
|
|
|
|
addButton.classList.remove("chip", "w-100")
|
|
|
|
icon.classList.add("unfocused");
|
|
|
|
const outerClickListener = (event: Event) => {
|
|
|
|
|
|
|
|
if (!(event.target instanceof HTMLElement && (this._matrix.contains(event.target) || addButton.contains(event.target)))) {
|
|
|
|
|
|
|
|
document.dispatchEvent(new CustomEvent("accounts-reload"));
|
|
|
|
|
|
|
|
document.removeEventListener("click", outerClickListener);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
document.addEventListener("click", outerClickListener);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
if (input.value.charAt(0) != "@" || !input.value.includes(":")) return;
|
|
|
|
if (input.value.charAt(0) != "@" || !input.value.includes(":")) return;
|
|
|
|
const send = {
|
|
|
|
const send = {
|
|
|
@ -259,7 +264,7 @@ class user implements User {
|
|
|
|
this._telegramUsername = u;
|
|
|
|
this._telegramUsername = u;
|
|
|
|
if (!u) {
|
|
|
|
if (!u) {
|
|
|
|
this._notifyDropdown.querySelector(".accounts-area-telegram").classList.add("unfocused");
|
|
|
|
this._notifyDropdown.querySelector(".accounts-area-telegram").classList.add("unfocused");
|
|
|
|
this._telegram.innerHTML = `<span class="chip btn @high">${window.lang.strings("add")}</span>`;
|
|
|
|
this._telegram.innerHTML = `<span class="chip btn @low w-100"><i class="ri-link" alt="${window.lang.strings("add")}"></i></span>`;
|
|
|
|
(this._telegram.querySelector("span") as HTMLSpanElement).onclick = this._addTelegram;
|
|
|
|
(this._telegram.querySelector("span") as HTMLSpanElement).onclick = this._addTelegram;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
this._notifyDropdown.querySelector(".accounts-area-telegram").classList.remove("unfocused");
|
|
|
|
this._notifyDropdown.querySelector(".accounts-area-telegram").classList.remove("unfocused");
|
|
|
@ -324,7 +329,7 @@ class user implements User {
|
|
|
|
const lastNotifyMethod = this.lastNotifyMethod() == "discord";
|
|
|
|
const lastNotifyMethod = this.lastNotifyMethod() == "discord";
|
|
|
|
this._discordUsername = u;
|
|
|
|
this._discordUsername = u;
|
|
|
|
if (!u) {
|
|
|
|
if (!u) {
|
|
|
|
this._discord.innerHTML = `<span class="chip btn @high">Add</span>`;
|
|
|
|
this._discord.innerHTML = `<span class="chip btn @low w-100"><i class="ri-link" alt="${window.lang.strings("add")}"></i></span>`;
|
|
|
|
(this._discord.querySelector("span") as HTMLSpanElement).onclick = () => addDiscord(this.id);
|
|
|
|
(this._discord.querySelector("span") as HTMLSpanElement).onclick = () => addDiscord(this.id);
|
|
|
|
this._notifyDropdown.querySelector(".accounts-area-discord").classList.add("unfocused");
|
|
|
|
this._notifyDropdown.querySelector(".accounts-area-discord").classList.add("unfocused");
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|