2022-01-09 14:19:32 +01:00
|
|
|
function generateHtml() {
|
2022-01-09 15:48:09 +01:00
|
|
|
if (
|
|
|
|
document.querySelector("#episode_name").value &&
|
|
|
|
document.querySelector("#funkwhale").value &&
|
|
|
|
document.querySelector("#peertube").value &&
|
|
|
|
document.querySelector("#youtube").value
|
|
|
|
) {
|
|
|
|
let funkwhale_id;
|
|
|
|
let peertube_id;
|
|
|
|
try {
|
|
|
|
funkwhale_id = document
|
|
|
|
.querySelector("#funkwhale")
|
|
|
|
.value.split("/tracks/")[1];
|
|
|
|
} catch (error) {
|
|
|
|
alert("Podaj prawidłową wartością dla funkwhale");
|
|
|
|
}
|
2022-01-09 14:19:32 +01:00
|
|
|
|
2022-01-09 15:48:09 +01:00
|
|
|
try {
|
|
|
|
peertube_id = document
|
|
|
|
.querySelector("#peertube")
|
|
|
|
.value.split("/w/")[1];
|
|
|
|
} catch (error) {
|
|
|
|
alert("Podaj prawidłową wartością dla peertube");
|
|
|
|
}
|
2022-01-09 14:19:32 +01:00
|
|
|
|
2022-01-09 15:48:09 +01:00
|
|
|
const html = `<div class="player">
|
2022-01-09 14:19:32 +01:00
|
|
|
<iframe
|
|
|
|
scrolling="no"
|
|
|
|
src="https://podcast.midline.pl/front/embed.html?type=track&id=${funkwhale_id}"
|
|
|
|
width="100%"
|
|
|
|
height="160"
|
|
|
|
frameborder="no"
|
|
|
|
></iframe>
|
|
|
|
</div>
|
|
|
|
<div class="player">
|
|
|
|
<iframe
|
|
|
|
sandbox="allow-same-origin allow-scripts"
|
|
|
|
src="https://video.internet-czas-dzialac.pl/videos/embed/${peertube_id}"
|
|
|
|
allowfullscreen=""
|
|
|
|
width="100%"
|
|
|
|
height="394"
|
|
|
|
frameborder="0"
|
|
|
|
></iframe>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="podcast-logos audio-logos">
|
|
|
|
<a
|
|
|
|
title="Link do naszego podcastowego RSSa"
|
|
|
|
alt="Logo RSS"
|
|
|
|
href="https://podcast.midline.pl/feed.xml"
|
|
|
|
>
|
|
|
|
<img
|
|
|
|
class="logo"
|
|
|
|
height="32"
|
|
|
|
width="32"
|
|
|
|
src="https://assets.midline.pl/logos/light/rss.svg"
|
|
|
|
/>
|
|
|
|
</a>
|
|
|
|
<a
|
2022-01-09 15:54:48 +01:00
|
|
|
title="${document.querySelector("#episode_name").value} w naszej instancji Funkwhale."
|
2022-01-09 14:19:32 +01:00
|
|
|
alt="Logo Funkwhale"
|
|
|
|
href="https://podcast.midline.pl/library/tracks/${funkwhale_id}"
|
|
|
|
>
|
|
|
|
<img
|
|
|
|
class="logo"
|
|
|
|
style="--dark-image: url('https://assets.midline.pl/logos/dark/funkwhale.svg')"
|
|
|
|
src="https://assets.midline.pl/logos/light/funkwhale.svg"
|
|
|
|
height="32"
|
|
|
|
width="32"
|
|
|
|
/>
|
|
|
|
</a>
|
|
|
|
<a
|
|
|
|
title="Podcast 'Internet. Czas działać!' w aplikacji AntennaPod."
|
|
|
|
alt="Logo AntennaPod"
|
|
|
|
href="https://antennapod.org/"
|
|
|
|
>
|
|
|
|
<img
|
|
|
|
class="logo"
|
|
|
|
height="32"
|
|
|
|
width="32"
|
|
|
|
src="https://assets.midline.pl/logos/light/antennapod.svg"
|
|
|
|
/>
|
|
|
|
</a>
|
|
|
|
<a
|
|
|
|
title="Podcast 'Internet. Czas działać!' w aplikacji Patronite Audio."
|
|
|
|
alt="Logo Patronite Audio"
|
|
|
|
href="https://patronite.pl/patrocast/podcasts/f2eaf21a-8c3e-4e7f-93e1-c11868afa5f0/details"
|
|
|
|
>
|
|
|
|
<img
|
|
|
|
class="logo"
|
|
|
|
src="https://assets.midline.pl/logos/light/patronite-audio.svg"
|
|
|
|
height="32"
|
|
|
|
width="32"
|
|
|
|
/>
|
|
|
|
</a>
|
|
|
|
<a
|
|
|
|
title="Podcast 'Internet. Czas działać!' w serwisie Spotify."
|
|
|
|
alt="Logo Spotify"
|
|
|
|
href="https://open.spotify.com/show/2BSREI0uQcADS8W0RHrkxB"
|
|
|
|
>
|
|
|
|
<img
|
|
|
|
class="logo"
|
|
|
|
style="--dark-image: url('https://assets.midline.pl/logos/dark/spotify.svg')"
|
|
|
|
src="https://assets.midline.pl/logos/light/spotify.svg"
|
|
|
|
height="48"
|
|
|
|
/>
|
|
|
|
</a>
|
|
|
|
<a
|
|
|
|
title="Podcast 'Internet. Czas działać!' w serwisie Apple Podcasts."
|
|
|
|
alt="Logo Apple Podcasts"
|
|
|
|
href="https://podcasts.apple.com/pl/podcast/internet-czas-dzia%C5%82a%C4%87/id1536929719"
|
|
|
|
>
|
|
|
|
<img
|
|
|
|
class="logo"
|
|
|
|
src="https://assets.midline.pl/logos/light/apple-podcasts.svg"
|
|
|
|
height="48"
|
|
|
|
/>
|
|
|
|
</a>
|
|
|
|
<a
|
|
|
|
title="Podcast 'Internet. Czas działać!' w serwisie Google Podcasts."
|
|
|
|
alt="Logo Podcasty Google"
|
|
|
|
href="https://podcasts.google.com/feed/aHR0cHM6Ly9wb2RjYXN0Lm1pZGxpbmUucGwvZmVlZC54bWw?sa=X&ved=0CAUQrrcFahcKEwiYtdDr7__sAhUAAAAAHQAAAAAQAQ"
|
|
|
|
>
|
|
|
|
<img
|
|
|
|
class="logo"
|
|
|
|
src="https://assets.midline.pl/logos/light/google-podcasts.svg"
|
|
|
|
height="48"
|
|
|
|
/>
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
<div class="podcast-logos video-logos">
|
|
|
|
<a
|
2022-01-09 15:54:48 +01:00
|
|
|
title="${document.querySelector("#episode_name").value} w serwisie PeerTube."
|
2022-01-09 14:19:32 +01:00
|
|
|
alt="Logo PeerTube"
|
|
|
|
href="https://video.internet-czas-dzialac.pl/videos/watch/${peertube_id}"
|
|
|
|
>
|
|
|
|
<img
|
|
|
|
class="logo"
|
|
|
|
style="--dark-image: url('https://assets.midline.pl/logos/dark/peertube.svg')"
|
|
|
|
src="https://assets.midline.pl/logos/light/peertube.svg"
|
|
|
|
height="48"
|
|
|
|
/>
|
|
|
|
</a>
|
|
|
|
<a
|
2022-01-09 15:48:09 +01:00
|
|
|
title="${document.querySelector("#odysee").value
|
2022-01-09 16:06:32 +01:00
|
|
|
? `${document.querySelector("#episode_name").value} w serwisie Odysee`
|
2022-01-09 15:48:09 +01:00
|
|
|
: `Kanał 'Internet. Czas działać!' w serwisie Odysee.`}"
|
2022-01-09 14:19:32 +01:00
|
|
|
alt="Logo Odysee"
|
2022-01-09 15:48:09 +01:00
|
|
|
href="${document.querySelector("#odysee").value
|
|
|
|
? document.querySelector("#odysee").value
|
|
|
|
: 'https://odysee.com/@internetczasdzialac'}"
|
2022-01-09 14:19:32 +01:00
|
|
|
>
|
|
|
|
<img
|
|
|
|
class="logo"
|
|
|
|
src="https://assets.midline.pl/logos/light/odysee.svg"
|
|
|
|
style="--dark-image: url('https://assets.midline.pl/logos/dark/odysee.svg')"
|
|
|
|
height="48"
|
|
|
|
/>
|
|
|
|
</a>
|
|
|
|
<a
|
2022-01-09 15:54:48 +01:00
|
|
|
title="${document.querySelector("#episode_name").value} w serwisie YouTube."
|
2022-01-09 14:19:32 +01:00
|
|
|
alt="Logo YouTube"
|
2022-01-09 15:39:07 +01:00
|
|
|
href="${document.querySelector("#youtube").value}"
|
2022-01-09 14:19:32 +01:00
|
|
|
>
|
|
|
|
<img
|
|
|
|
class="logo"
|
|
|
|
src="https://assets.midline.pl/logos/light/youtube.svg"
|
|
|
|
style="--dark-image: url('https://assets.midline.pl/logos/dark/youtube.svg')"
|
|
|
|
height="48"
|
|
|
|
/>
|
|
|
|
</a>
|
|
|
|
|
|
|
|
</div>`;
|
2022-01-09 15:48:09 +01:00
|
|
|
console.log(html);
|
|
|
|
document.querySelector("textarea").value = html;
|
|
|
|
document.querySelector(".preview").innerHTML = html;
|
|
|
|
}
|
2022-01-09 14:19:32 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
function copyHtml() {
|
2022-01-09 15:48:09 +01:00
|
|
|
navigator.clipboard.writeText(document.querySelector("textarea").value);
|
2022-01-09 14:19:32 +01:00
|
|
|
}
|
|
|
|
|