HEX
Server: nginx/1.24.0
System: Linux DGT-WORDPRESS-VM-SERVER 6.14.0-1014-azure #14~24.04.1-Ubuntu SMP Fri Oct 3 20:52:11 UTC 2025 x86_64
User: ubuntu (1000)
PHP: 8.4.12
Disabled: NONE
Upload Files
File: /mnt/data/doccure-wp/wp-content/plugins/dreams-zoom-integration/assets/js/doccure-zoom.js
jQuery(document).ready(function($) {
    $('#zoom_connect_button').click(function(e) {
        // e.preventDefault(); // Prevent default form submission behavior

        console.log('Connecting to Zoom...');

        var clientId = $('#zoom_oauth_client_id').val();
        var clientSecret = $('#zoom_oauth_client_secret').val();

        $.ajax({
            url: doccureZoom.ajax_url,
            method: 'POST',
            data: {
                action: 'connect_to_zoom',
                client_id: clientId,
                client_secret: clientSecret,
                nonce: doccureZoom.nonce
            },
            success: function(response) {
                if (response.success) {
                    console.log('Connected to Zoom successfully!');
                    console.log('Access Token:', response.data.access_token);
                    $('#zoom_connection_status').text('Connected to Zoom successfully!');
                } else {
                    console.log('Error connecting to Zoom:', response.data.message);
                    $('#zoom_connection_status').text('Error connecting to Zoom: ' + response.data.message);
                }
            },
            error: function(xhr, status, error) {
                console.log('Error connecting to Zoom:', error);
                $('#zoom_connection_status').text('Error connecting to Zoom!');
            }
        });

        return false;

    });
});