changes
This commit is contained in:
parent
c5ade9ca3c
commit
97c34e890a
@ -252,7 +252,6 @@ async function loadMessages(forceUpdate = false, scrollLocation) {
|
|||||||
);
|
);
|
||||||
const contentString =
|
const contentString =
|
||||||
doc.querySelector("span").textContent;
|
doc.querySelector("span").textContent;
|
||||||
console.log(contentString);
|
|
||||||
|
|
||||||
if (
|
if (
|
||||||
compareUsername ===
|
compareUsername ===
|
||||||
@ -299,7 +298,6 @@ function contentEmbedding(content) {
|
|||||||
src="https://www.youtube.com/embed/${videoId}"
|
src="https://www.youtube.com/embed/${videoId}"
|
||||||
frameborder="0"
|
frameborder="0"
|
||||||
onerror="console.log('Video failed to load:', this.src); this.style.display='none'"
|
onerror="console.log('Video failed to load:', this.src); this.style.display='none'"
|
||||||
onload="console.log('Video loaded successfully:', this.src)"
|
|
||||||
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
|
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
|
||||||
allowfullscreen></iframe></div>`;
|
allowfullscreen></iframe></div>`;
|
||||||
} else if (isImageUrl(url)) {
|
} else if (isImageUrl(url)) {
|
||||||
@ -307,8 +305,7 @@ function contentEmbedding(content) {
|
|||||||
src="${url}"
|
src="${url}"
|
||||||
alt="Embedded image"
|
alt="Embedded image"
|
||||||
loading="lazy"
|
loading="lazy"
|
||||||
onerror="console.log('Image failed to load:', this.src); this.style.display='none'"
|
onerror="console.log('Image failed to load:', this.src); this.style.display='none'"></div>`;
|
||||||
onload="console.log('Image loaded successfully:', this.src)"></div>`;
|
|
||||||
}
|
}
|
||||||
return `<a href="${url}" target="_blank" rel="noopener noreferrer">${url}</a>`;
|
return `<a href="${url}" target="_blank" rel="noopener noreferrer">${url}</a>`;
|
||||||
},
|
},
|
||||||
@ -528,6 +525,20 @@ document.addEventListener("keyup", function (event) {
|
|||||||
|
|
||||||
let bottom = 0;
|
let bottom = 0;
|
||||||
async function initialize() {
|
async function initialize() {
|
||||||
|
await checkUsername();
|
||||||
|
await updateCurrentUser();
|
||||||
|
await timeZoneCheck();
|
||||||
|
await loadMessages(true);
|
||||||
|
initializePanels();
|
||||||
|
initializeTheme();
|
||||||
|
initializeSearchBox();
|
||||||
|
setInterval(loadMessages, 1000);
|
||||||
|
setInterval(loadUsers, 1000);
|
||||||
|
setInterval(pingCheck, 3000);
|
||||||
|
setTimeout(scrollToBottom, 100);
|
||||||
|
}
|
||||||
|
|
||||||
|
function initializePanels() {
|
||||||
usersPanel = document.getElementById("users-panel");
|
usersPanel = document.getElementById("users-panel");
|
||||||
if (usersPanel) {
|
if (usersPanel) {
|
||||||
usersPanel.style.display = "none";
|
usersPanel.style.display = "none";
|
||||||
@ -536,16 +547,6 @@ async function initialize() {
|
|||||||
if (settingsPanel) {
|
if (settingsPanel) {
|
||||||
settingsPanel.style.display = "none";
|
settingsPanel.style.display = "none";
|
||||||
}
|
}
|
||||||
initializeTheme();
|
|
||||||
await checkUsername();
|
|
||||||
await updateCurrentUser();
|
|
||||||
await timeZoneCheck();
|
|
||||||
setInterval(loadMessages, 1000);
|
|
||||||
setInterval(loadUsers, 1000);
|
|
||||||
setInterval(pingCheck, 3000);
|
|
||||||
await loadMessages(true);
|
|
||||||
initializeSearchBox();
|
|
||||||
scrollToBottom();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function initializeSearchBox() {
|
function initializeSearchBox() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user