PageSourceSearch

https://www.coin-fr.com/modules/divioseo_cookiesvarnish/cookiesvarnish.js

js coin-fr.com collected 2026-10-06 13:12:09 UTC 2,576 bytes, 89 lines download raw bytes

1/* global $, prestashop */
2
3/**
4 * This module exposes an extension point in the form of the `showModal` function.
5 *
6 * If you want to override the way the modal window is displayed, simply define:
7 *
8 * prestashop.blockcart = prestashop.blockcart || {};
9 * prestashop.blockcart.showModal = function myOwnShowModal (modalHTML) {
10 *   // your own code
11 *   // please not that it is your responsibility to handle closing the modal too
12 * };
13 *
14 * Attention: your "override" JS needs to be included **before** this file.
15 * The safest way to do so is to place your "override" inside the theme's main JS file.
16 *
17 */
18
19$(document).ready(function () {
20	// Divioseo
21
22	// Refresh ajax varnish - Customer signin block
23	var customerRefreshURL = $('.linkcustomer').data('refresh-url');
24	console.log('aa'+customerRefreshURL);
25	if (customerRefreshURL) {
26		$.get(customerRefreshURL).then(function(resp){
27			var $newWidget = $(resp.widget);
28			$('.linkcustomer').replaceWith($newWidget.find('.linkcustomer').length ? $newWidget.find('.linkcustomer') : $newWidget);
29		});
30	}
31	// End refresh customer signin
32	
33	var currency='';
34	
35	if( $_GET('id_currency') != null){
36		currency = '?id_currency='+$_GET('id_currency');
37	}
38	var refreshURL = $('.blockcart').data('refresh-url')+currency;
39	 
40	$.get(refreshURL).then(function(resp){
41		 
42		setCookie('customer_infos', resp.mycookieCustomerInfos, 7 );
43		//console.log(resp.mycookieCustomerInfos);
44		$('.blockcart').replaceWith($(resp.preview).find('.blockcart'));
45		
46		if(resp.customeraccount != ''){
47			$('.header_user').replaceWith($(resp.customeraccount));
48		}
49	});
50	
51	$(document).on('click','.logout', function(){
52		var logout = $(this).attr('href');
53		var refreshURL = $('#cart_block').data('refresh-url')+'?mylogout=';
54		$.get(refreshURL).then(function(resp){
55		 
56			setCookie('customer_infos', resp.mycookieCustomerInfos, 7 );
57
58			window.location.reload(logout);
59			
60		});
61		
62		return false;
63	});
64	// End Divioseo
65});
66 
67function setCookie(name,value,days) {
68    var expires = "";
69    if (days) {
70        var date = new Date();
71        date.setTime(date.getTime() + (days*24*60*60*1000));
72        expires = "; expires=" + date.toUTCString();
73    }
74    document.cookie = name + "=" + (value || "")  + expires + "; path=/";
75}
76function $_GET(param) {
77	var vars = {};
78	window.location.href.replace( location.hash, '' ).replace( 
79		/[?&]+([^=&]+)=?([^&]*)?/gi, // regexp
80		function( m, key, value ) { // callback
81			vars[key] = value !== undefined ? value : '';
82		}
83	);
84
85	if ( param ) {
86		return vars[param] ? vars[param] : null;	
87	}
88	return vars;
89}

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.