PageSourceSearch

https://www.natureetdecouvertes.com/fstrz/r/s/www.natureetdecouvertes.com/Scripts/ned/ned.tagcommander.dev.js

js natureetdecouvertes.com collected 2026-10-01 13:14:41 UTC 7,040 bytes, 125 lines download raw bytes

1var ned = ned || {};
2ned.tagcommander = (function ($) {
3    var self = {};
4
5    var _functions = {
6        sendEvent: function (numero, category, action, label, value) {
7            if (typeof tc_events_global !== 'undefined') {
8                return tc_events_global(this, numero, { 'CATEGORY': category, 'ACTION': action, 'LABEL': label, 'VALUE': value });
9            }
10
11        },
12        initEvent: function () {
13            if ($('*[data-reference]').length != 0) {
14                var data = $('*[data-reference]').data('reference');
15                window.localStorage.setItem("scrollPosYBefore", data );
16            }
17        }
18    }
19
20    self.feedUserData = function () {
21        var uri = '/User/GetUser?dummy=' + new Date().getTime() + Math.random();
22        $.ajax(
23            {
24                type: "get",
25                contentType: "application/json; charset=utf-8",
26                url: uri,
27                data: "",
28                dataType: "json",
29                timeout: 5000,
30                error: function (xhr, status, error) {
31                    //Do nothing
32                },
33                success: function (result) {
34                    if (result !== null && result.user !== null) {
35                        tc_vars.user_email = result.user.email;
36                        tc_vars.user_email_hashed = result.user.email_hashed;
37                        tc_vars.id = result.user.id;
38                    }
39                }
40            });
41    };
42
43
44    self.feedCartDatalayer = function () {
45        var uri = ned.commun.baseURL.prefixLangue() + '/AjoutPanier/PanierJson2?dummy=' + new Date().getTime() + Math.random();
46        $.ajax(
47            {
48                type: "get",
49                contentType: "application/json; charset=utf-8",
50                url: uri,
51                data: "",
52                dataType: "json",
53                timeout: 5000,
54                error: function (xhr, status, error) {
55                    //Do nothing
56                },
57                success: function (result) {
58                    if (result !== null && result.Panier !== null) {
59                        tc_vars.basket_id = result.Panier.basketId;
60                        tc_vars.order_type = result.Panier.Type;
61                        tc_vars.order_amount_ati_without_sf = result.Panier.montantHorsFdp;
62                        tc_vars.order_amount_ati_with_sf = result.Panier.totalPanier;
63                        tc_vars.order_amount_tf_with_sf = result.Panier.totalPanierHT;
64                        tc_vars.order_discount_ati = result.Panier.remiseTTC;
65                        tc_vars.order_discount_tf = result.Panier.remiseHT;
66                        tc_vars.order_currency = result.Panier.currency;
67
68                        for (var i = 0; i < result.Panier.order_products_nd.length; i++) {
69                            tc_vars.order_products_nd.push({
70                                order_product_id: result.Panier.order_products_nd[i].order_product_reference
71                                , order_product_brand: result.Panier.order_products_nd[i].order_product_brand
72                                , order_product_seller: result.Panier.order_products_nd[i].order_product_seller
73                                , order_product_category: result.Panier.order_products_nd[i].order_product_category
74                                , order_product_quantity: result.Panier.order_products_nd[i].order_product_quantity
75                                , order_product_unitprice_ati: result.Panier.order_products_nd[i].order_product_unitprice_ati
76                                , order_product_unitprice_tf: result.Panier.order_products_nd[i].order_product_unitprice_tf
77                                , order_product_discount_ati: result.Panier.order_products_nd[i].order_product_discount_ati
78                                , order_product_currency: result.Panier.order_products_nd[i].order_product_currency
79                            });
80                        }
81                        for (var i = 0; i < result.Panier.order_products_mp.length; i++) {
82                            tc_vars.order_products_mp.push({
83                                order_product_id: result.Panier.order_products_mp[i].order_product_reference
84                                , order_product_brand: result.Panier.order_products_mp[i].order_product_brand
85                                , order_product_seller: result.Panier.order_products_mp[i].order_product_seller
86                                , order_product_category: result.Panier.order_products_mp[i].order_product_category
87                                , order_product_quantity: result.Panier.order_products_mp[i].order_product_quantity
88                                , order_product_unitprice_ati: result.Panier.order_products_mp[i].order_product_unitprice_ati
89                                , order_product_unitprice_tf: result.Panier.order_products_mp[i].order_product_unitprice_tf
90                                , order_product_discount_ati: result.Panier.order_products_mp[i].order_product_discount_ati
91                                , order_product_currency: result.Panier.order_products_mp[i].order_product_currency
92                            });
93                        }
94                        for (var i = 0; i < result.Panier.order_products_cc.length; i++) {
95                            tc_vars.order_products_cc.push({
96                                order_product_id: result.Panier.order_products_cc[i].order_product_reference
97                                , order_product_brand: result.Panier.order_products_cc[i].order_product_brand
98                                , order_product_seller: result.Panier.order_products_cc[i].order_product_seller
99                                , order_product_category: result.Panier.order_products_cc[i].order_product_category
100                                , order_product_quantity: result.Panier.order_products_cc[i].order_product_quantity
101                                , order_product_unitprice_ati: result.Panier.order_products_cc[i].order_product_unitprice_ati
102                                , order_product_unitprice_tf: result.Panier.order_products_cc[i].order_product_unitprice_tf
103                                , order_product_discount_ati: result.Panier.order_products_cc[i].order_product_discount_ati
104                                , order_product_currency: result.Panier.order_products_cc[i].order_product_currency
105                            });
106                        }
107                    }
108                }
109            });
110    };
111
112    self.sendEvent = function (numero, category, action, label, value) {
113        return _functions.sendEvent(numero, category, action, label, value);
114    }
115
116    self.initEvent = function () {
117        _functions.initEvent();
118    }
119
120    $(function () {
121        _functions.initEvent();
122    })
123
124    return self;
125})(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.