mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
More chat improvements
This commit is contained in:
2
static/dist/embed.min.js
vendored
2
static/dist/embed.min.js
vendored
File diff suppressed because one or more lines are too long
4
static/dist/main.min.js
vendored
4
static/dist/main.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -34,18 +34,20 @@ var Chat = {
|
|||||||
socket.on("chat.all", function(inp)
|
socket.on("chat.all", function(inp)
|
||||||
{
|
{
|
||||||
|
|
||||||
if($("#chat-bar").position()["left"] != 0)
|
|
||||||
{
|
//$("#chat-btn").css("color", "grey");
|
||||||
//$("#chat-btn").css("color", "grey");
|
|
||||||
|
|
||||||
if(!blink_interval_exists && inp.indexOf("changed name to") < 0)
|
console.log(inp.indexOf("changed name to"));
|
||||||
{
|
|
||||||
$("#favicon").attr("href", "static/images/highlogo.png");
|
if(!blink_interval_exists && inp.indexOf("changed name to") < 0 && !chat_active)
|
||||||
blink_interval_exists = true;
|
{
|
||||||
unseen = true;
|
$("#favicon").attr("href", "static/images/highlogo.png");
|
||||||
blink_interval = setInterval(Chat.chat_blink, 2000);
|
blink_interval_exists = true;
|
||||||
}
|
unseen = true;
|
||||||
}else if(document.hidden)
|
blink_interval = setInterval(Chat.chat_blink, 2000);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(document.hidden)
|
||||||
{
|
{
|
||||||
$("#favicon").attr("href", "static/images/highlogo.png");
|
$("#favicon").attr("href", "static/images/highlogo.png");
|
||||||
unseen = true;
|
unseen = true;
|
||||||
@@ -69,18 +71,13 @@ var Chat = {
|
|||||||
{
|
{
|
||||||
socket.on("chat", function(data)
|
socket.on("chat", function(data)
|
||||||
{
|
{
|
||||||
if($("#chat-bar").position()["left"] != 0)
|
if(!blink_interval_exists && data.indexOf("changed name to") < 0 && !chat_active)
|
||||||
{
|
{
|
||||||
if(data[1].indexOf(":") >= 0){
|
$("#favicon").attr("href", "static/images/highlogo.png");
|
||||||
//$("#chat-btn").css("color", "grey");
|
blink_interval_exists = true;
|
||||||
if(!blink_interval_exists && data.indexOf("changed name to") < 0)
|
blink_interval = setInterval(Chat.chat_blink, 2000);
|
||||||
{
|
|
||||||
$("#favicon").attr("href", "static/images/highlogo.png");
|
|
||||||
blink_interval_exists = true;
|
|
||||||
blink_interval = setInterval(Chat.chat_blink, 2000);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var color = Helper.intToARGB(Helper.hashCode(data[0]));
|
var color = Helper.intToARGB(Helper.hashCode(data[0]));
|
||||||
if(color.length < 6) {
|
if(color.length < 6) {
|
||||||
for(x = color.length; x < 6; x++){
|
for(x = color.length; x < 6; x++){
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ var lazy_load = true;
|
|||||||
var embed = false;
|
var embed = false;
|
||||||
var autoplay = true;
|
var autoplay = true;
|
||||||
var durationBegun = false;
|
var durationBegun = false;
|
||||||
|
var chat_active = false;
|
||||||
|
|
||||||
var mobile_beginning;
|
var mobile_beginning;
|
||||||
var timeout_search;
|
var timeout_search;
|
||||||
@@ -321,6 +322,8 @@ $(document).on("submit", "#adminForm", function(e){
|
|||||||
});
|
});
|
||||||
|
|
||||||
$(document).on("click", ".chat-link", function(e){
|
$(document).on("click", ".chat-link", function(e){
|
||||||
|
chat_active = true;
|
||||||
|
$("#favicon").attr("href", "static/images/favicon.png");
|
||||||
$("#chatPlaylist").css("display", "block");
|
$("#chatPlaylist").css("display", "block");
|
||||||
$("#wrapper").css("display", "none");
|
$("#wrapper").css("display", "none");
|
||||||
$("#suggestions").css("display", "none");
|
$("#suggestions").css("display", "none");
|
||||||
@@ -328,12 +331,14 @@ $(document).on("click", ".chat-link", function(e){
|
|||||||
});
|
});
|
||||||
|
|
||||||
$(document).on("click", ".playlist-link", function(e){
|
$(document).on("click", ".playlist-link", function(e){
|
||||||
|
chat_active = false;
|
||||||
$("#chatPlaylist").css("display", "none");
|
$("#chatPlaylist").css("display", "none");
|
||||||
$("#wrapper").css("display", "block");
|
$("#wrapper").css("display", "block");
|
||||||
$("#suggestions").css("display", "none");
|
$("#suggestions").css("display", "none");
|
||||||
});
|
});
|
||||||
|
|
||||||
$(document).on("click", ".suggested-link", function(e){
|
$(document).on("click", ".suggested-link", function(e){
|
||||||
|
chat_active = false;
|
||||||
$("#chatPlaylist").css("display", "none");
|
$("#chatPlaylist").css("display", "none");
|
||||||
$("#wrapper").css("display", "none");
|
$("#wrapper").css("display", "none");
|
||||||
$("#suggestions").css("display", "block");
|
$("#suggestions").css("display", "block");
|
||||||
|
|||||||
Reference in New Issue
Block a user