1/* #PRODUIRE{fond=jquery.cookiebar.js,lang=fr,signature=c1bccb7eee8414c02fa4d78802e8d7e6} 2 md5:c41df6564b6a1b73e03549fda929cfe0 */ 3(function($){ 4 $.cookieBar = function(options,val){ 5 if(options=='cookies'){ 6 var doReturn = 'cookies'; 7 }else if(options=='set'){ 8 var doReturn = 'set'; 9 }else{ 10 var doReturn = false; 11 } 12 var defaults = { 13 message: "<span class=\"cb-msg\">En poursuivant votre navigation sur ce site, vous acceptez l\u2019utilisation de cookies de suivi et de pr\u00e9f\u00e9rences<\/span>", //Message displayed on bar 14 acceptButton: true, //Set to true to show accept/enable button 15 acceptText: 'Jâaccepte', //Text on accept/enable button 16 declineButton: true, //Set to true to show decline/disable button 17 declineText: 'Désactiver les cookies', //Text on decline/disable button 18 policyButton: true, //Set to true to show Privacy Policy button 19 policyText: 'Politique de confidentialité', //Text on Privacy Policy button 20 policyURL: 'https://www.eglise-niort.net/Mentions-legales', //URL of Privacy Policy 21 autoEnable: true, //Set to true for cookies to be accepted automatically. Banner still shows 22 acceptOnContinue: false, //Set to true to silently accept cookies when visitor moves to another page 23 expireDays: 365, //Number of days for cookieBar cookie to be stored for 24 forceShow: false, //Force cookieBar to show regardless of user cookie preference 25 effect: 'fade', //Options: slide, fade, hide 26 element: 'body', //Element to append/prepend cookieBar to. Remember "." for class or "#" for id. 27 append: false, //Set to true for cookieBar HTML to be placed at base of website. Actual position may change according to CSS 28 fixed: true, //Set to true to add the class "fixed" to the cookie bar. Default CSS should fix the position 29 bottom: true, //Force CSS when fixed, so bar appears at bottom of website 30 zindex: '999', //Can be set in CSS, although some may prefer to set here 31 redirect: String(window.location.href), //Current location 32 domain: String(window.location.hostname), //Location of privacy policy 33 referrer: String(document.referrer) //Where visitor has come from 34 }; 35 var options = $.extend(defaults,options); 36 37 //Sets expiration date for cookie 38 var expireDate = new Date(); 39 expireDate.setTime(expireDate.getTime()+(options.expireDays*24*60*60*1000)); 40 expireDate = expireDate.toGMTString(); 41 42 var cookieEntry = 'cb-enabled={value}; expires='+expireDate+'; path=/'; 43 44 //Retrieves current cookie preference 45 var i,cookieValue='',aCookie,aCookies=document.cookie.split('; '); 46 for (i=0;i<aCookies.length;i++){ 47 aCookie = aCookies[i].split('='); 48 if(aCookie[0]=='cb-enabled'){ 49 cookieValue = aCookie[1]; 50 } 51 } 52 //Sets up default cookie preference if not already set 53 if(cookieValue=='' && options.autoEnable){ 54 cookieValue = 'enabled'; 55 document.cookie = cookieEntry.replace('{value}','enabled'); 56 } 57 if(options.acceptOnContinue){ 58 if(options.referrer.indexOf(options.domain)>=0 && String(window.location.href).indexOf(options.policyURL)==-1 && doReturn!='cookies' && doReturn!='set' && cookieValue!='accepted' && cookieValue!='declined'){ 59 doReturn = 'set'; 60 val = 'accepted'; 61 } 62 } 63 if(doReturn=='cookies'){ 64 //Returns true if cookies are enabled, false otherwise 65 if(cookieValue=='enabled' || cookieValue=='accepted'){ 66 return true; 67 }else{ 68 return false; 69 } 70 }else if(doReturn=='set' && (val=='accepted' || val=='declined')){ 71 //Sets value of cookie to 'accepted' or 'declined' 72 document.cookie = cookieEntry.replace('{value}',val); 73 if(val=='accepted'){ 74 return true; 75 }else{ 76 return false; 77 } 78 }else{ 79 //Sets up enable/accept button if required 80 var message = options.message.replace('{policy_url}',options.policyURL); 81 82 if(options.acceptButton){ 83 var acceptButton = '<a href="" class="cb-enable">'+options.acceptText+'</a>'; 84 }else{ 85 var acceptButton = ''; 86 } 87 //Sets up disable/decline button if required 88 if(options.declineButton){ 89 var declineButton = '<a href="" class="cb-disable">'+options.declineText+'</a>'; 90 }else{ 91 var declineButton = ''; 92 } 93 //Sets up privacy policy button if required 94 if(options.policyButton && options.policyURL){ 95 var policyButton = '<a href="'+options.policyURL+'" class="cb-policy">
95'+options.policyText+'</a>'; 96 }else{ 97 var policyButton = ''; 98 } 99 //Whether to add "fixed" class to cookie bar 100 if(options.fixed){ 101 if(options.bottom){ 102 var fixed = ' class="fixed bottom"'; 103 }else{ 104 var fixed = ' class="fixed"'; 105 } 106 }else{ 107 var fixed = ''; 108 } 109 if(options.zindex!=''){ 110 var zindex = ' style="z-index:'+options.zindex+';"'; 111 }else{ 112 var zindex = ''; 113 } 114 115 //Displays the cookie bar if arguments met 116 if(options.forceShow || cookieValue=='enabled' || cookieValue==''){ 117 if(options.append){ 118 $(options.element).append('<div id="cookie-bar"'+fixed+zindex+'><p>'+message+acceptButton+declineButton+policyButton+'</p></div>'); 119 }else{ 120 $(options.element).prepend('<div id="cookie-bar"'+fixed+zindex+'><p>'+message+acceptButton+declineButton+policyButton+'</p></div>'); 121 } 122 } 123 124 //Sets the cookie preference to accepted if enable/accept button pressed 125 $('#cookie-bar .cb-enable').click(function(){ 126 document.cookie = cookieEntry.replace('{value}','accepted'); 127 if(cookieValue!='enabled' && cookieValue!='accepted'){ 128 window.location = options.currentLocation; 129 }else{ 130 if(options.effect=='slide'){ 131 $('#cookie-bar').slideUp(300,function(){$('#cookie-bar').remove();}); 132 }else if(options.effect=='fade'){ 133 $('#cookie-bar').fadeOut(300,function(){$('#cookie-bar').remove();}); 134 }else{ 135 $('#cookie-bar').hide(0,function(){$('#cookie-bar').remove();}); 136 } 137 return false; 138 } 139 }); 140 //Sets the cookie preference to declined if disable/decline button pressed 141 $('#cookie-bar .cb-disable').click(function(){ 142 var deleteDate = new Date(); 143 deleteDate.setTime(deleteDate.getTime()-(864000000)); 144 deleteDate = deleteDate.toGMTString(); 145 aCookies=document.cookie.split('; '); 146 for (i=0;i<aCookies.length;i++){ 147 aCookie = aCookies[i].split('='); 148 if(aCookie[0].indexOf('_')>=0){ 149 document.cookie = aCookie[0]+'=0; expires='+deleteDate+'; domain='+options.domain.replace('www','')+'; path=/'; 150 }else{ 151 document.cookie = aCookie[0]+'=0; expires='+deleteDate+'; path=/'; 152 } 153 } 154 document.cookie = cookieEntry.replace('{value}','declined'); 155 if(cookieValue=='enabled' && cookieValue!='accepted'){ 156 window.location = options.currentLocation; 157 }else{ 158 if(options.effect=='slide'){ 159 $('#cookie-bar').slideUp(300,function(){$('#cookie-bar').remove();}); 160 }else if(options.effect=='fade'){ 161 $('#cookie-bar').fadeOut(300,function(){$('#cookie-bar').remove();}); 162 }else{ 163 $('#cookie-bar').hide(0,function(){$('#cookie-bar').remove();}); 164 } 165 return false; 166 } 167 }); 168 } 169 }; 170})(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.