|
57 | 57 |
|
58 | 58 | // Check if reactions are working after a delay |
59 | 59 | setTimeout(checkReactions, 2000); |
| 60 | + |
| 61 | + // Also check when Cusdis is fully loaded |
| 62 | + cusdisScript.onload = function() { |
| 63 | + console.log('Cusdis script loaded, checking for reactions...'); |
| 64 | + setTimeout(checkReactions, 1000); |
| 65 | + }; |
60 | 66 | } |
61 | 67 | } |
62 | 68 |
|
|
368 | 374 | /* Ensure reaction container is visible - multiple selector variations */ |
369 | 375 | #cusdis_thread .cusdis-reactions, |
370 | 376 | #cusdis_thread [class*="reactions"], |
371 | | - #cusdis_thread .reactions-container { |
| 377 | + #cusdis_thread .reactions-container, |
| 378 | + #cusdis_thread .reactions { |
372 | 379 | display: flex !important; |
373 | 380 | flex-wrap: wrap !important; |
374 | 381 | gap: 0.75rem !important; |
|
377 | 384 | padding: 0.75rem 0 !important; |
378 | 385 | border-top: 1px solid var(--md-default-fg-color--lightest) !important; |
379 | 386 | padding-top: 1rem !important; |
| 387 | + visibility: visible !important; |
| 388 | + opacity: 1 !important; |
| 389 | + } |
| 390 | + |
| 391 | + /* Force show any hidden reaction elements */ |
| 392 | + #cusdis_thread [style*="display: none"], |
| 393 | + #cusdis_thread [style*="visibility: hidden"] { |
| 394 | + display: flex !important; |
| 395 | + visibility: visible !important; |
380 | 396 | } |
381 | 397 | |
382 | 398 | /* Responsive design */ |
|
403 | 419 | } |
404 | 420 |
|
405 | 421 | function checkReactions() { |
| 422 | + console.log('Cusdis: Checking for reactions...'); |
| 423 | + |
406 | 424 | // Check if reactions are visible with multiple selector variations |
407 | | - const reactions = document.querySelectorAll('.cusdis-reaction, [class*="reaction"], .cusdis-reaction-button'); |
| 425 | + const reactions = document.querySelectorAll('.cusdis-reaction, [class*="reaction"], .cusdis-reaction-button, .reaction-btn'); |
408 | 426 | if (reactions.length === 0) { |
409 | 427 | console.log('Cusdis: No reaction buttons found, checking configuration...'); |
410 | 428 |
|
|
417 | 435 |
|
418 | 436 | // Check again after a short delay |
419 | 437 | setTimeout(() => { |
420 | | - const retryReactions = document.querySelectorAll('.cusdis-reaction, [class*="reaction"], .cusdis-reaction-button'); |
| 438 | + const retryReactions = document.querySelectorAll('.cusdis-reaction, [class*="reaction"], .cusdis-reaction-button, .reaction-btn'); |
421 | 439 | console.log(`Cusdis: Retry found ${retryReactions.length} reaction buttons`); |
422 | 440 | }, 1000); |
423 | 441 | } |
|
426 | 444 | } |
427 | 445 |
|
428 | 446 | // Also check for reaction containers |
429 | | - const reactionContainers = document.querySelectorAll('.cusdis-reactions, [class*="reactions"], .reactions-container'); |
| 447 | + const reactionContainers = document.querySelectorAll('.cusdis-reactions, [class*="reactions"], .reactions-container, .reactions'); |
430 | 448 | console.log(`Cusdis: Found ${reactionContainers.length} reaction containers`); |
| 449 | + |
| 450 | + // Check if there are any comments at all |
| 451 | + const comments = document.querySelectorAll('.cusdis-comment, [class*="comment"]'); |
| 452 | + console.log(`Cusdis: Found ${comments.length} comments`); |
| 453 | + |
| 454 | + // Log the current Cusdis configuration |
| 455 | + const cusdisThread = document.getElementById('cusdis_thread'); |
| 456 | + if (cusdisThread) { |
| 457 | + console.log('Cusdis configuration:', { |
| 458 | + 'data-reaction': cusdisThread.getAttribute('data-reaction'), |
| 459 | + 'data-theme': cusdisThread.getAttribute('data-theme'), |
| 460 | + 'data-version': cusdisThread.getAttribute('data-version'), |
| 461 | + 'data-lang': cusdisThread.getAttribute('data-lang') |
| 462 | + }); |
| 463 | + } |
431 | 464 | } |
432 | 465 | })(); |
0 commit comments