PageSourceSearch

https://redesurftank.com.br/_cdn/widgets/preregistration/preregistration.wc.js?v=1775673334

js redesurftank.com.br collected 2026-10-02 01:18:28 UTC 4,116 bytes, 84 lines download raw bytes

1$(function () {
2    //PREREGISTRATION MODAL CONTROL
3    $(window).load(function () {
4        var PreregKey = window.location.href;
5
6        $.post(BASE + "/_cdn/widgets/preregistration/preregistration.ajax.php", {url: PreregKey}, function (data) {
7            if (!data || !data.prereg_html) {
8                return;
9            }
10
11            var isLoggedIn = !!data.is_logged_in;
12
13            $("body").prepend(data.prereg_html);
14            $("body").css("overflow", "hidden");
15
16            var $overlay = $("#wc_prereg_" + data.prereg_id);
17            $overlay.css("opacity", 0).animate({opacity: 1}, 400);
18
19            //CLOSE
20            $(".wc_prereg_close").click(function () {
21                var PreregId = $(this).attr("data-prereg");
22                $.post(BASE + "/_cdn/widgets/preregistration/preregistration.ajax.php", {action: 'dismiss', prereg: PreregId});
23
24                var $ov = $("#wc_prereg_" + PreregId);
25                $ov.animate({opacity: 0}, 300, function () {
26                    $ov.remove();
27                    $("body").css("overflow", "");
28                });
29            });
30
31            //CTA: bifurca em logado vs anonimo
32            $(".wc_prereg_cta").click(function (e) {
33                var PreregId = $(this).attr("data-prereg");
34
35                if (isLoggedIn) {
36                    // Logado: track normal (fire-and-forget) e deixa o anchor navegar
37                    $.post(BASE + "/_cdn/widgets/preregistration/preregistration.ajax.php", {action: 'track', prereg: PreregId});
38                    return;
39                }
40
41                // Anonimo: troca o footer do modal por prompt de login/registro
42                // (sem reload, sem perder o contexto visual). O anon_cta so e
43                // disparado quando o usuario escolhe um dos dois botoes.
44                e.preventDefault();
45                var $footer = $(this).closest('.wc_prereg_footer');
46                if (!$footer.length) return;
47                $footer.html(
48                    '<p class="wc_prereg_auth_text">Para participar, faça login ou crie sua conta gratuita:</p>' +
49                    '<div class="wc_prereg_auth_btns">' +
50                        '<button type="button" class="wc_prereg_auth_btn wc_prereg_auth_login" data-prereg="' + PreregId + '">JÁ TENHO CONTA</button>' +
51                        '<button type="button" class="wc_prereg_auth_btn wc_prereg_auth_register" data-prereg="' + PreregId + '">CRIAR CONTA</button>' +
52                    '</div>'
53                );
54            });
55
56            // Click nos botoes de auth: salva intento e abre modal Bootstrap correspondente
57            $(document).on('click', '.wc_prereg_auth_login, .wc_prereg_auth_register', function () {
58                var PreregId = $(this).attr('data-prereg');
59                var modalTarget = $(this).hasClass('wc_prereg_auth_register') ? '#registerModal' : '#loginModal';
60
61                $.post(
62                    BASE + '/_cdn/widgets/preregistration/preregistration.ajax.php',
63                    {action: 'anon_cta', prereg: PreregId},
64                    function () {
65                        // Fecha o overlay do prereg para o modal Bootstrap aparecer limpo;
66                        // pos-login, force_show + oldLocation reabrem o prereg automaticamente.
67                        var $ov = $('#wc_prereg_' + PreregId);
68                        $ov.fadeOut(200, function () {
69                            $(this).remove();
70                            $('body').css('overflow', '');
71                            if (typeof $.fn.modal === 'function') {
72                                $(modalTarget).modal('show');
73                            } else {
74                                // Fallback: navega pra home com hash, alguma logica do site abre o modal
75                                window.location.href = BASE + '/';
76                            }
77                        });
78                    },
79                    'json'
80                );
81            });
82        }, 'json');
83    });
84});

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.