2014-07-17 17:40:11 +00:00
/*! tableSorter 2.16+ widgets - updated 7/17/2014 (v2.17.5) */
2014-05-29 00:18:37 +00:00
; ( function ( k ) {
2014-06-29 04:04:50 +00:00
var c = k . tablesorter = k . tablesorter || { } ;
2014-07-17 17:40:11 +00:00
c . 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 ui-corner-all" , 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 ( c . css , { filterRow : "tablesorter-filter-row" , filter : "tablesorter-filter" , wrapper : "tablesorter-wrapper" , resizer : "tablesorter-resizer" , sticky : "tablesorter-stickyHeader" , stickyVis : "tablesorter-sticky-visible" } ) ;
c . storage = function ( b , a , e , d ) { b = k ( b ) [ 0 ] ; var c , f , h = ! 1 ; c = { } ; f = b . config ; var l = k ( b ) ; b = d && d . id || l . attr ( d && d . group || "data-table-group" ) || b . id || k ( ".tablesorter" ) . index ( l ) ; d = d && d . url || l . attr ( d && d . page || "data-table-page" ) || f && f . fixedUrl || window . location . pathname ; if ( "localStorage" in window ) try { window . localStorage . setItem ( "_tmptest" , "temp" ) , h = ! 0 , window . localStorage . removeItem ( "_tmptest" ) } catch ( m ) { } k . parseJSON && ( h ? c = k . parseJSON ( localStorage [ a ] || "{}" ) : ( f = document . cookie . split ( /[;\s|=]/ ) , c = k . inArray ( a , f ) + 1 , c = 0 !== c ? k . parseJSON ( f [ c ] || "{}" ) : { } ) ) ; if ( ( e || "" === e ) && window . JSON && JSON . hasOwnProperty ( "stringify" ) ) c [ d ] || ( c [ d ] = { } ) , c [ d ] [ b ] = e , h ? localStorage [ a ] = JSON . stringify ( c ) : ( e = new Date , e . setTime ( e . getTime ( ) + 31536E6 ) , document . cookie = a + "=" + JSON . stringify ( c ) . replace ( /\"/g , '"' ) + "; expires=" + e . toGMTString ( ) + "; path=/" ) ; else return c && c [ d ] ? c [ d ] [ b ] : "" } ;
c . addHeaderResizeEvent = function ( b , a , c ) { var d ; c = k . extend ( { } , { timer : 250 } , c ) ; var g = b . config , f = g . widgetOptions , h = function ( a ) { f . resize _flag = ! 0 ; d = [ ] ; g . $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 && g . $table . trigger ( "resize" , [ d ] ) ; f . resize _flag = ! 1 } ; h ( ! 1 ) ; clearInterval ( f . resize _timer ) ; if ( a ) return f . resize _flag = ! 1 ; f . resize _timer = setInterval ( function ( ) { f . resize _flag || h ( ) } , c . timer ) } ;
c . addWidget ( { id : "uitheme" , priority : 10 , format : function ( b , a , e ) { var d , g , f , h = c . themes ; d = a . $table ; f = a . $headers ; var l = a . theme || "jui" , m = h [ l ] || h . jui , h = m . sortNone + " " + m . sortDesc + " " + m . sortAsc ; a . debug && ( g = new Date ) ; d . hasClass ( "tablesorter-" + l ) && a . theme !== l && b . hasInitialized || ( "" !== m . even && ( e . zebra [ 0 ] += " " + m . even ) , "" !== m . odd && ( e . zebra [ 1 ] += " " + m . odd ) , d . find ( "caption" ) . addClass ( m . caption ) , b = d . removeClass ( "" === a . theme ? "" : "tablesorter-" + a . theme ) . addClass ( "tablesorter-" + l + " " + m . table ) . find ( "tfoot" ) , b . length && b . find ( "tr" ) . addClass ( m . footerRow ) . children ( "th, td" ) . addClass ( m . footerCells ) , f . addClass ( m . header ) . not ( ".sorter-false" ) . bind ( "mouseenter.tsuitheme mouseleave.tsuitheme" , function ( a ) { k ( this ) [ "mouseenter" === a . type ? "addClass" : "removeClass" ] ( m . hover ) } ) , f . find ( "." + c . css . wrapper ) . length || f . wrapInner ( '<div class="' + c . css . wrapper + '" style="position:relative;height:100%;width:100%"></div>' ) , a . cssIcon && f . find ( "." + c . css . icon ) . addClass ( m . icons ) , d . hasClass ( "hasFilters" ) && f . find ( "." + c . css . filterRow ) . addClass ( m . filterRow ) ) ; for ( d = 0 ; d < a . columns ; d ++ ) f = a . $headers . add ( a . $extraHeaders ) . filter ( '[data-column="' + d + '"]' ) , b = c . css . icon ? f . find ( "." + c . css . icon ) : f , e = a . $headers . filter ( '[data-column="' + d + '"]:last' ) , e . length && ( e [ 0 ] . sortDisabled ? ( f . removeClass ( h ) , b . removeClass ( h + " " + m . icons ) ) : ( e = f . hasClass ( c . css . sortAsc ) ? m . sortAsc : f . hasClass ( c . css . sortDesc ) ? m . sortDesc : f . hasClass ( c . css . header ) ? m . sortNone : "" , f [ e === m . sortNone ? "removeClass" : "addClass" ] ( m . active ) , b . removeClass ( h ) . addClass ( e ) ) ) ; a . debug && c . benchmark ( "Applying " + l + " theme" , g ) } , remove : function ( b , a , e ) { b = a . $table ; a = a . theme || "jui" ; e = c . themes [ a ] || c . themes . jui ; var d = b . children ( "thead" ) . children ( ) , g = e . sortNone + " " + e . sortDesc + " " + e . sortAsc ; b . removeClass ( "tablesorter-" + a + " " + e . table ) . find ( c . css . header ) . removeClass ( e . header ) ; d . unbind ( "mouseenter.tsuitheme mouseleave.tsuitheme" ) . removeClass ( e . hover + " " + g + " " + e . active ) . find ( "." + c . css . filterRow ) . removeClass ( e . filterRow ) ; d . find ( "." + c . css . icon ) . removeClass ( e . icons ) } } ) ;
2014-07-04 12:36:50 +00:00
c . addWidget ( { id : "columns" , priority : 30 , options : { columns : [ "primary" , "secondary" , "tertiary" ] } , format : function ( b , a , e ) { var d , g , f , h , l , m , p , n , s = a . $table , r = a . $tbodies , t = a . sortList , v = t . length , w = e && e . columns || [ "primary" , "secondary" , "tertiary" ] , x = w . length - 1 ; p = w . join ( " " ) ; a . debug && ( d = new Date ) ; for ( f = 0 ; f < r . length ; f ++ ) g = c . processTbody ( b , r . eq ( f ) , ! 0 ) , h = g . children ( "tr" ) , h . each ( function ( ) { l = k ( this ) ; if ( "none" !== this . style . display && ( m = l . children ( ) . removeClass ( p ) , t && t [ 0 ] && ( m . eq ( t [ 0 ] [ 0 ] ) . addClass ( w [ 0 ] ) , 1 < v ) ) ) for ( n = 1 ; n < v ; n ++ ) m . eq ( t [ n ] [ 0 ] ) . addClass ( w [ n ] || w [ x ] ) } ) , c . processTbody ( b , g , ! 1 ) ; b = ! 1 !== e . columns _thead ? [ "thead tr" ] : [ ] ; ! 1 !== e . columns _tfoot && b . push ( "tfoot tr" ) ; if ( b . length && ( h = s . find ( b . join ( "," ) ) . children ( ) . removeClass ( p ) , v ) ) for ( n = 0 ; n < v ; n ++ ) h . filter ( '[data-column="' + t [ n ] [ 0 ] + '"]' ) . addClass ( w [ n ] || w [ x ] ) ; a . debug && c . benchmark ( "Applying Columns widget" , d ) } , remove : function ( b , a , e ) { var d = a . $tbodies , g = ( e . columns || [ "primary" , "secondary" , "tertiary" ] ) . join ( " " ) ; a . $headers . removeClass ( g ) ; a . $table . children ( "tfoot" ) . children ( "tr" ) . children ( "th, td" ) . removeClass ( g ) ; for ( a = 0 ; a < d . length ; a ++ ) e = c . processTbody ( b , d . eq ( a ) , ! 0 ) , e . children ( "tr" ) . each ( function ( ) { k ( this ) . children ( ) . removeClass ( g ) } ) , c . processTbody ( b , e , ! 1 ) } } ) ;
c . addWidget ( { id : "filter" , priority : 50 , options : { filter _childRows : ! 1 , filter _columnFilters : ! 0 , filter _cssFilter : "" , 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" } , format : function ( b , a , e ) { a . $table . hasClass ( "hasFilters" ) || c . filter . init ( b , a , e ) } , remove : function ( b , a , e ) { var d , g = a . $tbodies ; a . $table . removeClass ( "hasFilters" ) . unbind ( "addRows updateCell update updateRows updateComplete appendCache filterReset filterEnd search " . split ( " " ) . join ( a . namespace + "filter " ) ) . find ( "." + c . css . filterRow ) . remove ( ) ; for ( a = 0 ; a < g . length ; a ++ ) d = c . processTbody ( b , g . eq ( a ) , ! 0 ) , d . children ( ) . removeClass ( e . filter _filteredRow ) . show ( ) , c . processTbody ( b , d , ! 1 ) ; e . filter _reset && k ( document ) . undelegate ( e . filter _reset , "click.tsfilter" ) } } ) ;
2014-07-17 17:40:11 +00:00
c . filter = { regex : { regex : /^\/((?:\\\/|[^\/])+)\/([mig]{0,3})?$/ , child : /tablesorter-childRow/ , filtered : /filtered/ , type : /undefined|number/ , exact : /(^[\"|\'|=]+)|([\"|\'|=]+$)/g , nondigit : /[^\w,. \-()]/g , operators : /[<>=]/g } , types : { regex : function ( b , a , e , d ) { if ( c . filter . regex . regex . test ( a ) ) { var g ; b = c . filter . regex . regex . exec ( a ) ; try { g = ( new RegExp ( b [ 1 ] , b [ 2 ] ) ) . test ( d ) } catch ( f ) { g = ! 1 } return g } return null } , operators : function ( b , a , e , d , g , f , h , l , m ) { if ( /^[<>]=?/ . test ( a ) ) { var p ; e = h . config ; b = c . formatFloat ( a . replace ( c . filter . regex . operators , "" ) , h ) ; l = e . parsers [ f ] ; e = b ; if ( m [ f ] || "numeric" === l . type ) p = c . filter . parseFilter ( h , k . trim ( "" + a . replace ( c . filter . regex . operators , "" ) ) , f , m [ f ] , ! 0 ) , b = "number" !== typeof p || "" === p || isNaN ( p ) ? b : p ; d = ! m [ f ] && "numeric" !== l . type || isNaN ( b ) || "undefined" === typeof g ? isNaN ( d ) ? c . formatFloat ( d . replace ( c . filter . regex . nondigit , "" ) , h ) : c . formatFloat ( d , h ) : g ; />/ . test ( a ) && ( p = />=/ . test ( a ) ? d >= b : d > b ) ; /</ . test ( a ) && ( p = /<=/ . test ( a ) ? d <= b : d < b ) ; p || "" !== e || ( p = ! 0 ) ; return p } return null } , notMatch : function ( b , a , e , d , g , f , h , l , m ) { if ( /^\!/ . test ( a ) ) { a = c . filter . parseFilter ( h , a . replace ( "!" , "" ) , f , m [ f ] ) ; if ( c . filter . regex . exact . test ( a ) ) return a = a . replace ( c . filter . regex . exact , "" ) , "" === a ? ! 0 : k . trim ( a ) !== d ; b = d . search ( k . trim ( a ) ) ; return "" === a ? ! 0 : ! ( l . filter _startsWith ? 0 === b : 0 <= b ) } return null } , exact : function ( b , a , e , d , g , f , h , l , m , p ) { return c . filter . regex . exact . test ( a ) ? ( b = c . filter . parseFilter ( h , a . replace ( c . filter . regex . exact , "" ) , f , m [ f ] ) , p ? 0 <= k . inArray ( b , p ) : b == d ) : null } , and : function ( b , a , e , d , g , f , h , l , m ) { if ( c . filter . regex . andTest . test ( b ) ) { b = a . split ( c . filter . regex . andSplit ) ; a = 0 <= d . search ( k . trim ( c . filter . parseFilter ( h , b [ 0 ] , f , m [ f ] ) ) ) ; for ( e = b . length - 1 ; a && e ; ) a = a && 0 <= d . search ( k . trim ( c . filter . parseFilter ( h , b [ e ] , f , m [ f ] ) ) ) , e -- ; return a } return null } , range : function ( b , a , e , d , g , f , h , k , m ) { if ( c . filter . regex . toTest . test ( a ) ) { b = h . config ; var p = a . split ( c . filter . regex . toSplit ) ; e = c . formatFloat ( c . filter . parseFilter ( h , p [ 0 ] . replace ( c . filter . regex . nondigit , "" ) , f , m [ f ] ) , h ) ; k = c . formatFloat ( c . filter . parseFilter ( h , p [ 1 ] . replace ( c . filter . regex . nondigit , "" ) , f , m [ f ] ) , h ) ; if ( m [ f ] || "numeric" === b . parsers [ f ] . type ) a = b . parsers [ f ] . format ( "" + p [ 0 ] , h , b . $headers . eq ( f ) , f ) , e = "" === a || isNaN ( a ) ? e : a , a = b . parsers [ f ] . format ( "" + p [ 1 ] , h , b . $headers . eq ( f ) , f ) , k = "" === a || isNaN ( a ) ? k : a ; a = ! m [ f ] && "numeric" !== b . parsers [ f ] . type || isNaN ( e ) || isNaN ( k ) ? isNaN ( d ) ? c . formatFloat ( d . replace ( c . filter . regex . nondigit , "" ) , h ) : c . formatFloat ( d , h ) : g ; e > k && ( d = e , e = k , k = d ) ; return a >= e && a <= k || "" === e || "" === k } return null } , wild : function ( b , a , e , d , g , f , h , l , m , p ) { return /[\?|\*]/ . test ( a ) || c . filter . regex . orReplace . test ( b ) ? ( b = h . config , a = c . filter . parseFilter ( h , a . replace ( c . filter . regex . orReplace , "|" ) , f , m [ f ] ) , ! b . $headers . filter ( '[data-column="' + f + '"]:last' ) . hasClass ( "filter-match" ) && /\|/ . test ( a ) && ( a = k . isArray ( p ) ? "(" + a + ")" : "^(" + a + ")$" ) , ( new RegExp ( a . replace ( /\?/g , "\\S{1}" ) . replace ( /\*/g , "\\S*" ) ) ) . test ( d ) ) : null } , fuzzy : function ( b , a , e , d , g , f , h , k , m ) { if ( /^~/ . test ( a ) ) { b = 0 ; e = d . length ; f = c . filter . parseFilter ( h , a . slice ( 1 ) , f , m [ f ] ) ; for ( a = 0 ; a < e ; a ++ ) d [ a ] === f [ b ] && ( b += 1 ) ; return b === f . length ? ! 0 : ! 1 } return null } } , init : function ( b , a , e ) { c . language = k . extend ( ! 0 , { } , { to : "to" , or : "or" , and : "and" } , c . language ) ; var d , g , f , h , l , m , p ; d = c . filter . regex ; a . debug && ( m = new Date ) ; a . $table . addClass ( "hasFilters" ) ; e . searchTimer = null ; e . filter _initTimer = null ; e . filter _formatterCount = 0 ; e . filter _formatterInit = [ ] ; k . extend ( d , { child : new RegExp ( a . cssChildRow ) , filtered : new RegExp ( e . filter _filteredRow ) , alreadyFiltered : new RegExp ( "(\\s+(" + c . language . or + "|-|" + c . language . to + ")\\s+)" , "i" ) , toTest : new RegExp ( "\\s+(-|" + c . language . to + ")\\s+" , "i" ) , toSplit : new RegExp ( "(?:\\s+(?:-|" + c . language . to + ")\\s+)" , "gi" ) , andTest : new RegExp ( "\\s+(" + c . language . and + "|&&)\\s+" , "i" ) , andSplit : new RegExp ( "(?:\\s+(?:" + c . language . and + "|&&)\\s+)" , "gi" ) , orReplace : new RegExp ( "\\s+(" + c . language . or + ")\\s+" , "gi" ) } ) ; ! 1 !== e . filter _columnFilters && a . $headers . filter ( ".filter-false" ) . length !== a . $headers . length && c . filter . buildRow ( b , a , e ) ; a . $table . bind ( "addRows updateCell update updateRows updateComplete appendCache filterReset filterEnd search " . split ( " " ) . join ( a . namespace + "filter " ) , function ( d , f ) { a . $table . find ( "." + c . css . filterRow ) . toggle ( ! ( e . filter _hideEmpty && k . isEmptyObject ( a . cache ) && ( ! a
c . getFilters = function ( b , a , e , d ) { var g , f = ! 1 , h = b ? k ( b ) [ 0 ] . config : "" , l = h ? h . widgetOptions : "" ; if ( ! 0 !== a && l && ! l . filter _columnFilters ) return k ( b ) . data ( "lastSearch" ) ; if ( h && ( h . $filters && ( g = h . $filters . find ( "." + c . css . filter ) ) , l . filter _$externalFilters && ( g = g && g . length ? g . add ( l . filter _$externalFilters ) : l . filter _$externalFilters ) , g && g . length ) ) for ( f = e || [ ] , b = 0 ; b < h . columns + 1 ; b ++ ) a = g . filter ( '[data-column="' + ( b === h . columns ? "all" : b ) + '"]' ) , a . length && ( a = a . sort ( function ( a , b ) { return k ( b ) . attr ( "data-lastSearchTime" ) - k ( a ) . attr ( "data-lastSearchTime" ) } ) , k . isArray ( e ) ? ( d ? a . slice ( 1 ) : a ) . val ( e [ b ] ) . trigger ( "change.tsfilter" ) : ( f [ b ] = a . val ( ) || "" , a . slice ( 1 ) . val ( f [ b ] ) ) , b === h . columns && a . length && ( l . filter _$anyMatch = a ) ) ; 0 === f . length && ( f = ! 1 ) ; return f } ;
c . setFilters = function ( b , a , e , d ) { var g = b ? k ( b ) [ 0 ] . config : "" ; b = c . getFilters ( b , ! 0 , a , d ) ; g && e && ( g . lastCombinedFilter = null , g . lastSearch = [ ] , c . filter . searching ( g . $table [ 0 ] , a , d ) , g . $table . trigger ( "filterFomatterUpdate" ) ) ; return ! ! b } ;
c . addWidget ( { id : "stickyHeaders" , priority : 60 , options : { stickyHeaders : "" , stickyHeaders _attachTo : null , stickyHeaders _offset : 0 , stickyHeaders _filteredToTop : ! 0 , stickyHeaders _cloneId : "-sticky" , stickyHeaders _addResizeEvent : ! 0 , stickyHeaders _includeCaption : ! 0 , stickyHeaders _zIndex : 2 } , format : function ( b , a , e ) { if ( ! ( a . $table . hasClass ( "hasStickyHeaders" ) || 0 <= k . inArray ( "filter" , a . widgets ) && ! a . $table . hasClass ( "hasFilters" ) ) ) { var d = a . $table , g = k ( e . stickyHeaders _attachTo ) , f = d . children ( "thead:first" ) , h = g . length ? g : k ( window ) , l = f . children ( "tr" ) . not ( ".sticky-false" ) . children ( ) , m = "." + c . css . headerIn , p = d . find ( "tfoot" ) , n = isNaN ( e . stickyHeaders _offset ) ? k ( e . stickyHeaders _offset ) : "" , s = g . length ? 0 : n . length ? n . height ( ) || 0 : parseInt ( e . stickyHeaders _offset , 10 ) || 0 , r = e . $sticky = d . clone ( ) . addClass ( "containsStickyHeaders" ) . css ( { position : g . length ? "absolute" : "fixed" , margin : 0 , top : s , left : 0 , visibility : "hidden" , zIndex : e . stickyHeaders _zIndex ? e . stickyHeaders _zIndex : 2 } ) , t = r . children ( "thead:first" ) . addClass ( c . css . sticky + " " + e . stickyHeaders ) , v , w = "" , x = 0 , z = "collapse" !== d . css ( "border-collapse" ) && ! /(webkit|msie)/i . test ( navigator . userAgent ) , y = function ( ) { s = n . length ? n . height ( ) || 0 : parseInt ( e . stickyHeaders _offset , 10 ) || 0 ; x = 0 ; z && ( x = 2 * parseInt ( l . eq ( 0 ) . css ( "border-left-width" ) , 10 ) ) ; r . css ( { left : g . length ? ( parseInt ( g . css ( "padding-left" ) , 10 ) || 0 ) + parseInt ( a . $table . css ( "padding-left" ) , 10 ) + parseInt ( a . $table . css ( "margin-left" ) , 10 ) + parseInt ( d . css ( "border-left-width" ) , 10 ) : f . offset ( ) . left - h . scrollLeft ( ) - x , width : d . width ( ) } ) ; v . filter ( ":visible" ) . each ( function ( b ) { b = l . filter ( ":visible" ) . eq ( b ) ; var c = z && k ( this ) . attr ( "data-column" ) === "" + parseInt ( a . columns / 2 , 10 ) ? 1 : 0 ; k ( this ) . css ( { width : b . width ( ) - x } ) . find ( m ) . width ( b . find ( m ) . width ( ) - c ) } ) } ; r . attr ( "id" ) && ( r [ 0 ] . id += e . stickyHeaders _cloneId ) ; r . find ( "thead:gt(0), tr.sticky-false" ) . hide ( ) ; r . find ( "tbody, tfoot" ) . remove ( ) ; e . stickyHeaders _includeCaption ? r . find ( "caption" ) . css ( "margin-left" , "-1px" ) : r . find ( "caption" ) . remove ( ) ; v = t . children ( ) . children ( ) ; r . css ( { height : 0 , width : 0 , padding : 0 , margin : 0 , border : 0 } ) ; v . find ( "." + c . css . resizer ) . remove ( ) ; d . addClass ( "hasStickyHeaders" ) . bind ( "pagerComplete.tsSticky" , function ( ) { y ( ) } ) ; c . bindEvents ( b , t . children ( ) . children ( ".tablesorter-header" ) ) ; d . after ( r ) ; h . bind ( "scroll.tsSticky resize.tsSticky" , function ( a ) { if ( d . is ( ":visible" ) ) { var b = d . offset ( ) , c = e . stickyHeaders _includeCaption ? 0 : d . find ( "caption" ) . outerHeight ( ! 0 ) , c = ( g . length ? g . offset ( ) . top : h . scrollTop ( ) ) + s - c , k = d . height ( ) - ( r . height ( ) + ( p . height ( ) || 0 ) ) , b = c > b . top && c < b . top + k ? "visible" : "hidden" , c = { visibility : b } ; g . length ? c . top = g . scrollTop ( ) : c . left = f . offset ( ) . left - h . scrollLeft ( ) - x ; r . removeClass ( "tablesorter-sticky-visible tablesorter-sticky-hidden" ) . addClass ( "tablesorter-sticky-" + b ) . css ( c ) ; if ( b !== w || "resize" === a . type ) y ( ) , w = b } } ) ; e . stickyHeaders _addResizeEvent && c . addHeaderResizeEvent ( b ) ; d . hasClass ( "hasFilters" ) && ( d . bind ( "filterEnd" , function ( ) { var b = k ( document . activeElement ) . closest ( "td" ) , b = b . parent ( ) . children ( ) . index ( b ) ; r . hasClass ( c . css . stickyVis ) && e . stickyHeaders _filteredToTop && ( window . scrollTo ( 0 , d . position ( ) . top ) , 0 <= b && a . $filters && a . $filters . eq ( b ) . find ( "a, select, input" ) . filter ( ":visible" ) . focus ( ) ) } ) , c . filter . bindSearch ( d , v . find ( "." + c . css . filter ) ) , e . filter _hideFilters && c . filter . hideFilters ( r , a ) ) ; d . trigger ( "stickyHeadersInit" ) } } , remove : function ( b , a , e ) { a . $table . removeClass ( "hasStickyHeaders" ) . unbind ( "pagerComplete.tsSticky" ) . find ( "." + c . css . sticky ) . remove ( ) ; e . $sticky && e . $sticky . length && e . $sticky . remove ( ) ; k ( ".hasStickyHeaders" ) . length || k ( window ) . unbind ( "scroll.tsSticky resize.tsSticky" ) ; c . addHeaderResizeEvent ( b , ! 1 ) } } ) ;
c . addWidget ( { id : "resizable" , priority : 40 , options : { resizable : ! 0 , resizable _addLastColumn : ! 1 , resizable _widths : [ ] , resizable _throttle : ! 1 } , format : function ( b , a , e ) { if ( ! a . $table . hasClass ( "hasResizable" ) ) { a . $table . addClass ( "hasResizable" ) ; c . resizableReset ( b , ! 0 ) ; var d , g , f , h , l , m = { } , p = a . $table , n = 0 , s = null , r = null , t = 20 > Math . abs ( p . parent ( ) . width ( ) - p . width ( ) ) , v = function ( a ) { if ( 0 !== n && s ) { var b = a . pageX - n , c = s . width ( ) ; s . width ( c + b ) ; s . width ( ) !== c && t && r . width ( r . width ( ) - b ) ; n = a . pageX } } , w = function ( ) { c . storage && s && r && ( m = { } , m [ s . index ( ) ] = s . width ( ) , m [ r . index ( ) ] = r . width ( ) , s . width ( m [ s . index ( ) ] ) , r . width ( m [ r . index ( ) ] ) , ! 1 !== e . resizable && c . storage ( b , "tablesorter-resizable" , a . $headers . map ( function ( ) { return k ( this ) . width ( ) } ) . get ( ) ) ) ; n = 0 ; s = r = null ; k ( window ) . trigger ( "resize" ) } ; if ( m = c . storage && ! 1 !== e . resizable ? c . storage ( b , "tablesorter-resizable" ) : { } ) for ( h in m ) ! isNaN ( h ) && h < a . $headers . length && a . $headers . eq ( h ) . width ( m [ h ] ) ; d = p . children ( "thead:first" ) . children ( "tr" ) ; d . children ( ) . each ( function ( ) { var e ; e = k ( this ) ; h = e . attr ( "data-column" ) ; e = "false" === c . getData ( e , c . getColumnData ( b , a . headers , h ) , "resizable" ) ; d . children ( ) . filter ( '[data-column="' + h + '"]' ) [ e ? "addClass" : "removeClass" ] ( "resizable-false" ) } ) ; d . each ( function ( ) { f = k ( this ) . children ( ) . not ( ".resizable-false" ) ; k ( this ) . find ( "." + c . css . wrapper ) . length || f . wrapInner ( '<div class="' + c . css . wrapper + '" style="position:relative;height:100%;width:100%"></div>' ) ; e . resizable _addLastColumn || ( f = f . slice ( 0 , - 1 ) ) ; g = g ? g . add ( f ) : f } ) ; g . each ( function ( ) { var a = k ( this ) , b = parseInt ( a . css ( "padding-right" ) , 10 ) + 10 ; a . find ( "." + c . css . wrapper ) . append ( '<div class="' + c . css . resizer + '" style="cursor:w-resize;position:absolute;z-index:1;right:-' + b + 'px;top:0;height:100%;width:20px;"></div>' ) } ) . find ( "." + c . 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 ) ) ; r = b . shiftKey ? s . parent ( ) . find ( "th" ) . not ( ".resizable-false" ) . filter ( ":last" ) : s . nextAll ( ":not(.resizable-false)" ) . eq ( 0 ) ; n = b . pageX } ) ; k ( document ) . bind ( "mousemove.tsresize" , function ( a ) { 0 !== n && s && ( e . resizable _throttle ? ( clearTimeout ( l ) , l = setTimeout ( function ( ) { v ( a ) } , isNaN ( e . resizable _throttle ) ? 5 : e . resizable _throttle ) ) : v ( a ) ) } ) . bind ( "mouseup.tsresize" , function ( ) { w ( ) } ) ; p . find ( "thead:first" ) . bind ( "contextmenu.tsresize" , function ( ) { c . resizableReset ( b ) ; var a = k . isEmptyObject ? k . isEmptyObject ( m ) : ! 0 ; m = { } ; return a } ) } } , remove : function ( b , a ) { a . $table . removeClass ( "hasResizable" ) . children ( "thead" ) . unbind ( "mouseup.tsresize mouseleave.tsresize contextmenu.tsresize" ) . children ( "tr" ) . children ( ) . unbind ( "mousemove.tsresize mouseup.tsresize" ) . find ( "." + c . css . resizer ) . remove ( ) ; c . resizableReset ( b ) } } ) ;
2014-07-04 12:36:50 +00:00
c . resizableReset = function ( b , a ) { k ( b ) . each ( function ( ) { var e , d = this . config , g = d && d . widgetOptions ; b && d && ( d . $headers . each ( function ( a ) { e = k ( this ) ; g . resizable _widths [ a ] ? e . css ( "width" , g . resizable _widths [ a ] ) : e . hasClass ( "resizable-false" ) || e . css ( "width" , "" ) } ) , c . storage && ! a && c . storage ( this , "tablesorter-resizable" , { } ) ) } ) } ;
2014-07-17 17:40:11 +00:00
c . addWidget ( { id : "saveSort" , priority : 20 , options : { saveSort : ! 0 } , init : function ( b , a , c , d ) { a . format ( b , c , d , ! 0 ) } , format : function ( b , a , e , d ) { var g , f = a . $table ; e = ! 1 !== e . saveSort ; var h = { sortList : a . sortList } ; a . debug && ( g = new Date ) ; f . hasClass ( "hasSaveSort" ) ? e && b . hasInitialized && c . storage && ( c . storage ( b , "tablesorter-savesort" , h ) , a . debug && c . benchmark ( "saveSort widget: Saving last sort: " + a . sortList , g ) ) : ( f . addClass ( "hasSaveSort" ) , h = "" , c . storage && ( h = ( e = c . storage ( b , "tablesorter-savesort" ) ) && e . hasOwnProperty ( "sortList" ) && k . isArray ( e . sortList ) ? e . sortList : "" , a . debug && c . benchmark ( 'saveSort: Last sort loaded: "' + h + '"' , g ) , f . bind ( "saveSortReset" , function ( a ) { a . stopPropagation ( ) ; c . storage ( b , "tablesorter-savesort" , "" ) } ) ) , d && h && 0 < h . length ? a . sortList = h : b . hasInitialized && h && 0 < h . length && f . trigger ( "sorton" , [ h ] ) ) } , remove : function ( b ) { c . storage && c . storage ( b , "tablesorter-savesort" , "" ) } } )
2013-10-30 22:47:58 +00:00
} ) ( jQuery ) ;