16 lines
No EOL
45 KiB
JavaScript
16 lines
No EOL
45 KiB
JavaScript
/*! tablesorter (FORK) - updated 05-17-2015 (v2.22.1)*/
|
|
(function(a){if(typeof define==="function"&&define.amd){define(["jquery"],a)}else{if(typeof module==="object"&&typeof module.exports==="object"){module.exports=a(require("jquery"))}else{a(jQuery)}}}(function(a){
|
|
/*! Widget: storage - updated 3/26/2015 (v2.21.3) */
|
|
;(function(e,d,b){var c=e.tablesorter||{};c.storage=function(t,q,n,u){t=e(t)[0];var p,s,i,h=false,o={},l=t.config,m=l&&l.widgetOptions,j=(u&&u.useSessionStorage)||(m&&m.storage_useSessionStorage)?"sessionStorage":"localStorage",r=e(t),g=u&&u.id||r.attr(u&&u.group||m&&m.storage_group||"data-table-group")||m&&m.storage_tableId||t.id||e(".tablesorter").index(r),f=u&&u.url||r.attr(u&&u.page||m&&m.storage_page||"data-table-page")||m&&m.storage_fixedUrl||l&&l.fixedUrl||d.location.pathname;if(j in d){try{d[j].setItem("_tmptest","temp");h=true;d[j].removeItem("_tmptest")}catch(k){if(l&&l.debug){c.log(j+" is not supported in this browser")}}}if(e.parseJSON){if(h){o=e.parseJSON(d[j][q]||"null")||{}}else{s=b.cookie.split(/[;\s|=]/);p=e.inArray(q,s)+1;o=(p!==0)?e.parseJSON(s[p]||"null")||{}:{}}}if((n||n==="")&&d.JSON&&JSON.hasOwnProperty("stringify")){if(!o[f]){o[f]={}}o[f][g]=n;if(h){d[j][q]=JSON.stringify(o)}else{i=new Date();i.setTime(i.getTime()+(31536000000));b.cookie=q+"="+(JSON.stringify(o)).replace(/\"/g,'"')+"; expires="+i.toGMTString()+"; path=/"}}else{return o&&o[f]?o[f][g]:""}}})(jQuery,window,document);
|
|
/*! Widget: uitheme - updated 3/26/2015 (v2.21.3) */
|
|
;(function(c){var b=c.tablesorter||{};b.themes={bootstrap:{table:"table table-bordered table-striped",caption:"caption",header:"bootstrap-header",sortNone:"",sortAsc:"",sortDesc:"",active:"",hover:"",icons:"",iconSortNone:"bootstrap-icon-unsorted",iconSortAsc:"icon-chevron-up glyphicon glyphicon-chevron-up",iconSortDesc:"icon-chevron-down glyphicon glyphicon-chevron-down",filterRow:"",footerRow:"",footerCells:"",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",sortNone:"",sortAsc:"",sortDesc:"",active:"ui-state-active",hover:"ui-state-hover",icons:"ui-icon",iconSortNone:"ui-icon-carat-2-n-s",iconSortAsc:"ui-icon-carat-1-n",iconSortDesc:"ui-icon-carat-1-s",filterRow:"",footerRow:"",footerCells:"",even:"ui-widget-content",odd:"ui-state-default"}};c.extend(b.css,{wrapper:"tablesorter-wrapper"});b.addWidget({id:"uitheme",priority:10,format:function(s,w,h){var r,g,t,k,y,e,f,d,n,j,m,u,x=b.themes,l=w.$table.add(c(w.namespace+"_extra_table")),o=w.$headers.add(c(w.namespace+"_extra_headers")),v=w.theme||"jui",q=x[v]||{},z=c.trim([q.sortNone,q.sortDesc,q.sortAsc,q.active].join(" ")),p=c.trim([q.iconSortNone,q.iconSortDesc,q.iconSortAsc].join(" "));if(w.debug){k=new Date()}if(!l.hasClass("tablesorter-"+v)||w.theme!==w.appliedTheme||!h.uitheme_applied){h.uitheme_applied=true;n=x[w.appliedTheme]||{};u=!c.isEmptyObject(n);j=u?[n.sortNone,n.sortDesc,n.sortAsc,n.active].join(" "):"";m=u?[n.iconSortNone,n.iconSortDesc,n.iconSortAsc].join(" "):"";if(u){h.zebra[0]=c.trim(" "+h.zebra[0].replace(" "+n.even,""));h.zebra[1]=c.trim(" "+h.zebra[1].replace(" "+n.odd,""));w.$tbodies.children().removeClass([n.even,n.odd].join(" "))}if(q.even){h.zebra[0]+=" "+q.even}if(q.odd){h.zebra[1]+=" "+q.odd}l.children("caption").removeClass(n.caption||"").addClass(q.caption);f=l.removeClass((w.appliedTheme?"tablesorter-"+(w.appliedTheme||""):"")+" "+(n.table||"")).addClass("tablesorter-"+v+" "+(q.table||"")).children("tfoot");w.appliedTheme=w.theme;if(f.length){f.children("tr").removeClass(n.footerRow||"").addClass(q.footerRow).children("th, td").removeClass(n.footerCells||"").addClass(q.footerCells)}o.removeClass((u?[n.header,n.hover,j].join(" "):"")||"").addClass(q.header).not(".sorter-false").unbind("mouseenter.tsuitheme mouseleave.tsuitheme").bind("mouseenter.tsuitheme mouseleave.tsuitheme",function(i){c(this)[i.type==="mouseenter"?"addClass":"removeClass"](q.hover||"")});o.each(function(){var i=c(this);if(!i.find("."+b.css.wrapper).length){i.wrapInner('<div class="'+b.css.wrapper+'" style="position:relative;height:100%;width:100%"></div>')}});if(w.cssIcon){o.find("."+b.css.icon).removeClass(u?[n.icons,m].join(" "):"").addClass(q.icons||"")}if(l.hasClass("hasFilters")){l.children("thead").children("."+b.css.filterRow).removeClass(u?n.filterRow||"":"").addClass(q.filterRow||"")}}for(r=0;r<w.columns;r++){y=w.$headers.add(c(w.namespace+"_extra_headers")).not(".sorter-false").filter('[data-column="'+r+'"]');e=(b.css.icon)?y.find("."+b.css.icon):c();d=o.not(".sorter-false").filter('[data-column="'+r+'"]:last');if(d.length){y.removeClass(z);e.removeClass(p);if(d[0].sortDisabled){e.removeClass(q.icons||"")}else{g=q.sortNone;t=q.iconSortNone;if(d.hasClass(b.css.sortAsc)){g=[q.sortAsc,q.active].join(" ");t=q.iconSortAsc}else{if(d.hasClass(b.css.sortDesc)){g=[q.sortDesc,q.active].join(" ");t=q.iconSortDesc}}y.addClass(g);e.addClass(t||"")}}}if(w.debug){b.benchmark("Applying "+v+" theme",k)}},remove:function(m,g,j,k){if(!j.uitheme_applied){return}var l=g.$table,e=g.appliedTheme||"jui",i=b.themes[e]||b.themes.jui,h=l.children("thead").children(),d=i.sortNone+" "+i.sortDesc+" "+i.sortAsc,f=i.iconSortNone+" "+i.iconSortDesc+" "+i.iconSortAsc;l.removeClass("tablesorter-"+e+" "+i.table);j.uitheme_applied=false;if(k){return}l.find(b.css.header).removeClass(i.header);h.unbind("mouseenter.tsuitheme mouseleave.tsuitheme").removeClass(i.hover+" "+d+" "+i.active).filter("."+b.css.filterRow).removeClass(i.filterRow);h.find("."+b.css.icon).removeClass(i.icons+" "+f)}})})(jQuery);
|
|
/*! Widget: columns */
|
|
;(function(c){var b=c.tablesorter||{};b.addWidget({id:"columns",priority:30,options:{columns:["primary","secondary","tertiary"]},format:function(s,l,n){var e,m,p,t,k,r,f,i,q=l.$table,g=l.$tbodies,d=l.sortList,j=d.length,h=n&&n.columns||["primary","secondary","tertiary"],o=h.length-1;f=h.join(" ");for(m=0;m<g.length;m++){e=b.processTbody(s,g.eq(m),true);p=e.children("tr");p.each(function(){k=c(this);if(this.style.display!=="none"){r=k.children().removeClass(f);if(d&&d[0]){r.eq(d[0][0]).addClass(h[0]);if(j>1){for(i=1;i<j;i++){r.eq(d[i][0]).addClass(h[i]||h[o])}}}}});b.processTbody(s,e,false)}t=n.columns_thead!==false?["thead tr"]:[];if(n.columns_tfoot!==false){t.push("tfoot tr")}if(t.length){p=q.find(t.join(",")).children().removeClass(f);if(j){for(i=0;i<j;i++){p.filter('[data-column="'+d[i][0]+'"]').addClass(h[i]||h[o])}}}},remove:function(h,j,g){var f,e,i=j.$tbodies,d=(g.columns||["primary","secondary","tertiary"]).join(" ");j.$headers.removeClass(d);j.$table.children("tfoot").children("tr").children("th, td").removeClass(d);for(f=0;f<i.length;f++){e=b.processTbody(h,i.eq(f),true);e.children("tr").each(function(){c(this).children().removeClass(d)});b.processTbody(h,e,false)}}})})(jQuery);
|
|
/*! Widget: filter - updated 5/17/2015 (v2.22.1) */
|
|
;(function(d){var c=d.tablesorter||{},b=c.css;d.extend(b,{filterRow:"tablesorter-filter-row",filter:"tablesorter-filter",filterDisabled:"disabled",filterRowHide:"hideme"});c.addWidget({id:"filter",priority:50,options:{filter_childRows:false,filter_childByColumn:false,filter_columnFilters:true,filter_columnAnyMatch:true,filter_cellFilter:"",filter_cssFilter:"",filter_defaultFilter:{},filter_excludeFilter:{},filter_external:"",filter_filteredRow:"filtered",filter_formatter:null,filter_functions:null,filter_hideEmpty:true,filter_hideFilters:false,filter_ignoreCase:true,filter_liveSearch:true,filter_onlyAvail:"filter-onlyAvail",filter_placeholder:{search:"",select:""},filter_reset:null,filter_saveFilters:false,filter_searchDelay:300,filter_searchFiltered:true,filter_selectSource:null,filter_startsWith:false,filter_useParsedData:false,filter_serversideFiltering:false,filter_defaultAttrib:"data-value",filter_selectSourceSeparator:"|"},format:function(f,g,e){if(!g.$table.hasClass("hasFilters")){c.filter.init(f,g,e)}},remove:function(m,g,i,j){var h,e,k=g.$table,f=g.$tbodies,l="addRows updateCell update updateRows updateComplete appendCache filterReset filterEnd search ".split(" ").join(g.namespace+"filter ");k.removeClass("hasFilters").unbind(l.replace(/\s+/g," ")).find("."+b.filterRow).remove();if(j){return}for(h=0;h<f.length;h++){e=c.processTbody(m,f.eq(h),true);e.children().removeClass(i.filter_filteredRow).show();c.processTbody(m,e,false)}if(i.filter_reset){d(document).undelegate(i.filter_reset,"click.tsfilter")}}});c.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(j,h){if(c.filter.regex.regex.test(h.filter)){var g,f=h.filter_regexCache[h.index]||c.filter.regex.regex.exec(h.filter),i=f instanceof RegExp;try{if(!i){h.filter_regexCache[h.index]=f=new RegExp(f[1],f[2])}g=f.test(h.exact)}catch(e){g=false}return g}return null},operators:function(l,h){if(/^[<>]=?/.test(h.iFilter)&&h.iExact!==""){var f,o,i,n=l.table,j=h.index,m=h.parsed[j],k=c.formatFloat(h.iFilter.replace(c.filter.regex.operators,""),n),e=l.parsers[j],g=k;if(m||e.type==="numeric"){i=d.trim(""+h.iFilter.replace(c.filter.regex.operators,""));o=c.filter.parseFilter(l,i,j,true);k=(typeof o==="number"&&o!==""&&!isNaN(o))?o:k}if((m||e.type==="numeric")&&!isNaN(k)&&typeof h.cache!=="undefined"){f=h.cache}else{i=isNaN(h.iExact)?h.iExact.replace(c.filter.regex.nondigit,""):h.iExact;f=c.formatFloat(i,n)}if(/>/.test(h.iFilter)){o=/>=/.test(h.iFilter)?f>=k:f>k}else{if(/</.test(h.iFilter)){o=/<=/.test(h.iFilter)?f<=k:f<k}}if(!o&&g===""){o=true}return o}return null},notMatch:function(i,h){if(/^\!/.test(h.iFilter)){var g,e=h.iFilter.replace("!",""),f=c.filter.parseFilter(i,e,h.index,h.parsed[h.index])||"";if(c.filter.regex.exact.test(f)){f=f.replace(c.filter.regex.exact,"");return f===""?true:d.trim(f)!==h.iExact}else{g=h.iExact.search(d.trim(f));return f===""?true:!(i.widgetOptions.filter_startsWith?g===0:g>=0)}}return null},exact:function(h,g){if(c.filter.regex.exact.test(g.iFilter)){var e=g.iFilter.replace(c.filter.regex.exact,""),f=c.filter.parseFilter(h,e,g.index,g.parsed[g.index])||"";return g.anyMatch?d.inArray(f,g.rowArray)>=0:f==g.iExact}return null},and:function(k,j){if(c.filter.regex.andTest.test(j.filter)){var g=j.index,f=j.parsed[g],i=j.iFilter.split(c.filter.regex.andSplit),e=j.iExact.search(d.trim(c.filter.parseFilter(k,i[0],g,f)))>=0,h=i.length-1;while(e&&h){e=e&&j.iExact.search(d.trim(c.filter.parseFilter(k,i[h],g,f)))>=0;h--}return e}return null},range:function(j,e){if(c.filter.regex.toTest.test(e.iFilter)){var n,f,m,k,l=j.table,g=e.index,i=e.parsed[g],h=e.iFilter.split(c.filter.regex.toSplit);f=h[0].replace(c.filter.regex.nondigit,"")||"";m=c.formatFloat(c.filter.parseFilter(j,f,g,i),l);f=h[1].replace(c.filter.regex.nondigit,"")||"";k=c.formatFloat(c.filter.parseFilter(j,f,g,i),l);if(i||j.parsers[g].type==="numeric"){n=j.parsers[g].format(""+h[0],l,j.$headers.eq(g),g);m=(n!==""&&!isNaN(n))?n:m;n=j.parsers[g].format(""+h[1],l,j.$headers.eq(g),g);k=(n!==""&&!isNaN(n))?n:k}if((i||j.parsers[g].type==="numeric")&&!isNaN(m)&&!isNaN(k)){n=e.cache}else{f=isNaN(e.iExact)?e.iExact.replace(c.filter.regex.nondigit,""):e.iExact;n=c.formatFloat(f,l)}if(m>k){f=m;m=k;k=f}return(n>=m&&n<=k)||(m===""||k==="")}return null},wild:function(j,i){if(/[\?\*\|]/.test(i.iFilter)||c.filter.regex.orReplace.test(i.filter)){var g=i.index,f=i.parsed[g],e=i.iFilter.replace(c.filter.regex.orReplace,"|"),h=""+(c.filter.parseFilter(j,e,g,f)||"");if(!j.$headerIndexed[g].hasClass("filter-match")&&/\|/.test(h)){if(h[h.length-1]==="|"){h+="*"}h=i.anyMatch&&d.isArray(i.rowArray)?"("+h+")":"^("+h+")$"}return new RegExp(h.replace(/\?/g,"\\S{1}").replace(/\*/g,"\\S*")).test(i.iExact)}return null},fuzzy:function(k,j){if(/^~/.test(j.iFilter)){var h,g=0,f=j.iExact.length,e=j.iFilter.slice(1),i=c.filter.parseFilter(k,e,j.index,j.parsed[j.index])||"";for(h=0;h<f;h++){if(j.iExact[h]===i[g]){g+=1}}if(g===i.length){return true}return false}return null}},init:function(p,m,o){c.language=d.extend(true,{},{to:"to",or:"or",and:"and"},c.language);var q,k,i,e,h,f,g,l,j,n=c.filter.regex;m.$table.addClass("hasFilters");o.searchTimer=null;o.filter_initTimer=null;o.filter_formatterCount=0;o.filter_formatterInit=[];o.filter_anyColumnSelector='[data-column="all"],[data-column="any"]';o.filter_multipleColumnSelector='[data-column*="-"],[data-column*=","]';g="\\{"+c.filter.regex.query+"\\}";d.extend(n,{child:new RegExp(m.cssChildRow),filtered:new RegExp(o.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"),iQuery:new RegExp(g,"i"),igQuery:new RegExp(g,"ig")});g=m.$headers.filter(".filter-false, .parser-false").length;if(o.filter_columnFilters!==false&&g!==m.$headers.length){c.filter.buildRow(p,m,o)}i="addRows updateCell update updateRows updateComplete appendCache filterReset filterEnd search ".split(" ").join(m.namespace+"filter ");m.$table.bind(i,function(s,r){g=o.filter_hideEmpty&&d.isEmptyObject(m.cache)&&!(m.delayInit&&s.type==="appendCache");m.$table.find("."+b.filterRow).toggleClass(o.filter_filteredRow,g);if(!/(search|filter)/.test(s.type)){s.stopPropagation();c.filter.buildDefault(p,true)}if(s.type==="filterReset"){m.$table.find("."+b.filter).add(o.filter_$externalFilters).val("");c.filter.searching(p,[])}else{if(s.type==="filterEnd"){c.filter.buildDefault(p,true)}else{r=s.type==="search"?r:s.type==="updateComplete"?m.$table.data("lastSearch"):"";if(/(update|add)/.test(s.type)&&s.type!=="updateComplete"){m.lastCombinedFilter=null;m.lastSearch=[]}c.filter.searching(p,r,true)}}return false});if(o.filter_reset){if(o.filter_reset instanceof d){o.filter_reset.click(function(){m.$table.trigger("filterReset")})}else{if(d(o.filter_reset).length){d(document).undelegate(o.filter_reset,"click.tsfilter").delegate(o.filter_reset,"click.tsfilter",function(){m.$table.trigger("filterReset")})}}}if(o.filter_functions){for(h=0;h<m.columns;h++){l=c.getColumnData(p,o.filter_functions,h);if(l){e=m.$headerIndexed[h].removeClass("filter-select");j=!(e.hasClass("filter-false")||e.hasClass("parser-false"));q="";if(l===true&&j){c.filter.buildSelect(p,h)}else{if(typeof l==="object"&&j){for(k in l){if(typeof k==="string"){q+=q===""?'<option value="">'+(e.data("placeholder")||e.attr("data-placeholder")||o.filter_placeholder.select||"")+"</option>":"";g=k;i=k;if(k.indexOf(o.filter_selectSourceSeparator)>=0){g=k.split(o.filter_selectSourceSeparator);i=g[1];g=g[0]}q+="<option "+(i===g?"":'data-function-name="'+k+'" ')+'value="'+g+'">'+i+"</option>"}}m.$table.find("thead").find("select."+b.filter+'[data-column="'+h+'"]').append(q);i=o.filter_selectSource;l=d.isFunction(i)?true:c.getColumnData(p,i,h);if(l){c.filter.buildSelect(m.table,h,"",true,e.hasClass(o.filter_onlyAvail))}}}}}}c.filter.buildDefault(p,true);c.filter.bindSearch(p,m.$table.find("."+b.filter),true);if(o.filter_external){c.filter.bindSearch(p,o.filter_external)}if(o.filter_hideFilters){c.filter.hideFilters(p,m)}if(m.showProcessing){i="filterStart filterEnd ".split(" ").join(m.namespace+"filter ");m.$table.unbind(i.replace(/\s+/g," ")).bind(i,function(s,r){e=(r)?m.$table.find("."+b.header).filter("[data-column]").filter(function(){return r[d(this).data("column")]!==""}):"";c.isProcessing(p,s.type==="filterStart",r?e:"")})}m.filteredRows=m.totalRows;i="tablesorter-initialized pagerBeforeInitialized ".split(" ").join(m.namespace+"filter ");m.$table.unbind(i.replace(/\s+/g," ")).bind(i,function(){var r=this.config.widgetOptions;f=c.filter.setDefaults(p,m,r)||[];if(f.length){if(!(m.delayInit&&f.join("")==="")){c.setFilters(p,f,true)}}m.$table.trigger("filterFomatterUpdate");setTimeout(function(){if(!r.filter_initialized){c.filter.filterInitComplete(m)}},100)});if(m.pager&&m.pager.initialized&&!o.filter_initialized){m.$table.trigger("filterFomatterUpdate");setTimeout(function(){c.filter.filterInitComplete(m)},100)}},formatterUpdated:function(g,f){var e=g.closest("table")[0].config.widgetOptions;if(!e.filter_initialized){e.filter_formatterInit[f]=1}},filterInitComplete:function(j){var i,e,g=j.widgetOptions,h=0,f=function(){g.filter_initialized=true;j.$table.trigger("filterInit",j);c.filter.findRows(j.table,j.$table.data("lastSearch")||[])};if(d.isEmptyObject(g.filter_formatter)){f()}else{e=g.filter_formatterInit.length;for(i=0;i<e;i++){if(g.filter_formatterInit[i]===1){h++}}clearTimeout(g.filter_initTimer);if(!g.filter_initialized&&h===g.filter_formatterCount){f()}else{if(!g.filter_initialized){g.filter_initTimer=setTimeout(function(){f()},500)}}}},setDefaults:function(m,j,k){var h,l,g,f,i,e=c.getFilters(m)||[];if(k.filter_saveFilters&&c.storage){l=c.storage(m,"tablesorter-filters")||[];h=d.isArray(l);if(!(h&&l.join("")===""||!h)){e=l}}if(e.join("")===""){i=j.$headers.add(k.filter_$externalFilters).filter("["+k.filter_defaultAttrib+"]");for(g=0;g<=j.columns;g++){f=g===j.columns?"all":g;e[g]=i.filter('[data-column="'+f+'"]').attr(k.filter_defaultAttrib)||e[g]||""}}j.$table.data("lastSearch",e);return e},parseFilter:function(h,g,f,e){return e?h.parsers[f].format(g,h.table,[],f):g},buildRow:function(s,n,p){var h,j,f,o,k,g,e,l,r=p.filter_cellFilter,i=n.columns,m=d.isArray(r),q='<tr role="row" class="'+b.filterRow+" "+n.cssIgnoreRow+'">';for(j=0;j<i;j++){q+="<td";if(m){q+=(r[j]?' class="'+r[j]+'"':"")}else{q+=(r!==""?' class="'+r+'"':"")}q+="></td>"}n.$filters=d(q+="</tr>").appendTo(n.$table.children("thead").eq(0)).find("td");for(j=0;j<i;j++){k=false;f=n.$headerIndexed[j];e=c.getColumnData(s,p.filter_functions,j);o=(p.filter_functions&&e&&typeof e!=="function")||f.hasClass("filter-select");h=c.getColumnData(s,n.headers,j);k=c.getData(f[0],h,"filter")==="false"||c.getData(f[0],h,"parser")==="false";if(o){q=d("<select>").appendTo(n.$filters.eq(j))}else{e=c.getColumnData(s,p.filter_formatter,j);if(e){p.filter_formatterCount++;q=e(n.$filters.eq(j),j);if(q&&q.length===0){q=n.$filters.eq(j).children("input")}if(q&&(q.parent().length===0||(q.parent().length&&q.parent()[0]!==n.$filters[j]))){n.$filters.eq(j).append(q)}}else{q=d('<input type="search">').appendTo(n.$filters.eq(j))}if(q){l=f.data("placeholder")||f.attr("data-placeholder")||p.filter_placeholder.search||"";q.attr("placeholder",l)}}if(q){g=(d.isArray(p.filter_cssFilter)?(typeof p.filter_cssFilter[j]!=="undefined"?p.filter_cssFilter[j]||"":""):p.filter_cssFilter)||"";q.addClass(b.filter+" "+g).attr("data-column",j);if(k){q.attr("placeholder","").addClass(b.filterDisabled)[0].disabled=true}}}},bindSearch:function(j,g,e){j=d(j)[0];g=d(g);if(!g.length){return}var f,l=j.config,i=l.widgetOptions,h=l.namespace+"filter",k=i.filter_$externalFilters;if(e!==true){f=i.filter_anyColumnSelector+","+i.filter_multipleColumnSelector;i.filter_$anyMatch=g.filter(f);if(k&&k.length){i.filter_$externalFilters=i.filter_$externalFilters.add(g)}else{i.filter_$externalFilters=g}c.setFilters(j,l.$table.data("lastSearch")||[],e===false)}f=("keypress keyup search change ".split(" ").join(h+" "));g.attr("data-lastSearchTime",new Date().getTime()).unbind(f.replace(/\s+/g," ")).bind("keyup"+h,function(m){d(this).attr("data-lastSearchTime",new Date().getTime());if(m.which===27){this.value=""}else{if(i.filter_liveSearch===false){return}else{if(this.value!==""&&((typeof i.filter_liveSearch==="number"&&this.value.length<i.filter_liveSearch)||(m.which!==13&&m.which!==8&&(m.which<32||(m.which>=37&&m.which<=40))))){return}}}c.filter.searching(j,true,true)}).bind("search change keypress ".split(" ").join(h+" "),function(n){var m=d(this).data("column");if(n.which===13||n.type==="search"||n.type==="change"&&this.value!==l.lastSearch[m]){n.preventDefault();d(this).attr("data-lastSearchTime",new Date().getTime());c.filter.searching(j,false,true)}})},searching:function(h,g,f){var e=h.config.widgetOptions;clearTimeout(e.searchTimer);if(typeof g==="undefined"||g===true){e.searchTimer=setTimeout(function(){c.filter.checkFilters(h,g,f)},e.filter_liveSearch?e.filter_searchDelay:10)}else{c.filter.checkFilters(h,g,f)}},checkFilters:function(j,h,g){var l=j.config,f=l.widgetOptions,e=d.isArray(h),i=(e)?h:c.getFilters(j,true),k=(i||[]).join("");if(d.isEmptyObject(l.cache)){if(l.delayInit&&l.pager&&l.pager.initialized){l.$table.trigger("updateCache",[function(){c.filter.checkFilters(j,false,g)}])}return}if(e){c.setFilters(j,i,false,g!==true);if(!f.filter_initialized){l.lastCombinedFilter=""}}if(f.filter_hideFilters){l.$table.find("."+b.filterRow).trigger(k===""?"mouseleave":"mouseenter")}if(l.lastCombinedFilter===k&&h!==false){return}else{if(h===false){l.lastCombinedFilter=null;l.lastSearch=[]}}if(f.filter_initialized){l.$table.trigger("filterStart",[i])}if(l.showProcessing){setTimeout(function(){c.filter.findRows(j,i,k);return false},30)}else{c.filter.findRows(j,i,k);return false}},hideFilters:function(f,i){var g,e,h;d(f).find("."+b.filterRow).addClass(b.filterRowHide).bind("mouseenter mouseleave",function(k){var j=k;g=d(this);clearTimeout(h);h=setTimeout(function(){if(/enter|over/.test(j.type)){g.removeClass(b.filterRowHide)}else{if(d(document.activeElement).closest("tr")[0]!==g[0]){if(i.lastCombinedFilter===""){g.addClass(b.filterRowHide)}}}},200)}).find("input, select").bind("focus blur",function(k){e=d(this).closest("tr");clearTimeout(h);var j=k;h=setTimeout(function(){if(c.getFilters(i.$table).join("")===""){e.toggleClass(b.filterRowHide,j.type==="focus")}},200)})},defaultFilter:function(g,f){if(g===""){return g}var j=c.filter.regex.iQuery,i=f.match(c.filter.regex.igQuery).length,k=i>1?d.trim(g).split(/\s/):[d.trim(g)],e=k.length-1,h=0,l=f;if(e<1&&i>1){k[1]=k[0]}while(j.test(l)){l=l.replace(j,k[h++]||"");if(j.test(l)&&h<e&&(k[h]||"")!==""){l=f.replace(j,l)}}return l},getLatestSearch:function(e){if(e){return e.sort(function(g,f){return d(f).attr("data-lastSearchTime")-d(g).attr("data-lastSearchTime")})}return d()},multipleColumns:function(q,r){var t,e,m,f,j,k,l,n,p,s=q.widgetOptions,o=s.filter_initialized||!r.filter(s.filter_anyColumnSelector).length,h=[],g=d.trim(c.filter.getLatestSearch(r).attr("data-column")||"");if(o&&/-/.test(g)){e=g.match(/(\d+)\s*-\s*(\d+)/g);p=e.length;for(n=0;n<p;n++){m=e[n].split(/\s*-\s*/);f=parseInt(m[0],10)||0;j=parseInt(m[1],10)||(q.columns-1);if(f>j){t=f;f=j;j=t}if(j>=q.columns){j=q.columns-1}for(;f<=j;f++){h.push(f)}g=g.replace(e[n],"")}}if(o&&/,/.test(g)){k=g.split(/\s*,\s*/);p=k.length;for(l=0;l<p;l++){if(k[l]!==""){n=parseInt(k[l],10);if(n<q.columns){h.push(n)}}}}if(!h.length){for(n=0;n<q.columns;n++){h.push(n)}}return h},processRow:function(o,h,n){var p,l,s,i,u,f,k,t,m,e,g,r=c.filter.regex,q=o.widgetOptions,j=true;h.$cells=h.$row.children();if(h.anyMatchFlag){l=c.filter.multipleColumns(o,q.filter_$anyMatch);h.anyMatch=true;h.rowArray=h.$cells.map(function(v){if(d.inArray(v,l)>-1){if(h.parsed[v]){g=h.cacheArray[v]}else{g=h.rawArray[v];g=d.trim(q.filter_ignoreCase?g.toLowerCase():g);if(o.sortLocaleCompare){g=c.replaceAccents(g)}}return g}}).get();h.filter=h.anyMatchFilter;h.iFilter=h.iAnyMatchFilter;h.exact=h.rowArray.join(" ");h.iExact=q.filter_ignoreCase?h.exact.toLowerCase():h.exact;h.cache=h.cacheArray.slice(0,-1).join(" ");k=null;i=null;for(e in c.filter.types){if(d.inArray(e,n.noAnyMatch)<0&&i===null){i=c.filter.types[e](o,h);if(i!==null){k=i}}}if(k!==null){j=k}else{if(q.filter_startsWith){j=false;l=o.columns;while(!j&&l>0){l--;j=j||h.rowArray[l].indexOf(h.iFilter)===0}}else{j=(h.iExact+h.childRowText).indexOf(h.iFilter)>=0}}h.anyMatch=false;if(h.filters.join("")===h.filter){return j}}for(l=0;l<o.columns;l++){h.filter=h.filters[l];h.index=l;t=n.excludeFilter[l];if(h.filter){h.cache=h.cacheArray[l];if(q.filter_useParsedData||h.parsed[l]){h.exact=h.cache}else{u=h.rawArray[l]||"";h.exact=o.sortLocaleCompare?c.replaceAccents(u):u}h.iExact=!r.type.test(typeof h.exact)&&q.filter_ignoreCase?h.exact.toLowerCase():h.exact;u=j;e=q.filter_columnFilters?o.$filters.add(o.$externalFilters).filter('[data-column="'+l+'"]').find("select option:selected").attr("data-function-name")||"":"";if(o.sortLocaleCompare){h.filter=c.replaceAccents(h.filter)}f=true;if(q.filter_defaultFilter&&r.iQuery.test(n.defaultColFilter[l])){h.filter=c.filter.defaultFilter(h.filter,n.defaultColFilter[l]);f=false}h.iFilter=q.filter_ignoreCase?(h.filter||"").toLowerCase():h.filter;m=n.functions[l];p=o.$headerIndexed[l];s=p.hasClass("filter-select");k=null;if(m||(s&&f)){if(m===true||s){k=p.hasClass("filter-match")?h.iExact.search(h.iFilter)>=0:h.filter===h.exact}else{if(typeof m==="function"){k=m(h.exact,h.cache,h.filter,l,h.$row,o,h)}else{if(typeof m[e||h.filter]==="function"){g=e||h.filter;k=m[g](h.exact,h.cache,h.filter,l,h.$row,o,h)}}}}if(k===null){i=null;for(e in c.filter.types){if(d.inArray(e,t)<0&&i===null){i=c.filter.types[e](o,h);if(i!==null){k=i}}}if(k!==null){u=k}else{g=(h.iExact+h.childRowText).indexOf(c.filter.parseFilter(o,h.iFilter,l,h.parsed[l]));u=((!q.filter_startsWith&&g>=0)||(q.filter_startsWith&&g===0))}}else{u=k}j=(u)?j:false}}return j},findRows:function(C,n,m){if(C.config.lastCombinedFilter===m||!C.config.widgetOptions.filter_initialized){return}var B,k,l,v,p,r,u,E,o,z,y,w,j,I,G,x,e,i,A,H,t,q,h=d.extend([],n),g=c.filter.regex,D=C.config,f=D.widgetOptions,F={anyMatch:false,filters:n,filter_regexCache:[]},s={noAnyMatch:["range","notMatch","operators"],functions:[],excludeFilter:[],defaultColFilter:[],defaultAnyFilter:c.getColumnData(C,f.filter_defaultFilter,D.columns,true)||""};F.parsed=D.$headers.map(function(J){return D.parsers&&D.parsers[J]&&D.parsers[J].parsed||c.getData&&c.getData(D.$headerIndexed[J],c.getColumnData(C,D.headers,J),"filter")==="parsed"||d(this).hasClass("filter-parsed")}).get();for(E=0;E<D.columns;E++){s.functions[E]=c.getColumnData(C,f.filter_functions,E);s.defaultColFilter[E]=c.getColumnData(C,f.filter_defaultFilter,E)||"";s.excludeFilter[E]=(c.getColumnData(C,f.filter_excludeFilter,E,true)||"").split(/\s+/)}if(D.debug){c.log("Filter: Starting filter widget search",n);j=new Date()}D.filteredRows=0;D.totalRows=0;m=(h||[]).join("");for(r=0;r<D.$tbodies.length;r++){u=c.processTbody(C,D.$tbodies.eq(r),true);E=D.columns;k=D.cache[r].normalized;v=d(d.map(k,function(J){return J[E].$row.get()}));if(m===""||f.filter_serversideFiltering){v.removeClass(f.filter_filteredRow).not("."+D.cssChildRow).css("display","")}else{v=v.not("."+D.cssChildRow);B=v.length;if((f.filter_$anyMatch&&f.filter_$anyMatch.length)||typeof n[D.columns]!=="undefined"){F.anyMatchFlag=true;F.anyMatchFilter=""+(n[D.columns]||f.filter_$anyMatch&&c.filter.getLatestSearch(f.filter_$anyMatch).val()||"");if(f.filter_columnAnyMatch){i=F.anyMatchFilter.split(g.andSplit);A=false;for(G=0;G<i.length;G++){H=i[G].split(":");if(H.length>1){t=parseInt(H[0],10)-1;if(t>=0&&t<D.columns){n[t]=H[1];i.splice(G,1);G--;A=true}}}if(A){F.anyMatchFilter=i.join(" && ")}}}e=f.filter_searchFiltered;y=D.lastSearch||D.$table.data("lastSearch")||[];if(e){for(G=0;G<E+1;G++){I=n[G]||"";if(!e){G=E}e=e&&y.length&&I.indexOf(y[G]||"")===0&&!g.alreadyFiltered.test(I)&&!/[=\"\|!]/.test(I)&&!(/(>=?\s*-\d)/.test(I)||/(<=?\s*\d)/.test(I))&&!(I!==""&&D.$filters&&D.$filters.eq(G).find("select").length&&!D.$headerIndexed[G].hasClass("filter-match"))}}x=v.not("."+f.filter_filteredRow).length;if(e&&x===0){e=false}if(D.debug){c.log("Filter: Searching through "+(e&&x<B?x:"all")+" rows")}if(F.anyMatchFlag){if(D.sortLocaleCompare){F.anyMatchFilter=c.replaceAccents(F.anyMatchFilter)}if(f.filter_defaultFilter&&g.iQuery.test(s.defaultAnyFilter)){F.anyMatchFilter=c.filter.defaultFilter(F.anyMatchFilter,s.defaultAnyFilter);e=false}F.iAnyMatchFilter=!(f.filter_ignoreCase&&D.ignoreCase)?F.anyMatchFilter:F.anyMatchFilter.toLowerCase()}for(p=0;p<B;p++){q=v[p].className;o=p&&g.child.test(q);if(o||(e&&g.filtered.test(q))){continue}F.$row=v.eq(p);F.cacheArray=k[p];l=F.cacheArray[D.columns];F.rawArray=l.raw;F.childRowText="";if(!f.filter_childByColumn){q="";z=l.child;for(G=0;G<z.length;G++){q+=" "+z[G].join("")||""}F.childRowText=f.filter_childRows?(f.filter_ignoreCase?q.toLowerCase():q):""}w=c.filter.processRow(D,F,s);z=l.$row.filter(":gt( 0 )");if(f.filter_childRows&&z.length){if(f.filter_childByColumn){for(G=0;G<z.length;G++){F.$row=z.eq(G);F.cacheArray=l.child[G];F.rawArray=F.cacheArray;w=w||c.filter.processRow(D,F,s)}}z.toggleClass(f.filter_filteredRow,!w)}l.$row.toggleClass(f.filter_filteredRow,!w)[0].display=w?"":"none"}}D.filteredRows+=v.not("."+f.filter_filteredRow).length;D.totalRows+=v.length;c.processTbody(C,u,false)}D.lastCombinedFilter=m;D.lastSearch=h;D.$table.data("lastSearch",h);if(f.filter_saveFilters&&c.storage){c.storage(C,"tablesorter-filters",h)}if(D.debug){c.benchmark("Completed filter widget search",j)}if(f.filter_initialized){D.$table.trigger("filterEnd",D)}setTimeout(function(){D.$table.trigger("applyWidgets")},0)},getOptionSource:function(q,g,h){q=d(q)[0];var f,i,k,n=q.config,o=n.widgetOptions,m=[],j=false,e=o.filter_selectSource,p=n.$table.data("lastSearch")||[],l=d.isFunction(e)?true:c.getColumnData(q,e,g);if(h&&p[g]!==""){h=false}if(l===true){j=e(q,g,h)}else{if(l instanceof d||(d.type(l)==="string"&&l.indexOf("</option>")>=0)){return l}else{if(d.isArray(l)){j=l}else{if(d.type(e)==="object"&&l){j=l(q,g,h)}}}}if(j===false){j=c.filter.getOptions(q,g,h)}j=d.grep(j,function(s,r){return d.inArray(s,j)===r});if(n.$headerIndexed[g].hasClass("filter-select-nosort")){return j}else{k=j.length;for(i=0;i<k;i++){m.push({t:j[i],p:n.parsers&&n.parsers[g].format(j[i],q,[],g)})}f=n.textSorter||"";m.sort(function(t,s){var r=t.p.toString(),u=s.p.toString();if(d.isFunction(f)){return f(r,u,true,g,q)}else{if(typeof(f)==="object"&&f.hasOwnProperty(g)){return f[g](r,u,true,g,q)}else{if(c.sortNatural){return c.sortNatural(r,u)}}}return true});j=[];k=m.length;for(i=0;i<k;i++){j.push(m[i].t)}return j}},getOptions:function(n,f,g){n=d(n)[0];var k,l,i,o,e,j=n.config,m=j.widgetOptions,h=[];for(l=0;l<j.$tbodies.length;l++){e=j.cache[l];i=j.cache[l].normalized.length;for(k=0;k<i;k++){o=e.row?e.row[k]:e.normalized[k][j.columns].$row[0];if(g&&o.className.match(m.filter_filteredRow)){continue}if(m.filter_useParsedData||j.parsers[f].parsed||j.$headerIndexed[f].hasClass("filter-parsed")){h.push(""+e.normalized[k][f])}else{h.push(e.normalized[k][j.columns].raw[f])}}}return h},buildSelect:function(s,g,k,p,i){s=d(s)[0];g=parseInt(g,10);if(!s.config.cache||d.isEmptyObject(s.config.cache)){return}var j,e,h,r,l,n,m=s.config,o=m.widgetOptions,f=m.$headerIndexed[g],u='<option value="">'+(f.data("placeholder")||f.attr("data-placeholder")||o.filter_placeholder.select||"")+"</option>",q=m.$table.find("thead").find("select."+b.filter+'[data-column="'+g+'"]').val();if(typeof k==="undefined"||k===""){k=c.filter.getOptionSource(s,g,i)}if(d.isArray(k)){for(j=0;j<k.length;j++){h=k[j]=(""+k[j]).replace(/\"/g,""");e=h;if(h.indexOf(o.filter_selectSourceSeparator)>=0){r=h.split(o.filter_selectSourceSeparator);e=r[0];h=r[1]}u+=k[j]!==""?"<option "+(e===h?"":'data-function-name="'+k[j]+'" ')+'value="'+e+'">'+h+"</option>":""}k=[]}l=(m.$filters?m.$filters:m.$table.children("thead")).find("."+b.filter);if(o.filter_$externalFilters){l=l&&l.length?l.add(o.filter_$externalFilters):o.filter_$externalFilters}n=l.filter('select[data-column="'+g+'"]');if(n.length){n[p?"html":"append"](u);if(!d.isArray(k)){n.append(k).val(q)}n.val(q)}},buildDefault:function(j,i){var h,e,k,l=j.config,g=l.widgetOptions,f=l.columns;for(h=0;h<f;h++){e=l.$headerIndexed[h];k=!(e.hasClass("filter-false")||e.hasClass("parser-false"));if((e.hasClass("filter-select")||c.getColumnData(j,g.filter_functions,h)===true)&&k){c.filter.buildSelect(j,h,"",i,e.hasClass(g.filter_onlyAvail))}}}};c.getFilters=function(o,g,m,p){var f,h,n,k,e=false,j=o?d(o)[0].config:"",l=j?j.widgetOptions:"";if((g!==true&&l&&!l.filter_columnFilters)||(d.isArray(m)&&m.join("")===j.lastCombinedFilter)){return d(o).data("lastSearch")}if(j){if(j.$filters){h=j.$filters.find("."+b.filter)}if(l.filter_$externalFilters){h=h&&h.length?h.add(l.filter_$externalFilters):l.filter_$externalFilters}if(h&&h.length){e=m||[];for(f=0;f<j.columns+1;f++){k=(f===j.columns?l.filter_anyColumnSelector+","+l.filter_multipleColumnSelector:'[data-column="'+f+'"]');n=h.filter(k);if(n.length){n=c.filter.getLatestSearch(n);if(d.isArray(m)){if(p){n.slice(1)}if(f===j.columns){k=n.filter(l.filter_anyColumnSelector);n=k.length?k:n}n.val(m[f]).trigger("change.tsfilter")}else{e[f]=n.val()||"";if(f===j.columns){n.slice(1).filter('[data-column*="'+n.attr("data-column")+'"]').val(e[f])}else{n.slice(1).val(e[f])}}if(f===j.columns&&n.length){l.filter_$anyMatch=n}}}}}if(e.length===0){e=false}return e};c.setFilters=function(i,g,e,f){var j=i?d(i)[0].config:"",h=c.getFilters(i,true,g,f);if(j&&e){j.lastCombinedFilter=null;j.lastSearch=[];c.filter.searching(j.table,g,f);j.$table.trigger("filterFomatterUpdate")}return !!h}})(jQuery);
|
|
/*! Widget: stickyHeaders - updated 3/26/2015 (v2.21.3) */
|
|
;(function(d,c){var b=d.tablesorter||{};d.extend(b.css,{sticky:"tablesorter-stickyHeader",stickyVis:"tablesorter-sticky-visible",stickyHide:"tablesorter-sticky-hidden",stickyWrap:"tablesorter-sticky-wrapper"});b.addHeaderResizeEvent=function(l,h,f){l=d(l)[0];var e,g={timer:250},m=d.extend({},g,f),i=l.config,k=i.widgetOptions,j=function(n){k.resize_flag=true;e=[];i.$headers.each(function(){var p=d(this),r=p.data("savedSizes")||[0,0],q=this.offsetWidth,o=this.offsetHeight;if(q!==r[0]||o!==r[1]){p.data("savedSizes",[q,o]);e.push(this)}});if(e.length&&n!==false){i.$table.trigger("resize",[e])}k.resize_flag=false};j(false);clearInterval(k.resize_timer);if(h){k.resize_flag=false;return false}k.resize_timer=setInterval(function(){if(k.resize_flag){return}j()},m.timer)};b.addWidget({id:"stickyHeaders",priority:60,options:{stickyHeaders:"",stickyHeaders_attachTo:null,stickyHeaders_xScroll:null,stickyHeaders_yScroll:null,stickyHeaders_offset:0,stickyHeaders_filteredToTop:true,stickyHeaders_cloneId:"-sticky",stickyHeaders_addResizeEvent:true,stickyHeaders_includeCaption:true,stickyHeaders_zIndex:2},format:function(u,v,h){if(v.$table.hasClass("hasStickyHeaders")||(d.inArray("filter",v.widgets)>=0&&!v.$table.hasClass("hasFilters"))){return}var p=v.$table,z=d(h.stickyHeaders_attachTo),r=v.namespace+"stickyheaders ",s=d(h.stickyHeaders_yScroll||h.stickyHeaders_attachTo||c),k=d(h.stickyHeaders_xScroll||h.stickyHeaders_attachTo||c),o=p.children("thead:first"),x=o.children("tr").not(".sticky-false").children(),f=p.children("tfoot"),j=isNaN(h.stickyHeaders_offset)?d(h.stickyHeaders_offset):"",m=j.length?j.height()||0:parseInt(h.stickyHeaders_offset,10)||0,w=p.parent().closest("."+b.css.table).hasClass("hasStickyHeaders")?p.parent().closest("table.tablesorter")[0].config.widgetOptions.$sticky.parent():[],t=w.length?w.height():0,A=h.$sticky=p.clone().addClass("containsStickyHeaders "+b.css.sticky+" "+h.stickyHeaders+" "+v.namespace.slice(1)+"_extra_table").wrap('<div class="'+b.css.stickyWrap+'">'),n=A.parent().addClass(b.css.stickyHide).css({position:z.length?"absolute":"fixed",padding:parseInt(A.parent().parent().css("padding-left"),10),top:m+t,left:0,visibility:"hidden",zIndex:h.stickyHeaders_zIndex||2}),y=A.children("thead:first"),l,q="",i=0,e=function(B,C){B.filter(":visible").each(function(E){var F,D,G=C.filter(":visible").eq(E),H=d(this);if(H.css("box-sizing")==="border-box"){F=H.outerWidth()}else{if(G.css("border-collapse")==="collapse"){if(c.getComputedStyle){F=parseFloat(c.getComputedStyle(this,null).width)}else{D=parseFloat(H.css("border-width"));F=H.outerWidth()-parseFloat(H.css("padding-left"))-parseFloat(H.css("padding-right"))-D}}else{F=H.width()}}G.css({"min-width":F,"max-width":F})})},g=function(){m=j.length?j.height()||0:parseInt(h.stickyHeaders_offset,10)||0;i=0;n.css({left:z.length?parseInt(z.css("padding-left"),10)||0:p.offset().left-parseInt(p.css("margin-left"),10)-k.scrollLeft()-i,width:p.outerWidth()});e(p,A);e(x,l)};if(z.length&&!z.css("position")){z.css("position","relative")}if(A.attr("id")){A[0].id+=h.stickyHeaders_cloneId}A.find("thead:gt(0), tr.sticky-false").hide();A.find("tbody, tfoot").remove();A.find("caption").toggle(h.stickyHeaders_includeCaption);l=y.children().children();A.css({height:0,width:0,margin:0});l.find("."+b.css.resizer).remove();p.addClass("hasStickyHeaders").bind("pagerComplete"+r,function(){g()});b.bindEvents(u,y.children().children("."+b.css.header));p.after(n);if(v.onRenderHeader){y.children("tr").children().each(function(B){v.onRenderHeader.apply(d(this),[B,v,A])})}k.add(s).unbind(("scroll resize ".split(" ").join(r)).replace(/\s+/g," ")).bind("scroll resize ".split(" ").join(r),function(F){if(!p.is(":visible")){return}t=w.length?w.offset().top-s.scrollTop()+w.height():0;var H=p.offset(),E=d.isWindow(s[0]),D=d.isWindow(k[0]),G=(z.length?(E?s.scrollTop():s.offset().top):s.scrollTop())+m+t,C=p.height()-(n.height()+(f.height()||0)),B=(G>H.top)&&(G<H.top+C)?"visible":"hidden",I={visibility:B};if(z.length){I.top=E?G-z.offset().top:z.scrollTop()}if(D){I.left=p.offset().left-parseInt(p.css("margin-left"),10)-k.scrollLeft()-i}if(w.length){I.top=(I.top||0)+m+t}n.removeClass(b.css.stickyVis+" "+b.css.stickyHide).addClass(B==="visible"?b.css.stickyVis:b.css.stickyHide).css(I);if(B!==q||F.type==="resize"){g();q=B}});if(h.stickyHeaders_addResizeEvent){b.addHeaderResizeEvent(u)}if(p.hasClass("hasFilters")&&h.filter_columnFilters){p.bind("filterEnd"+r,function(){var C=d(document.activeElement).closest("td"),B=C.parent().children().index(C);if(n.hasClass(b.css.stickyVis)&&h.stickyHeaders_filteredToTop){c.scrollTo(0,p.position().top);if(B>=0&&v.$filters){v.$filters.eq(B).find("a, select, input").filter(":visible").focus()}}});b.filter.bindSearch(p,l.find("."+b.css.filter));if(h.filter_hideFilters){b.filter.hideFilters(A,v)}}p.trigger("stickyHeadersInit")},remove:function(g,h,f){var e=h.namespace+"stickyheaders ";h.$table.removeClass("hasStickyHeaders").unbind(("pagerComplete filterEnd ".split(" ").join(e)).replace(/\s+/g," ")).next("."+b.css.stickyWrap).remove();if(f.$sticky&&f.$sticky.length){f.$sticky.remove()}d(c).add(f.stickyHeaders_xScroll).add(f.stickyHeaders_yScroll).add(f.stickyHeaders_attachTo).unbind(("scroll resize ".split(" ").join(e)).replace(/\s+/g," "));b.addHeaderResizeEvent(g,false)}})})(jQuery,window);
|
|
/*! Widget: resizable - updated 5/17/2015 (v2.22.0) */
|
|
;(function(d,c){var b=d.tablesorter||{};d.extend(b.css,{resizableContainer:"tablesorter-resizable-container",resizableHandle:"tablesorter-resizable-handle",resizableNoSelect:"tablesorter-disableSelection",resizableStorage:"tablesorter-resizable"});d(function(){var e="<style>body."+b.css.resizableNoSelect+" { -ms-user-select: none; -moz-user-select: -moz-none;-khtml-user-select: none; -webkit-user-select: none; user-select: none; }."+b.css.resizableContainer+" { position: relative; height: 1px; }."+b.css.resizableHandle+" { position: absolute; display: inline-block; width: 8px; top: 1px;cursor: ew-resize; z-index: 3; user-select: none; -moz-user-select: none; }</style>";d(e).appendTo("body")});b.resizable={init:function(k,g){if(k.$table.hasClass("hasResizable")){return}k.$table.addClass("hasResizable");b.resizableReset(k.table,true);g.resizable_={$wrap:k.$table.parent(),mouseXPosition:0,$target:null,$next:null,overflow:k.$table.parent().css("overflow")==="auto",fullWidth:Math.abs(k.$table.parent().width()-k.$table.width())<20,storedSizes:[]};var j,e,f,i,h=parseInt(k.$table.css("margin-top"),10);g.resizable_.storedSizes=i=((b.storage&&g.resizable!==false)?b.storage(k.table,b.css.resizableStorage):[])||[];b.resizable.setWidths(k,g,i);g.$resizable_container=d('<div class="'+b.css.resizableContainer+'">').css({top:h}).insertBefore(k.$table);for(f=0;f<k.columns;f++){e=k.$headerIndexed[f];j=b.getData(e,b.getColumnData(k.table,k.headers,f),"resizable")==="false";if(!j){d('<div class="'+b.css.resizableHandle+'">').appendTo(g.$resizable_container).attr({"data-column":f,unselectable:"on"}).data("header",e).bind("selectstart",false)}}k.$table.one("tablesorter-initialized",function(){b.resizable.setHandlePosition(k,g);b.resizable.bindings(this.config,this.config.widgetOptions)})},setWidth:function(e,f){e.css({width:f,"min-width":"","max-width":""})},setWidths:function(j,g,i){var f,h=d(j.namespace+"_extra_headers"),e=j.$table.children("colgroup").children("col");i=i||g.resizable_.storedSizes||[];if(i.length){for(f=0;f<j.columns;f++){j.$headerIndexed[f].width(i[f]);if(h.length){b.resizable.setWidth(h.eq(f).add(e.eq(f)),i[f])}}if(d(j.namespace+"_extra_table").length&&!b.hasWidget(j.table,"scroller")){b.resizable.setWidth(d(j.namespace+"_extra_table"),j.$table.outerWidth())}}},setHandlePosition:function(k,i){var h,j=b.hasWidget(k.table,"scroller"),f=k.$table.height(),e=i.$resizable_container.children(),g=Math.floor(e.width()/2);if(j){f=0;k.$table.closest("."+b.css.scrollerWrap).children().each(function(){var l=d(this);f+=l.filter('[style*="height"]').length?l.height():l.children("table").height()})}h=k.$table.position().left;e.each(function(){var o=d(this),n=parseInt(o.attr("data-column"),10),m=k.columns-1,l=o.data("header");if(!l){return}if(!l.is(":visible")){o.hide()}else{if(n<m||n===m&&i.resizable_addLastColumn){o.css({display:"inline-block",height:f,left:l.position().left-h+l.outerWidth()-g})}}})},toggleTextSelection:function(g,e){var f=g.namespace+"tsresize";g.widgetOptions.resizable_.disabled=e;d("body").toggleClass(b.css.resizableNoSelect,e);if(e){d("body").attr("unselectable","on").bind("selectstart"+f,false)}else{d("body").removeAttr("unselectable").unbind("selectstart"+f)}},bindings:function(g,f){var e=g.namespace+"tsresize";f.$resizable_container.children().bind("mousedown",function(j){var i,m,l=f.resizable_,k=d(g.namespace+"_extra_headers"),h=d(j.target).data("header");i=parseInt(h.attr("data-column"),10);l.$target=h=h.add(k.filter('[data-column="'+i+'"]'));l.target=i;l.$next=j.shiftKey||f.resizable_targetLast?h.parent().children().not(".resizable-false").filter(":last"):h.nextAll(":not(.resizable-false)").eq(0);i=parseInt(l.$next.attr("data-column"),10);l.$next=l.$next.add(k.filter('[data-column="'+i+'"]'));l.next=i;l.mouseXPosition=j.pageX;l.storedSizes=[];for(i=0;i<g.columns;i++){m=g.$headerIndexed[i];l.storedSizes[i]=m.is(":visible")?m.width():0}b.resizable.toggleTextSelection(g,true)});d(document).bind("mousemove"+e,function(h){var i=f.resizable_;if(!i.disabled||i.mouseXPosition===0||!i.$target){return}if(f.resizable_throttle){clearTimeout(i.timer);i.timer=setTimeout(function(){b.resizable.mouseMove(g,f,h)},isNaN(f.resizable_throttle)?5:f.resizable_throttle)}else{b.resizable.mouseMove(g,f,h)}}).bind("mouseup"+e,function(){if(!f.resizable_.disabled){return}b.resizable.toggleTextSelection(g,false);b.resizable.stopResize(g,f);b.resizable.setHandlePosition(g,f)});d(c).bind("resize"+e+" resizeEnd"+e,function(){b.resizable.setHandlePosition(g,f)});g.$table.bind("columnUpdate"+e,function(){b.resizable.setHandlePosition(g,f)}).find("thead:first").add(d(g.namespace+"_extra_table").find("thead:first")).bind("contextmenu"+e,function(){var h=f.resizable_.storedSizes.length===0;b.resizableReset(g.table);b.resizable.setHandlePosition(g,f);f.resizable_.storedSizes=[];return h})},mouseMove:function(j,f,g){if(f.resizable_.mouseXPosition===0||!f.resizable_.$target){return}var i=f.resizable_,e=i.$next,h=g.pageX-i.mouseXPosition;if(i.fullWidth){i.storedSizes[i.target]+=h;i.storedSizes[i.next]-=h;b.resizable.setWidths(j,f)}else{if(i.overflow){j.$table.add(d(j.namespace+"_extra_table")).width(function(l,k){return k+h});if(!e.length){i.$wrap[0].scrollLeft=j.$table.width()}}else{i.storedSizes[i.target]+=h;b.resizable.setWidths(j,f)}}i.mouseXPosition=g.pageX},stopResize:function(i,f){var h,e,g=f.resizable_;g.storedSizes=[];if(b.storage){g.storedSizes=[];for(e=0;e<i.columns;e++){h=i.$headerIndexed[e];g.storedSizes[e]=h.is(":visible")?h.width():0}if(f.resizable!==false){b.storage(i.table,b.css.resizableStorage,g.storedSizes)}}g.mouseXPosition=0;g.$target=g.$next=null;d(c).trigger("resize")}};b.addWidget({id:"resizable",priority:40,options:{resizable:true,resizable_addLastColumn:false,resizable_widths:[],resizable_throttle:false,resizable_targetLast:false},init:function(g,f,h,e){b.resizable.init(h,e)},remove:function(g,i,f,h){if(f.$resizable_container){var e=i.namespace+"tsresize";i.$table.add(d(i.namespace+"_extra_table")).removeClass("hasResizable").children("thead").unbind("contextmenu"+e);f.$resizable_container.remove();b.resizable.toggleTextSelection(i,false);b.resizableReset(g,h);d(document).unbind("mousemove"+e+" mouseup"+e)}}});b.resizableReset=function(e,f){d(e).each(function(){var g,j,i=this.config,h=i&&i.widgetOptions;if(e&&i&&i.$headerIndexed.length){for(g=0;g<i.columns;g++){j=i.$headerIndexed[g];if(h.resizable_widths&&h.resizable_widths[g]){j.css("width",h.resizable_widths[g])}else{if(!j.hasClass("resizable-false")){j.css("width","")}}}d(c).trigger("resize");if(b.storage&&!f){b.storage(this,b.css.resizableStorage,{})}}})}})(jQuery,window);
|
|
/*! Widget: saveSort */
|
|
;(function(c){var b=c.tablesorter||{};b.addWidget({id:"saveSort",priority:20,options:{saveSort:true},init:function(f,e,g,d){e.format(f,g,d,true)},format:function(l,h,i,k){var g,d,j=h.$table,e=i.saveSort!==false,f={sortList:h.sortList};if(h.debug){d=new Date()}if(j.hasClass("hasSaveSort")){if(e&&l.hasInitialized&&b.storage){b.storage(l,"tablesorter-savesort",f);if(h.debug){b.benchmark("saveSort widget: Saving last sort: "+h.sortList,d)}}}else{j.addClass("hasSaveSort");f="";if(b.storage){g=b.storage(l,"tablesorter-savesort");f=(g&&g.hasOwnProperty("sortList")&&c.isArray(g.sortList))?g.sortList:"";if(h.debug){b.benchmark('saveSort: Last sort loaded: "'+f+'"',d)}j.bind("saveSortReset",function(m){m.stopPropagation();b.storage(l,"tablesorter-savesort","")})}if(k&&f&&f.length>0){h.sortList=f}else{if(l.hasInitialized&&f&&f.length>0){j.trigger("sorton",[f])}}}},remove:function(d,e){e.$table.removeClass("hasSaveSort");if(b.storage){b.storage(d,"tablesorter-savesort","")}}})})(jQuery);return a.tablesorter})); |