Premetto che stavo affrontando il problema nella lunga discussione sull'argomento in area "Programmazione" ma un moderatore mi ha consiglieto di chiedere qui.
Con colpevole ritardo sto cercando di adeguare i miei siti alla nuova normativa sui cookies ma non riesco a far funzionare nessuno dei tools provati finora. Non è che io non riesca ad installarli, ma non mi funzionano proprio i file html di esempio!
Sareste così gentili da dirmi se a voi funzionano, ovvero se visualizzano un banner pop-up all'apertura del file html?
Nella fattispecie sto provando sia Cookie-enabler (https://github.com/nicholasruggeri/cookies-enabler), sia Cookie Consent 2 (https://github.com/silktide/cookieconsent2).
Scompatto gli archivi senza alterare la struttura delle directories e provo ad aprire i file di esempio HTML ma NESSUN banner viene visualizzato.
Il file di esempio di Cookies-enabler è questo:
codice:
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<title>Cookies Enabler JS</title>
<meta name="description" content="Cookies-enabler.js is a easy-to-use pure Javascript solution for preventively blocking third-party cookies installed by js and comply with the EU cookie law.">
<link rel="stylesheet" href="stylesheets/page.css">
<link rel="stylesheet" href="stylesheets/cookies-enabler.css">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
</head>
<body>
<div class="wrapper">
<header>
<h1>Cookies Enabler JS</h1>
<p>Cookies-enabler.js is a easy-to-use pure Javascript solution for preventively blocking third-party cookies installed by js and comply with the EU cookie law.</p>
<p class="view">
<a href="https://github.com/nicholasruggeri/cookies-enabler">View the Project on GitHub</a>
</p>
<ul>
<li><a href="https://github.com/nicholasruggeri/cookies-enabler/archive/master.zip">Download <strong>ZIP File</strong></a></li>
<li><a href="https://github.com/nicholasruggeri/cookies-enabler">Fork On <strong>GitHub</strong></a></li>
</ul>
</header>
<section>
<h2>Iframes disabled</h2>
<iframe class="ce-iframe" data-ce-src="https://player.vimeo.com/video/1084537" width="500" height="281" frameborder="0" allowfullscreen></iframe>
<iframe width="560" height="315" class="ce-iframe" data-ce-src="https://www.youtube.com/embed/ZSn3Tvc7jQU" frameborder="0" allowfullscreen></iframe>
</section>
<footer>
<p>This project is maintained by:<br>
<a href="http://github.com/nicholasruggeri">Nicholas Ruggeri</a> and <a href="http://github.com/gsimone">Gianmarco Simone</a></p>
</footer>
</div>
<script type="text/plain" class="ce-script">
console.log('facebook initializing');
// FB Demo
(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.3&appId=1402028420038023";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
</script>
<div class="fb-like" data-href="https://developers.facebook.com/docs/plugins/" data-layout="standard" data-action="like" data-show-faces="true" data-share="true"></div>
<script type="text/plain" class="ce-script">
console.log('ga initializing');
// GA Demo
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-XXXXX-X']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
<!-- Templates -->
<script id="ce-banner-html" type="text/plain">
<p>This websites uses cookies to give you the <i>best</i> possible experience.</p>
<p>
<a href="#" class="ce-accept">Enable Cookies</a> <a href="#" class="ce-disable">Disable Cookies</a> or <a href="#">Read More</a>
<a href="#" class="ce-dismiss">X</a>
</p>
</script>
<script id="ce-iframePlaceholder-html" type="text/plain">
<p>This content is not available without cookies.
<a href="#" class="ce-accept">Enable Cookies</a> or <a href="#">Read More</a></p>
</script>
<!-- Load the script -->
<script src="../cookies-enabler.js"></script>
<!-- Init the script -->
<script>
COOKIES_ENABLER.init({
scriptClass: 'ce-script',
iframeClass: 'ce-iframe',
acceptClass: 'ce-accept',
dismissClass: 'ce-dismiss',
disableClass: 'ce-disable',
bannerClass: 'ce-banner',
bannerHTML:
'<p>This website uses cookies. '
+'<a href="#" class="ce-accept">'
+'Enable Cookies'
+'</a>'
+'</p>',
eventScroll: false,
scrollOffset: 200,
clickOutside: true,
cookieName: 'ce-cookie',
cookieDuration: '365',
iframesPlaceholder: true,
iframesPlaceholderHTML:
'<p>To view this content you need to'
+'<a href="#" class="ce-accept">Enable Cookies</a>'
+'</p>',
iframesPlaceholderClass: 'ce-iframe-placeholder',
// Callbacks
onEnable: '',
onDismiss: '',
onDisable: ''
});
</script>
</body>
</html>
Il file di esempio di Cookie Consent 2 è questo:
codice:
<!--
An example of how to use cookie consent only using the local files
-->
<html>
<head>
<title>Cookie Consent</title>
</head>
<body>
<h1>Cookie Consent example page.</h1>
<div class="cookie_container"></div>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
</body>
<script>
window.cookieconsent_options = {
learnMore: 'more info',
theme: 'styles/dark-top.css'
}
</script>
<script type="text/javascript" src="cookieconsent.js"></script>
</html>
Ripeto TUTTI i file richiamati dal HTML sono presenti nella cartella rispettando la struttura originale, ma quando apro il file non compare NULLA Provato con diversi browser).
C'è qualcosa di errato nei files HTML?
Se volete provare gli script li trovate agli URL inseriti sopra ovvero:
https://github.com/silktide/cookieconsent2
https://github.com/nicholasruggeri/cookies-enabler
Grazie in anticipo.