add support for iframe embedding

This commit is contained in:
Tomáš Mládek 2018-10-17 17:44:04 +02:00
parent 9157e916d7
commit eecec447f7
4 changed files with 24 additions and 0 deletions

View file

@ -37,3 +37,11 @@ function nl2br(str, is_xhtml) {
function scrollWindowDown() {
window.scrollTo(0, document.body.scrollHeight)
}
function inIframe() {
try {
return window.self !== window.top;
} catch (e) {
return true;
}
}

View file

@ -16,6 +16,9 @@
<input type="text" name="name" placeholder="name" minLength="3" maxLength="20" class="modal__form-input">
<input type="submit" value="»" class="modal__form-submit">
</form>
<div class="modal__info_url">
to only see chat, go <a href="https://live.sdbs.cz/sermon" target="_top">https://live.sdbs.cz/sermon</a>
</div>
</div>
<?php } ?>

View file

@ -135,6 +135,15 @@ body {
background: none;
}
.modal__info_url {
text-align: center;
visibility: hidden;
}
.modal__info_url a {
color: white;
}
@media (max-width: 640px) {
.chat {
padding: 10px 10px 50px 10px;

View file

@ -110,3 +110,7 @@ getMessages()
setInterval(function () {
getMessages()
}, 2000)
if (inIframe()) {
document.querySelector('.modal__info_url').style.visibility = 'visible';
}