2014-11-08 01:32:10 +00:00
/*! tableSorter (FORK) 2.16+ widgets - updated 11/7/2014 (v2.18.3) */
2014-10-27 00:11:12 +00:00
; ( function ( k , z ) {
var e = k . tablesorter = k . tablesorter || { } ;
e . themes = { bootstrap : { table : "table table-bordered table-striped" , caption : "caption" , header : "bootstrap-header" , footerRow : "" , footerCells : "" , icons : "" , sortNone : "bootstrap-icon-unsorted" , sortAsc : "icon-chevron-up glyphicon glyphicon-chevron-up" , sortDesc : "icon-chevron-down glyphicon glyphicon-chevron-down" , active : "" , hover : "" , filterRow : "" , even : "" , odd : "" } , jui : { table : "ui-widget ui-widget-content ui-corner-all" , caption : "ui-widget-content" , header : "ui-widget-header ui-corner-all ui-state-default" , footerRow : "" , footerCells : "" , icons : "ui-icon" , sortNone : "ui-icon-carat-2-n-s" , sortAsc : "ui-icon-carat-1-n" , sortDesc : "ui-icon-carat-1-s" , active : "ui-state-active" , hover : "ui-state-hover" , filterRow : "" , even : "ui-widget-content" , odd : "ui-state-default" } } ; k . extend ( e . css , { filterRow : "tablesorter-filter-row" , filter : "tablesorter-filter" , wrapper : "tablesorter-wrapper" , resizer : "tablesorter-resizer" , sticky : "tablesorter-stickyHeader" , stickyVis : "tablesorter-sticky-visible" , stickyWrap : "tablesorter-sticky-wrapper" } ) ;
e . storage = function ( c , a , b , d ) { c = k ( c ) [ 0 ] ; var e , h , g = ! 1 ; e = { } ; h = c . config ; var m = k ( c ) ; c = d && d . id || m . attr ( d && d . group || "data-table-group" ) || c . id || k ( ".tablesorter" ) . index ( m ) ; d = d && d . url || m . attr ( d && d . page || "data-table-page" ) || h && h . fixedUrl || z . location . pathname ; if ( "localStorage" in z ) try { z . localStorage . setItem ( "_tmptest" , "temp" ) , g = ! 0 , z . localStorage . removeItem ( "_tmptest" ) } catch ( n ) { } k . parseJSON && ( g ? e = k . parseJSON ( localStorage [ a ] || "{}" ) : ( h = document . cookie . split ( /[;\s|=]/ ) , e = k . inArray ( a , h ) + 1 , e = 0 !== e ? k . parseJSON ( h [ e ] || "{}" ) : { } ) ) ; if ( ( b || "" === b ) && z . JSON && JSON . hasOwnProperty ( "stringify" ) ) e [ d ] || ( e [ d ] = { } ) , e [ d ] [ c ] = b , g ? localStorage [ a ] = JSON . stringify ( e ) : ( b = new Date , b . setTime ( b . getTime ( ) + 31536E6 ) , document . cookie = a + "=" + JSON . stringify ( e ) . replace ( /\"/g , '"' ) + "; expires=" + b . toGMTString ( ) + "; path=/" ) ; else return e && e [ d ] ? e [ d ] [ c ] : "" } ;
e . addHeaderResizeEvent = function ( c , a , b ) { c = k ( c ) [ 0 ] ; var d ; b = k . extend ( { } , { timer : 250 } , b ) ; var e = c . config , h = e . widgetOptions , g = function ( a ) { h . resize _flag = ! 0 ; d = [ ] ; e . $headers . each ( function ( ) { var a = k ( this ) , b = a . data ( "savedSizes" ) || [ 0 , 0 ] , c = this . offsetWidth , e = this . offsetHeight ; if ( c !== b [ 0 ] || e !== b [ 1 ] ) a . data ( "savedSizes" , [ c , e ] ) , d . push ( this ) } ) ; d . length && ! 1 !== a && e . $table . trigger ( "resize" , [ d ] ) ; h . resize _flag = ! 1 } ; g ( ! 1 ) ; clearInterval ( h . resize _timer ) ; if ( a ) return h . resize _flag = ! 1 ; h . resize _timer = setInterval ( function ( ) { h . resize _flag || g ( ) } , b . timer ) } ;
2014-11-03 16:56:46 +00:00
e . addWidget ( { id : "uitheme" , priority : 10 , format : function ( c , a , b ) { var d , f , h , g = e . themes ; d = a . $table ; var m = a . $headers , n = a . theme || "jui" , p = g [ n ] || g . jui , g = [ p . sortNone , p . sortDesc , p . sortAsc , p . active ] . join ( " " ) ; a . debug && ( f = new Date ) ; d . hasClass ( "tablesorter-" + n ) && a . theme === a . appliedTheme && c . hasInitialized || ( h = ( c = p [ a . appliedTheme ] || { } , [ c . sortNone , c . sortDesc , c . sortAsc , c . active ] . join ( " " ) ) , c && ( b . zebra [ 0 ] = b . zebra [ 0 ] . replace ( " " + c . even , "" ) , b . zebra [ 1 ] = b . zebra [ 1 ] . replace ( " " + c . odd , "" ) ) , "" !== p . even && ( b . zebra [ 0 ] += " " + p . even ) , "" !== p . odd && ( b . zebra [ 1 ] += " " + p . odd ) , d . children ( "caption" ) . removeClass ( c . caption ) . addClass ( p . caption ) , b = d . removeClass ( a . appliedTheme ? "tablesorter-" + ( a . appliedTheme || "" ) : "" ) . addClass ( "tablesorter-" + n + " " + p . table ) . children ( "tfoot" ) , b . length && b . children ( "tr" ) . removeClass ( c . footerRow || "" ) . addClass ( p . footerRow ) . children ( "th, td" ) . removeClass ( c . footerCells || "" ) . addClass ( p . footerCells ) , m . add ( a . $extraHeaders ) . removeClass ( c . header + " " + c . hover + " " + h ) . addClass ( p . header ) . not ( ".sorter-false" ) . bind ( "mouseenter.tsuitheme mouseleave.tsuitheme" , function ( a ) { k ( this ) [ "mouseenter" === a . type ? "addClass" : "removeClass" ] ( p . hover ) } ) , m . find ( "." + e . css . wrapper ) . length || m . wrapInner ( '<div class="' + e . css . wrapper + '" style="position:relative;height:100%;width:100%"></div>' ) , a . cssIcon && m . find ( "." + e . css . icon ) . removeClass ( c . icons + " " + h ) . addClass ( p . icons ) , d . hasClass ( "hasFilters" ) && d . children ( "thead" ) . children ( "." + e . css . filterRow ) . removeClass ( c . filterRow ) . addClass ( p . filterRow ) , a . appliedTheme = a . theme ) ; for ( d = 0 ; d < a . columns ; d ++ ) b = a . $headers . add ( a . $extraHeaders ) . not ( ".sorter-false" ) . filter ( '[data-column="' + d + '"]' ) , c = e . css . icon ? b . find ( "." + e . css . icon ) : b , h = m . not ( ".sorter-false" ) . filter ( '[data-column="' + d + '"]:last' ) , h . length && ( h [ 0 ] . sortDisabled ? ( b . removeClass ( g ) , c . removeClass ( g + " " + p . icons ) ) : ( h = b . hasClass ( e . css . sortAsc ) ? p . sortAsc : b . hasClass ( e . css . sortDesc ) ? p . sortDesc : b . hasClass ( e . css . header ) ? p . sortNone : "" , b [ h === p . sortNone ? "removeClass" : "addClass" ] ( p . active ) , c . removeClass ( g ) . addClass ( h ) ) ) ; a . debug && e . benchmark ( "Applying " + n + " theme" , f ) } , remove : function ( c , a ) { var b = a . $table , d = a . theme || "jui" , f = e . themes [ d ] || e . themes . jui , h = b . children ( "thead" ) . children ( ) , g = f . sortNone + " " + f . sortDesc + " " + f . sortAsc ; b . removeClass ( "tablesorter-" + d + " " + f . table ) . find ( e . css . header ) . removeClass ( f . header ) ; h . unbind ( "mouseenter.tsuitheme mouseleave.tsuitheme" ) . removeClass ( f . hover + " " + g + " " + f . active ) . find ( "." + e . css . filterRow ) . removeClass ( f . filterRow ) ; h . find ( "." + e . css . icon ) . removeClass ( f . icons ) } } ) ;
2014-10-27 00:11:12 +00:00
e . addWidget ( { id : "columns" , priority : 30 , options : { columns : [ "primary" , "secondary" , "tertiary" ] } , format : function ( c , a , b ) { var d , f , h , g , m , n , p = a . $table , r = a . $tbodies , v = a . sortList , w = v . length , s = b && b . columns || [ "primary" , "secondary" , "tertiary" ] , t = s . length - 1 ; m = s . join ( " " ) ; for ( d = 0 ; d < r . length ; d ++ ) a = e . processTbody ( c , r . eq ( d ) , ! 0 ) , f = a . children ( "tr" ) , f . each ( function ( ) { h = k ( this ) ; if ( "none" !== this . style . display && ( g = h . children ( ) . removeClass ( m ) , v && v [ 0 ] && ( g . eq ( v [ 0 ] [ 0 ] ) . addClass ( s [ 0 ] ) , 1 < w ) ) ) for ( n = 1 ; n < w ; n ++ ) g . eq ( v [ n ] [ 0 ] ) . addClass ( s [ n ] || s [ t ] ) } ) , e . processTbody ( c , a , ! 1 ) ; c = ! 1 !== b . columns _thead ? [ "thead tr" ] : [ ] ; ! 1 !== b . columns _tfoot && c . push ( "tfoot tr" ) ; if ( c . length && ( f = p . find ( c . join ( "," ) ) . children ( ) . removeClass ( m ) , w ) ) for ( n = 0 ; n < w ; n ++ ) f . filter ( '[data-column="' + v [ n ] [ 0 ] + '"]' ) . addClass ( s [ n ] || s [ t ] ) } , remove : function ( c , a , b ) { var d = a . $tbodies , f = ( b . columns || [ "primary" , "secondary" , "tertiary" ] ) . join ( " " ) ; a . $headers . removeClass ( f ) ; a . $table . children ( "tfoot" ) . children ( "tr" ) . children ( "th, td" ) . removeClass ( f ) ; for ( a = 0 ; a < d . length ; a ++ ) b = e . processTbody ( c , d . eq ( a ) , ! 0 ) , b . children ( "tr" ) . each ( function ( ) { k ( this ) . children ( ) . removeClass ( f ) } ) , e . processTbody ( c , b , ! 1 ) } } ) ;
e . addWidget ( { id : "filter" , priority : 50 , options : { filter _childRows : ! 1 , filter _columnFilters : ! 0 , filter _cellFilter : "" , filter _cssFilter : "" , filter _defaultFilter : { } , filter _excludeFilter : { } , filter _external : "" , filter _filteredRow : "filtered" , filter _formatter : null , filter _functions : null , filter _hideEmpty : ! 0 , filter _hideFilters : ! 1 , filter _ignoreCase : ! 0 , filter _liveSearch : ! 0 , filter _onlyAvail : "filter-onlyAvail" , filter _placeholder : { search : "" , select : "" } , filter _reset : null , filter _saveFilters : ! 1 , filter _searchDelay : 300 , filter _searchFiltered : ! 0 , filter _selectSource : null , filter _startsWith : ! 1 , filter _useParsedData : ! 1 , filter _serversideFiltering : ! 1 , filter _defaultAttrib : "data-value" , filter _selectSourceSeparator : "|" } , format : function ( c , a , b ) { a . $table . hasClass ( "hasFilters" ) || e . filter . init ( c , a , b ) } , remove : function ( c , a , b ) { var d , f = a . $tbodies ; a . $table . removeClass ( "hasFilters" ) . unbind ( "addRows updateCell update updateRows updateComplete appendCache filterReset filterEnd search " . split ( " " ) . join ( a . namespace + "filter " ) ) . find ( "." + e . css . filterRow ) . remove ( ) ; for ( a = 0 ; a < f . length ; a ++ ) d = e . processTbody ( c , f . eq ( a ) , ! 0 ) , d . children ( ) . removeClass ( b . filter _filteredRow ) . show ( ) , e . processTbody ( c , d , ! 1 ) ; b . filter _reset && k ( document ) . undelegate ( b . filter _reset , "click.tsfilter" ) } } ) ;
2014-11-03 23:45:53 +00:00
e . filter = { regex : { regex : /^\/((?:\\\/|[^\/])+)\/([mig]{0,3})?$/ , child : /tablesorter-childRow/ , filtered : /filtered/ , type : /undefined|number/ , exact : /(^[\"\'=]+)|([\"\'=]+$)/g , nondigit : /[^\w,. \-()]/g , operators : /[<>=]/g , query : "(q|query)" } , types : { regex : function ( c , a ) { if ( e . filter . regex . regex . test ( a . iFilter ) ) { var b , d = e . filter . regex . regex . exec ( a . iFilter ) ; try { b = ( new RegExp ( d [ 1 ] , d [ 2 ] ) ) . test ( a . iExact ) } catch ( f ) { b = ! 1 } return b } return null } , operators : function ( c , a ) { if ( /^[<>]=?/ . test ( a . iFilter ) ) { var b , d ; b = c . table ; var f = a . index , h = a . parsed [ f ] , g = e . formatFloat ( a . iFilter . replace ( e . filter . regex . operators , "" ) , b ) , m = c . parsers [ f ] , n = g ; if ( h || "numeric" === m . type ) d = e . filter . parseFilter ( c , k . trim ( "" + a . iFilter . replace ( e . filter . regex . operators , "" ) ) , f , h , ! 0 ) , g = "number" !== typeof d || "" === d || isNaN ( d ) ? g : d ; b = ! h && "numeric" !== m . type || isNaN ( g ) || "undefined" === typeof a . cache ? isNaN ( a . iExact ) ? e . formatFloat ( a . iExact . replace ( e . filter . regex . nondigit , "" ) , b ) : e . formatFloat ( a . iExact , b ) : a . cache ; />/ . test ( a . iFilter ) && ( d = />=/ . test ( a . iFilter ) ? b >= g : b > g ) ; /</ . test ( a . iFilter ) && ( d = /<=/ . test ( a . iFilter ) ? b <= g : b < g ) ; d || "" !== n || ( d = ! 0 ) ; return d } return null } , notMatch : function ( c , a ) { if ( /^\!/ . test ( a . iFilter ) ) { var b , d = e . filter . parseFilter ( c , a . iFilter . replace ( "!" , "" ) , a . index , a . parsed [ a . index ] ) ; if ( e . filter . regex . exact . test ( d ) ) return d = d . replace ( e . filter . regex . exact , "" ) , "" === d ? ! 0 : k . trim ( d ) !== a . iExact ; b = a . iExact . search ( k . trim ( d ) ) ; return "" === d ? ! 0 : ! ( c . widgetOptions . filter _startsWith ? 0 === b : 0 <= b ) } return null } , exact : function ( c , a ) { if ( e . filter . regex . exact . test ( a . iFilter ) ) { var b = e . filter . parseFilter ( c , a . iFilter . replace ( e . filter . regex . exact , "" ) , a . index , a . parsed [ a . index ] ) ; return a . anyMatch ? 0 <= k . inArray ( b , a . rowArray ) : b == a . iExact } return null } , and : function ( c , a ) { if ( e . filter . regex . andTest . test ( a . filter ) ) { for ( var b = a . index , d = a . parsed [ b ] , f = a . iFilter . split ( e . filter . regex . andSplit ) , h = 0 <= a . iExact . search ( k . trim ( e . filter . parseFilter ( c , f [ 0 ] , b , d ) ) ) , g = f . length - 1 ; h && g ; ) h = h && 0 <= a . iExact . search ( k . trim ( e . filter . parseFilter ( c , f [ g ] , b , d ) ) ) , g -- ; return h } return null } , range : function ( c , a ) { if ( e . filter . regex . toTest . test ( a . iFilter ) ) { var b , d ; d = c . table ; var f = a . index , h = a . parsed [ f ] , g = a . iFilter . split ( e . filter . regex . toSplit ) , k = e . formatFloat ( e . filter . parseFilter ( c , g [ 0 ] . replace ( e . filter . regex . nondigit , "" ) , f , h ) , d ) , n = e . formatFloat ( e . filter . parseFilter ( c , g [ 1 ] . replace ( e . filter . regex . nondigit , "" ) , f , h ) , d ) ; if ( h || "numeric" === c . parsers [ f ] . type ) b = c . parsers [ f ] . format ( "" + g [ 0 ] , d , c . $headers . eq ( f ) , f ) , k = "" === b || isNaN ( b ) ? k : b , b = c . parsers [ f ] . format ( "" + g [ 1 ] , d , c . $headers . eq ( f ) , f ) , n = "" === b || isNaN ( b ) ? n : b ; b = ! h && "numeric" !== c . parsers [ f ] . type || isNaN ( k ) || isNaN ( n ) ? isNaN ( a . iExact ) ? e . formatFloat ( a . iExact . replace ( e . filter . regex . nondigit , "" ) , d ) : e . formatFloat ( a . iExact , d ) : a . cache ; k > n && ( d = k , k = n , n = d ) ; return b >= k && b <= n || "" === k || "" === n } return null } , wild : function ( c , a ) { if ( /[\?\*\|]/ . test ( a . iFilter ) || e . filter . regex . orReplace . test ( a . filter ) ) { var b = a . index , d = a . parsed [ b ] , d = e . filter . parseFilter ( c , a . iFilter . replace ( e . filter . regex . orReplace , "|" ) , b , d ) ; ! c . $headers . filter ( '[data-column="' + b + '"]:last' ) . hasClass ( "filter-match" ) && /\|/ . test ( d ) && ( "|" === d [ d . length - 1 ] && ( d += "*" ) , d = a . anyMatch && k . isArray ( a . rowArray ) ? "(" + d + ")" : "^(" + d + ")$" ) ; return ( new RegExp ( d . replace ( /\?/g , "\\S{1}" ) . replace ( /\*/g , "\\S*" ) ) ) . test ( a . iExact ) } return null } , fuzzy : function ( c , a ) { if ( /^~/ . test ( a . iFilter ) ) { var b , d = 0 , f = a . iExact . length , h = e . filter . parseFilter ( c , a . iFilter . slice ( 1 ) , a . index , a . parsed [ a . index ] ) ; for ( b = 0 ; b < f ; b ++ ) a . iExact [ b ] === h [ d ] && ( d += 1 ) ; return d === h . length ? ! 0 : ! 1 } return null } } , init : function ( c , a , b ) { e . language = k . extend ( ! 0 , { } , { to : "to" , or : "or" , and : "and" } , e . language ) ; var d , f , h , g , m , n , p ; d = e . filter . regex ; a . $table . addClass ( "hasFilters" ) ; b . searchTimer = null ; b . filter _initTimer = null ; b . filter _formatterCount = 0 ; b . filter _formatterInit = [ ] ; b . filter _anyColumnSelector = '[data-column="all"],[data-column="any"]' ; b . filter _multipleColumnSelector = '[data-column*="-"],[data-column*=","]' ; h = "\\{" + e . filter . regex . query + "\\}" ; k . extend ( d , { child : new RegExp ( a . cssChildRow ) , filtered : new RegExp ( b . filter _filteredRow ) , alreadyFiltered : new RegExp ( "(\\s+(" + e . language . or + "|-|" + e . language . to + ")\\s+)" , "i" ) , toTest : new RegExp ( "\\s+(-|" + e . language . to + ")\\s+" , "i" ) , toSplit : ne
2014-10-27 00:11:12 +00:00
e . getFilters = function ( c , a , b , d ) { var f , h , g = ! 1 , m = c ? k ( c ) [ 0 ] . config : "" , n = m ? m . widgetOptions : "" ; if ( ! 0 !== a && n && ! n . filter _columnFilters ) return k ( c ) . data ( "lastSearch" ) ; if ( m && ( m . $filters && ( f = m . $filters . find ( "." + e . css . filter ) ) , n . filter _$externalFilters && ( f = f && f . length ? f . add ( n . filter _$externalFilters ) : n . filter _$externalFilters ) , f && f . length ) ) for ( g = b || [ ] , c = 0 ; c < m . columns + 1 ; c ++ ) h = c === m . columns ? n . filter _anyColumnSelector + "," + n . filter _multipleColumnSelector : '[data-column="' + c + '"]' , a = f . filter ( h ) , a . length && ( a = e . filter . getLatestSearch ( a ) , k . isArray ( b ) ? ( d && a . slice ( 1 ) , c === m . columns && ( h = a . filter ( n . filter _anyColumnSelector ) , a = h . length ? h : a ) , a . val ( b [ c ] ) . trigger ( "change.tsfilter" ) ) : ( g [ c ] = a . val ( ) || "" , c === m . columns ? a . slice ( 1 ) . filter ( '[data-column*="' + a . attr ( "data-column" ) + '"]' ) . val ( g [ c ] ) : a . slice ( 1 ) . val ( g [ c ] ) ) , c === m . columns && a . length && ( n . filter _$anyMatch = a ) ) ; 0 === g . length && ( g = ! 1 ) ; return g } ;
e . setFilters = function ( c , a , b , d ) { var f = c ? k ( c ) [ 0 ] . config : "" ; c = e . getFilters ( c , ! 0 , a , d ) ; f && b && ( f . lastCombinedFilter = null , f . lastSearch = [ ] , e . filter . searching ( f . $table [ 0 ] , a , d ) , f . $table . trigger ( "filterFomatterUpdate" ) ) ; return ! ! c } ;
e . addWidget ( { id : "stickyHeaders" , priority : 60 , options : { stickyHeaders : "" , stickyHeaders _attachTo : null , stickyHeaders _xScroll : null , stickyHeaders _yScroll : null , stickyHeaders _offset : 0 , stickyHeaders _filteredToTop : ! 0 , stickyHeaders _cloneId : "-sticky" , stickyHeaders _addResizeEvent : ! 0 , stickyHeaders _includeCaption : ! 0 , stickyHeaders _zIndex : 2 } , format : function ( c , a , b ) { if ( ! ( a . $table . hasClass ( "hasStickyHeaders" ) || 0 <= k . inArray ( "filter" , a . widgets ) && ! a . $table . hasClass ( "hasFilters" ) ) ) { var d = a . $table , f = k ( b . stickyHeaders _attachTo ) , h = a . namespace + "stickyheaders " , g = k ( b . stickyHeaders _yScroll || b . stickyHeaders _attachTo || z ) , m = k ( b . stickyHeaders _xScroll || b . stickyHeaders _attachTo || z ) , n = d . children ( "thead:first" ) . children ( "tr" ) . not ( ".sticky-false" ) . children ( ) , p = d . children ( "tfoot" ) , r = isNaN ( b . stickyHeaders _offset ) ? k ( b . stickyHeaders _offset ) : "" , v = f . length ? 0 : r . length ? r . height ( ) || 0 : parseInt ( b . stickyHeaders _offset , 10 ) || 0 , w = d . parent ( ) . closest ( "." + e . css . table ) . hasClass ( "hasStickyHeaders" ) ? d . parent ( ) . closest ( "table.tablesorter" ) [ 0 ] . config . widgetOptions . $sticky . parent ( ) : [ ] , s = w . length ? w . height ( ) : 0 , t = b . $sticky = d . clone ( ) . addClass ( "containsStickyHeaders " + e . css . sticky + " " + b . stickyHeaders ) . wrap ( '<div class="' + e . css . stickyWrap + '">' ) , x = t . parent ( ) . css ( { position : f . length ? "absolute" : "fixed" , margin : 0 , top : v + s , left : 0 , visibility : "hidden" , zIndex : b . stickyHeaders _zIndex || 2 } ) , D = t . children ( "thead:first" ) , y , A = "" , B = 0 , F = function ( a , b ) { a . filter ( ":visible" ) . each ( function ( a ) { var d ; a = b . filter ( ":visible" ) . eq ( a ) ; var c = k ( this ) ; "border-box" === c . css ( "box-sizing" ) ? d = c . outerWidth ( ) : "collapse" === a . css ( "border-collapse" ) ? z . getComputedStyle ? d = parseFloat ( z . getComputedStyle ( this , null ) . width ) : ( d = parseFloat ( c . css ( "border-width" ) ) , d = c . outerWidth ( ) - parseFloat ( c . css ( "padding-left" ) ) - parseFloat ( c . css ( "padding-right" ) ) - d ) : d = c . width ( ) ; a . css ( { "min-width" : d , "max-width" : d } ) } ) } , C = function ( ) { v = r . length ? r . height ( ) || 0 : parseInt ( b . stickyHeaders _offset , 10 ) || 0 ; B = 0 ; x . css ( { left : f . length ? parseInt ( f . css ( "padding-left" ) , 10 ) || 0 : d . offset ( ) . left - parseInt ( d . css ( "margin-left" ) , 10 ) - m . scrollLeft ( ) - B , width : d . outerWidth ( ) } ) ; F ( d , t ) ; F ( n , y ) } ; t . attr ( "id" ) && ( t [ 0 ] . id += b . stickyHeaders _cloneId ) ; t . find ( "thead:gt(0), tr.sticky-false" ) . hide ( ) ; t . find ( "tbody, tfoot" ) . remove ( ) ; b . stickyHeaders _includeCaption || t . find ( "caption" ) . remove ( ) ; y = D . children ( ) . children ( ) ; t . css ( { height : 0 , width : 0 , margin : 0 } ) ; y . find ( "." + e . css . resizer ) . remove ( ) ; d . addClass ( "hasStickyHeaders" ) . bind ( "pagerComplete" + h , function ( ) { C ( ) } ) ; e . bindEvents ( c , D . children ( ) . children ( ".tablesorter-header" ) ) ; d . after ( x ) ; a . onRenderHeader && D . children ( "tr" ) . children ( ) . each ( function ( b ) { a . onRenderHeader . apply ( k ( this ) , [ b , a , t ] ) } ) ; m . add ( g ) . unbind ( [ "scroll" , "resize" , "" ] . join ( h ) ) . bind ( [ "scroll" , "resize" , "" ] . join ( h ) , function ( a ) { if ( d . is ( ":visible" ) ) { s = w . length ? w . offset ( ) . top - g . scrollTop ( ) + w . height ( ) : 0 ; var b = d . offset ( ) , c = k . isWindow ( g [ 0 ] ) , e = k . isWindow ( m [ 0 ] ) , h = ( f . length ? c ? g . scrollTop ( ) : g . offset ( ) . top : g . scrollTop ( ) ) + v + s , l = d . height ( ) - ( x . height ( ) + ( p . height ( ) || 0 ) ) , b = h > b . top && h < b . top + l ? "visible" : "hidden" , l = { visibility : b } ; f . length && ( l . top = c ? h : f . scrollTop ( ) ) ; e && ( l . left = d . offset ( ) . left - parseInt ( d . css ( "margin-left" ) , 10 ) - m . scrollLeft ( ) - B ) ; w . length && ( l . top = ( l . top || 0 ) + v + s ) ; x . removeClass ( "tablesorter-sticky-visible tablesorter-sticky-hidden" ) . addClass ( "tablesorter-sticky-" + b ) . css ( l ) ; if ( b !== A || "resize" === a . type ) C ( ) , A = b } } ) ; b . stickyHeaders _addResizeEvent && e . addHeaderResizeEvent ( c ) ; d . hasClass ( "hasFilters" ) && b . filter _columnFilters && ( d . bind ( "filterEnd" + h , function ( ) { var c = k ( document . activeElement ) . closest ( "td" ) , c = c . parent ( ) . children ( ) . index ( c ) ; x . hasClass ( e . css . stickyVis ) && b . stickyHeaders _filteredToTop && ( z . scrollTo ( 0 , d . position ( ) . top ) , 0 <= c && a . $filters && a . $filters . eq ( c ) . find ( "a, select, input" ) . filter ( ":visible" ) . focus ( ) ) } ) , e . filter . bindSearch ( d , y . find ( "." + e . css . filter ) ) , b . filter _hideFilters && e . filter . hideFilters ( t , a ) ) ; d . trigger ( "stickyHeadersInit" ) } } , remove : function ( c , a , b ) { var d = a . namespace + "stickyheaders " ; a . $table . removeClass ( "hasStickyHeaders" ) . unbind ( [ "pagerComplete" , "filterEnd" , "" ] . join ( d ) ) . next ( "." + e . css . stickyWrap ) . remove ( ) ; b . $sticky && b . $sticky . length && b . $sticky . remove ( ) ; k ( ".hasStickyHeaders" ) . length || k ( z ) . add ( b . stickyHeaders _
e . addWidget ( { id : "resizable" , priority : 40 , options : { resizable : ! 0 , resizable _addLastColumn : ! 1 , resizable _widths : [ ] , resizable _throttle : ! 1 } , format : function ( c , a , b ) { if ( ! a . $table . hasClass ( "hasResizable" ) ) { a . $table . addClass ( "hasResizable" ) ; e . resizableReset ( c , ! 0 ) ; var d , f , h , g , m , n = { } , p = a . $table , r = p . parent ( ) , v = "auto" === p . parent ( ) . css ( "overflow" ) , w = 0 , s = null , t = null , x = 20 > Math . abs ( p . parent ( ) . width ( ) - p . width ( ) ) , D = function ( a ) { if ( 0 !== w && s ) { var b = a . pageX - w , c = s . width ( ) ; s . width ( c + b ) ; s . width ( ) !== c && x ? t . width ( t . width ( ) - b ) : v && ( p . width ( function ( a , c ) { return c + b } ) , t . length || ( r [ 0 ] . scrollLeft = p . width ( ) ) ) ; w = a . pageX } } , y = function ( ) { e . storage && s && t && ( n = { } , n [ s . index ( ) ] = s . width ( ) , n [ t . index ( ) ] = t . width ( ) , s . width ( n [ s . index ( ) ] ) , t . width ( n [ t . index ( ) ] ) , ! 1 !== b . resizable && e . storage ( c , "tablesorter-resizable" , a . $headers . map ( function ( ) { return k ( this ) . width ( ) } ) . get ( ) ) ) ; w = 0 ; s = t = null ; k ( z ) . trigger ( "resize" ) } ; if ( n = e . storage && ! 1 !== b . resizable ? e . storage ( c , "tablesorter-resizable" ) : { } ) for ( g in n ) ! isNaN ( g ) && g < a . $headers . length && a . $headers . eq ( g ) . width ( n [ g ] ) ; d = p . children ( "thead:first" ) . children ( "tr" ) ; d . children ( ) . each ( function ( ) { var b ; b = k ( this ) ; g = b . attr ( "data-column" ) ; b = "false" === e . getData ( b , e . getColumnData ( c , a . headers , g ) , "resizable" ) ; d . children ( ) . filter ( '[data-column="' + g + '"]' ) [ b ? "addClass" : "removeClass" ] ( "resizable-false" ) } ) ; d . each ( function ( ) { h = k ( this ) . children ( ) . not ( ".resizable-false" ) ; k ( this ) . find ( "." + e . css . wrapper ) . length || h . wrapInner ( '<div class="' + e . css . wrapper + '" style="position:relative;height:100%;width:100%"></div>' ) ; b . resizable _addLastColumn || ( h = h . slice ( 0 , - 1 ) ) ; f = f ? f . add ( h ) : h } ) ; f . each ( function ( ) { var a = k ( this ) , b = parseInt ( a . css ( "padding-right" ) , 10 ) + 10 ; a . find ( "." + e . css . wrapper ) . append ( '<div class="' + e . css . resizer + '" style="cursor:w-resize;position:absolute;z-index:1;right:-' + b + 'px;top:0;height:100%;width:20px;"></div>' ) } ) . find ( "." + e . css . resizer ) . bind ( "mousedown" , function ( b ) { s = k ( b . target ) . closest ( "th" ) ; var c = a . $headers . filter ( '[data-column="' + s . attr ( "data-column" ) + '"]' ) ; 1 < c . length && ( s = s . add ( c ) ) ; t = b . shiftKey ? s . parent ( ) . find ( "th" ) . not ( ".resizable-false" ) . filter ( ":last" ) : s . nextAll ( ":not(.resizable-false)" ) . eq ( 0 ) ; w = b . pageX } ) ; k ( document ) . bind ( "mousemove.tsresize" , function ( a ) { 0 !== w && s && ( b . resizable _throttle ? ( clearTimeout ( m ) , m = setTimeout ( function ( ) { D ( a ) } , isNaN ( b . resizable _throttle ) ? 5 : b . resizable _throttle ) ) : D ( a ) ) } ) . bind ( "mouseup.tsresize" , function ( ) { y ( ) } ) ; p . find ( "thead:first" ) . bind ( "contextmenu.tsresize" , function ( ) { e . resizableReset ( c ) ; var a = k . isEmptyObject ? k . isEmptyObject ( n ) : ! 0 ; n = { } ; return a } ) } } , remove : function ( c , a ) { a . $table . removeClass ( "hasResizable" ) . children ( "thead" ) . unbind ( "mouseup.tsresize mouseleave.tsresize contextmenu.tsresize" ) . children ( "tr" ) . children ( ) . unbind ( "mousemove.tsresize mouseup.tsresize" ) . find ( "." + e . css . resizer ) . remove ( ) ; e . resizableReset ( c ) } } ) ;
e . resizableReset = function ( c , a ) { k ( c ) . each ( function ( ) { var b , d = this . config , f = d && d . widgetOptions ; c && d && ( d . $headers . each ( function ( a ) { b = k ( this ) ; f . resizable _widths [ a ] ? b . css ( "width" , f . resizable _widths [ a ] ) : b . hasClass ( "resizable-false" ) || b . css ( "width" , "" ) } ) , e . storage && ! a && e . storage ( this , "tablesorter-resizable" , { } ) ) } ) } ;
2014-11-03 23:45:53 +00:00
e . addWidget ( { id : "saveSort" , priority : 20 , options : { saveSort : ! 0 } , init : function ( c , a , b , d ) { a . format ( c , b , d , ! 0 ) } , format : function ( c , a , b , d ) { var f , h = a . $table ; b = ! 1 !== b . saveSort ; var g = { sortList : a . sortList } ; a . debug && ( f = new Date ) ; h . hasClass ( "hasSaveSort" ) ? b && c . hasInitialized && e . storage && ( e . storage ( c , "tablesorter-savesort" , g ) , a . debug && e . benchmark ( "saveSort widget: Saving last sort: " + a . sortList , f ) ) : ( h . addClass ( "hasSaveSort" ) , g = "" , e . storage && ( g = ( b = e . storage ( c , "tablesorter-savesort" ) ) && b . hasOwnProperty ( "sortList" ) && k . isArray ( b . sortList ) ? b . sortList : "" , a . debug && e . benchmark ( 'saveSort: Last sort loaded: "' + g + '"' , f ) , h . bind ( "saveSortReset" , function ( a ) { a . stopPropagation ( ) ; e . storage ( c , "tablesorter-savesort" , "" ) } ) ) , d && g && 0 < g . length ? a . sortList = g : c . hasInitialized && g && 0 < g . length && h . trigger ( "sorton" , [ g ] ) ) } , remove : function ( c ) { e . storage && e . storage ( c , "tablesorter-savesort" , "" ) } }
) } ) ( jQuery , window ) ;