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

View File

@@ -15,7 +15,7 @@ gulp.task('js', function () {
}); });
gulp.task('embed', function () { gulp.task('embed', function () {
gulp.src(['public/js/player.js', 'public/js/helpers.js', 'public/js/playercontrols.js', 'public/js/list.js', 'public/js/embed.js', '!public/js/nochan*', '!public/js/remotecontroller.js']) gulp.src(['public/js/player.js', 'public/js/helpers.js', 'public/js/playercontrols.js', 'public/js/list.js', 'public/js/embed.js', '!public/js/frontpage*', '!public/js/remotecontroller.js'])
.pipe(uglify({ .pipe(uglify({
mangle: true, mangle: true,
compress: true, compress: true,

View File

@@ -3,6 +3,6 @@
$guid=substr(base64_encode(crc32($_SERVER['HTTP_USER_AGENT'].$_SERVER['REMOTE_ADDR'].$_SERVER['HTTP_ACCEPT_LANGUAGE'])), 0, 8); $guid=substr(base64_encode(crc32($_SERVER['HTTP_USER_AGENT'].$_SERVER['REMOTE_ADDR'].$_SERVER['HTTP_ACCEPT_LANGUAGE'])), 0, 8);
if(isset($_GET['chan'])) {header('Location: '.$_GET['chan']); exit;} if(isset($_GET['chan'])) {header('Location: '.$_GET['chan']); exit;}
$list = explode("/", htmlspecialchars(strtolower($_SERVER["REQUEST_URI"]))); $list = explode("/", htmlspecialchars(strtolower($_SERVER["REQUEST_URI"])));
if($list[1]==""||!isset($list[1])||count($list)<=1){$list="";include('public/php/nochan.php');die();} if($list[1]==""||!isset($list[1])||count($list)<=1){$list="";include('public/php/frontpage.php');die();}
else{$list=preg_replace("/[^A-Za-z0-9 ]/", '', $list[1]);include('public/php/channel.php');die();} else{$list=preg_replace("/[^A-Za-z0-9 ]/", '', $list[1]);include('public/php/channel.php');die();}
?> ?>

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

View File

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

View File

@@ -13,8 +13,8 @@
</a> </a>
<a href="//zoff.no" class="brand-logo hide-on-med-and-up">Zöff</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"> <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="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-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="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> <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> <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="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="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-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="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> <li><a class="waves-effect waves-purple" href="https://github.com/zoff-music/">GitHub</a></li>