mirror of
https://gitlab.com/CodeSolutionsProject/CodeShare.git
synced 2026-02-21 04:13:47 +01:00
Improve cookies disable: TODO
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
<link type="text/css" rel="stylesheet" href="{{ app.frontcss }}/main.css"/>
|
||||
<link type="text/css" rel="stylesheet" href="{{ app.frontcss }}/alert.css"/>
|
||||
<link type="text/css" rel="stylesheet" href="{{ app.frontcss }}/codeStyles/vs.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="//cdnjs.cloudflare.com/ajax/libs/cookieconsent2/3.0.3/cookieconsent.min.css" />
|
||||
<link rel="stylesheet" type="text/css" href="//cdnjs.cloudflare.com/ajax/libs/cookieconsent2/3.1.0/cookieconsent.min.css" />
|
||||
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.4.1/css/all.css" integrity="sha384-5sAR7xN1Nv6T6+dT2mhtzEpVJvfS3NScPQTrOxhwjIuvcA67KV2R5Jz6kr4abQsz" crossorigin="anonymous">
|
||||
{#<link rel="shortcut icon" href="{{ path.img }}favicon.ico" type="image/x-icon"/>#}
|
||||
{% block css %}{% endblock %}
|
||||
@@ -49,10 +49,41 @@
|
||||
<script>hljs.initHighlightingOnLoad();</script>
|
||||
{% endblock %}
|
||||
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/cookieconsent2/3.0.3/cookieconsent.min.js"></script>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/cookieconsent2/3.1.0/cookieconsent.min.js"></script>
|
||||
<script>
|
||||
window.addEventListener("load", function(){
|
||||
window.cookieconsent.initialise({
|
||||
onInitialise: function (status) {
|
||||
var type = this.options.type;
|
||||
var didConsent = this.hasConsented();
|
||||
if (type == 'opt-in' && didConsent) {
|
||||
// enable cookies
|
||||
}
|
||||
if (type == 'opt-out' && !didConsent) {
|
||||
// disable cookies
|
||||
}
|
||||
},
|
||||
|
||||
onStatusChange: function(status, chosenBefore) {
|
||||
var type = this.options.type;
|
||||
var didConsent = this.hasConsented();
|
||||
if (type == 'opt-in' && didConsent) {
|
||||
// enable cookies
|
||||
}
|
||||
if (type == 'opt-out' && !didConsent) {
|
||||
// disable cookies
|
||||
}
|
||||
},
|
||||
|
||||
onRevokeChoice: function() {
|
||||
var type = this.options.type;
|
||||
if (type == 'opt-in') {
|
||||
// disable cookies
|
||||
}
|
||||
if (type == 'opt-out') {
|
||||
// enable cookies
|
||||
}
|
||||
},
|
||||
"palette": {
|
||||
"popup": {
|
||||
"background": "#2196f3",
|
||||
@@ -64,11 +95,13 @@
|
||||
"border": "#b2dbfb"
|
||||
}
|
||||
},
|
||||
"type": "opt-out",
|
||||
"content": {
|
||||
"href": "{{ path('tos') }}#cookiePolicy",
|
||||
"message": "This website uses cookies to ensure you get the best experience on on our website. If you don't accept any cookie won't be install on your browser.",
|
||||
"dismiss": "I accept it"
|
||||
"dismiss": "I accept them",
|
||||
"href": "{{ path('tos') }}#cookiePolicy"
|
||||
}
|
||||
})});
|
||||
</script>
|
||||
|
||||
</body>
|
||||
|
||||
Reference in New Issue
Block a user