1
!function(c,g,m){XF.BRMSContainer=XF.Element.newHandler({options:{}
2
,$clone:null,created:!1,init:function(){this.$container=$container=this.$target;var a=$container.attr("data-previewType"),b=parseInt($container.attr("data-allowCusItemLimit")),e=parseInt($container.attr("data-allowCusLayout")),h=$container.attr("data-useLimit"),l=$container.attr("data-entryLimit"),k=$container.attr("data-navPosition"),d=parseInt($container.attr("data-updateInterval")),f=parseInt($container.attr("data-modernStatisticId"));
3
this.$containerClass="BRMSContainer ";$container.hasClass("BRMSContainerDark")&&(this.$containerClass="BRMSContainer BRMSContainerDark ");this.$previewType=a;this.$allowCusItemLimit=b;this.$allowCusLayout=e;this.$entryLimit=l;this.$navPosition=k;this.$updateIntervalTime=d;this.$modernStatisticId=f;this.$hardReload=!1;a=XF.Cookie.get("brmsLayoutChange"+f);e&&a&&($container.removeClass("brmsTopTabs brmsRightTabs brmsLeftTabs"),$container.addClass(a));h&&0<parseInt(h)?(this.$entryLimit=h,$container.attr("data-entryLimit",
4
h)):this.$allowCusItemLimit&&XF.Cookie.get("brmsNumberEntry"+f)&&(this.$entryLimit=XF.Cookie.get("brmsNumberEntry"+f),$container.attr("data-entryLimit",this.$entryLimit));e=$container.find("ul.brmsTabNav > li").length-2;$container.find("ul.brmsTabNav > li:first").addClass("first");$container.find("ul.brmsTabNav > li:eq("+e+")").addClass("last");$container.find("ul.brmsTabNav > li > a, .brmsTabNavHidden ul.brmsDropdownMenu > li > a").click(XF.proxy(this,"navTabTriggerHandle"));this.showTab($container.find(".brmsTabContent:first").data("content"));
5
this.updateInterval();$container.find(".brmsNumberEntry").click(XF.proxy(this,"numberEntryChangeHandle"));$container.find(".brmsLayoutChange").click(XF.proxy(this,"layoutChangeHandle"));$container.find(".brmsRefresh").click(XF.proxy(this,"refreshHandle"));this.responsiveInit();c(g).resize(XF.proxy(this,"responsiveInit"));$container.find(".brmsDropdownToggle").hover(function(a){a=c(this).find("ul.brmsDropdownMenu");a.show();a.offset().left+a.width()>$container.width()?a.addClass("edge"):a.removeClass("edge");
6
"none"!=a.css("display")&&0>=a.offset().left&&a.css({left:0}
7
)}
8
,function(a){a=c(this).find("ul.brmsDropdownMenu");c(this).find("ul.brmsDropdownMenu").hide();a.offset().left+a.width()>$container.width()?a.addClass("edge"):a.removeClass("edge");"none"!=a.css("display")&&0>=a.offset().left&&a.css({left:0}
9
)}
10
);$container.find(".brmsDropdownToggle").click(function(a){c(this).find("ul.brmsDropdownMenu").toggle()}
11
)}
12
,navTabTriggerHandle:function(a){a.preventDefault();var b=this.$container;a=c(a.target);a.attr("data-content")||
13
(a=a.closest("a"));var e=a.closest("li");e&&!e.hasClass("current")&&(b.find("ul.brmsTabNav > li , .brmsTabNavHidden ul.brmsDropdownMenu > li").removeClass("current"),a.closest("li").addClass("current"),e=a.attr("data-content"),b.find("."+e).find(".brmsIcoLoader").length&&this.getStatistics(a.attr("data-tabid"),0),b.find(".brmsTabContent").hide().removeClass("current"),b.find("."+e).fadeIn(100).addClass("current"),this.responsiveInit())}
14
,numberEntryChangeHandle:function(a){a.preventDefault();var b=
15
this.$container;if(a=c(a.target).attr("data-limit"))this.$entryLimit=a,b.attr("data-entryLimit",a),XF.Cookie.set("brmsNumberEntry"+this.$modernStatisticId,a),this.resetInterval(),this.$hardReload=1,this.runInterval(),this.$hardReload=!1}
16
,layoutChangeHandle:function(a){a.preventDefault();var b=this.$container;if(a=c(a.target).attr("data-layout"))b.hasClass(a)||(b.removeClass("brmsTopTabs brmsRightTabs brmsLeftTabs"),b.addClass(a)),XF.Cookie.set("brmsLayoutChange"+this.$modernStatisticId,a),this.responsiveInit()}
17
,
18
refreshHandle:function(a){a.preventDefault();a=c(a.target);a.hasClass("disable")||(this.resetInterval(),this.$hardReload=1,a.addClass("disable"),this.runInterval(),this.$hardReload=!1)}
19
,getStatistics:function(a,b){var e=this.$modernStatisticId,c=this;b||(b=c.$entryLimit);XF.ajax("post",XF.canonicalizeUrl("index.php?brms-statistics/load-tab"),{tab_id:a,modern_statistic_id:e,hard_reload:c.$hardReload,limit:b}
20
,XF.proxy(c,"showResult"),{cache:!1}
21
).always(function(){c.$entryLimit=0}
22
)}
23
,showResult:function(a){var b=
24
this.$container,c=this;a.errors||a.exception||(c=this,XF.setupHtmlInsert(a.tabContentHtml,function(e,l,k){e?c.$container.find(".brmsTabContent_"+a.tabId).html(e):c.$container.find(".brmsTabContent_"+a.tabId).html("");k();XF.activate(b);c.$container.find(".brmsRefresh").removeClass("disable");c.responsiveInit()}
25
),a.limit&&b.attr("data-entryLimit",a.limit))}
26
,showTab:function(a){var b=this.$container;a?(b.find("ul.brmsTabNav > li > a[data-content='"+a+"']").trigger("click"),a.replace("brmsTabContent_",
27
"")):(b.find("ul.brmsTabNav > li.current a").trigger("click"),b.find("ul.brmsTabNav > li.current a").attr("data-content").replace("brmsTabContent_",""))}
28
,runInterval:function(){this.getStatistics(this.$container.find("li.brmlShow.current a").data("tabid"),this.$entryLimit)}
29
,updateInterval:function(){if(!this.$brmsActive){var a=this.$container,b=this.$updateIntervalTime,c=this;if(0<b)return this.$brmsActive=g.setInterval(function(){c.getStatistics(a.find("ul.brmsTabNav > li.current a").data("tabid"),
30
c.$entryLimit)}
31
,1E3*b)}
32
}
33
,clearInterval:function(){g.clearInterval(this.$brmsActive);this.$brmsActive=!1;this.$updateIntervalTime=0}
34
,resetInterval:function(){this.clearInterval();this.updateInterval()}
35
,responsiveInit:function(){var a=this.$container;if(a.find(".brmsTabContent.current").length){var b=a.find(".brmsLayoutList");if(a.hasClass("brmsTopTabs")){var e=0,h=a.find(".brmsStatisticHeader").width()-a.find(".brmsConfigList").width()-75,l=!1;a.find(".brmsTabNav > li.brmlShow").each(function(){var b=
36
a.find(".brmsTabNavHidden li:eq("+c(this).index()+")");e+c(this).width()<=h?(e+=c(this).width(),c(this).css({display:"block"}
37
),b.hasClass("current")&&(c(this).addClass("current"),b.removeClass("current")),b.css({display:"none"}
38
)):(l=!0,c(this).css({display:"none"}
39
),c(this).hasClass("current")&&(c(this).removeClass("current"),b.addClass("current")),b.css({display:"block"}
40
))}
...
</html>