2012-04-23 13:20:28 +02:00
|
|
|
function check_new_chats_icon(id_icon) {
|
2019-01-30 12:27:18 +01:00
|
|
|
if (new_chat) {
|
|
|
|
$("#" + id_icon).pulsate();
|
|
|
|
}
|
2012-04-23 13:20:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
function check_new_chats_icon_ajax(id_icon) {
|
2019-01-30 12:27:18 +01:00
|
|
|
var exit = false;
|
|
|
|
|
|
|
|
url_chunks = location.href.split("&");
|
|
|
|
$.each(url_chunks, function(key, chunk) {
|
|
|
|
if (chunk == "sec2=operation/users/webchat") exit = true;
|
|
|
|
return;
|
|
|
|
});
|
|
|
|
|
|
|
|
if (exit) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
old = global_counter_chat;
|
|
|
|
get_last_global_counter();
|
|
|
|
|
|
|
|
if (old < global_counter_chat) {
|
|
|
|
$("#" + id_icon).pulsate();
|
|
|
|
}
|
|
|
|
|
|
|
|
setTimeout('check_new_chats_icon("' + id_icon + '")', 5000);
|
2012-04-23 13:20:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
function get_last_global_counter() {
|
2019-01-30 12:27:18 +01:00
|
|
|
var parameters = {};
|
|
|
|
parameters["page"] = "operation/users/webchat";
|
|
|
|
parameters["get_last_global_counter"] = 1;
|
|
|
|
|
|
|
|
$.ajax({
|
|
|
|
type: "POST",
|
|
|
|
url: "ajax.php",
|
|
|
|
data: parameters,
|
|
|
|
dataType: "json",
|
|
|
|
async: false,
|
|
|
|
success: function(data) {
|
|
|
|
if (data["correct"] == 1) {
|
|
|
|
global_counter_chat = data["global_counter"];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
2012-04-23 13:20:28 +02:00
|
|
|
}
|