|
|
|
!function(a){"use strict";var b=a.tablesorter,c=b.grouping={types:{number:function(a,c,d,e){var f,g=c.hasClass(b.css.sortAsc);return e>1&&""!==d?(f=g?Math.floor(parseFloat(d)/e)*e:Math.ceil(parseFloat(d)/e)*e,f+=" - "+(f+(e-1)*(g?1:-1))):f=parseFloat(d)||d,f},separator:function(b,c,d,e){var f=(d+"").split(b.widgetOptions.group_separator);return a.trim(f[e-1]||"")},text:function(a,b,c){return c},word:function(a,b,c,d){var e=(c+" ").match(/\w+/g)||[];return e[d-1]||""},letter:function(a,b,c,d){return c?(c+" ").substring(0,d):""},date:function(a,b,d,e,f){var g,h,i=a.widgetOptions,j=new Date(d||"");return j instanceof Date&&isFinite(j)?(g=j.getFullYear(),h=c.findMonth(i,j.getMonth()),"year"===e?g:"month"===e?h:"monthyear"===e?h+" "+g:"day"===e?h+" "+j.getDate():"week"===e?c.findWeek(i,j.getDay()):"time"===e?c.findTime(i,j):"hour"===e?c.findTime(i,j,"hour"):i.group_dateString(j,a,b)):i.group_dateInvalid}},findMonth:function(a,b){return a.group_months[b+(""===(a.group_months[0]||"")?1:0)]},findWeek:function(b,c){if(a.isArray(b.group_week))return b.group_week[c];if(!a.isEmptyObject(b.group_week)){var d=["sun","mon","tue","wed","thu","fri","sat"];return b.group_week[d[c]]}},findTime:function(a,b,c){var d,e=a.group_time.am&&a.group_time.pm,f=b.getHours(),g=f>=12?1:0,h=a.group_time24Hour&&f>12?f-12:a.group_time24Hour&&0===f?f+12:f,i=("00"+h).slice(-2),j=("00"+b.getMinutes()).slice(-2);return d=a.group_time[e?["am","pm"][g]:g],"hour"===c?i:i+":"+j+(a.group_time24Hour?"":" "+(d||""))},update:function(b){if(!a.isEmptyObject(b.config.cache)){var d=b.config,e=d.widgetOptions,f="undefined"!=typeof d.sortList[0],g={},h=a.isArray(e.group_forceColumn)&&"undefined"!=typeof e.group_forceColumn[0]?e.group_enforceSort&&!f?-1:e.group_forceColumn[0]:f?d.sortList[0][0]:-1;d.$table.find("tr.group-hidden").removeClass("group-hidden").end().find("tr.group-header").remove(),e.group_collapsible&&d.$table.data("pagerSavedHeight",0),h>=0&&h<d.columns&&!d.$headerIndexed[h].hasClass("group-false")&&(e.group_collapsedGroup="",e.group_collapsedGroups={},g.column=h,g.groupClass=(d.$headerIndexed[h].attr("class")||"").match(/(group-\w+(-\w+)?)/g),g.grouping=g.groupClass?g.groupClass[0].split("-"):["group","letter",1],g.savedGroup=c.saveCurrentGrouping(d,e,g),c.findColumnGroups(d,e,g),c.processHeaders(d,e,g),d.$table.triggerHandler(e.group_complete))}},processHeaders:function(b,c,d){var e,f,g,h,i,j,k=b.$table.find("tr.group-header"),l=k.length;for(k.bind("selectstart",!1),e=0;e<l;e++)j=k.eq(e),i=j.nextUntil("tr.group-header").filter(":visible"),(c.group_count||a.isFunction(c.group_callback))&&(g=j.find(".group-count"),g.length&&(c.group_count&&g.html(c.group_count.toString().replace(/\{num\}/g,i.length)),a.isFunction(c.group_callback)&&c.group_callback(j.find("td"),i,d.column,b.table))),c.group_saveGroups&&!a.isEmptyObject(c.group_collapsedGroups)&&c.group_collapsedGroups[c.group_collapsedGroup].length?(h=j.find(".group-name").text().toLowerCase()+j.attr("data-group-index"),f=a.inArray(h,c.group_collapsedGroups[c.group_collapsedGroup])>-1,j.toggleClass("collapsed",f),i.toggleClass("group-hidden",f)):c.group_collapsed&&c.group_collapsible&&(j.addClass("collapsed"),i.addClass("group-hidden"))},groupHeaderHTML:function(a,b,c){var d=(c.currentGroup||"").toString().replace(/</g,"<").replace(/>/g,">");return'<tr class="group-header '+a.selectorRemove.slice(1)+'" unselectable="on" '+(a.tabIndex?'tabindex="0" ':"")+'data-group-index="'+c.groupIndex+'"><td colspan="'+a.columns+'">'+(b.group_collapsible?"<i/>":"")+'<span class="group-name">'+d+'</span><span class="group-count"></span></td></tr>'},saveCurrentGrouping:function(a,c,d){var e,f,g=!1;return c.group_collapsible&&c.group_saveGroups&&(c.group_collapsedGroups=b.storage&&b.storage(a.table,"tablesorter-groups")||{},f="dir"+a.sortList[0][1],e=c.group_collapsedGroup=""+a.sortList[0][0]+f+d.grouping.join(""),c.group_collapsedGroups[e]?g=!0:c.group_collapsedGroups[e]=[]),g},findColumnGroups:function(a,d,e){var f,g,h,i,j,k=b.hasWidget(a.table,"pager"),l=a.pager||{};for(e.groupIndex=0,f=0;f<a.$tbodies.length;f++)f
|