Changed nochan to frontpage, and made changes accordingly

This commit is contained in:
Kasper Rynning-Tønnesen
2017-01-23 12:26:05 +01:00
parent aa7ed10522
commit 211e29bcc4
8 changed files with 36 additions and 36 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -19,7 +19,7 @@ function getCookie(cname) {
}
*/
var Nochan = {
var Frontpage = {
blob_list: [],
@@ -37,9 +37,9 @@ var Nochan = {
Helper.log(msg);
Helper.log("------------");
Nochan.populate_channels(msg.channels);
Frontpage.populate_channels(msg.channels);
Nochan.set_viewers(msg.viewers);
Frontpage.set_viewers(msg.viewers);
},
populate_channels: function(lists)
@@ -50,7 +50,7 @@ var Nochan = {
if(lists[0].pinned == 1){
pinned = lists.shift();
}
lists.sort(Nochan.sortFunction);
lists.sort(Frontpage.sortFunction);
if(pinned !== undefined){
lists.unshift(pinned);
}
@@ -61,7 +61,7 @@ var Nochan = {
Helper.log("-------------");
if(!Helper.mobilecheck())
Nochan.add_backdrop(lists, 0);
Frontpage.add_backdrop(lists, 0);
for(var x in lists)
{
@@ -141,11 +141,11 @@ var Nochan = {
var id = list[i].id;
if(Nochan.blob_list[i] !== undefined){
if(Frontpage.blob_list[i] !== undefined){
//$(".room-namer").css("opacity", 0);
setTimeout(function(){
if(frontpage){
$("#mega-background").css("background", "url(data:image/png;base64,"+Nochan.blob_list[i]+")");
$("#mega-background").css("background", "url(data:image/png;base64,"+Frontpage.blob_list[i]+")");
$("#mega-background").css("background-size" , "200%");
$("#mega-background").css("opacity", 1);
$("#searchFrontpage").attr("placeholder", list[i].channel);
@@ -162,7 +162,7 @@ var Nochan = {
data: {id:id},
url: "/public/php/imageblob.php",
success: function(data){
Nochan.blob_list.push(data);
Frontpage.blob_list.push(data);
//data will contain the vote count echoed by the controller i.e.
//$(".room-namer").css("opacity", 0);
setTimeout(function(){
@@ -187,13 +187,13 @@ var Nochan = {
}
rotation_timeout = setTimeout(function(){
if(Nochan.times_rotated == 50 && frontpage){
Nochan.times_rotated = 0;
if(Frontpage.times_rotated == 50 && frontpage){
Frontpage.times_rotated = 0;
i = 0;
socket.emit("frontpage_lists");
}else if(frontpage){
Nochan.times_rotated += 1;
Nochan.add_backdrop(list, i+1);
Frontpage.times_rotated += 1;
Frontpage.add_backdrop(list, i+1);
}
},6000);
@@ -210,8 +210,8 @@ var Nochan = {
snow.style.left = x+"px";
snow.style.top = "0px";
parent.appendChild(snow);
Nochan.fall_snow(snow);
Nochan.start_snowfall();
Frontpage.fall_snow(snow);
Frontpage.start_snowfall();
}, 800);
},
@@ -219,7 +219,7 @@ var Nochan = {
corn.style.top = (parseInt(corn.style.top.replace("px", ""))+2)+"px";
if(parseInt(corn.style.top.replace("px", "")) < document.getElementById("mega-background").offsetHeight-2.5){
setTimeout(function(){
Nochan.fall_snow(corn);
Frontpage.fall_snow(corn);
},50);
}else{
corn.remove();
@@ -315,7 +315,7 @@ function share_link_modifier_frontpage(){
function initfp(){
var date = new Date();
Nochan.blob_list = [];
Frontpage.blob_list = [];
if(date.getMonth() == 3 && date.getDate() == 1){
$(".mega").css("-webkit-transform", "rotate(180deg)");
$(".mega").css("-moz-transform", "rotate(180deg)");
@@ -327,7 +327,7 @@ function initfp(){
var url_split = window.location.href.split("/");
if(url_split[3] !== "" && url_split[3].substring(0,1) != "#"){
Nochan.to_channel(url_split[3], true);
Frontpage.to_channel(url_split[3], true);
}
};
@@ -375,9 +375,9 @@ function initfp(){
window.location.href = 'http://etys.no';
});
if(!Helper.mobilecheck() && Nochan.winter) {
if(!Helper.mobilecheck() && Frontpage.winter) {
$(".mega").prepend('<div id="snow"></div>');
//Nochan.start_snowfall();
//Frontpage.start_snowfall();
}
window['__onGCastApiAvailable'] = function(loaded, errorInfo) {

View File

@@ -438,7 +438,7 @@ function setup_list_listener(){
function setup_playlist_listener(){
Helper.log("Setting up playlist_listener");
socket.on('playlists', Nochan.frontpage_function);
socket.on('playlists', Frontpage.frontpage_function);
}
function setup_host_initialization(){
@@ -636,25 +636,25 @@ $(document).on('input', '#color_embed', function(){
$(document).on('click', ".chan-link", function(e){
e.preventDefault();
Nochan.to_channel($(this).attr("href"), false);
Frontpage.to_channel($(this).attr("href"), false);
});
$(document).on("click", ".listen-button", function(e){
if($(".room-namer").val() === ""){
e.preventDefault();
Nochan.to_channel($(".room-namer").attr("placeholder"));
Frontpage.to_channel($(".room-namer").attr("placeholder"));
}
});
$(document).on("submit", ".channel-finder", function(e){
e.preventDefault();
Nochan.to_channel($(".room-namer").val());
Frontpage.to_channel($(".room-namer").val());
return false;
});
$(document).on("submit", ".channel-finder-mobile", function(e){
e.preventDefault();
Nochan.to_channel($("#search-mobile").val());
Frontpage.to_channel($("#search-mobile").val());
return false;
});
@@ -1033,7 +1033,7 @@ $(document).on("click", ".brand-logo-navigate", function(e){
});
$(document).on("click", "#player_bottom_overlay", function(){
Nochan.to_channel(chan.toLowerCase(), false);
Frontpage.to_channel(chan.toLowerCase(), false);
});
$(document).on("mousemove", "#playlist", function(e)
@@ -1160,7 +1160,7 @@ function onepage_load(){
$("#embed-button").css("display", "none");
$.ajax({
url: "public/php/nochan.php",
url: "public/php/frontpage.php",
success: function(e){
if(Helper.mobilecheck()) {

View File

@@ -13,8 +13,8 @@
</a>
<a href="//zoff.no" class="brand-logo hide-on-med-and-up">Zöff</a>
<ul id="nav-mobile" class="right hide-on-med-and-down">
<li><a class="waves-effect waves-green" title="Remote control a Zöff player" href="https://remote.zoff.no">Remote</a></li>
<li><a class="modal-trigger waves-effect waves-red" title="Need help with the site?" onclick="$('#help').openModal()">Help</a></li>
<li><a class="waves-effect green" title="Remote control a Zöff player" href="https://remote.zoff.no">Remote</a></li>
<li><a class="modal-trigger waves-effect waves-orange" onclick="$('#about').openModal()">About</a></li>
<li><a class="modal-trigger waves-effect waves-yellow" onclick="$('#legal').openModal()">Legal</a></li>
<li><a class="waves-effect waves-purple" href="https://github.com/zoff-music/">GitHub</a></li>

View File

@@ -22,8 +22,8 @@ if(isset($_GET['chan'])){
<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>-->
<ul id="nav-mobile" class="right hide-on-med-and-down">
<li><a class="waves-effect waves-green" title="Remote control a Zöff player" href="https://remote.zoff.no">Remote</a></li>
<li><a class="modal-trigger waves-effect waves-red" title="Need help with the site?" onclick="$('#help').openModal()">Help</a></li>
<li><a class="waves-effect green" title="Remote control a Zöff player" href="https://remote.zoff.no">Remote</a></li>
<li><a class="modal-trigger waves-effect waves-orange" onclick="$('#about').openModal()">About</a></li>
<li><a class="modal-trigger waves-effect waves-yellow" onclick="$('#legal').openModal()">Legal</a></li>
<li><a class="waves-effect waves-purple" href="https://github.com/zoff-music/">GitHub</a></li>