403Webshell
Server IP : 104.21.84.107  /  Your IP : 104.23.197.209
Web Server : Apache/2.4.63 (Ubuntu)
System : Linux adminpruebas-Virtual-Machine 6.14.0-37-generic #37-Ubuntu SMP PREEMPT_DYNAMIC Fri Nov 14 22:10:32 UTC 2025 x86_64
User : www-data ( 33)
PHP Version : 8.4.5
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /var/www/html/congresofce2/administrator/components/com_gantry5/js/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/html/congresofce2/administrator/components/com_gantry5/js/dark-mode.js
// Gantry5 Dark Mode for Joomla
document.addEventListener('DOMContentLoaded', function() {
    // Check if Joomla is using dark mode
    const htmlElement = document.documentElement;
    const bodyElement = document.body;
    
    // Various ways to detect dark mode in Joomla
    const isJoomlaDarkMode = 
        htmlElement.getAttribute('data-color-scheme') === 'dark' || 
        htmlElement.getAttribute('data-bs-theme') === 'dark' ||
        htmlElement.classList.contains('dark-mode') ||
        bodyElement.classList.contains('dark-mode') ;
    
    console.log('Gantry5 Dark Mode: Joomla dark mode detected:', isJoomlaDarkMode);
    
    // Apply dark mode class to Gantry container
    if (isJoomlaDarkMode) {
        const gantryContainer = document.getElementById('g5-container');
        if (gantryContainer) {
            gantryContainer.classList.add('g5-dark-mode');
            console.log('Gantry5 Dark Mode: Applied dark mode to Gantry container');
        }
    }
    
    // Watch for changes in Joomla's color scheme
    const observeHtml = new MutationObserver(function(mutations) {
        mutations.forEach(function(mutation) {
            if (mutation.type === 'attributes' || mutation.type === 'classList') {
                const isDark = 
                    htmlElement.getAttribute('data-color-scheme') === 'dark' || 
                    htmlElement.getAttribute('data-bs-theme') === 'dark' ||
                    htmlElement.classList.contains('dark-mode') ||
                    bodyElement.classList.contains('dark-mode');
                
                const gantryContainer = document.getElementById('g5-container');
                if (gantryContainer) {
                    if (isDark) {
                        gantryContainer.classList.add('g5-dark-mode');
                        console.log('Gantry5 Dark Mode: Applied dark mode to Gantry container (mutation)');
                    } else {
                        gantryContainer.classList.remove('g5-dark-mode');
                        console.log('Gantry5 Dark Mode: Removed dark mode from Gantry container (mutation)');
                    }
                }
            }
        });
    });
    
    // Start observing HTML element for attribute and class changes
    observeHtml.observe(htmlElement, { 
        attributes: true, 
        attributeFilter: ['data-color-scheme', 'data-bs-theme', 'class'] 
    });
    
    // Also observe body element for class changes
    observeHtml.observe(bodyElement, { 
        attributes: true, 
        attributeFilter: ['class'] 
    });
    
    // Force apply dark mode if needed
    const forceApply = function() {
        if (isJoomlaDarkMode) {
            const gantryContainer = document.getElementById('g5-container');
            if (gantryContainer) {
                gantryContainer.classList.add('g5-dark-mode');
                console.log('Gantry5 Dark Mode: Force applied dark mode to Gantry container');
            }
        }
    };
    
    // Try to apply dark mode after a short delay (in case container is loaded later)
    setTimeout(forceApply, 500);
});

Youez - 2016 - github.com/yon3zu
LinuXploit