mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
Merge branch 'dev' of github.com:nixolas1/Zoff into dev
Conflicts: static/js/search.js
This commit is contained in:
@@ -138,7 +138,7 @@ io.on('connection', function(socket){
|
||||
}else
|
||||
{
|
||||
console.log(np[0]["title"] + " before if");
|
||||
if(startTime+np[0]["duration"]<=get_time()+2)
|
||||
if(startTime+parseInt(np[0]["duration"])<=get_time()+2)
|
||||
{
|
||||
console.log(np[0]["title"] + " after if");
|
||||
db.collection(coll).update({now_playing:true, id:id},
|
||||
@@ -197,7 +197,7 @@ io.on('connection', function(socket){
|
||||
var id = arr[0];
|
||||
var title = arr[1];
|
||||
var hash = hash_pass(arr[2]);
|
||||
var duration = arr[3];
|
||||
var duration = parseInt(arr[3]);
|
||||
db.collection(coll).find({views:{$exists:true}}, function(err, docs)
|
||||
{
|
||||
if((docs[0]["addsongs"] == true && (hash == docs[0]["adminpass"] || docs[0]["adminpass"] == "")) || docs[0]["addsongs"] == false)
|
||||
@@ -214,7 +214,6 @@ io.on('connection', function(socket){
|
||||
np = false;
|
||||
db.collection(coll).insert({"added":get_time(),"guids":guids,"id":id,"now_playing":np,"title":title,"votes":votes, "duration":duration}, function(err, docs){
|
||||
sort_list(coll, undefined, np, true);
|
||||
socket.emit("toast", "addedsong");
|
||||
});
|
||||
});
|
||||
}else{
|
||||
@@ -437,7 +436,7 @@ io.on('connection', function(socket){
|
||||
lists[coll].push(guid);
|
||||
io.sockets.emit(coll+",viewers", lists[coll].length);
|
||||
}
|
||||
|
||||
|
||||
send_play(coll, socket);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -28,7 +28,7 @@ socket.on("skipping", function(obj)
|
||||
|
||||
function populate_list(msg, conf_only)
|
||||
{
|
||||
console.log(msg);
|
||||
//console.log(msg);
|
||||
console.log(conf_only);
|
||||
if(!conf_only)
|
||||
$("#wrapper").empty();
|
||||
@@ -84,7 +84,7 @@ function populate_list(msg, conf_only)
|
||||
{
|
||||
player_name = "#jplayer";
|
||||
}else player_name = "#player";
|
||||
|
||||
|
||||
if(scroller === false)
|
||||
{
|
||||
myScroll = new IScroll('#playlist', {
|
||||
|
||||
@@ -21,10 +21,22 @@ $(document).ready(function()
|
||||
}
|
||||
});
|
||||
|
||||
$("body").keyup(function(event) {
|
||||
if(event.keyCode == 27){
|
||||
$("#results").html("");
|
||||
$(".main").removeClass("blurT");
|
||||
$("#controls").removeClass("blurT");
|
||||
$(".main").removeClass("clickthrough");
|
||||
if(!contains($("#search-wrapper").attr("class").split(" "), "hide"))
|
||||
$("#search-wrapper").toggleClass("hide");
|
||||
if(contains($("#song-title").attr("class").split(" "), "hide"))
|
||||
$("#song-title").toggleClass("hide");
|
||||
}
|
||||
});
|
||||
|
||||
$(".search_input").focus();
|
||||
$(".search_input").keyup(function(event) {
|
||||
search_input = $(this).val();
|
||||
console.log(search_input);
|
||||
if(event.keyCode == 13 && search_input == "fireplace")
|
||||
{
|
||||
if(!peis)
|
||||
@@ -45,12 +57,6 @@ $(document).ready(function()
|
||||
if(search_input.length < 3){$("#results").html("");}
|
||||
if(event.keyCode == 13){
|
||||
search(search_input);
|
||||
}else if(event.keyCode == 27){
|
||||
$("#results").html("");
|
||||
$(".main").removeClass("blurT");
|
||||
$("#controls").removeClass("blurT");
|
||||
$(".main").removeClass("clickthrough");
|
||||
showSearch();
|
||||
}else{
|
||||
i = 0;
|
||||
timer=100;
|
||||
@@ -250,3 +256,14 @@ function durationToSeconds(duration) {
|
||||
seconds= parseInt(matches[16])||0
|
||||
return hours*60*60+minutes*60+seconds;
|
||||
}
|
||||
|
||||
|
||||
function contains(a, obj) {
|
||||
var i = a.length;
|
||||
while (i--) {
|
||||
if (a[i] === obj) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -224,6 +224,8 @@ function errorHandler(newState)
|
||||
{
|
||||
if(video_id !== undefined)
|
||||
{
|
||||
console.log(video_id);
|
||||
console.log(ytplayer.getVideoUrl());
|
||||
console.log("errorskip");
|
||||
socket.emit("skip");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user