File size: 1.62Kb
/*
* @package XenCentral Feedback System
* @author DNF Technology
* @copyright Drnoyan & Nalyan LDA, Portugal, EU
* @license http://dnf.technology/terms/
* @link http://customers.dnf.technology
* @version 2.0.0 Beta 10
* @revision 12
*/
$(function() {
$("ol#latestActivity").SkyDevComet({
restartInterval: 5000,
timeout: 30000,
ajaxCallInterval: tradingAjaxCallInterval, //global var
url: currentActivityURL,
success: function(data) {
$('ol#latestActivity li').remove();
$(data.html.content).hide().prependTo('ol#latestActivity').slideDown();
$("ol#latestActivity").children().each(function(index, elem) {
if (index > 19) {
$(elem).fadeOut(function() {
$(elem).remove();
});
}
});
},
updateData: function(data) {
var checkedTypes=[];
$('div#typeFilterPopup ul li a').each(function(index, link){
if($(link).attr('data-filter')==='all') {
if($(link).hasClass('checked')) {
// no filter selected
checkedTypes=false;
return false;
}
} else {
if($(link).hasClass('checked')) {
checkedTypes[checkedTypes.length]=$(link).attr('data-filter');
}
}
});
if(checkedTypes!==false) {
data['checkedTypes']=checkedTypes;
}
var usernameFilter=$('[name=usernameFilter]').val();
if(usernameFilter) {
data['usernameFilter']=usernameFilter;
}
return data;
},
preventRun:function() {
if ($('#activityEnabled').attr('checked')) {
return false;
}
return true;
},
data: {
_xfResponseType: 'json',
_xfToken: XF.config.csrf
},
dataType: 'json'
});
//console.log(XF.config.csrf);
});