-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathindex.html
More file actions
107 lines (105 loc) · 3.71 KB
/
Copy pathindex.html
File metadata and controls
107 lines (105 loc) · 3.71 KB
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
<!DOCTYPE html>
<html lang="en">
<head>
<title>CMP PV Test</title>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
body{
padding: 0;
margin: 0;
}
#menu {
background: #333;
font-size: 0;
}
#menu button{
padding: 14px 16px;
background: transparent;
color: white;
border: none;
cursor: pointer;
outline: 0;
}
#menu button:hover:not(.active){
background-color: #000;
}
#menu button.active{
background-color: #4CAF50;
}
#API{
background: #f2f2f2;
font-size: 0;
border-bottom: 1px solid #bfbfbf;
}
#API button{
background: #e7e7e7;
padding: 14px 16px;
color: #292929;
border: none;
cursor: pointer;
border-right: 1px solid #bfbfbf;
height: 43px;
}
#API button:hover{
background: #dcdcdc;
}
#Iframe, #ifrCall{
border: 0;
width: 100%;
height: 44px;
}
</style>
<script src="stub.js" type="application/javascript"></script>
</head>
<body>
<script>
window.__cmp('init', {
// hasGlobalScope: true,
cookieSecure: false,
cookieDomain: null,
// urlVendorList: 'test/vendorlist.json',
// globalConsentLocation: 'http://cmp.paruvendu.consensu.org:8000/portal.html',
consentCallback: function () {console.info('Callback');}
});
function showResult(data){
console.log(data);
document.getElementById('res').innerHTML = JSON.stringify(data, null, 4);
}
function showTab(tab){
var not = (tab === 'API')?'Iframe':'API';
document.getElementById(not).style.display = 'none';
document.getElementById(not+'menu').className = '';
document.getElementById(tab).style.display = 'block';
document.getElementById(tab+'menu').className = 'active';
}
// window.__cmp('showConsentUi', null, function(){});
</script>
<div id="menu">
<button id="APImenu" onclick="showTab('API');" class="active">API</button>
<button id="Iframemenu" onclick="showTab('Iframe');">iframe</button>
</div>
<div id="API">
<button onclick="window.__cmp('showConsentUi', null, function(a, b){showResult(a);});">showConsentUi</button>
<button onclick="window.__cmp('ping', null, function(a, b){showResult(a);});">ping</button>
<button onclick="window.__cmp('getVendorConsents', null, function(a, b){showResult(a);});">getVendorConsents</button>
<button onclick="window.__cmp('getVendorConsents', [1,2,3,4,5,1000], function(a, b){showResult(a);});">getVendorConsents [1,2,3,4,5,1000]</button>
<button onclick="window.__cmp('getConsentData', null, function(a, b){showResult(a)});">getConsentData</button>
<button onclick="window.__cmp('getConsentData', 2, function(a, b){showResult(a)});">getConsentData 2</button>
<button onclick="window.__cmp('getPublisherConsents', null, function(a, b){showResult(a)});">getPublisherConsents</button>
<button onclick="window.__cmp('getPublisherConsents', [1,2,3,40], function(a, b){showResult(a)});">getPublisherConsents [1,2,3,40]</button>
<button onclick="window.__cmp('getVendorList', null, function(a, b){showResult(a)});">getVendorList</button>
<button onclick="window.__cmp('getVendorList', 25, function(a, b){showResult(a)});">getVendorList 25</button>
</div>
<div id="Iframe" style="display: none;">
<iframe id="ifrCall" src="iframe.html"></iframe>
</div>
<div id="res" style="white-space: pre; font-family: monospace;"></div>
<!-- Chargement du CMP -->
<script src="polyfills/assign.polyfill.js" type="application/javascript"></script>
<script src="polyfills/base64.polyfill.js" type="application/javascript"></script>
<script src="cmp.js" type="application/javascript" async></script>
<!--<script src="cmp.min.js" type="application/javascript" async></script>-->
</body>
</html>