T.ME/BIBIL_0DAY
CasperSecurity


Server : Apache/2
System : Linux server-15-235-50-60 5.15.0-164-generic #174-Ubuntu SMP Fri Nov 14 20:25:16 UTC 2025 x86_64
User : gositeme ( 1004)
PHP Version : 8.2.29
Disable Function : exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Directory :  /home/gositeme/.cursor-server/data/User/History/-9bf69ba/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/gositeme/.cursor-server/data/User/History/-9bf69ba/ROh5.js
(function() {
    function notify(message, type) {
        if (typeof window.showNotification === 'function') {
            window.showNotification(message, type || 'info');
        } else if (message) {
            alert(message);
        }
    }

    function updateButtonState(button, added) {
        if (!button) return;
        button.classList.toggle('active', added);
        button.setAttribute('aria-pressed', added ? 'true' : 'false');
        const icon = button.querySelector('i');
        if (icon) {
            icon.classList.remove(added ? 'far' : 'fas');
            icon.classList.add(added ? 'fas' : 'far');
        }
    }

    function resolveButton(trackId, button) {
        if (button) return button;
        const card = document.querySelector(`[data-track-id="${trackId}"]`);
        return card ? card.querySelector('.wishlist-btn') : null;
    }

    window.toggleWishlist = function(trackId, button = null) {
        if (!trackId) return;
        const targetBtn = resolveButton(trackId, button);
        if (targetBtn) {
            targetBtn.classList.add('loading');
            targetBtn.disabled = true;
        }

        fetch('/api/add_to_wishlist.php', {
            method: 'POST',
            headers: { 'Content-Type': 'application/json' },
            credentials: 'include',
            body: JSON.stringify({ track_id: trackId })
        })
        .then(response => response.json())
        .then(data => {
            if (!data.success) {
                notify(data.message || 'Unable to update wishlist.', 'error');
                return;
            }
            const added = data.action === 'added';
            updateButtonState(targetBtn, added);
            notify(added ? 'Added to wishlist!' : 'Removed from wishlist', 'success');
            window.dispatchEvent(new CustomEvent('wishlist:toggled', {
                detail: { trackId, added }
            }));
        })
        .catch(error => {
            console.error('Wishlist error:', error);
            notify('Failed to update wishlist. Please try again.', 'error');
        })
        .finally(() => {
            if (targetBtn) {
                targetBtn.classList.remove('loading');
                targetBtn.disabled = false;
            }
        });
    };
})();


CasperSecurity Mini