/
ccb_element_blocker.html5
93 lines (91 loc) · 3.52 KB
/
ccb_element_blocker.html5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
<!DOCTYPE html>
<html lang="<?= $this->language ?>">
<head>
<?php $this->block('head'); ?>
<meta name="robots" content="noindex,nofollow" />
<style>
.ccb-element-blocker {
font-size: 14px;
font-family: sans-serif;
text-align: center;
color: #6f6f6f;
}
.ccb-element-blocker .cc-icon {
position: relative;
width: 220px;
height: 110px;
margin: 0 auto 8px;
}
.ccb-element-blocker .cc-icon:after {
content: "";
position: absolute;
left: 0;
top: 0;
bottom: 0;
right: 0;
background-position: center center;
background-size: contain;
background-repeat: no-repeat;
background-image: url("/bundles/contaocookiebar/images/default.png");
}
.ccb-element-blocker .cc-icon.vimeo:after {
background-image: url("/bundles/contaocookiebar/images/vimeo.png");
}
.ccb-element-blocker .cc-icon.youtube:after {
background-image: url("/bundles/contaocookiebar/images/youtube.png");
}
.ccb-element-blocker .cc-icon.googlemaps:after {
background-image: url("/bundles/contaocookiebar/images/googlemaps.png");
}
.ccb-element-blocker .cc-icon.openstreetmap:after {
background-image: url("/bundles/contaocookiebar/images/openstreetmap.png");
}
.ccb-element-blocker .cc-title{
font-weight: bold;
}
.ccb-element-blocker .cc-btn{
display: inline-block;
cursor: pointer;
padding: 8px 14px;
font-size: 15px;
outline: 0 none;
border: 1px solid #cfcfcf;
border-radius: 4px;
color: #444;
background: #f5f5f5;
}
.ccb-element-blocker .cc-btn:hover{
background: #ececec;
}
</style>
<script>
// Check if the cookie bar is ready, otherwise respond to document load (#148)
if(parent.cookiebar){
redirectIfNecessary()
}else{
parent.addEventListener('load', () => {
redirectIfNecessary()
})
}
function redirectIfNecessary(){
if(parent.cookiebar.issetCookie(<?=$this->id?>)){
const decoder = document.createElement('textarea');
decoder.innerHTML = '<?=$this->redirect?>';
window.location.href = decoder.value;
}
}
</script>
<?php $this->endblock(); ?>
</head>
<body>
<?php $this->block('body'); ?>
<div class="ccb-element-blocker <?=$this->type?>">
<?php $this->block('blocker_content'); ?>
<div class="cc-icon <?=$this->iframeType?>"></div>
<div class="cc-title"><?=$this->title?></div>
<div class="cc-description"><?=$this->description?></div>
<button class="cc-btn" onclick="parent.cookiebar.unblock(window.frames.frameElement, <?=$this->id?>, '<?=$this->redirect?>')"><?=$this->acceptAndDisplayLabel?></button>
<?php $this->endblock(); ?>
</div>
<?php $this->endblock(); ?>
</body>