Merge branch 'dev' of github.com:nixolas1/Zoff into dev

This commit is contained in:
Nicolas A. Tonne
2015-04-30 16:48:01 +02:00
2 changed files with 15 additions and 24 deletions

View File

@@ -21,19 +21,6 @@ $(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").focus();
$(".search_input").keyup(function(event) { $(".search_input").keyup(function(event) {
search_input = $(this).val(); search_input = $(this).val();
@@ -99,7 +86,16 @@ $(document).ready(function()
}); });
$(document).keyup(function(e) { $(document).keyup(function(e) {
if ($("div.result").length > 2){ 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");
}else if ($("div.result").length > 2){
if (e.keyCode == 40) { if (e.keyCode == 40) {
if(i < $("div.result").length -2) if(i < $("div.result").length -2)
i++; i++;

View File

@@ -224,19 +224,14 @@ function getTitle(titt, v)
function errorHandler(newState) function errorHandler(newState)
{ {
var failsafe = ytplayer.getVideoUrl().split("https://www.youtube.com/watch"); var failsafe = ytplayer.getVideoUrl().split("https://www.youtube.com/watch");
if(video_id !== undefined && !failsafe[0] == "" && !failsafe[1] == "") if(newState.data == 5 || newState.data == 100 || newState.data == 101 || newState.data == 150)
{ {
console.log(video_id);
console.log(ytplayer.getVideoUrl());
console.log("errorskip");
socket.emit("skip"); socket.emit("skip");
} }
} }
function onPlayerReady(event) { function onPlayerReady(event) {
player_ready = true; player_ready = true;
console.log(ytplayer.getVideoUrl());
console.log(ytplayer.getVideoUrl().split("https://www.youtube.com/watch"));
if(!window.mobilecheck()) if(!window.mobilecheck())
{ {
$("#player").css("opacity", "1"); $("#player").css("opacity", "1");