Added chatblink on message recieved

This commit is contained in:
Kasper Rynning-Tønnesen
2016-04-20 16:09:32 +02:00
parent c921379e7f
commit db1af9a19d
6 changed files with 30 additions and 6 deletions

View File

@@ -671,6 +671,13 @@ hide mdi-action-visibility mdi-action-visibility-off
width: calc(100% - 8px) !important; width: calc(100% - 8px) !important;
} }
.chat-link {
-webkit-transition: color 1s !important;
-moz-transition: color 1s !important;
-o-transition: color 1s !important;
transition: color 1s !important;
}
.playlist-tabs, .playlist-tabs-loggedIn{ .playlist-tabs, .playlist-tabs-loggedIn{
background-color:rgba(0,0,0,0) !important; background-color:rgba(0,0,0,0) !important;
margin:0; margin:0;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -37,12 +37,13 @@ var Chat = {
//$("#chat-btn").css("color", "grey"); //$("#chat-btn").css("color", "grey");
if(!blink_interval_exists && inp.indexOf("changed name to") < 0 && !chat_active) if(!blink_interval_exists && inp[1].substring(0,1) == ":" && !chat_active)
{ {
$("#favicon").attr("href", "static/images/highlogo.png"); $("#favicon").attr("href", "static/images/highlogo.png");
blink_interval_exists = true; blink_interval_exists = true;
unseen = true; unseen = true;
chat_unseen = true; chat_unseen = true;
if(!blinking) Chat.chat_blink();
//blink_interval = setTimeout(Chat.chat_blink, 2000); //blink_interval = setTimeout(Chat.chat_blink, 2000);
} }
@@ -69,11 +70,12 @@ var Chat = {
{ {
socket.on("chat", function(data) socket.on("chat", function(data)
{ {
if(!blink_interval_exists && data.indexOf("changed name to") < 0 && !chat_active) if(!blink_interval_exists && data[1].substring(0,1) == ":" && !chat_active)
{ {
$("#favicon").attr("href", "static/images/highlogo.png"); $("#favicon").attr("href", "static/images/highlogo.png");
unseen = true; unseen = true;
chat_unseen = true; chat_unseen = true;
if(!blinking) Chat.chat_blink();
//blink_interval = setTimeout(Chat.chat_blink, 1000); //blink_interval = setTimeout(Chat.chat_blink, 1000);
} }
@@ -90,6 +92,17 @@ var Chat = {
$("#chatchannel li:last")[0].appendChild(in_text); $("#chatchannel li:last")[0].appendChild(in_text);
document.getElementById("chatchannel").scrollTop = document.getElementById("chatchannel").scrollHeight; document.getElementById("chatchannel").scrollTop = document.getElementById("chatchannel").scrollHeight;
}); });
},
chat_blink: function() {
blinking = true;
$(".chat-link").attr("style", "color: grey !important;");
setTimeout(function () {
$(".chat-link").attr("style", "color: white !important;");
setTimeout(function() {
if(blinking) Chat.chat_blink();
}, 1000);
}, 1000);
} }
} }

View File

@@ -28,6 +28,7 @@ var autoplay = true;
var durationBegun = false; var durationBegun = false;
var chat_active = false; var chat_active = false;
var chat_unseen = false; var chat_unseen = false;
var blinking = false;
var result_html; var result_html;
var empty_results_html; var empty_results_html;
@@ -329,6 +330,8 @@ $(document).on("click", ".chat-link", function(e){
chat_active = true; chat_active = true;
unseen = false; unseen = false;
chat_unseen = false; chat_unseen = false;
$(".chat-link").attr("style", "color: white !important;");
blinking = false;
$("#favicon").attr("href", "static/images/favicon.png"); $("#favicon").attr("href", "static/images/favicon.png");
$("#chatPlaylist").css("display", "block"); $("#chatPlaylist").css("display", "block");
$("#wrapper").css("display", "none"); $("#wrapper").css("display", "none");

View File

@@ -68,7 +68,6 @@ var Player = {
Player.ytplayer.playVideo(); Player.ytplayer.playVideo();
if(!durationBegun) if(!durationBegun)
Player.durationSetter(); Player.durationSetter();
mobile_beginning = false;
} }
if(Player.ytplayer.getDuration() > seekTo || Player.ytplayer.getDuration() == 0) if(Player.ytplayer.getDuration() > seekTo || Player.ytplayer.getDuration() == 0)
Player.ytplayer.seekTo(seekTo); Player.ytplayer.seekTo(seekTo);
@@ -103,6 +102,7 @@ var Player = {
if(beginning && window.mobilecheck()){ if(beginning && window.mobilecheck()){
Player.ytplayer.pauseVideo(); Player.ytplayer.pauseVideo();
beginning = false; beginning = false;
mobile_beginning = false;
} }
if(!embed) Helper.addClass("#player_overlay", "hide"); if(!embed) Helper.addClass("#player_overlay", "hide");
if(document.getElementById("play").className.split(" ").length == 1) if(document.getElementById("play").className.split(" ").length == 1)
@@ -120,6 +120,7 @@ var Player = {
{*/ {*/
paused = true; paused = true;
Playercontrols.play_pause_show(); Playercontrols.play_pause_show();
mobile_beginning = true;
/*} /*}
else else
Player.ytplayer.playVideo();*/ Player.ytplayer.playVideo();*/