Skip to content

Commit 6269001

Browse files
authored
Merge pull request #548 from microsoftgraph/bethpan/privacy
Privacy banner and footer
2 parents 4232a2b + bdc0f3d commit 6269001

File tree

1 file changed

+66
-8
lines changed

1 file changed

+66
-8
lines changed

.storybook/manager-head.html

Lines changed: 66 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,71 @@
1+
<link rel="shortcut icon" type="image/png" href="/favicon.png" />
2+
<div id="cookie-banner"></div>
3+
<footer class="storybook-footer">
4+
Microsoft Graph Toolkit Playground was founded by Microsoft as a community guided, open source project.
5+
<a href="https://privacy.microsoft.com/en-us/privacystatement">Privacy & cookies</a>
6+
<a href="https://www.microsoft.com/en-us/legal/intellectualproperty/copyright/default">Term of use</a>
7+
</footer>
8+
9+
<script src="https://consentdeliveryfd.azurefd.net/mscc/lib/v2/wcp-consent.js"></script>
110
<script src="https://az725175.vo.msecnd.net/scripts/jsll-4.js" type="text/javascript"></script>
211
<script type="text/javascript">
3-
var config = {
4-
autoCapture: {
5-
lineage: true
12+
WcpConsent.init(
13+
'en-US',
14+
'cookie-banner',
15+
function(err, _siteConsent) {
16+
if (err != undefined) {
17+
return err;
18+
} else {
19+
siteConsent = _siteConsent; //siteConsent is used to get the current consent
20+
}
621
},
7-
coreData: {
8-
appId: 'JS:GraphToolkit'
22+
onConsentChanged
23+
);
24+
25+
function onConsentChanged(consentCategories) {
26+
console.log('consentCatogories', consentCategories);
27+
if (siteConsent.getConsentFor(WcpConsent.consentCategories.Analytics)) {
28+
// add analytics
29+
var config = {
30+
autoCapture: {
31+
lineage: true
32+
},
33+
coreData: {
34+
appId: 'JS:GraphToolkit'
35+
}
36+
};
37+
awa.init(config);
938
}
10-
};
11-
awa.init(config);
39+
}
1240
</script>
13-
<link rel="shortcut icon" type="image/png" href="/favicon.png" />
41+
42+
<style>
43+
#root > div:first-of-type {
44+
height: calc(100% - 40px);
45+
}
46+
47+
.storybook-footer {
48+
position: absolute;
49+
bottom: 0;
50+
font-size: 11px;
51+
padding: 10px;
52+
width: 100%;
53+
text-align: center;
54+
z-index: 9999;
55+
background-color: #f2f2f2;
56+
}
57+
58+
.storybook-footer a {
59+
color: #616161;
60+
}
61+
62+
.storybook-footer a:hover {
63+
color: #323232;
64+
}
65+
66+
@media (max-width: 768px) {
67+
#root > div:first-of-type {
68+
height: calc(100% - 50px);
69+
}
70+
}
71+
</style>

0 commit comments

Comments
 (0)