/*! * TableSorter 2.7 - Client-side table sorting with ease! * @requires jQuery v1.2.6+ * * Copyright (c) 2007 Christian Bach * Examples and docs at: http://tablesorter.com * Dual licensed under the MIT and GPL licenses: * http://www.opensource.org/licenses/mit-license.php * http://www.gnu.org/licenses/gpl.html * * @type jQuery * @name tablesorter * @cat Plugins/Tablesorter * @author Christian Bach/christian.bach@polyester.se * @contributor Rob Garrison/https://github.com/Mottie/tablesorter */ !function(C){"use strict";C.extend({tablesorter:new function(){var b=this;function g(e){"undefined"!=typeof console&&void 0!==console.log?console.log(e):alert(e)}function w(e,t){g(e+" ("+((new Date).getTime()-t.getTime())+"ms)")}function m(e,t,r){if(!t)return"";var s=e.config,o=s.textExtraction,i="";return i="simple"===o?s.supportsTextContent?t.textContent:C(t).text():"function"==typeof o?o(t,e,r):"object"==typeof o&&o.hasOwnProperty(r)?o[r](t,e,r):s.supportsTextContent?t.textContent:C(t).text(),C.trim(i)}function f(e,t,r,s){for(var o,i=b.parsers.length,n=!1,a="",d=!0;""===a&&d;)t[++r]?(a=m(e,n=t[r].cells[s],s),e.config.debug&&g("Checking if value was empty on row "+r+", column: "+s+": "+a)):d=!1;for(o=1;o':"",d=C(e).find(l.selectorHeaders).each(function(e){r=C(this),t=l.headers[e],l.headerContent[e]=this.innerHTML,i=l.headerTemplate.replace(/\{content\}/g,this.innerHTML).replace(/\{icon\}/g,o),l.onRenderTemplate&&(s=l.onRenderTemplate.apply(r,[e,i]))&&"string"==typeof s&&(i=s),this.innerHTML='
'+i+"
",l.onRenderHeader&&l.onRenderHeader.apply(r,[e]),this.column=c[this.parentNode.rowIndex+"-"+this.cellIndex],this.order=u(b.getData(r,t,"sortInitialOrder")||l.sortInitialOrder)?[1,0,2]:[0,1,2],this.count=-1,"false"===b.getData(r,t,"sorter")?(this.sortDisabled=!0,r.addClass("sorter-false")):r.removeClass("sorter-false"),this.lockedOrder=!1,void 0!==(n=b.getData(r,t,"lockedOrder")||!1)&&!1!==n&&(this.order=this.lockedOrder=u(n)?[1,1,1]:[0,0,0]),r.addClass((this.sortDisabled?"sorter-false ":" ")+l.cssHeader),l.headerList[e]=this,r.parent().addClass(l.cssHeaderRow)}),e.config.debug&&(w("Built headers:",a),g(d)),d}function y(e){var t,r,s,o,i=e.config,n=i.sortList,a=[i.cssAsc,i.cssDesc],d=C(e).find("tfoot tr").children().removeClass(a.join(" "));for(i.$headers.removeClass(a.join(" ")),o=n.length,r=0;r thead th, > thead td",selectorSort:"th, td",selectorRemove:".remove-me",debug:!1,headerList:[],empties:{},strings:{},parsers:[]},b.benchmark=w,b.construct=function(t){return this.each(function(){if(!this.tHead||0===this.tBodies.length||!0===this.hasInitialized)return this.config.debug?g("stopping initialization! No thead, tbody or tablesorter has already been initialized"):"";var f,s,c,o,i,n,a,u=C(this),d="",e=C.metadata;this.hasInitialized=!1,this.config={},f=C.extend(!0,this.config,b.defaults,t),C.data(this,"tablesorter",f),f.debug&&C.data(this,"startoveralltimer",new Date),f.supportsTextContent="x"===C("x")[0].textContent,f.supportsDataObject=1.4<=parseFloat(C.fn.jquery),f.string={max:1,min:-1,"max+":1,"max-":-1,zero:0,none:0,null:0,top:!0,bottom:!1},/tablesorter\-/.test(u.attr("class"))||(d=""!==f.theme?" tablesorter-"+f.theme:""),u.addClass(f.tableClass+d),f.$headers=r(this),f.parsers=l(this),f.delayInit||h(this),f.$headers.find("*").andSelf().filter(f.selectorSort).unbind("mousedown.tablesorter mouseup.tablesorter").bind("mousedown.tablesorter mouseup.tablesorter",function(e,t){var r=(this.tagName.match("TH|TD")?C(this):C(this).parents("th, td").filter(":last"))[0];if(1!==(e.which||e.button))return!1;if("mousedown"===e.type)return a=(new Date).getTime(),"INPUT"===e.target.tagName?"":!f.cancelSelection;if(!0!==t&&250<(new Date).getTime()-a)return!1;if(f.delayInit&&!f.cache&&h(u[0]),!r.sortDisabled){if(u.trigger("sortStart",u[0]),d=!e[f.sortMultiSortKey],r.count=e[f.sortResetKey]?2:(r.count+1)%(f.sortReset?3:2),f.sortRestart&&(s=r,f.$headers.each(function(){this===s||!d&&C(this).is("."+f.cssDesc+",."+f.cssAsc)||(this.count=-1)})),s=r.column,d){if(f.sortList=[],null!==f.sortForce)for(o=f.sortForce,c=0;c"),r=C(e).width();C("tr:first td",e.tBodies[0]).each(function(){t.append(C("").css("width",parseInt(C(this).width()/r*1e3,10)/10+"%"))}),C(e).prepend(t)}}(this),f.showProcessing&&u.unbind("sortBegin sortEnd").bind("sortBegin sortEnd",function(e){b.isProcessing(u[0],"sortBegin"===e.type)}),this.hasInitialized=!0,f.debug&&b.benchmark("Overall initialization time",C.data(this,"startoveralltimer")),u.trigger("tablesorter-initialized",this),"function"==typeof f.initialized&&f.initialized(this)})},b.isProcessing=function(e,t,r){var s=e.config,o=r||C(e).find("."+s.cssHeader);t?(0'),s=C.fn.detach?t.detach():t.remove();s=C(e).find("span.tablesorter-savemyplace"),t.insertAfter(s),s.remove()},b.clearTableBody=function(e){C(e.tBodies).filter(":not(."+e.config.cssInfoBlock+")").empty()},b.destroy=function(e,t,r){var s=C(e),o=e.config,i=s.find("thead:first");e.hasInitialized=!1,i.find("tr:not(."+o.cssHeaderRow+")").remove(),i.find(".tablesorter-resizer").remove(),b.refreshWidgets(e,!0,!0),s.removeData("tablesorter").unbind("sortReset update updateCell addRows sorton appendCache applyWidgetId applyWidgets refreshWidgets destroy mouseup mouseleave").find("."+o.cssHeader).unbind("click mousedown mousemove mouseup").removeClass(o.cssHeader+" "+o.cssAsc+" "+o.cssDesc).find(".tablesorter-header-inner").each(function(){""!==o.cssIcon&&C(this).find("."+o.cssIcon).remove(),C(this).replaceWith(C(this).contents())}),!1!==t&&s.removeClass(o.tableClass),"function"==typeof r&&r(e)},b.regex=[/(^-?[0-9]+(\.?[0-9]*)[df]?e?[0-9]?$|^0x[0-9a-f]+$|[0-9]+)/gi,/(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-]\d{1,4}[\/\-]\d{1,4}|^\w+, \w+ \d+, \d{4})/,/^0x[0-9a-f]+$/i],b.sortText=function(e,t,r,s){if(t===r)return 0;var o,i,n,a,d,c,l,f,u=e.config,h=u.string[u.empties[s]||u.emptyTo],p=b.regex;if(""===t&&0!==h)return"boolean"==typeof h?h?-1:1:-h||-1;if(""===r&&0!==h)return"boolean"==typeof h?h?1:-1:h||1;if("function"==typeof u.textSorter)return u.textSorter(t,r,e,s);if(o=t.replace(p[0],"\\0$1\\0").replace(/\\0$/,"").replace(/^\\0/,"").split("\\0"),n=r.replace(p[0],"\\0$1\\0").replace(/\\0$/,"").replace(/^\\0/,"").split("\\0"),i=parseInt(t.match(p[2]),16)||1!==o.length&&t.match(p[1])&&Date.parse(t),a=parseInt(r.match(p[2]),16)||i&&r.match(p[1])&&Date.parse(r)||null){if(i