tablesorter/dist/js/jquery.tablesorter.widgets.min.js
2015-02-20 19:37:29 -06:00

4 lines
39 KiB
JavaScript

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