PageSourceSearch

https://hagerty.world/intl/themes/hagerty/modules/ps_emailsubscription/views/js/ps_emailsubscription.js

js hagerty.world collected 2026-10-04 02:04:16 UTC 2,262 bytes, 56 lines download raw bytes

1/**
2 * 2007-2020 PrestaShop.
3 *
4 * NOTICE OF LICENSE
5 *
6 * This source file is subject to the Academic Free License 3.0 (AFL-3.0)
7 * that is bundled with this package in the file LICENSE.txt.
8 * It is also available through the world-wide-web at this URL:
9 * https://opensource.org/licenses/AFL-3.0
10 * If you did not receive a copy of the license and are unable to
11 * obtain it through the world-wide-web, please send an email
12 * to [email protected] so we can send you a copy immediately.
13 *
14 * DISCLAIMER
15 *
16 * Do not edit or add to this file if you wish to upgrade PrestaShop to newer
17 * versions in the future. If you wish to customize PrestaShop for your
18 * needs please refer to http://www.prestashop.com for more information.
19 *
20 * @author    PrestaShop SA <[email protected]>
21 * @copyright 2007-2020 PrestaShop SA
22 * @license   https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
23 * International Registered Trademark & Property of PrestaShop SA
24 */
25 $(document).ready(function () {
26    $('.block_newsletter form').on('submit', function () {
27        var psemailsubscriptionForm = $(this);
28        if (typeof psemailsubscription_subscription === 'undefined') {
29            return true;
30        }
31        $('.block_newsletter_alert').remove();
32        $.ajax({
33            type: 'POST',
34            dataType: 'JSON',
35            url: psemailsubscription_subscription,
36            cache: false,
37            data: $(this).serialize(),
38            success: function (data) {
39                if (data.nw_error) {
40                    psemailsubscriptionForm.prepend('<p class="mx-auto max-w-lg bg-red-200 border-red-300 text-red-800 block_newsletter_alert">' + data.msg + '</p>');
41                } else {
42                    psemailsubscriptionForm.prepend('<p class="mx-auto max-w-lg bg-green-200 border-green-300 text-green-800 block_newsletter_alert">' + data.msg + '</p>');
43
44                    window.dataLayer = window.dataLayer || [];
45                    window.dataLayer.push({
46                        'event': 'NewsletterRegister'
47                    })
48                }
49            },
50            error: function (err) {
51                console.log(err);
52            }
53        });
54        return false;
55    });
56});

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.