This commit is contained in:
ssbg04 committed 2026-06-06 08:32:49 +08:00
1 parent 542827f333
commit 4671c0e292
1 file changed
+13 -15
+13 -15
View File
@@ -1,18 +1,16 @@
document.addEventListener("DOMContentLoaded", () => {
const toggleBtn = document.getElementById("chatbot-toggle-btn");
const closeBtn = document.getElementById("chatbot-close-btn");
const chatWindow = document.getElementById("chatbot-window");
const chatForm = document.getElementById("chatbot-input-form");
const inputField = document.getElementById("chatbot-input-field");
const messagesContainer = document.getElementById("chatbot-messages");
const pulseDot = document.querySelector(".pulse-notification-dot");
const toggleBtn = document.getElementById("chatbot-toggle-btn");
const closeBtn = document.getElementById("chatbot-close-btn");
const chatWindow = document.getElementById("chatbot-window");
const chatForm = document.getElementById("chatbot-input-form");
const inputField = document.getElementById("chatbot-input-field");
const messagesContainer = document.getElementById("chatbot-messages");
const pulseDot = document.querySelector(".pulse-notification-dot");
// Initialize the new JavaScript intent matching engine using injected PHP data
// We add a safety check in case chatbot-engine.js failed to load
if (typeof window.PortfolioChatEngine === 'undefined') {
console.error("Chat engine not loaded");
return;
}
// Initialize the new JavaScript intent matching engine using injected PHP data
// We add a safety check in case chatbot-engine.js failed to load
if (typeof window.PortfolioChatEngine === 'undefined') {
console.error("Chat engine not loaded");
} else {
const engine = new window.PortfolioChatEngine(window.portfolioData || {});
let isWaiting = false;
@@ -162,4 +160,4 @@ document.addEventListener("DOMContentLoaded", () => {
return text;
}
});
}