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