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