mirror of
https://github.com/netz39/www.netz39.de.git
synced 2025-01-18 20:10:12 +01:00
Add iCal-Feed link
This commit is contained in:
parent
e3847ce2d2
commit
274b11d4f9
1 changed files with 30 additions and 0 deletions
|
@ -38,5 +38,35 @@ icon: "far fa-calendar"
|
|||
</head>
|
||||
<body>
|
||||
<div id='calendar' style="width:95%; margin: auto;"></div>
|
||||
<div style="display: flex; flex-direction: column; justify-content: center; align-items: center; border: 1px">
|
||||
<div style="display: flex; align-items: center; margin-top: 50px">
|
||||
<p>iCal-Feed:
|
||||
<code id="icalFeedUrl" style="box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.1); font-family: monospace;"></code>
|
||||
</p>
|
||||
<a id="copyButton" class="button" style="margin-left: 10px; margin-top: 0px">
|
||||
<i class="fas fa-copy" title="In Zwischenablage kopieren"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
const ICAL_FEED_URL = "{{site.url}}/feed/eo-events/events.ics";
|
||||
|
||||
// set text in HTML element "icalFeedUrl" to the URL
|
||||
document.getElementById("icalFeedUrl").textContent = ICAL_FEED_URL;
|
||||
|
||||
const copyButton = document.getElementById('copyButton');
|
||||
const urlToCopy = ICAL_FEED_URL;
|
||||
|
||||
copyButton.addEventListener('click', () => {
|
||||
const tempInput = document.createElement('input');
|
||||
tempInput.value = urlToCopy;
|
||||
document.body.appendChild(tempInput);
|
||||
tempInput.select();
|
||||
document.execCommand('copy');
|
||||
document.body.removeChild(tempInput);
|
||||
alert('URL wurde in die Zwischenablage kopiert!');
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
Loading…
Reference in a new issue