-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
commented out console logs for client browser
- Loading branch information
1 parent
299fb70
commit a58d7e2
Showing
10 changed files
with
23 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,49 +23,14 @@ const App = { | |
this.initLogout(); | ||
this.loadFooter(); | ||
this.updateAuthUI(); | ||
this.checkForAnnouncements(); | ||
this.initParticles(); | ||
// this.checkForAnnouncements(); | ||
// this.initParticles(); | ||
}); | ||
}, | ||
|
||
loadParticles: function () { | ||
if (!document.getElementById('particles-js')) { | ||
const particlesContainer = document.createElement('div'); | ||
particlesContainer.id = 'particles-js'; | ||
document.body.insertBefore(particlesContainer, document.body.firstChild); | ||
} | ||
|
||
if (typeof particlesJS === 'undefined') { | ||
const script = document.createElement('script'); | ||
script.src = 'https://cdn.jsdelivr.net/npm/[email protected]/particles.min.js'; | ||
script.onload = () => this.initParticles(); | ||
document.head.appendChild(script); | ||
} else { | ||
this.initParticles(); | ||
} | ||
}, | ||
|
||
initParticles: function () { | ||
particlesJS('particles-js', { | ||
particles: { | ||
number: { value: 80, density: { enable: true, value_area: 800 } }, | ||
color: { value: "#007bff" }, | ||
shape: { type: "circle" }, | ||
opacity: { value: 0.5, random: false }, | ||
size: { value: 3, random: true }, | ||
line_linked: { enable: true, distance: 150, color: "#007bff", opacity: 0.4, width: 1 }, | ||
move: { enable: true, speed: 6, direction: "none", random: false, straight: false, out_mode: "out", bounce: false } | ||
}, | ||
interactivity: { | ||
detect_on: "canvas", | ||
events: { onhover: { enable: true, mode: "repulse" }, onclick: { enable: true, mode: "push" }, resize: true }, | ||
modes: { grab: { distance: 400, line_linked: { opacity: 1 } }, bubble: { distance: 400, size: 40, duration: 2, opacity: 8, speed: 3 }, repulse: { distance: 200, duration: 0.4 }, push: { particles_nb: 4 }, remove: { particles_nb: 2 } } | ||
}, | ||
retina_detect: true | ||
}); | ||
}, | ||
|
||
|
||
checkForAnnouncements: function () { | ||
/* checkForAnnouncements: function () { | ||
$.ajax({ | ||
url: "/api/announcements", | ||
method: "GET", | ||
|
@@ -78,7 +43,7 @@ const App = { | |
console.error("Error fetching announcements:", xhr.responseText); | ||
}, | ||
}); | ||
}, | ||
}, | ||
showAnnouncement: function (message, type = 'info') { | ||
$("#announcement-message").text(message); | ||
|
@@ -91,6 +56,7 @@ const App = { | |
hideAnnouncement: function () { | ||
$("#site-wide-announcement").hide(); | ||
}, | ||
*/ | ||
|
||
// Load navbar | ||
loadNavbar: function () { | ||
|
@@ -169,10 +135,10 @@ const App = { | |
"Authorization": `Bearer ${token}`, | ||
}, | ||
success: (response) => { | ||
console.log("User status updated:", response.isOnline); | ||
// console.log("User status updated:", response.isOnline); | ||
}, | ||
error: (xhr, status, error) => { | ||
console.error("Error updating user status:", error); | ||
// console.error("Error updating user status:", error); | ||
if (xhr.status === 401) { | ||
// Token is invalid or expired, log out the user | ||
this.logout(); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters