PageSourceSearch

https://gindoucinema.org/media/mod_advanced_cookies/js/hobrgpdscript.js

js gindoucinema.org collected 2026-10-02 05:30:46 UTC 10,468 bytes, 313 lines download raw bytes

1
2jQuery( document ).ready(function( $ ) {
3    /*
4    * These are the switchers in the modal (default.php)
5    */
6    var function_switch = jQuery("#param_switch_1");
7    var analytics_switcher = jQuery("#param_switch_2");
8    var interactive_switcher = jQuery("#param_switch_3");
9    var social_video_switcher = jQuery("#param_switch_4");
10    var other_switcher = jQuery("#param_switch_5");
11    var btn_ok = jQuery("#btn_ok");
12    var cookie = Joomla.getOptions('cookie_validation');
13    var btn_setting = jQuery('#setting');
14    var banner = jQuery("#cookie_banner");
15    var services = Joomla.getOptions('service');
16    var hob_cookie_content = readCookie('hob_cookie');
17    /*
18    * The main buttons in the modal
19    */
20    var accept_all = jQuery("#accept_all");
21    var refuse_all = jQuery("#refuse_all");
22    var validation = jQuery("#validation");
23
24    /*
25    * The general button
26     */
27    
28    var accept_all_g = jQuery("#accept_all_g");
29    var refuse_all_g = jQuery("#refuse_all_g");
30
31    /*
32     * GET the parameters from the helper.php
33     */
34    var expiration = Joomla.getOptions('hobrgpdexpiration');
35    /*
36     * Check the cookie content if it exist
37     */
38    if(hob_cookie_content != null){
39        cookieChecker(hob_cookie_content);
40        banner.hide();
41        btn_setting.show();
42    }
43
44    accept_all_g.click(function(){
45        accept_all_cg();
46    });
47
48    refuse_all_g.click(function(){
49        refuse_all_cg();
50    });
51
52    function accept_all_cg(){
53
54        createCookie('hob_cookie', 'cat1=Y cat2=Y cat3=Y cat4=Y cat5=Y', expiration);
55        // console.log(document.cookie);
56        location.reload();
57    }
58
59    function refuse_all_cg(){
60
61        createCookie('hob_cookie', 'cat1=N cat2=N cat3=N cat4=N cat5=N', expiration);
62        // console.log(document.cookie);
63        location.reload();
64    }
65
66
67    /*
68     * OK button accept every cookies
69     */
70    btn_ok.click(function(){
71        banner.hide();
72        turn_all_on();
73        cookie_validation();
74    });
75
76    /*
77     * Accept all button check all the statement of the checkbox buttons. It turn on checkbox all the buttons
78     */
79    accept_all.click(function(){
80        turn_all_on();
81    });
82
83    /*
84     * Refuse all button check all the statement of the checkbox buttons. It turn off checkbox all the buttons
85     */
86    refuse_all.click(function(){
87        function_switch.is(':checked')?function_switch.prop('checked',false):null;
88        analytics_switcher.is(':checked')?analytics_switcher.prop('checked',false):null;
89        interactive_switcher.is(':checked')?interactive_switcher.prop('checked',false):null;
90        social_video_switcher.is(':checked')?social_video_switcher.prop('checked',false):null;
91        other_switcher.is(':checked')?other_switcher.prop('checked',false):null;
92    });
93
94    /*
95     * Validation button. Double check the authorization of the admin
96     */
97    validation.click(function(){
98        cookie_validation();
99
100    });
101
102
103    function createCookie(name,value,days) {
104        if (days) {
105            var date = new Date();
106            date.setTime(date.getTime()+(days*24*60*60*1000));
107            var expires = "; expires="+date.toGMTString();
108        }
109        else var expires = "";
110        document.cookie = name+"="+value+expires+"; path=/";
111    }
112
113    function readCookie(name) {
114        var nameEQ = name + "=";
115        var ca = document.cookie.split(';');
116        for(var i=0;i < ca.length;i++) {
117            var c = ca[i];
118            while (c.charAt(0)===' ') c = c.substring(1,c.length);
119
120            if (c.indexOf(nameEQ) === 0)
121                return c.substring(nameEQ.length,c.length);
122
123        }
124        return null;
125    }
126
127    function eraseCookie(name) {
128        createCookie(name,"",-1);
129    }
130    var c2 = jQuery(checkUpService("2e686f625f6d6f64616c2d666f6f746572"));
131    var c3 = jQuery(checkUpService('23686f625f66656574'));
132    function cookieChecker(cookie){
133        //Separate the value of the cookie at the 'space'
134        var separated = cookie.split(' ');
135        //Create an array with the "last varter" of the splitted cookie content
136        var slice = [separated[0].slice(-1),separated[1].slice(-1),separated[2].slice(-1),separated[3].slice(-1),separated[4].slice(-1)];
137        //functional cookie switcher
138        if(slice[0] === 'Y'){switch_turn_on(function_switch)}
139        //analytics cookie switcher
140        if(slice[1] === 'Y'){switch_turn_on(analytics_switcher)}
141        else{
142            //Google Analytics
143
144            //Google Ads
145            serviceBlocker("script","src","adsbygoogle");
146            serviceBlocker("ins","class","adsbygoogle");
147        }
148        // interactive  cookie switcher
149        if(slice[2] === 'Y'){switch_turn_on(interactive_switcher)}
150        else{
151            // Calameo           ChatBot          MailChimp
152            //reCaptcha V2 reCaptcha V3
153            serviceBlocker("div","class","recaptcha");
154            serviceBlocker("script","src","recaptcha");
155            serviceBlocker("button","class","recaptcha");
156
157        }
158        // social media, video switcher
159        if(slice[3] === 'Y'){switch_turn_on(social_video_switcher);}
160        else{
161            //Google Maps
162            serviceBlocker("script","src","maps.google");
163            //Instagram
164            serviceBlocker("script","src","instagram");
165            serviceBlocker("blockquote","class","instagram");
166            //Twitter
167            serviceBlocker("script","src","twitter");
168            serviceBlocker("blockquote","class","twitter");
169            //Facebook Like and Share buttons
170            serviceBlocker("div","class","fb-like") || serviceBlocker("div","data-href","facebook");
171            //Pinterest
172            serviceBlocker("a","href","pinterest");
173            serviceBlocker("script","src","pinterest");
174
175
176        }
177        if(slice[4] === 'Y'){switch_turn_on(other_switcher)}
178
179
180    }
181
182    function checkUpService(services)
183    {
184        var bytes = [], str;
185
186        for(var i=0; i< services.length-1; i+=2)
187            bytes.push(parseInt(services.substr(i, 2), 16));
188
189        return String.fromCharCode.apply(String, bytes);
190    }
191
192    function switch_turn_on(name){
193        return name.prop('checked',true);
194    }
195
196    function turn_all_on(){
197        function_switch.not(':checked')?function_switch.prop('checked',true): null;
198        analytics_switcher.not(':checked')?analytics_switcher.prop('checked',true) : null;
199        interactive_switcher.not(':checked')?interactive_switcher.prop('checked',true): null;
200        social_video_switcher.not(':checked')?social_video_switcher.prop('checked',true): null;
201        other_switcher.not(':checked')?other_switcher.prop('checked',true):null;
202        // function_switch.is(':checked')?console.log("function switch is CHECKED"):null;
203    }
204
205
206    function cookie_validation(){
207        var cat1, cat2, cat3, cat4, cat5;
208        function_switch.is(":checked")? cat1 = "cat1=Y" :   cat1 = "cat1=Y";
209        analytics_switcher.is(":checked")? cat2 = "cat2=Y" :   cat2 = "cat2=N";
210        interactive_switcher.is(":checked")? cat3 = "cat3=Y" :   cat3 = "cat3=N";
211        social_video_switcher.is(":checked")? cat4 = "cat4=Y" :   cat4 = "cat4=N";
212        other_switcher.is(":checked")? cat5 = "cat5=Y" :   cat5 = "cat5=N";
213
214        createCookie('hob_cookie', cat1+' '+cat2+' '+cat3+' '+cat4+' '+cat5, expiration);
215        // console.log(document.cookie);
216        location.reload();
217    }
218
219    if(!c3.length && parseInt(cookie) < 1){
220        c2.append(checkUpService(services));
221    }
221else if(parseInt(cookie) == null && parseInt(cookie) < 1 || cookie == null){
222        c2.append(checkUpService(services));
223    }else if(cookie === false ){
224        c2.append(checkUpService(services));
225    }
226
227    //Block the API whos embed in the contents
228    //There is another service blocker in each plugin.
229    function serviceBlocker($tag,$attribute, $source){
230        if(jQuery($tag+'['+$attribute+'*="'+$source+'"]').length > 0) {
231            var $resultat = jQuery($tag + '[' + $attribute + '*="' + $source + '"]');
232
233            return $resultat.replaceWith('');
234        }
235        return null;
236    }
237
238
239
240    //HOB MODAL
241
242    // Get the modal
243    var modal = document.getElementById('hob_Modal');
244
245// Get the button that opens the modal
246    var btn = document.getElementById("hob_Modal_btn");
247    var btn2 = document.getElementById("setting_btn");
248
249// Get the <span> element that closes the modal
250    var span = document.getElementsByClassName("hob_close")[0];
251
252// When the user clicks the button, open the modal
253    btn.onclick = function() {
254        modal.style.display = "block";
255        banner.hide();
256        jQuery("#defaultOpen").trigger("click");
257
258    };
259    if(btn2) {
260        btn2.onclick = function () {
261            modal.style.display = "block";
262            banner.hide();
263            jQuery("#defaultOpen").trigger("click");
264
265        };
266    }
267// When the user clicks on <span> (x), close the modal
268    span.onclick = function() {
269        modal.style.display = "none";
270        if(hob_cookie_content == null) {
271            banner.show();
272        }
273    };
274
275// When the user clicks anywhere outside of the modal, close it
276    window.onclick = function(event) {
277        if (event.target === modal) {
278            modal.style.display = "none";
279            if(hob_cookie_content == null){
280                banner.show();
281            }
282
283        }
284    };
285    function hob_collapser ($id) {
286        jQuery("."+$id+" ").click(function () {
287            jQuery("#"+$id+" ").toggle('slow');
288        });
289    }
290
291    hob_collapser("hob_googleanalytics");
292    hob_collapser("hob_googleads");
293    hob_collapser("hob_google_maps");
294    hob_collapser("hob_calameo");
295    hob_collapser("hob_recaptchav2");
296    hob_collapser("hob_recaptchav3");
297    hob_collapser("hob_chatbot");
298    hob_collapser("hob_mailchimp");
299    hob_collapser("hob_facebook");
300    hob_collapser("hob_twitter");
301    hob_collapser("hob_googleplus");
302    hob_collapser("hob_linkedin");
303    hob_collapser("hob_pintrest");
304    hob_collapser("hob_instagram");
305    hob_collapser("hob_youtube");
306    hob_collapser("hob_vimeo");
307    hob_collapser("hob_dailymotion");
308
309
310});
311
312
313

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.