Added modal for mobile automatically open in iframe

This commit is contained in:
Kasper Rynning-Tønnesen
2018-09-23 21:30:13 +02:00
parent 1fef8a9831
commit 58e5def473
3 changed files with 13 additions and 4 deletions

View File

@@ -3352,6 +3352,10 @@ nav ul li:hover, nav ul li.active {
margin-top: auto !important;
}
#channel-share-modal {
width: 100%;
}
#autocomplete-input {
width: 100%;
border-bottom: 1px solid #9e9e9e !important;

View File

@@ -207,9 +207,14 @@ var Channel = {
if(!client) {
if(!Helper.mobilecheck()) {
var shareCodeUrl = window.location.protocol + "//client."+window.location.hostname+"/r/"+btoa(encodeURIComponent(chan.toLowerCase()));
document.getElementById("share-join-qr").setAttribute("src", "https://chart.googleapis.com/chart?chs=221x221&cht=qr&choe=UTF-8&chld=L|1&chl="+shareCodeUrl);
Helper.setHtml("#channel-name-join", "client." + window.location.hostname + "/" + encodeURIComponent(chan.toLowerCase()));
} else if(small_player) {
document.querySelector("#channel-share-modal .modal-content").innerHTML = "<p>To listen to this channel, go to</p><p>https://zoff.me/" + encodeURIComponent(chan.toLowerCase()) + "</p><img src='/assets/images/favicon.png' height='100' width='100' alt='circle-logo-zoff'>";
M.Modal.getInstance(document.getElementById("channel-share-modal")).open();
}
} else {
Helper.removeElement(".video-container");
Helper.removeElement(".offline-panel");

View File

@@ -1236,7 +1236,7 @@ function before_toast(){
}
function addJoinBox() {
document.querySelector("#video-container").insertAdjacentHTML("beforeend", '<a href="https://zoff.me" target="_blank"><div class="addedJoinBox">Listen directly on https://zoff.me</div></a>');
document.querySelector("#video-container").insertAdjacentHTML("beforeend", '<a href="https://zoff.me" target="_blank"><div class="addedJoinBox">Listen directly on https://zoff.me<br>&copy; KasperRT &amp; Nixo</div></a>');
}
function scrollChat() {