add support for iframe embedding
This commit is contained in:
parent
9157e916d7
commit
eecec447f7
4 changed files with 24 additions and 0 deletions
|
@ -36,4 +36,12 @@ 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;
|
||||
}
|
||||
}
|
|
@ -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 } ?>
|
||||
|
||||
|
|
9
main.css
9
main.css
|
@ -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;
|
||||
|
|
4
main.js
4
main.js
|
@ -110,3 +110,7 @@ getMessages()
|
|||
setInterval(function () {
|
||||
getMessages()
|
||||
}, 2000)
|
||||
|
||||
if (inIframe()) {
|
||||
document.querySelector('.modal__info_url').style.visibility = 'visible';
|
||||
}
|
Loading…
Reference in a new issue