PageSourceSearch

https://registration.wbcsd.org/wp-content/plugins/gther-tx-portal/assets/js/helpers.js?ver=1789657855

js wbcsd.org collected 2026-10-01 07:25:38 UTC 2,591 bytes, 77 lines download raw bytes

1(function($) {
2    'use strict';
3
4    /**
5     * Check if a user has a webinar license
6     * @param   {string} url      The url to make the ajax request to
7     * @param   {string} email    The email address to check
8     * @param   {string} nonce    The form security nonce
9     * @returns {Promise}         Resolves with license information
10     */
11    function checkWebinarLicense(url, email, nonce) {
12        return new Promise((resolve, reject) => {
13            $.ajax({
14                url: url,
15                type: 'POST',
16                data: {
17                    action: 'check_webinar_license',
18                    email: email,
19                    nonce: nonce
20                },
21                success: function(response) {
22                    if (response.success) {
23                        resolve(response.data);
24                    } else {
25                        reject(new Error(response.data.message || 'Failed to check webinar license'));
26                    }
27                },
28                error: function(xhr, status, error) {
29                    reject(new Error('AJAX request failed: ' + error));
30                }
31            });
32        });
33    }
34    window.checkWebinarLicense = checkWebinarLicense;
35
36    function enablePanelistsSearch(ajaxurl) {
37        // Handle panelists search select field
38        $('#panelists_search').select2({
39            ajax: {
40                url: ajaxurl,
41                dataType: 'json',
42                delay: 500,
43                data: function(params) {
44                    return {
45                        action: 'gther_panelists_search',
46                        q: params.term
47                    };
48                },
49                processResults: function(data) {
50                    return {
51                        results: data.results
52                    };
53                }
54            },
55            placeholder: 'Search for panelists',
56            minimumInputLength: 2
57        });
58    }
59    window.enablePanelistsSearch = enablePanelistsSearch;
60
61    function initOpenForSpeakersEmailToggle(checkboxSelector = '#open_for_speakers', blockSelector = '#open_for_speakers_email_block') {
62        const $checkbox = $(checkboxSelector);
63        const $block = $(blockSelector);
64
65        if (!$checkbox.length || !$block.length) {
66            return;
67        }
68
69        const toggle = () => {
70            $block.toggle($checkbox.is(':checked'));
71        };
72
73        toggle();
74        $checkbox.on('change', toggle);
75    }
76    window.initOpenForSpeakersEmailToggle = initOpenForSpeakersEmailToggle;
77})(jQuery);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.