mirror of
https://gitlab.com/CodeSolutionsProject/CodeShare.git
synced 2026-02-14 09:01:33 +01:00
HotFix: Decline allow
This commit is contained in:
@@ -53,29 +53,29 @@
|
||||
<script>
|
||||
window.addEventListener("load", function(){
|
||||
window.cookieconsent.initialise({
|
||||
onInitialise: function (status) {
|
||||
"onInitialise": function (status) {
|
||||
var type = this.options.type;
|
||||
var didConsent = this.hasConsented();
|
||||
if (type == 'opt-in' && didConsent) {
|
||||
|
||||
}
|
||||
if (type == 'opt-out' && !didConsent) {
|
||||
deleteCookies();
|
||||
}
|
||||
},
|
||||
|
||||
"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
|
||||
deleteCookies();
|
||||
}
|
||||
},
|
||||
|
||||
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() {
|
||||
"onRevokeChoice": function() {
|
||||
var type = this.options.type;
|
||||
if (type == 'opt-in') {
|
||||
// disable cookies
|
||||
|
||||
@@ -154,6 +154,10 @@ function onScroll() {
|
||||
//From https://stackoverflow.com/questions/35297919/javascript-select-all-text-inside-a-pre-code-block-on-double-click
|
||||
window.onload = function(){
|
||||
|
||||
if(!comprobarCookie('cookieconsent_status') || obtenerCookie('cookieconsent_status')=='deny'){
|
||||
deleteCookies();
|
||||
}
|
||||
|
||||
document.body.addEventListener('dblclick', function(e){
|
||||
var target = e.target || e.srcElement;
|
||||
if (target.className.indexOf("highlight") !== -1 || target.parentNode.className.indexOf("highlight") !== -1){
|
||||
@@ -174,4 +178,11 @@ window.onload = function(){
|
||||
}
|
||||
|
||||
});
|
||||
};
|
||||
};
|
||||
|
||||
function deleteCookies() {
|
||||
var theCookies = document.cookie.split(';');
|
||||
for (var i = 0 ; i < theCookies.length; i++) {
|
||||
document.cookie = theCookies[i].split('=')[0] + '=; path=/; expires=Thu, 01 Jan 1970 00:00:01 GMT;';
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
if(isset($_COOKIE['cookieconsent_status'])) {
|
||||
if(isset($_COOKIE['cookieconsent_status']) and $_COOKIE['cookieconsent_status']!="deny") {
|
||||
session_start(); //Start session in app, before loading vars ($_SESSION)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user