2014-04-24 00:41:05 +00:00
/*! tableSorter 2.16+ widgets - updated 4/23/2014 (v2.16.0) */
2014-04-21 00:39:59 +00:00
; ( function ( k ) {
var c = k . tablesorter = k . tablesorter || { } ;
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" , grip : "tablesorter-resizer-grip" , sticky : "tablesorter-stickyHeader" , stickyVis : "tablesorter-sticky-visible" } ) ;
c . storage = function ( b , a , e , c ) { b = k ( b ) [ 0 ] ; var d , g , h = ! 1 ; d = { } ; g = b . config ; var m = k ( b ) ; b = c && c . id || m . attr ( c && c . group || "data-table-group" ) || b . id || k ( ".tablesorter" ) . index ( m ) ; c = c && c . url || m . attr ( c && c . page || "data-table-page" ) || g && g . fixedUrl || window . location . pathname ; if ( "localStorage" in window ) try { window . localStorage . setItem ( "_tmptest" , "temp" ) , h = ! 0 , window . localStorage . removeItem ( "_tmptest" ) } catch ( q ) { } k . parseJSON && ( h ? d = k . parseJSON ( localStorage [ a ] || "{}" ) : ( g = document . cookie . split ( /[;\s|=]/ ) , d = k . inArray ( a , g ) + 1 , d = 0 !== d ? k . parseJSON ( g [ d ] || "{}" ) : { } ) ) ; if ( ( e || "" === e ) && window . JSON && JSON . hasOwnProperty ( "stringify" ) ) d [ c ] || ( d [ c ] = { } ) , d [ c ] [ b ] = e , h ? localStorage [ a ] = JSON . stringify ( d ) : ( e = new Date , e . setTime ( e . getTime ( ) + 31536E6 ) , document . cookie = a + "=" + JSON . stringify ( d ) . replace ( /\"/g , '"' ) + "; expires=" + e . toGMTString ( ) + "; path=/" ) ; else return d && d [ c ] ? d [ c ] [ b ] : "" } ;
c . addHeaderResizeEvent = function ( b , a , e ) { var c ; e = k . extend ( { } , { timer : 250 } , e ) ; var d = b . config , g = d . widgetOptions , h = function ( a ) { g . resize _flag = ! 0 ; c = [ ] ; d . $headers . each ( function ( ) { var a = k ( this ) , b = a . data ( "savedSizes" ) || [ 0 , 0 ] , e = this . offsetWidth , d = this . offsetHeight ; if ( e !== b [ 0 ] || d !== b [ 1 ] ) a . data ( "savedSizes" , [ e , d ] ) , c . push ( this ) } ) ; c . length && ! 1 !== a && d . $table . trigger ( "resize" , [ c ] ) ; g . resize _flag = ! 1 } ; h ( ! 1 ) ; clearInterval ( g . resize _timer ) ; if ( a ) return g . resize _flag = ! 1 ; g . resize _timer = setInterval ( function ( ) { g . resize _flag || h ( ) } , e . timer ) } ;
c . addWidget ( { id : "uitheme" , priority : 10 , format : function ( b , a , e ) { var f , d , g , h , m = c . themes , q = a . $table , p = a . $headers , n = a . theme || "jui" , l = m [ n ] || m . jui , v = l . sortNone + " " + l . sortDesc + " " + l . sortAsc ; a . debug && ( f = new Date ) ; q . hasClass ( "tablesorter-" + n ) && a . theme !== n && b . hasInitialized || ( "" !== l . even && ( e . zebra [ 0 ] += " " + l . even ) , "" !== l . odd && ( e . zebra [ 1 ] += " " + l . odd ) , q . find ( "caption" ) . addClass ( l . caption ) , b = q . removeClass ( "" === a . theme ? "" : "tablesorter-" + a . theme ) . addClass ( "tablesorter-" + n + " " + l . table ) . find ( "tfoot" ) , b . length && b . find ( "tr" ) . addClass ( l . footerRow ) . children ( "th, td" ) . addClass ( l . footerCells ) , p . addClass ( l . header ) . not ( ".sorter-false" ) . bind ( "mouseenter.tsuitheme mouseleave.tsuitheme" , function ( a ) { k ( this ) [ "mouseenter" === a . type ? "addClass" : "removeClass" ] ( l . hover ) } ) , p . find ( "." + c . css . wrapper ) . length || p . wrapInner ( '<div class="' + c . css . wrapper + '" style="position:relative;height:100%;width:100%"></div>' ) , a . cssIcon && p . find ( "." + c . css . icon ) . addClass ( l . icons ) , q . hasClass ( "hasFilters" ) && p . find ( "." + c . css . filterRow ) . addClass ( l . filterRow ) ) ; k . each ( p , function ( ) { g = k ( this ) ; h = c . css . icon ? g . find ( "." + c . css . icon ) : g ; this . sortDisabled ? ( g . removeClass ( v ) , h . removeClass ( v + " " + l . icons ) ) : ( d = g . hasClass ( c . css . sortAsc ) ? l . sortAsc : g . hasClass ( c . css . sortDesc ) ? l . sortDesc : g . hasClass ( c . css . header ) ? l . sortNone : "" , g [ d === l . sortNone ? "removeClass" : "addClass" ] ( l . active ) , h . removeClass ( v ) . addClass ( d ) ) } ) ; a . debug && c . benchmark ( "Applying " + n + " theme" , f ) } , remove : function ( b , a , e ) { b = a . $table ; a = a . theme || "jui" ; e = c . themes [ a ] || c . themes . jui ; var f = b . children ( "thead" ) . children ( ) , d = e . sortNone + " " + e . sortDesc + " " + e . sortAsc ; b . removeClass ( "tablesorter-" + a + " " + e . table ) . find ( c . css . header ) . removeClass ( e . header ) ; f . unbind ( "mouseenter.tsuitheme mouseleave.tsuitheme" ) . removeClass ( e . hover + " " + d + " " + e . active ) . find ( "." + c . css . filterRow ) . removeClass ( e . filterRow ) ; f . find ( "." + c . css . icon ) . removeClass ( e . icons ) } } ) ;
c . addWidget ( { id : "columns" , priority : 30 , options : { columns : [ "primary" , "secondary" , "tertiary" ] } , format : function ( b , a , e ) { var f , d , g , h , m , q , p , n , l = a . $table , v = a . $tbodies , s = a . sortList , u = s . length , w = e && e . columns || [ "primary" , "secondary" , "tertiary" ] , x = w . length - 1 ; p = w . join ( " " ) ; a . debug && ( f = new Date ) ; for ( g = 0 ; g < v . length ; g ++ ) d = c . processTbody ( b , v . eq ( g ) , ! 0 ) , h = d . children ( "tr" ) , h . each ( function ( ) { m = k ( this ) ; if ( "none" !== this . style . display && ( q = m . children ( ) . removeClass ( p ) , s && s [ 0 ] && ( q . eq ( s [ 0 ] [ 0 ] ) . addClass ( w [ 0 ] ) , 1 < u ) ) ) for ( n = 1 ; n < u ; n ++ ) q . eq ( s [ n ] [ 0 ] ) . addClass ( w [ n ] || w [ x ] ) } ) , c . processTbody ( b , d , ! 1 ) ; b = ! 1 !== e . columns _thead ? [ "thead tr" ] : [ ] ; ! 1 !== e . columns _tfoot && b . push ( "tfoot tr" ) ; if ( b . length && ( h = l . find ( b . join ( "," ) ) . children ( ) . removeClass ( p ) , u ) ) for ( n = 0 ; n < u ; n ++ ) h . filter ( '[data-column="' + s [ n ] [ 0 ] + '"]' ) . addClass ( w [ n ] || w [ x ] ) ; a . debug && c . benchmark ( "Applying Columns widget" , f ) } , remove : function ( b , a , e ) { var f = a . $tbodies , d = ( e . columns || [ "primary" , "secondary" , "tertiary" ] ) . join ( " " ) ; a . $headers . removeClass ( d ) ; a . $table . children ( "tfoot" ) . children ( "tr" ) . children ( "th, td" ) . removeClass ( d ) ; for ( a = 0 ; a < f . length ; a ++ ) e = c . processTbody ( b , f . eq ( a ) , ! 0 ) , e . children ( "tr" ) . each ( function ( ) { k ( this ) . children ( ) . removeClass ( d ) } ) , 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 _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 f , d = 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 < d . length ; a ++ ) f = c . processTbody ( b , d . eq ( a ) , ! 0 ) , f . children ( ) . removeClass ( e . filter _filteredRow ) . show ( ) , c . processTbody ( b , f , ! 1 ) ; e . filter _reset && k ( document ) . undelegate ( e . filter _reset , "click.tsfilter" ) } } ) ;
2014-04-24 00:41:05 +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 , f ) { if ( c . filter . regex . regex . test ( a ) ) { var d ; b = c . filter . regex . regex . exec ( a ) ; try { d = RegExp ( b [ 1 ] , b [ 2 ] ) . test ( f ) } catch ( g ) { d = ! 1 } return d } return null } , operators : function ( b , a , e , f , d , g , h , k , q ) { if ( /^[<>]=?/ . test ( a ) ) { var p , n ; p = h . config ; b = c . formatFloat ( a . replace ( c . filter . regex . operators , "" ) , h ) ; e = p . parsers [ g ] ; k = b ; if ( q [ g ] || "numeric" === e . type ) p = e . format ( "" + a . replace ( c . filter . regex . operators , "" ) , h , p . $headers . eq ( g ) , g ) , b = "number" !== typeof b || "" === p || isNaN ( p ) ? b : p ; p = ! q [ g ] && "numeric" !== e . type || isNaN ( b ) || ! d ? isNaN ( f ) ? c . formatFloat ( f . replace ( c . filter . regex . nondigit , "" ) , h ) : c . formatFloat ( f , h ) : d ; />/ . test ( a ) && ( n = />=/ . test ( a ) ? p >= b : p > b ) ; /</ . test ( a ) && ( n = /<=/ . test ( a ) ? p <= b : p < b ) ; n || "" !== k || ( n = ! 0 ) ; return n } return null } , exact : function ( b , a , e , f , d , g , h , m , q , p ) { return c . filter . regex . exact . test ( a ) ? ( b = a . replace ( c . filter . regex . exact , "" ) , p ? 0 <= k . inArray ( b , p ) : b == f ) : null } , notMatch : function ( b , a , e , c , d , g , h , m ) { return /^\!/ . test ( a ) ? ( a = a . replace ( "!" , "" ) , b = c . search ( k . trim ( a ) ) , "" === a ? ! 0 : ! ( m . filter _startsWith ? 0 === b : 0 <= b ) ) : null } , and : function ( b , a , e , c ) { if ( /\s+(AND|&&)\s+/g . test ( b ) ) { b = a . split ( /(?:\s+(?:and|&&)\s+)/g ) ; a = 0 <= c . search ( k . trim ( b [ 0 ] ) ) ; for ( e = b . length - 1 ; a && e ; ) a = a && 0 <= c . search ( k . trim ( b [ e ] ) ) , e -- ; return a } return null } , range : function ( b , a , e , f , d , g , h , k , q ) { if ( /\s+(-|to)\s+/ . test ( a ) ) { b = h . config ; var p = a . split ( /(?: - | to )/ ) ; e = c . formatFloat ( p [ 0 ] . replace ( c . filter . regex . nondigit , "" ) , h ) ; k = c . formatFloat ( p [ 1 ] . replace ( c . filter . regex . nondigit , "" ) , h ) ; if ( q [ g ] || "numeric" === b . parsers [ g ] . type ) a = b . parsers [ g ] . format ( "" + p [ 0 ] , h , b . $headers . eq ( g ) , g ) , e = "" === a || isNaN ( a ) ? e : a , a = b . parsers [ g ] . format ( "" + p [ 1 ] , h , b . $headers . eq ( g ) , g ) , k = "" === a || isNaN ( a ) ? k : a ; a = ! q [ g ] && "numeric" !== b . parsers [ g ] . type || isNaN ( e ) || isNaN ( k ) ? isNaN ( f ) ? c . formatFloat ( f . replace ( c . filter . regex . nondigit , "" ) , h ) : c . formatFloat ( f , h ) : d ; e > k && ( f = e , e = k , k = f ) ; return a >= e && a <= k || "" === e || "" === k } return null } , wild : function ( b , a , c , f , d , g , h , m , q , p ) { return /[\?|\*]/ . test ( a ) || /\s+OR\s+/i . test ( b ) ? ( b = h . config , a = a . replace ( /\s+OR\s+/gi , "|" ) , ! b . $headers . filter ( '[data-column="' + g + '"]:last' ) . hasClass ( "filter-match" ) && /\|/ . test ( a ) && ( a = k . isArray ( p ) ? "(" + a + ")" : "^(" + a + ")$" ) , RegExp ( a . replace ( /\?/g , "\\S{1}" ) . replace ( /\*/g , "\\S*" ) ) . test ( f ) ) : null } , fuzzy : function ( b , a , c , f ) { if ( /^~/ . test ( a ) ) { b = 0 ; c = f . length ; var d = a . slice ( 1 ) ; for ( a = 0 ; a < c ; a ++ ) f [ a ] === d [ b ] && ( b += 1 ) ; return b === d . length ? ! 0 : ! 1 } return null } } , init : function ( b , a , e ) { var f , d , g , h , m , q ; a . debug && ( q = new Date ) ; a . $table . addClass ( "hasFilters" ) ; c . filter . regex . child = RegExp ( a . cssChildRow ) ; c . filter . regex . filtered = RegExp ( e . filter _filteredRow ) ; ! 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 , g ) { a . $table . find ( "." + c . css . filterRow ) . toggle ( ! ( e . filter _hideEmpty && k . isEmptyObject ( a . cache ) ) ) ; /(search|filter)/ . test ( d . type ) || ( d . stopPropagation ( ) , c . filter . buildDefault ( b , ! 0 ) ) ; "filterReset" === d . type ? c . filter . searching ( b , [ ] ) : "filterEnd" === d . type ? c . filter . buildDefault ( b , ! 0 ) : ( g = "search" === d . type ? g : "updateComplete" === d . type ? a . $table . data ( "lastSearch" ) : "" , /(update|add)/ . test ( d . type ) && "updateComplete" !== d . type && ( a . lastCombinedFilter = null ) , c . filter . searching ( b , g , ! 0 ) ) ; return ! 1 } ) ; e . filter _reset && ( e . filter _reset instanceof k ? e . filter _reset . click ( function ( ) { a . $table . trigger ( "filterReset" ) } ) : k ( e . filter _reset ) . length && k ( document ) . undelegate ( e . filter _reset , "click.tsfilter" ) . delegate ( e . filter _reset , "click.tsfilter" , function ( ) { a . $table . trigger ( "filterReset" ) } ) ) ; if ( e . filter _functions ) for ( h in e . filter _functions ) if ( e . filter _functions . hasOwnProperty ( h ) && "string" === typeof h ) if ( g = a . $headers . filter ( '[data-column="' + h + '"]:last' ) , f = "" , ! 0 === e . filter _functions [ h ] && ! g . hasClass ( "filter-false" ) ) c . filter . buildSelect ( b , h ) ; else if ( "string" === typeof h && ! g . hasClass ( "filter-false" ) ) { for ( d in e . filter _functions [ h ] ) "string" === typeo
2014-04-21 00:39:59 +00:00
c . getFilters = function ( b , a , e , f ) { var d , g = ! 1 , h = b ? k ( b ) [ 0 ] . config : "" , m = h ? h . widgetOptions : "" ; if ( ! 0 !== a && m && ! m . filter _columnFilters ) return k ( b ) . data ( "lastSearch" ) ; if ( h && ( h . $filters && ( d = h . $filters . find ( "." + c . css . filter ) ) , m . filter _$externalFilters && ( d = d && d . length ? d . add ( m . filter _$externalFilters ) : m . filter _$externalFilters ) , d && d . length ) ) for ( g = e || [ ] , b = 0 ; b < h . columns + 1 ; b ++ ) a = d . 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 ) ? ( f ? a . slice ( 1 ) : a ) . val ( e [ b ] ) . trigger ( "change.tsfilter" ) : ( g [ b ] = a . val ( ) || "" , a . slice ( 1 ) . val ( g [ b ] ) ) , b === h . columns && a . length && ( m . filter _$anyMatch = a ) ) ; 0 === g . length && ( g = ! 1 ) ; return g } ;
2014-04-24 00:41:05 +00:00
c . setFilters = function ( b , a , e , f ) { var d = b ? k ( b ) [ 0 ] . config : "" ; b = c . getFilters ( b , ! 0 , a , f ) ; d && e && ( d . lastCombinedFilter = null , c . filter . searching ( d . $table [ 0 ] , a , f ) , d . $table . trigger ( "filterFomatterUpdate" ) ) ; return ! ! b } ;
c . addWidget ( { id : "stickyHeaders" , priority : 60 , options : { stickyHeaders : "" , stickyHeaders _attachTo : null , stickyHeaders _offset : 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 f , d = a . $table , g = k ( e . stickyHeaders _attachTo ) , h = d . children ( "thead:first" ) , m = g . length ? g : k ( window ) , q = h . children ( "tr" ) . not ( ".sticky-false" ) . children ( ) , p = "." + c . css . headerIn , n = d . find ( "tfoot" ) , l = isNaN ( e . stickyHeaders _offset ) ? k ( e . stickyHeaders _offset ) : "" , v = g . length ? 0 : l . length ? l . height ( ) || 0 : parseInt ( e . stickyHeaders _offset , 10 ) || 0 , s = e . $sticky = d . clone ( ) . addClass ( "containsStickyHeaders" ) . css ( { position : g . length ? "absolute" : "fixed" , margin : 0 , top : v , left : 0 , visibility : "hidden" , zIndex : e . stickyHeaders _zIndex ? e . stickyHeaders _zIndex : 2 } ) , u = s . children ( "thead:first" ) . addClass ( c . css . sticky + " " + e . stickyHeaders ) , w , x = "" , A = 0 , z = "collapse" !== d . css ( "border-collapse" ) && ! /(webkit|msie)/i . test ( navigator . userAgent ) , y = function ( ) { v = l . length ? l . height ( ) || 0 : parseInt ( e . stickyHeaders _offset , 10 ) || 0 ; A = 0 ; z && ( A = 2 * parseInt ( q . eq ( 0 ) . css ( "border-left-width" ) , 10 ) ) ; s . 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 ) : h . offset ( ) . left - m . scrollLeft ( ) - A , width : d . width ( ) } ) ; w . filter ( ":visible" ) . each ( function ( b ) { b = q . 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 ( ) - A , height : b . height ( ) } ) . find ( p ) . width ( b . find ( p ) . width ( ) - c ) } ) } ; s . attr ( "id" ) && ( s [ 0 ] . id += e . stickyHeaders _cloneId ) ; s . find ( "thead:gt(0), tr.sticky-false" ) . hide ( ) ; s . find ( "tbody, tfoot" ) . remove ( ) ; e . stickyHeaders _includeCaption ? s . find ( "caption" ) . css ( "margin-left" , "-1px" ) : s . find ( "caption" ) . remove ( ) ; w = u . children ( ) . children ( ) ; s . css ( { height : 0 , width : 0 , padding : 0 , margin : 0 , border : 0 } ) ; w . find ( "." + c . css . resizer ) . remove ( ) ; d . addClass ( "hasStickyHeaders" ) . bind ( "sortEnd.tsSticky" , function ( ) { q . filter ( ":visible" ) . each ( function ( b ) { f = w . filter ( ":visible" ) . eq ( b ) . attr ( "class" , k ( this ) . attr ( "class" ) ) . removeClass ( c . css . processing + " " + a . cssProcessing ) ; a . cssIcon && f . find ( "." + c . css . icon ) . attr ( "class" , k ( this ) . find ( "." + c . css . icon ) . attr ( "class" ) ) } ) } ) . bind ( "pagerComplete.tsSticky" , function ( ) { y ( ) } ) ; c . bindEvents ( b , u . children ( ) . children ( ".tablesorter-header" ) ) ; d . after ( s ) ; m . 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 : m . scrollTop ( ) ) + v - c , f = d . height ( ) - ( s . height ( ) + ( n . height ( ) || 0 ) ) , b = c > b . top && c < b . top + f ? "visible" : "hidden" , c = { visibility : b } ; g . length ? c . top = g . scrollTop ( ) : c . left = h . offset ( ) . left - m . scrollLeft ( ) - A ; s . removeClass ( "tablesorter-sticky-visible tablesorter-sticky-hidden" ) . addClass ( "tablesorter-sticky-" + b ) . css ( c ) ; if ( b !== x || "resize" === a . type ) y ( ) , x = 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 ) ; s . hasClass ( c . css . stickyVis ) && ( window . scrollTo ( 0 , d . position ( ) . top ) , 0 <= b && a . $filters . eq ( b ) . find ( "a, select, input" ) . filter ( ":visible" ) . focus ( ) ) } ) , c . filter . bindSearch ( d , w . find ( "." + c . css . filter ) ) ) ; d . trigger ( "stickyHeadersInit" ) } } , remove : function ( b , a , e ) { a . $table . removeClass ( "hasStickyHeaders" ) . unbind ( "sortEnd.tsSticky 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 : [ ] } , format : function ( b , a , e ) { if ( ! a . $table . hasClass ( "hasResizable" ) ) { a . $table . addClass ( "hasResizable" ) ; c . resizableReset ( b , ! 0 ) ; var f , d , g , h , m = { } , q = a . $table , p = 0 , n = null , l = null , v = 20 > Math . abs ( q . parent ( ) . width ( ) - q . width ( ) ) , s = function ( ) { c . storage && n && l && ( m = { } , m [ n . index ( ) ] = n . width ( ) , m [ l . index ( ) ] = l . width ( ) , n . width ( m [ n . index ( ) ] ) , l . width ( m [ l . index ( ) ] ) , ! 1 !== e . resizable && c . storage ( b , "tablesorter-resizable" , a . $headers . map ( function ( ) { return k ( this ) . width ( ) } ) . get ( ) ) ) ; p = 0 ; n = l = 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 ] ) ; f = q . children ( "thead:first" ) . children ( "tr" ) ; f . children ( ) . each ( function ( ) { var b ; b = k ( this ) ; h = b . attr ( "data-column" ) ; b = "false" === c . getData ( b , a . headers [ h ] , "resizable" ) ; f . children ( ) . filter ( '[data-column="' + h + '"]' ) [ b ? "addClass" : "removeClass" ] ( "resizable-false" ) } ) ; f . each ( function ( ) { g = k ( this ) . children ( ) . not ( ".resizable-false" ) ; k ( this ) . find ( "." + c . css . wrapper ) . length || g . wrapInner ( '<div class="' + c . css . wrapper + '" style="position:relative;height:100%;width:100%"></div>' ) ; e . resizable _addLastColumn || ( g = g . slice ( 0 , - 1 ) ) ; d = d ? d . add ( g ) : g } ) ; d . 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>' ) } ) . bind ( "mousemove.tsresize" , function ( a ) { if ( 0 !== p && n ) { var b = a . pageX - p , c = n . width ( ) ; n . width ( c + b ) ; n . width ( ) !== c && v && l . width ( l . width ( ) - b ) ; p = a . pageX } } ) . bind ( "mouseup.tsresize" , function ( ) { s ( ) } ) . find ( "." + c . css . resizer + ",." + c . css . grip ) . bind ( "mousedown" , function ( b ) { n = k ( b . target ) . closest ( "th" ) ; var c = a . $headers . filter ( '[data-column="' + n . attr ( "data-column" ) + '"]' ) ; 1 < c . length && ( n = n . add ( c ) ) ; l = b . shiftKey ? n . parent ( ) . find ( "th" ) . not ( ".resizable-false" ) . filter ( ":last" ) : n . nextAll ( ":not(.resizable-false)" ) . eq ( 0 ) ; p = b . pageX } ) ; q . find ( "thead:first" ) . bind ( "mouseup.tsresize mouseleave.tsresize" , function ( ) { s ( ) } ) . 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 + ",." + c . css . grip ) . remove ( ) ; c . resizableReset ( b ) } } ) ;
c . resizableReset = function ( b , a ) { k ( b ) . each ( function ( ) { var e , f = this . config , d = f && f . widgetOptions ; b && f && ( f . $headers . each ( function ( a ) { e = k ( this ) ; d . resizable _widths [ a ] ? e . css ( "width" , d . resizable _widths [ a ] ) : e . hasClass ( "resizable-false" ) || e . css ( "width" , "" ) } ) , c . storage && ! a && c . storage ( this , "tablesorter-resizable" , { } ) ) } ) } ;
2014-04-21 00:39:59 +00:00
c . addWidget ( { id : "saveSort" , priority : 20 , options : { saveSort : ! 0 } , init : function ( b , a , c , f ) { a . format ( b , c , f , ! 0 ) } , format : function ( b , a , e , f ) { var d , g = a . $table ; e = ! 1 !== e . saveSort ; var h = { sortList : a . sortList } ; a . debug && ( d = new Date ) ; g . hasClass ( "hasSaveSort" ) ? e && b . hasInitialized && c . storage && ( c . storage ( b , "tablesorter-savesort" , h ) , a . debug && c . benchmark ( "saveSort widget: Saving last sort: " + a . sortList , d ) ) : ( g . 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 + '"' , d ) , g . bind ( "saveSortReset" , function ( a ) { a . stopPropagation ( ) ; c . storage ( b , "tablesorter-savesort" , "" ) } ) ) , f && h && 0 < h . length ? a . sortList = h : b . hasInitialized && h && 0 < h . length && g . trigger ( "sorton" , [ h ] ) ) } , remove : function ( b ) { c . storage && c . storage ( b , "tablesorter-savesort" , "" ) } } )
2013-10-30 22:47:58 +00:00
} ) ( jQuery ) ;