mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
Added listeners on frontpage
This commit is contained in:
@@ -17,6 +17,7 @@ if(isset($_GET['chan'])){
|
|||||||
<a href="#" class="brand-logo hide-on-small-only noselect">
|
<a href="#" class="brand-logo hide-on-small-only noselect">
|
||||||
<img id="zicon" src="static/images/squareicon_small.png" alt="zöff" title="Zöff" />
|
<img id="zicon" src="static/images/squareicon_small.png" alt="zöff" title="Zöff" />
|
||||||
</a>
|
</a>
|
||||||
|
<span id="frontpage-viewer-counter" class="hide-on-small-only noselect" title="Divided among all channels. Hidden or not"></span>
|
||||||
<a href="//zoff.no" class="brand-logo brand-mobile hide-on-med-and-up">Zöff</a>
|
<a href="//zoff.no" class="brand-logo brand-mobile hide-on-med-and-up">Zöff</a>
|
||||||
<ul id="nav-mobile" class="right hide-on-med-and-down">
|
<ul id="nav-mobile" class="right hide-on-med-and-down">
|
||||||
<li><a class="modal-trigger waves-effect waves-red" title="Need help with the site?" onclick="$('#help').openModal()">Help</a></li>
|
<li><a class="modal-trigger waves-effect waves-red" title="Need help with the site?" onclick="$('#help').openModal()">Help</a></li>
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
<a href="#" class="brand-logo hide-on-small-only noselect">
|
<a href="#" class="brand-logo hide-on-small-only noselect">
|
||||||
<img id="zicon" src="static/images/squareicon_small.png" alt="zöff" title="Zöff" />
|
<img id="zicon" src="static/images/squareicon_small.png" alt="zöff" title="Zöff" />
|
||||||
</a>
|
</a>
|
||||||
|
<span id="frontpage-viewer-counter" class="hide-on-small-only noselect" title="Divided among all channels. Hidden or not"></span>
|
||||||
<a href="//zoff.no" class="brand-logo brand-mobile hide-on-med-and-up">Zöff</a>
|
<a href="//zoff.no" class="brand-logo brand-mobile hide-on-med-and-up">Zöff</a>
|
||||||
<ul id="nav-mobile" class="right hide-on-med-and-down">
|
<ul id="nav-mobile" class="right hide-on-med-and-down">
|
||||||
<li><a class="modal-trigger waves-effect waves-red" title="Need help with the site?" onclick="$('#help').openModal()">Help</a></li>
|
<li><a class="modal-trigger waves-effect waves-red" title="Need help with the site?" onclick="$('#help').openModal()">Help</a></li>
|
||||||
|
|||||||
@@ -20,6 +20,12 @@
|
|||||||
display:none;
|
display:none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#frontpage-viewer-counter{
|
||||||
|
position: absolute;
|
||||||
|
top: 0px;
|
||||||
|
left: 125px;
|
||||||
|
}
|
||||||
|
|
||||||
#toast-container{
|
#toast-container{
|
||||||
left:2% !important;
|
left:2% !important;
|
||||||
cursor:pointer;
|
cursor:pointer;
|
||||||
|
|||||||
2
static/dist/embed.min.js
vendored
2
static/dist/embed.min.js
vendored
File diff suppressed because one or more lines are too long
2
static/dist/frontpage.min.js
vendored
Normal file → Executable file
2
static/dist/frontpage.min.js
vendored
Normal file → Executable file
File diff suppressed because one or more lines are too long
4
static/dist/main.min.js
vendored
4
static/dist/main.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -91,7 +91,6 @@ var Admin = {
|
|||||||
|
|
||||||
socket.on("conf", function(msg)
|
socket.on("conf", function(msg)
|
||||||
{
|
{
|
||||||
|
|
||||||
Crypt.init();
|
Crypt.init();
|
||||||
Admin.set_conf(msg[0]);
|
Admin.set_conf(msg[0]);
|
||||||
if(Crypt.get_pass(chan.toLowerCase()) !== undefined && Admin.beginning && Crypt.get_pass(chan.toLowerCase()) != ""){
|
if(Crypt.get_pass(chan.toLowerCase()) !== undefined && Admin.beginning && Crypt.get_pass(chan.toLowerCase()) != ""){
|
||||||
|
|||||||
@@ -30,6 +30,8 @@ var Nochan = {
|
|||||||
|
|
||||||
winter: false,
|
winter: false,
|
||||||
|
|
||||||
|
times_rotated: 0,
|
||||||
|
|
||||||
populate_channels: function(lists)
|
populate_channels: function(lists)
|
||||||
{
|
{
|
||||||
var output = "";
|
var output = "";
|
||||||
@@ -169,7 +171,12 @@ var Nochan = {
|
|||||||
|
|
||||||
}
|
}
|
||||||
setTimeout(function(){
|
setTimeout(function(){
|
||||||
if(frontpage) Nochan.add_backdrop(list, i+1);
|
if(Nochan.times_rotated == 2 && frontpage){
|
||||||
|
socket.emit("frontpage_lists");
|
||||||
|
}else if(frontpage){
|
||||||
|
Nochan.times_rotated += 1;
|
||||||
|
Nochan.add_backdrop(list, i+1);
|
||||||
|
}
|
||||||
},6000);
|
},6000);
|
||||||
|
|
||||||
},
|
},
|
||||||
@@ -201,6 +208,13 @@ var Nochan = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
set_viewers: function(viewers){
|
||||||
|
if(viewers > 0){
|
||||||
|
var to_add = viewers > 1 ? "listeners" : "listener";
|
||||||
|
$("#frontpage-viewer-counter").html(viewers + " " + to_add);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
to_channel: function(chan, popstate){
|
to_channel: function(chan, popstate){
|
||||||
|
|
||||||
$("#channel-load").css("display", "block");
|
$("#channel-load").css("display", "block");
|
||||||
@@ -256,6 +270,17 @@ $().ready(initfp);
|
|||||||
|
|
||||||
function initfp(){
|
function initfp(){
|
||||||
|
|
||||||
|
if(window.location.hostname == "zoff.no") add = "https://zoff.no";
|
||||||
|
else add = "localhost";
|
||||||
|
socket = io.connect(''+add+':8880', connection_options);
|
||||||
|
socket.emit('frontpage_lists');
|
||||||
|
socket.on('playlists', function(msg){
|
||||||
|
|
||||||
|
Nochan.populate_channels(msg.channels);
|
||||||
|
|
||||||
|
Nochan.set_viewers(msg.viewers);
|
||||||
|
});
|
||||||
|
|
||||||
$("#channel-load").css("display", "none");
|
$("#channel-load").css("display", "none");
|
||||||
//Materialize.toast("<a href='/remote' style='color:white;'>Try out our new feature, remote!</a>", 8000)
|
//Materialize.toast("<a href='/remote' style='color:white;'>Try out our new feature, remote!</a>", 8000)
|
||||||
if(window.location.hash == "#donation")
|
if(window.location.hash == "#donation")
|
||||||
@@ -273,14 +298,6 @@ function initfp(){
|
|||||||
'force new connection': true
|
'force new connection': true
|
||||||
};
|
};
|
||||||
|
|
||||||
if(window.location.hostname == "zoff.no") add = "https://zoff.no";
|
|
||||||
else add = "localhost";
|
|
||||||
socket = io.connect(''+add+':8880', connection_options);
|
|
||||||
socket.emit('frontpage_lists');
|
|
||||||
socket.on('playlists', function(msg){
|
|
||||||
Nochan.populate_channels(msg);
|
|
||||||
});
|
|
||||||
|
|
||||||
if(!localStorage["ok_cookie"])
|
if(!localStorage["ok_cookie"])
|
||||||
Materialize.toast("We're using cookies to enhance your experience! <a class='waves-effect waves-light btn light-green' href='#ok' id='cookieok' style='cursor:pointer;pointer-events:all;'> ok</a>", 10000);
|
Materialize.toast("We're using cookies to enhance your experience! <a class='waves-effect waves-light btn light-green' href='#ok' id='cookieok' style='cursor:pointer;pointer-events:all;'> ok</a>", 10000);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user