PageSourceSearch

http://www.mairie-nomain.fr/wp-content/themes/le-valois/js/vendor/…/tarteaucitron-init.js?ver=6.9.9

js mairie-nomain.fr collected 2026-10-02 19:23:02 UTC 6,934 bytes, 197 lines download raw bytes

1/**
2 * Configuration des éléments à bloqué pour les cookies
3 * afin de respect les spécification de la lois du CNIL
4 * en référence au cookie
5 *
6 * @link http://www.cnil.fr/vos-obligations/sites-web-cookies-et-autres-traceurs/que-dit-la-loi/
7 *
8 * Plugin utilisé tartaucitron.js
9 * @see /tarteaucitron/tarteaucitron.js
10 * @link https://opt-out.ferank.eu/fr/
11 */
12if (typeof tarteaucitron !== 'undefined') {
13    tarteaucitron.job = tarteaucitron.job || [];
14    
15    tarteaucitron.init({
16        /* Ouverture automatique du panel avec le hashtag */
17        "hashtag": "#tarteaucitron",
18        /* désactiver le consentement implicite (en naviguant) ? */
19        "highPrivacy": false,
20        /* le bandeau doit être en haut (top) ou en bas (bottom) ? */
21        "orientation": "bottom",
22        /* Afficher un message si un adblocker est détecté */
23        "adblocker": false,
24        /* afficher le petit bandeau en bas à droite ? */
25        "showAlertSmall": false,
26        /* Afficher la liste des cookies installés ? */
27        "cookieslist": true,
28        /* supprimer le lien vers la source ? */
29        "removeCredit": true
30    });
31
32}
33/**
34 *
35 *
36 */
37jQuery(document).ready(function($){
38
39    /**
40     * Permets de savoir l'état d'acceptation des cookies des différentes services 
41     * @type {Object}
42     */
43    var TC = {
44        /**
45         * Stock les cookie de tarteaucitron
46         * @type {String}
47         */
48        _cookie: '',
49        /**
50         * Permets de récupérer la liste des cookies de tarteaucitron
51         * @return boolean - true si le cookie existe, false sinon
52         */
53        readCookie: function(){
54            this._cookie = tarteaucitron.cookie.read();
55            if (this._cookie !== '') {
56                return true;
57            }
58            return false;
59        },
60        /**
61         * Permets de définir si un service est accepté dans les cookies
62         * @param  {string} service le nom du service à rechercher
63         * @return {boolean} - true si le service est accepté, false sinon
64         */
65        isActive: function(service){
66            if (this._cookie !== '') {
67                var c = this._cookie.split('!');
68                for(var i=0;i < c.length;i++) {
69                    var p = c[i];
70                    if (p.indexOf(service) == 0) {
71                        s = p.split('=');
72                        if (s[1] === 'true') {
73                            return true;
74                        }
75                        return false;
76                    }
77                }
78            }
79            return false;
80        }
81    }
82    
83    TC.readCookie();
84
85    // console.log("Youtube : " + TC.isActive('youtube'));
86    // console.log("Vimeo : " + TC.isActive('vimeo'));
87    // console.log("Dailymotion : " + TC.isActive('dailymotion'));
88    // console.log("test_service_false : " + TC.isActive('test_service_false'));
89
90
91    /**
92     * Recherche et Remplace les iframes de youtube
93     * pour permettre la validation de celle-ci par tarteaucitron.js
94     *
95     * @link https://opt-out.ferank.eu/fr/install/
96     *
97     */
98    if (!TC.isActive('youtube')) {
99        $('iframe[src*="youtube.com"]').each(function() {
100            var url = $(this).attr("src");
101            var match = url.match(/(?:https?:\/{2})?(?:w{3}\.)?youtu(?:be)?\.(?:com|be)(?:\/watch\?v=|\/)([^\s&!?]+)(\??autoplay=([0-1]))?/);
102            if(match !== null) {
103                console.log(match);
104                var height = $(this).height();
105                if (height) {
106                    height = 'height="'+ height +'"';
107                }
108                var width = $(this).width();
109                 if (width) {
110                    width = 'width="'+ width +'"';
111                }
112                var autoplay = 0;
113                if (match[3]) {
114                    autoplay = match[3];
115                }
116
117                var id = match[1].split('/')[1].split('?')[0];
118                var frame = '<div class="youtube_player video-container" wmode="transparent" videoID="'+ id +'" theme="dark" rel="0" controls="1" showinfo="1" autoplay="'+ autoplay +'" '+ height +' '+ width + '></div>';
119
120                $(this).before(frame).remove();
121
122
123            }
124
125            //$(this).attr("src",url+"&amp;wmode=transparent");
126        });
127    }
128
129    /**
130     * Recherche et Remplace les iframes de vimeo
131     * pour permettre la validation de celle-ci par tarteaucitron.js
132     *
133     * @link https://opt-out.ferank.eu/fr/install/
134     *
135     */
136    if (!TC.isActive('vimeo')) {
137        $('iframe[src*="vimeo.com"]').each(function() {
138            var url = $(this).attr("src");
139            var match = url.match(/(?:https?:\/\/(?:[\w]+\.)*vimeo\.com(?:[\/\w:]*(?:\/videos)?)?\/([0-9]+)[^\s]*)"?/);
140
141            if(match !== null) {
142                var id = match[1];
143
144                var height = $(this).height();
145                if (height) {
146                    height = 'height="'+ height +'"';
147                }
148                var width = $(this).width();
149                 if (width) {
150                    width = 'width="'+ width +'"';
151                }
152
153
154                var frame = '<div class="vimeo_player video-container" videoID="'+ id +'" controls="1" '+ height +' '+ width + '></div>';
155
156                $(this).before(frame).remove();
157
158            }
159            // $(this).attr("src",url+"&amp;wmode=transparent");
160        });
161    }
162
163    /**
164     * Recherche et Remplace les iframes de dailymotion
165     * pour permettre la validation de celle-ci par tarteaucitron.js
166     *
167     * @link https://opt-out.ferank.eu/fr/install/
168     *
169     */
170    if (!TC.isActive('dailymotion')) {
171        $('iframe[src*="dailymotion.com"]').each(function() {
172            var url = $(this).attr("src");
173            var match = url.match(/(?:https?:\/{2})?\/{0,2}?(www\.dailymotion.com\/embed\/video\/.*?)([A-Za-z0-9_-]+)(?:\?autoPlay=(0|1))?/);
174            if(match !== null) {
175                console.log(match);
176                var height = $(this).height();
177                if (height) {
178                    height = 'height="'+ height +'"';
179                }
180                var width = $(this).width();
181                 if (width) {
182                    width = 'width="'+ width +'"';
183                }
184                var autoplay = 0;
185                if (match[3]) {
186                    autoplay = match[3];
187                }
188
189                var id = match[2];
190                var frame = '<div class="dailymotion_player video-container" wmode="transparent" videoID="'+ id +'" theme="dark" rel="0" controls="1" showinfo="1" autoplay="'+ autoplay +'" '+ height +' '+ width + '></div>';
191                $(this).before(frame).remove();
192
193            }
194        });
195    }
196
197});

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.