mirror of
https://gitlab.com/CodeSolutionsProject/CodeShare.git
synced 2026-02-21 04:13:47 +01:00
HotFix: Decline allow
This commit is contained in:
@@ -53,29 +53,29 @@
|
|||||||
<script>
|
<script>
|
||||||
window.addEventListener("load", function(){
|
window.addEventListener("load", function(){
|
||||||
window.cookieconsent.initialise({
|
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 type = this.options.type;
|
||||||
var didConsent = this.hasConsented();
|
var didConsent = this.hasConsented();
|
||||||
if (type == 'opt-in' && didConsent) {
|
if (type == 'opt-in' && didConsent) {
|
||||||
// enable cookies
|
// enable cookies
|
||||||
}
|
}
|
||||||
if (type == 'opt-out' && !didConsent) {
|
if (type == 'opt-out' && !didConsent) {
|
||||||
// disable cookies
|
deleteCookies();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
onStatusChange: function(status, chosenBefore) {
|
"onRevokeChoice": function() {
|
||||||
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;
|
var type = this.options.type;
|
||||||
if (type == 'opt-in') {
|
if (type == 'opt-in') {
|
||||||
// disable cookies
|
// 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
|
//From https://stackoverflow.com/questions/35297919/javascript-select-all-text-inside-a-pre-code-block-on-double-click
|
||||||
window.onload = function(){
|
window.onload = function(){
|
||||||
|
|
||||||
|
if(!comprobarCookie('cookieconsent_status') || obtenerCookie('cookieconsent_status')=='deny'){
|
||||||
|
deleteCookies();
|
||||||
|
}
|
||||||
|
|
||||||
document.body.addEventListener('dblclick', function(e){
|
document.body.addEventListener('dblclick', function(e){
|
||||||
var target = e.target || e.srcElement;
|
var target = e.target || e.srcElement;
|
||||||
if (target.className.indexOf("highlight") !== -1 || target.parentNode.className.indexOf("highlight") !== -1){
|
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
|
<?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)
|
session_start(); //Start session in app, before loading vars ($_SESSION)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user