Fewer channels on frontpage, fixed clearing channels on full round, working input for channel search on mobile webapp

This commit is contained in:
Kasper Rynning-Tønnesen
2016-02-02 17:02:30 +01:00
parent 8fb9c3a3d6
commit 3fc027a2e8
6 changed files with 25 additions and 19 deletions

View File

@@ -112,12 +112,12 @@ if(isset($_GET['chan'])){
</div> </div>
<div class="section mobile-search"> <div class="section mobile-search">
<form class="row" id="base" method="get"> <form class="row" id="base" method="get" onsubmit="return false;">
<div class="input-field col s12"> <div class="input-field col s12">
<input <input
class="input-field" class="input-field"
type="text" type="text"
id="search" id="search-mobile"
name="chan" name="chan"
title="Type channel name here to create or listen to a channel. Only alphanumerical chars. [a-zA-Z0-9]+" title="Type channel name here to create or listen to a channel. Only alphanumerical chars. [a-zA-Z0-9]+"
autocomplete="off" autocomplete="off"
@@ -127,7 +127,7 @@ if(isset($_GET['chan'])){
maxlength="18" maxlength="18"
data-length="18" data-length="18"
/> />
<label for="search" class="noselect">Find or create radio channel</label> <label for="search-mobile" class="noselect">Find or create radio channel</label>
<datalist id="searches"> <datalist id="searches">
</datalist> </datalist>
</div> </div>

View File

@@ -99,12 +99,12 @@
</div> </div>
<div class="section mobile-search"> <div class="section mobile-search">
<form class="row" id="base" method="get"> <form class="row" id="base" method="get" onsubmit="return false;">
<div class="input-field col s12"> <div class="input-field col s12">
<input <input
class="input-field" class="input-field"
type="text" type="text"
id="search" id="search-mobile"
name="chan" name="chan"
title="Type channel name here to create or listen to a channel. Only alphanumerical chars. [a-zA-Z0-9]+" title="Type channel name here to create or listen to a channel. Only alphanumerical chars. [a-zA-Z0-9]+"
autocomplete="off" autocomplete="off"
@@ -114,7 +114,7 @@
maxlength="18" maxlength="18"
data-length="18" data-length="18"
/> />
<label for="search" class="noselect">Find or create radio channel</label> <label for="search-mobile" class="noselect">Find or create radio channel</label>
<datalist id="searches"> <datalist id="searches">
</datalist> </datalist>
</div> </div>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -53,7 +53,7 @@ var Nochan = {
{ {
var chan = lists[x][3]; var chan = lists[x][3];
if(num<16) if(num<12)
{ {
var id = lists[x][1]; var id = lists[x][1];
var viewers = lists[x][0]; var viewers = lists[x][0];
@@ -171,7 +171,7 @@ var Nochan = {
} }
setTimeout(function(){ setTimeout(function(){
if(Nochan.times_rotated == 50 && frontpage){ if(Nochan.times_rotated == 2 && frontpage){
Nochan.times_rotated = 0; Nochan.times_rotated = 0;
socket.emit("frontpage_lists"); socket.emit("frontpage_lists");
}else if(frontpage){ }else if(frontpage){
@@ -270,12 +270,19 @@ String.prototype.capitalizeFirstLetter = function() {
$().ready(initfp); $().ready(initfp);
function initfp(){ function initfp(){
channel_list = $("#channel-list-container").html();
var connection_options = {
'secure': true,
'force new connection': true
};
if(window.location.hostname == "zoff.no") add = "https://zoff.no"; if(window.location.hostname == "zoff.no") add = "https://zoff.no";
else add = "localhost"; else add = "localhost";
socket = io.connect(''+add+':8880', connection_options); socket = io.connect(''+add+':8880', connection_options);
socket.emit('frontpage_lists'); socket.emit('frontpage_lists');
socket.on('playlists', function(msg){ socket.on('playlists', function(msg){
$("#channels").empty();
Nochan.populate_channels(msg.channels); Nochan.populate_channels(msg.channels);
@@ -289,15 +296,8 @@ function initfp(){
window.location.hash = "#"; window.location.hash = "#";
$('#donation').openModal() $('#donation').openModal()
} }
channel_list = $("#channel-list-container").html();
//window.channel_list = channel_list; //window.channel_list = channel_list;
$("#channels").empty();
var connection_options = {
'secure': true,
'force new connection': true
};
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);
@@ -381,3 +381,9 @@ $(document).on('click', '#cookieok', function() {
return false; return false;
}); });
$(document).on("submit", "#base", function(e){
e.preventDefault();
Nochan.to_channel($("#search-mobile").val());
return false;
});