feat: add debug logging to uncloseai.js
This commit is contained in:
parent
8f256b19fa
commit
cbf48e370d
1 changed files with 8 additions and 0 deletions
|
|
@ -1153,9 +1153,11 @@ function initializeChatInterface() {
|
|||
|
||||
// Function to create floating AI button
|
||||
function createFloatingAIButton() {
|
||||
console.log('uncloseai.js: createFloatingAIButton() called.');
|
||||
// Remove any existing floating button first
|
||||
const existingButton = document.getElementById('floating-ai-button');
|
||||
if (existingButton) {
|
||||
console.log('uncloseai.js: Found existing floating button, removing it.');
|
||||
existingButton.remove();
|
||||
}
|
||||
|
||||
|
|
@ -1163,6 +1165,7 @@ function createFloatingAIButton() {
|
|||
const floatingButton = document.createElement('button');
|
||||
floatingButton.id = 'floating-ai-button';
|
||||
floatingButton.textContent = 'uncloseai.';
|
||||
console.log('uncloseai.js: Created new floating button element.');
|
||||
|
||||
// Function to update button theme
|
||||
function updateButtonTheme() {
|
||||
|
|
@ -1217,6 +1220,7 @@ function createFloatingAIButton() {
|
|||
floatingButton.onclick = () => toggleHermesModal();
|
||||
|
||||
document.body.appendChild(floatingButton);
|
||||
console.log('uncloseai.js: Appended floating button to document.body.');
|
||||
}
|
||||
|
||||
// Global variable to track modal state
|
||||
|
|
@ -2880,13 +2884,17 @@ const SHOW_FLOATING_BUTTON = window.UNCLOSEAI_SHOW_BUTTON !== false;
|
|||
|
||||
// Initialize on page load
|
||||
window.onload = () => {
|
||||
console.log('uncloseai.js: window.onload event fired.');
|
||||
initializeChatInterface();
|
||||
createModelSelectionDropdown();
|
||||
addRefreshModelsButton();
|
||||
|
||||
// Only create floating button if not disabled
|
||||
if (SHOW_FLOATING_BUTTON) {
|
||||
console.log('uncloseai.js: SHOW_FLOATING_BUTTON is true, calling createFloatingAIButton()');
|
||||
createFloatingAIButton();
|
||||
} else {
|
||||
console.log('uncloseai.js: SHOW_FLOATING_BUTTON is false, not creating floating button.');
|
||||
}
|
||||
|
||||
// Initialize class-based elements
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue