Remove debug logging
Clean up console.log statements added during troubleshooting: - Removed logging from showImageManagement() - Removed logging from setupImageManagementEventListeners() - Removed logging from loadImageGallery() - Removed logging from updateImageGalleryControls() Production ready - no more debug console spam.
This commit is contained in:
parent
205fbc1186
commit
5caa82e659
29
game.js
29
game.js
|
|
@ -850,39 +850,29 @@ class TaskChallengeGame {
|
|||
|
||||
// Image Management Methods
|
||||
showImageManagement() {
|
||||
console.log('showImageManagement() called');
|
||||
|
||||
// Reset listener flag to allow fresh attachment
|
||||
this.imageManagementListenersAttached = false;
|
||||
|
||||
this.showScreen('image-management-screen');
|
||||
console.log('Screen switched to image-management-screen');
|
||||
this.setupImageManagementEventListeners();
|
||||
console.log('Event listeners set up');
|
||||
|
||||
// Wait for image discovery to complete before loading gallery
|
||||
if (!this.imageDiscoveryComplete) {
|
||||
console.log('Image discovery not complete, waiting...');
|
||||
const gallery = document.getElementById('image-gallery');
|
||||
gallery.innerHTML = '<div class="loading">Discovering images...</div>';
|
||||
|
||||
// Wait and try again
|
||||
setTimeout(() => {
|
||||
console.log('Timeout reached, checking discovery status...');
|
||||
if (this.imageDiscoveryComplete) {
|
||||
console.log('Discovery complete, loading gallery...');
|
||||
this.loadImageGallery();
|
||||
} else {
|
||||
console.log('Discovery still not complete, waiting longer...');
|
||||
gallery.innerHTML = '<div class="loading">Still discovering images... Please wait</div>';
|
||||
setTimeout(() => this.loadImageGallery(), 1000);
|
||||
}
|
||||
}, 500);
|
||||
} else {
|
||||
console.log('Image discovery already complete, loading gallery...');
|
||||
this.loadImageGallery();
|
||||
}
|
||||
console.log('showImageManagement() completed');
|
||||
}
|
||||
|
||||
switchImageTab(tabType) {
|
||||
|
|
@ -909,8 +899,6 @@ class TaskChallengeGame {
|
|||
}
|
||||
|
||||
updateImageGalleryControls(activeTab) {
|
||||
console.log('updateImageGalleryControls() called for tab:', activeTab);
|
||||
|
||||
// Update the select/deselect/delete buttons to work with the active tab
|
||||
const selectAllBtn = document.getElementById('select-all-images-btn');
|
||||
const deselectAllBtn = document.getElementById('deselect-all-images-btn');
|
||||
|
|
@ -927,21 +915,14 @@ class TaskChallengeGame {
|
|||
if (deleteBtn) {
|
||||
deleteBtn.onclick = () => this.deleteSelectedImages(activeTab);
|
||||
}
|
||||
|
||||
console.log('Gallery controls updated for:', activeTab);
|
||||
}
|
||||
|
||||
setupImageManagementEventListeners() {
|
||||
console.log('setupImageManagementEventListeners() called');
|
||||
|
||||
// Check if we already have listeners attached to prevent duplicates
|
||||
if (this.imageManagementListenersAttached) {
|
||||
console.log('Image management listeners already attached, skipping...');
|
||||
return;
|
||||
}
|
||||
|
||||
console.log('Setting up image management event listeners...');
|
||||
|
||||
// Back button
|
||||
const backBtn = document.getElementById('back-to-start-from-images-btn');
|
||||
if (backBtn) {
|
||||
|
|
@ -952,7 +933,6 @@ class TaskChallengeGame {
|
|||
const importTaskBtn = document.getElementById('import-task-images-btn');
|
||||
if (importTaskBtn) {
|
||||
importTaskBtn.onclick = async () => {
|
||||
console.log('Import task images clicked');
|
||||
if (this.fileManager) {
|
||||
await this.fileManager.selectAndImportImages('task');
|
||||
this.loadImageGallery(); // Refresh the gallery to show new images
|
||||
|
|
@ -965,7 +945,6 @@ class TaskChallengeGame {
|
|||
const importConsequenceBtn = document.getElementById('import-consequence-images-btn');
|
||||
if (importConsequenceBtn) {
|
||||
importConsequenceBtn.onclick = async () => {
|
||||
console.log('Import consequence images clicked');
|
||||
if (this.fileManager) {
|
||||
await this.fileManager.selectAndImportImages('consequence');
|
||||
this.loadImageGallery(); // Refresh the gallery to show new images
|
||||
|
|
@ -1006,25 +985,17 @@ class TaskChallengeGame {
|
|||
|
||||
// Mark listeners as attached
|
||||
this.imageManagementListenersAttached = true;
|
||||
console.log('setupImageManagementEventListeners() completed');
|
||||
}
|
||||
|
||||
loadImageGallery() {
|
||||
console.log('loadImageGallery() called');
|
||||
// Load both task and consequence image galleries
|
||||
console.log('Cleaning up invalid images...');
|
||||
this.cleanupInvalidImages(); // Clean up invalid images first
|
||||
console.log('Loading task images...');
|
||||
this.loadTaskImages();
|
||||
console.log('Loading consequence images...');
|
||||
this.loadConsequenceImages();
|
||||
console.log('Updating image counts...');
|
||||
this.updateImageCounts();
|
||||
|
||||
// Initialize with task tab active and update controls
|
||||
console.log('Updating gallery controls for task tab...');
|
||||
this.updateImageGalleryControls('task');
|
||||
console.log('loadImageGallery() completed');
|
||||
}
|
||||
|
||||
loadTaskImages() {
|
||||
|
|
|
|||
Loading…
Reference in New Issue