Created
August 8, 2021 16:10
-
-
Save RedfinDiver/730baae7f9ffd680dadc8a25199483d6 to your computer and use it in GitHub Desktop.
This is a html/javasript snippet to embedd a google calender only with user consent
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="gcal"> | |
<p id="consent_text"><i> Beim Klick auf den Button "Kalender zeigen" wird ein eingebetter Kalender von Google geladen. Sie erklären sich damit mit der <a href="https://policies.google.com/privacy/update?hl=de" target="_blank" rel="noopener">Google Datenschutzerklärung</a> einverstanden und stimmen dieser explizit zu.</i></p> | |
<button id="consent_button" class="btn btn-primary" style="margin-top: 20px;" onclick="show_cal()">Kalender zeigen</button> | |
</div> | |
<script type="text/javascript"> | |
function show_cal() { | |
var cal_div = document.getElementById('gcal'); | |
var button = document.getElementById('consent_button'); | |
var consent_text = document.getElementById('consent_text'); | |
var cal = '<iframe src="https://calendar.google.com/calendar/embed?height=600&wkst=1&bgcolor=%23ffffff&ctz=Europe%2FVienna&src=Nm00M20zNXJvbjh2cTJjZDZqNWhndDNrdHNAZ3JvdXAuY2FsZW5kYXIuZ29vZ2xlLmNvbQ&color=%23D50000" style="border:solid 1px #777" width="800" height="600" frameborder="0" scrolling="no"></iframe>'; | |
cal_div.removeChild(button); | |
cal_div.removeChild(consent_text); | |
cal_div.innerHTML = cal; | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment