|
|
|
;(function(h){var k=h.tablesorter;h.extend({tablesorterPager:new function(){this.defaults={container:null,ajaxUrl:null,customAjaxUrl:function(b,a){return a},ajaxObject:{dataType:"json"},processAjaxOnInit:!0,ajaxProcessing:function(b){return[0,[],null]},output:"{startRow} to {endRow} of {totalRows} rows",updateArrows:!0,page:0,size:10,savePages:!0,storageKey:"tablesorter-pager",fixedHeight:!1,countChildRows:!1,removeRows:!1,cssFirst:".first",cssPrev:".prev",cssNext:".next",cssLast:".last",cssGoto:".gotoPage", cssPageDisplay:".pagedisplay",cssPageSize:".pagesize",cssErrorRow:"tablesorter-errorRow",cssDisabled:"disabled",totalRows:0,totalPages:0,filteredRows:0,filteredPages:0,ajaxCounter:0,currentFilters:[],startRow:0,endRow:0,$size:null,last:{}};var u=this,l=function(b,a){var e=b.cssDisabled,d=!!a,f=d||0===b.page,g=Math.min(b.totalPages,b.filteredPages),d=d||b.page===g-1||0===b.totalPages;b.updateArrows&&(b.$container.find(b.cssFirst+","+b.cssPrev)[f?"addClass":"removeClass"](e).attr("aria-disabled",f), b.$container.find(b.cssNext+","+b.cssLast)[d?"addClass":"removeClass"](e).attr("aria-disabled",d))},q=function(b,a,e){var d,f,g,c=b.config;d=c.$table.hasClass("hasFilters")&&!a.ajaxUrl;g=(c.widgetOptions&&c.widgetOptions.filter_filteredRow||"filtered")+","+c.selectorRemove+(a.countChildRows?"":",."+c.cssChildRow);f=a.size||10;a.totalPages=Math.ceil(a.totalRows/f);a.filteredRows=d?c.$tbodies.eq(0).children("tr").not("."+g).length:a.totalRows;a.filteredPages=d?Math.ceil(a.filteredRows/f)||1:a.totalPages; if(0<=Math.min(a.totalPages,a.filteredPages)&&(g=a.size*a.page>a.filteredRows,a.startRow=g?1:0===a.filteredRows?0:a.size*a.page+1,a.page=g?0:a.page,a.endRow=Math.min(a.filteredRows,a.totalRows,a.size*(a.page+1)),d=a.$container.find(a.cssPageDisplay),g=(a.ajaxData&&a.ajaxData.output?a.ajaxData.output||a.output:a.output).replace(/\{page([\-+]\d+)?\}/gi,function(b,c){return a.totalPages?a.page+(c?parseInt(c,10):1):0}).replace(/\{\w+(\s*:\s*\w+)?\}/gi,function(b){b=b.replace(/[{}\s]/g,"");var c=b.split(":"), d=a.ajaxData,e=/(rows?|pages?)$/i.test(b)?0:"";return 1<c.length&&d&&d[c[0]]?d[c[0]][c[1]]:a[b]||(d?d[b]:e)||e}),d.length&&(d["INPUT"===d[0].tagName?"val":"html"](g),a.$goto.length))){g="";f=Math.min(a.totalPages,a.filteredPages);for(d=1;d<=f;d++)g+="<option>"+d+"</option>";a.$goto.html(g).val(a.page+1)}l(a);a.initialized&&!1!==e&&(c.$table.trigger("pagerComplete",a),a.savePages&&k.storage&&k.storage(b,a.storageKey,{page:a.page,size:a.size}))},s=function(b,a){var e,d=b.config,f=d.$tbodies.eq(0);a.fixedHeight&& (f.find("tr.pagerSavedHeightSpacer").remove(),e=h.data(b,"pagerSavedHeight"))&&(e-=f.height(),5<e&&h.data(b,"pagerLastSize")===a.size&&f.children("tr:visible").length<a.size&&f.append('<tr class="pagerSavedHeightSpacer '+d.selectorRemove.replace(/(tr)?\./g,"")+'" style="height:'+e+'px;"></tr>'))},z=function(b,a){var e=b.config.$tbodies.eq(0);e.find("tr.pagerSavedHeightSpacer").remove();h.data(b,"pagerSavedHeight",e.height());s(b,a);h.data(b,"pagerLastSize",a.size)},t=function(b,a){if(!a.ajaxUrl){var e, d=b.config,f=d.$tbodies.eq(0).children(),g=f.length,c=a.page*a.size,h=c+a.size,k=d.widgetOptions&&d.widgetOptions.filter_filteredRow||"filtered",p=0;for(e=0;e<g;e++)f[e].className.match(k)||(f[e].style.display=p>=c&&p<h?"":"none",p+=f[e].className.match(d.cssChildRow+"|"+d.selectorRemove.slice(1))&&!a.countChildRows?0:1)}},A=function(b,a){a.size=parseInt(a.$size.val(),10)||a.size;h.data(b,"pagerLastSize",a.size);l(a);a.removeRows||(t(b,a),h(b).bind("sortEnd.pager filterEnd.pager",function(){t(b,a)}))}, B=function(b,a,e,d,f){if("function"===typeof e.ajaxProcessing){var g,c,y,m,p,v,r=a.config,n=r.$table,l="";g=e.ajaxProcessing(b,a)||[0,[]];b=n.find("thead th").length;k.showError(a);if(f)r.debug&&k.log("Ajax Error",d,f),k.showError(a,0===d.status?"Not connected, verify Network":404===d.status?"Requested page not found [404]":500===d.status?"Internal Server Error [500]":"parsererror"===f?"Requested JSON parse failed":"timeout"===f?"Time out error":"abort"===f?"Ajax Request aborted":"Uncaught error: "+ d.statusText+" ["+d.sta
|