Добавить в избранное



‘);
},
success: function(response) {

if(response.errorCode == 0) {
container.empty();
var i = 0;
var new_count = 0;
for(; i ‘, {
class: response.result[i].readed ? ‘noticeBlock’ : ‘noticeBlock notRead’,
title: response.result[i].readed ? ‘Прочитанное уведомление’ : ‘Непрочитанное уведомление’,
href: response.result[i].url,
id: ‘noticeBlock_’+response.result[i].id
});
elem.data({id_read: response.result[i].id});

if(!response.result[i].readed) {
new_count++;
// need send message – message is read!
elem.on(‘click’,function(e){
var target = KPjQuery(this);
var data = ‘key=’ + ApolloApi.getUserInfo().sosh_o + ‘ids=’ + target.data(‘id_read’);
KPjQuery.ajax(
{
url: ‘/_ajax/profile_informer?ts=’ + (new Date()).getTime(),
type: ‘POST’,
timeout: 5000,
cache: false,
dataType: ‘json’,
‘data’: data,
success: function() {
window.location.href = target.attr(‘href’);
},
error: function() {
window.location.href = target.attr(‘href’);
}
});
return false;
});
}

elem.html(‘‘ + response.result[i].text + ‘‘);
container.append(elem);

}
// not be found notices
if( i==0 ) {
container.html(‘

У вас нет уведомлений.

‘);
}
else if(new_count 0){
KPjQuery(‘#jewel_new’).addClass(‘new’).removeClass(‘new-none’).html(‘‘ + new_count + ‘‘);
}
}

}
});
KPjQuery(‘#informer’).addClass(‘dropDown’);
KPjQuery(‘#informer’).removeClass(‘hideDropDown’);
informer_show = 1;
}
else {
KPjQuery(‘#informer’).addClass(‘hideDropDown’);
KPjQuery(‘#informer’).removeClass(‘dropDown’);
informer_show = 0;
}

return false;
});