Easy Table - Version 1.4

Version Description

  • Updated: TableSorter JavaScript library now updated to 2.10.8 from 2.0.5b ( hope it will solve many sorting problems )
Download this release

Release Info

Developer takien
Plugin Icon wp plugin Easy Table
Version 1.4
Comparing to
See all releases

Code changes from version 1.3.1 to 1.4

easy-table.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: Easy Table
4
  Plugin URI: http://takien.com/
5
  Description: Create table in post, page, or widget in easy way.
6
  Author: Takien
7
- Version: 1.3.1
8
  Author URI: http://takien.com/
9
  */
10
 
@@ -87,7 +87,7 @@ function __construct(){
87
  private function easy_table_base($return){
88
  $easy_table_base = Array(
89
  'name' => 'Easy Table',
90
- 'version' => '1.3.1',
91
  'plugin-domain' => 'easy-table'
92
  );
93
  return $easy_table_base[$return];
@@ -1166,6 +1166,7 @@ $api = plugins_api('plugin_information', array('slug' => 'easy-table' ));
1166
  <li>CSS <?php _e('by','easy-table');?> <a target="_blank" href="http://twitter.github.com/bootstrap">Twitter Bootstrap</a></li>
1167
  <li>jQuery metadata <?php _e('by','easy-table');?> <a target="_blank" href="https://github.com/jquery/jquery-metadata/">John Resig</a></li>
1168
  <li>CuscoSky table styles <?php _e('by','easy-table');?> <a target="_blank" href="http://www.buayacorp.com">Braulio Soncco</a></li>
 
1169
 
1170
  </ul>
1171
  <?php endif; ?>
4
  Plugin URI: http://takien.com/
5
  Description: Create table in post, page, or widget in easy way.
6
  Author: Takien
7
+ Version: 1.4
8
  Author URI: http://takien.com/
9
  */
10
 
87
  private function easy_table_base($return){
88
  $easy_table_base = Array(
89
  'name' => 'Easy Table',
90
+ 'version' => '1.4',
91
  'plugin-domain' => 'easy-table'
92
  );
93
  return $easy_table_base[$return];
1166
  <li>CSS <?php _e('by','easy-table');?> <a target="_blank" href="http://twitter.github.com/bootstrap">Twitter Bootstrap</a></li>
1167
  <li>jQuery metadata <?php _e('by','easy-table');?> <a target="_blank" href="https://github.com/jquery/jquery-metadata/">John Resig</a></li>
1168
  <li>CuscoSky table styles <?php _e('by','easy-table');?> <a target="_blank" href="http://www.buayacorp.com">Braulio Soncco</a></li>
1169
+ <li>Tablesorter updated version <?php _e('by','easy-table');?> <a target="_blank" href="https://github.com/Mottie/tablesorter">Rob Garrison</a></li>
1170
 
1171
  </ul>
1172
  <?php endif; ?>
js/easy-table-script.js CHANGED
@@ -11,22 +11,26 @@
11
  *
12
  */
13
  (function($,window,undefined){$.extend({metadata:{defaults:{type:"class",name:"metadata",cre:/({.*})/,single:"metadata"},setType:function(a,b){this.defaults.type=a;this.defaults.name=b},get:function(elem,opts){function getData(data){if("string"!==typeof data){return data}if(data.indexOf("{")<0){data=eval("("+data+")")}}function getObject(data){if("string"===typeof data){data=eval("("+data+")")}return data}var settings=$.extend({},this.defaults,opts),object={},data,match,attr;if(!settings.single.length){settings.single="metadata"}data=$.data(elem,settings.single);if(data){return data}data="{}";if(settings.type=="html5"){$(elem.attributes).each(function(){var a=this.nodeName;if(a.match(/^data-/)){a=a.replace(/^data-/,"");object[a]=getObject(this.nodeValue)}})}else{if(settings.type=="class"){match=settings.cre.exec(elem.className);if(match){data=match[1]}}else if(settings.type=="elem"){if(!elem.getElementsByTagName){return}match=elem.getElementsByTagName(settings.name);if(match.length){data=$.trim(match[0].innerHTML)}}else if(undefined!==elem.getAttribute){attr=elem.getAttribute(settings.name);if(attr){data=attr}}object=getObject(data.indexOf("{")<0?"{"+data+"}":data)}if(data!=="{}"){$.data(elem,settings.single,object)}return object}}});$.fn.metadata=function(a){return $.metadata.get(this[0],a)}})(jQuery,this);
14
- /*
15
- *
16
- * TableSorter 2.0 - Client-side table sorting with ease!
17
- * Version 2.0.5b
18
- * @requires jQuery v1.2.3
19
- *
20
- * Copyright (c) 2007 Christian Bach
21
- * Examples and docs at: http://tablesorter.com
22
- * Dual licensed under the MIT and GPL licenses:
23
- * http://www.opensource.org/licenses/mit-license.php
24
- * http://www.gnu.org/licenses/gpl.html
25
- *
26
- */
27
- (function($){$.extend({tablesorter:new
28
- function(){var parsers=[],widgets=[];this.defaults={cssHeader:"header",cssAsc:"headerSortUp",cssDesc:"headerSortDown",cssChildRow:"expand-child",sortInitialOrder:"asc",sortMultiSortKey:"shiftKey",sortForce:null,sortAppend:null,sortLocaleCompare:true,textExtraction:"simple",parsers:{},widgets:[],widgetZebra:{css:["even","odd"]},headers:{},widthFixed:false,cancelSelection:true,sortList:[],headerList:[],dateFormat:"us",decimal:'/\.|\,/g',onRenderHeader:null,selectorHeaders:'thead th',debug:false};function benchmark(s,d){log(s+","+(new Date().getTime()-d.getTime())+"ms");}this.benchmark=benchmark;function log(s){if(typeof console!="undefined"&&typeof console.debug!="undefined"){console.log(s);}else{alert(s);}}function buildParserCache(table,$headers){if(table.config.debug){var parsersDebug="";}if(table.tBodies.length==0)return;var rows=table.tBodies[0].rows;if(rows[0]){var list=[],cells=rows[0].cells,l=cells.length;for(var i=0;i<l;i++){var p=false;if($.metadata&&($($headers[i]).metadata()&&$($headers[i]).metadata().sorter)){p=getParserById($($headers[i]).metadata().sorter);}else if((table.config.headers[i]&&table.config.headers[i].sorter)){p=getParserById(table.config.headers[i].sorter);}if(!p){p=detectParserForColumn(table,rows,-1,i);}if(table.config.debug){parsersDebug+="column:"+i+" parser:"+p.id+"\n";}list.push(p);}}if(table.config.debug){log(parsersDebug);}return list;};function detectParserForColumn(table,rows,rowIndex,cellIndex){var l=parsers.length,node=false,nodeValue=false,keepLooking=true;while(nodeValue==''&&keepLooking){rowIndex++;if(rows[rowIndex]){node=getNodeFromRowAndCellIndex(rows,rowIndex,cellIndex);nodeValue=trimAndGetNodeText(table.config,node);if(table.config.debug){log('Checking if value was empty on row:'+rowIndex);}}else{keepLooking=false;}}for(var i=1;i<l;i++){if(parsers[i].is(nodeValue,table,node)){return parsers[i];}}return parsers[0];}function getNodeFromRowAndCellIndex(rows,rowIndex,cellIndex){return rows[rowIndex].cells[cellIndex];}function trimAndGetNodeText(config,node){return $.trim(getElementText(config,node));}function getParserById(name){var l=parsers.length;for(var i=0;i<l;i++){if(parsers[i].id.toLowerCase()==name.toLowerCase()){return parsers[i];}}return false;}function buildCache(table){if(table.config.debug){var cacheTime=new Date();}var totalRows=(table.tBodies[0]&&table.tBodies[0].rows.length)||0,totalCells=(table.tBodies[0].rows[0]&&table.tBodies[0].rows[0].cells.length)||0,parsers=table.config.parsers,cache={row:[],normalized:[]};for(var i=0;i<totalRows;++i){var c=$(table.tBodies[0].rows[i]),cols=[];if(c.hasClass(table.config.cssChildRow)){cache.row[cache.row.length-1]=cache.row[cache.row.length-1].add(c);continue;}cache.row.push(c);for(var j=0;j<totalCells;++j){cols.push(parsers[j].format(getElementText(table.config,c[0].cells[j]),table,c[0].cells[j]));}cols.push(cache.normalized.length);cache.normalized.push(cols);cols=null;};if(table.config.debug){benchmark("Building cache for "+totalRows+" rows:",cacheTime);}return cache;};function getElementText(config,node){var text="";if(!node)return"";if(!config.supportsTextContent)config.supportsTextContent=node.textContent||false;if(config.textExtraction=="simple"){if(config.supportsTextContent){text=node.textContent;}else{if(node.childNodes[0]&&node.childNodes[0].hasChildNodes()){text=node.childNodes[0].innerHTML;}else{text=node.innerHTML;}}}else{if(typeof(config.textExtraction)=="function"){text=config.textExtraction(node);}else{text=$(node).text();}}return text;}function appendToTable(table,cache){if(table.config.debug){var appendTime=new Date()}var c=cache,r=c.row,n=c.normalized,totalRows=n.length,checkCell=(n[0].length-1),tableBody=$(table.tBodies[0]),rows=[];for(var i=0;i<totalRows;i++){var pos=n[i][checkCell];rows.push(r[pos]);if(!table.config.appender){var l=r[pos].length;for(var j=0;j<l;j++){tableBody[0].appendChild(r[pos][j]);}}}if(table.config.appender){table.config.appender(table,rows);}rows=null;if(table.config.debug){benchmark("Rebuilt table:",appendTime);}applyWidget(table);setTimeout(function(){$(table).trigger("sortEnd");},0);};function buildHeaders(table){if(table.config.debug){var time=new Date();}var meta=($.metadata)?true:false;var header_index=computeTableHeaderCellIndexes(table);$tableHeaders=$(table.config.selectorHeaders,table).each(function(index){this.column=header_index[this.parentNode.rowIndex+"-"+this.cellIndex];this.order=formatSortingOrder(table.config.sortInitialOrder);this.count=this.order;if(checkHeaderMetadata(this)||checkHeaderOptions(table,index))this.sortDisabled=true;if(checkHeaderOptionsSortingLocked(table,index))this.order=this.lockedOrder=checkHeaderOptionsSortingLocked(table,index);if(!this.sortDisabled){var $th=$(this).addClass(table.config.cssHeader);if(table.config.onRenderHeader)table.config.onRenderHeader.apply($th);}table.config.headerList[index]=this;});if(table.config.debug){benchmark("Built headers:",time);log($tableHeaders);}return $tableHeaders;};function computeTableHeaderCellIndexes(t){var matrix=[];var lookup={};var thead=t.getElementsByTagName('THEAD')[0];var trs=thead.getElementsByTagName('TR');for(var i=0;i<trs.length;i++){var cells=trs[i].cells;for(var j=0;j<cells.length;j++){var c=cells[j];var rowIndex=c.parentNode.rowIndex;var cellId=rowIndex+"-"+c.cellIndex;var rowSpan=c.rowSpan||1;var colSpan=c.colSpan||1
29
- var firstAvailCol;if(typeof(matrix[rowIndex])=="undefined"){matrix[rowIndex]=[];}for(var k=0;k<matrix[rowIndex].length+1;k++){if(typeof(matrix[rowIndex][k])=="undefined"){firstAvailCol=k;break;}}lookup[cellId]=firstAvailCol;for(var k=rowIndex;k<rowIndex+rowSpan;k++){if(typeof(matrix[k])=="undefined"){matrix[k]=[];}var matrixrow=matrix[k];for(var l=firstAvailCol;l<firstAvailCol+colSpan;l++){matrixrow[l]="x";}}}}return lookup;}function checkCellColSpan(table,rows,row){var arr=[],r=table.tHead.rows,c=r[row].cells;for(var i=0;i<c.length;i++){var cell=c[i];if(cell.colSpan>1){arr=arr.concat(checkCellColSpan(table,headerArr,row++));}else{if(table.tHead.length==1||(cell.rowSpan>1||!r[row+1])){arr.push(cell);}}}return arr;};function checkHeaderMetadata(cell){if(($.metadata)&&($(cell).metadata().sorter===false)){return true;};return false;}function checkHeaderOptions(table,i){if((table.config.headers[i])&&(table.config.headers[i].sorter===false)){return true;};return false;}function checkHeaderOptionsSortingLocked(table,i){if((table.config.headers[i])&&(table.config.headers[i].lockedOrder))return table.config.headers[i].lockedOrder;return false;}function applyWidget(table){var c=table.config.widgets;var l=c.length;for(var i=0;i<l;i++){getWidgetById(c[i]).format(table);}}function getWidgetById(name){var l=widgets.length;for(var i=0;i<l;i++){if(widgets[i].id.toLowerCase()==name.toLowerCase()){return widgets[i];}}};function formatSortingOrder(v){if(typeof(v)!="Number"){return(v.toLowerCase()=="desc")?1:0;}else{return(v==1)?1:0;}}function isValueInArray(v,a){var l=a.length;for(var i=0;i<l;i++){if(a[i][0]==v){return true;}}return false;}function setHeadersCss(table,$headers,list,css){$headers.removeClass(css[0]).removeClass(css[1]);var h=[];$headers.each(function(offset){if(!this.sortDisabled){h[this.column]=$(this);}});var l=list.length;for(var i=0;i<l;i++){h[list[i][0]].addClass(css[list[i][1]]);}}function fixColumnWidth(table,$headers){var c=table.config;if(c.widthFixed){var colgroup=$('<colgroup>');$("tr:first td",table.tBodies[0]).each(function(){colgroup.append($('<col>').css('width',$(this).width()));});$(table).prepend(colgroup);};}function updateHeaderSortCount(table,sortList){var c=table.config,l=sortList.length;for(var i=0;i<l;i++){var s=sortList[i],o=c.headerList[s[0]];o.count=s[1];o.count++;}}function multisort(table,sortList,cache){if(table.config.debug){var sortTime=new Date();}var dynamicExp="var sortWrapper = function(a,b) {",l=sortList.length;for(var i=0;i<l;i++){var c=sortList[i][0];var order=sortList[i][1];var s=(table.config.parsers[c].type=="text")?((order==0)?makeSortFunction("text","asc",c):makeSortFunction("text","desc",c)):((order==0)?makeSortFunction("numeric","asc",c):makeSortFunction("numeric","desc",c));var e="e"+i;dynamicExp+="var "+e+" = "+s;dynamicExp+="if("+e+") { return "+e+"; } ";dynamicExp+="else { ";}var orgOrderCol=cache.normalized[0].length-1;dynamicExp+="return a["+orgOrderCol+"]-b["+orgOrderCol+"];";for(var i=0;i<l;i++){dynamicExp+="}; ";}dynamicExp+="return 0; ";dynamicExp+="}; ";if(table.config.debug){benchmark("Evaling expression:"+dynamicExp,new Date());}eval(dynamicExp);cache.normalized.sort(sortWrapper);if(table.config.debug){benchmark("Sorting on "+sortList.toString()+" and dir "+order+" time:",sortTime);}return cache;};function makeSortFunction(type,direction,index){var a="a["+index+"]",b="b["+index+"]";if(type=='text'&&direction=='asc'){return"("+a+" == "+b+" ? 0 : ("+a+" === null ? Number.POSITIVE_INFINITY : ("+b+" === null ? Number.NEGATIVE_INFINITY : ("+a+" < "+b+") ? -1 : 1 )));";}else if(type=='text'&&direction=='desc'){return"("+a+" == "+b+" ? 0 : ("+a+" === null ? Number.POSITIVE_INFINITY : ("+b+" === null ? Number.NEGATIVE_INFINITY : ("+b+" < "+a+") ? -1 : 1 )));";}else if(type=='numeric'&&direction=='asc'){return"("+a+" === null && "+b+" === null) ? 0 :("+a+" === null ? Number.POSITIVE_INFINITY : ("+b+" === null ? Number.NEGATIVE_INFINITY : "+a+" - "+b+"));";}else if(type=='numeric'&&direction=='desc'){return"("+a+" === null && "+b+" === null) ? 0 :("+a+" === null ? Number.POSITIVE_INFINITY : ("+b+" === null ? Number.NEGATIVE_INFINITY : "+b+" - "+a+"));";}};function makeSortText(i){return"((a["+i+"] < b["+i+"]) ? -1 : ((a["+i+"] > b["+i+"]) ? 1 : 0));";};function makeSortTextDesc(i){return"((b["+i+"] < a["+i+"]) ? -1 : ((b["+i+"] > a["+i+"]) ? 1 : 0));";};function makeSortNumeric(i){return"a["+i+"]-b["+i+"];";};function makeSortNumericDesc(i){return"b["+i+"]-a["+i+"];";};function sortText(a,b){if(table.config.sortLocaleCompare)return a.localeCompare(b);return((a<b)?-1:((a>b)?1:0));};function sortTextDesc(a,b){if(table.config.sortLocaleCompare)return b.localeCompare(a);return((b<a)?-1:((b>a)?1:0));};function sortNumeric(a,b){return a-b;};function sortNumericDesc(a,b){return b-a;};function getCachedSortType(parsers,i){return parsers[i].type;};this.construct=function(settings){return this.each(function(){if(!this.tHead||!this.tBodies)return;var $this,$document,$headers,cache,config,shiftDown=0,sortOrder;this.config={};config=$.extend(this.config,$.tablesorter.defaults,settings);$this=$(this);$.data(this,"tablesorter",config);$headers=buildHeaders(this);this.config.parsers=buildParserCache(this,$headers);cache=buildCache(this);var sortCSS=[config.cssDesc,config.cssAsc];fixColumnWidth(this);$headers.click(function(e){var totalRows=($this[0].tBodies[0]&&$this[0].tBodies[0].rows.length)||0;if(!this.sortDisabled&&totalRows>0){$this.trigger("sortStart");var $cell=$(this);var i=this.column;this.order=this.count++%2;if(this.lockedOrder)this.order=this.lockedOrder;if(!e[config.sortMultiSortKey]){config.sortList=[];if(config.sortForce!=null){var a=config.sortForce;for(var j=0;j<a.length;j++){if(a[j][0]!=i){config.sortList.push(a[j]);}}}config.sortList.push([i,this.order]);}else{if(isValueInArray(i,config.sortList)){for(var j=0;j<config.sortList.length;j++){var s=config.sortList[j],o=config.headerList[s[0]];if(s[0]==i){o.count=s[1];o.count++;s[1]=o.count%2;}}}else{config.sortList.push([i,this.order]);}};setTimeout(function(){setHeadersCss($this[0],$headers,config.sortList,sortCSS);appendToTable($this[0],multisort($this[0],config.sortList,cache));},1);return false;}}).mousedown(function(){if(config.cancelSelection){this.onselectstart=function(){return false};return false;}});$this.bind("update",function(){var me=this;setTimeout(function(){me.config.parsers=buildParserCache(me,$headers);cache=buildCache(me);},1);}).bind("updateCell",function(e,cell){var config=this.config;var pos=[(cell.parentNode.rowIndex-1),cell.cellIndex];cache.normalized[pos[0]][pos[1]]=config.parsers[pos[1]].format(getElementText(config,cell),cell);}).bind("sorton",function(e,list){$(this).trigger("sortStart");config.sortList=list;var sortList=config.sortList;updateHeaderSortCount(this,sortList);setHeadersCss(this,$headers,sortList,sortCSS);appendToTable(this,multisort(this,sortList,cache));}).bind("appendCache",function(){appendToTable(this,cache);}).bind("applyWidgetId",function(e,id){getWidgetById(id).format(this);}).bind("applyWidgets",function(){applyWidget(this);});if($.metadata&&($(this).metadata()&&$(this).metadata().sortlist)){config.sortList=$(this).metadata().sortlist;}if(config.sortList.length>0){$this.trigger("sorton",[config.sortList]);}applyWidget(this);});};this.addParser=function(parser){var l=parsers.length,a=true;for(var i=0;i<l;i++){if(parsers[i].id.toLowerCase()==parser.id.toLowerCase()){a=false;}}if(a){parsers.push(parser);};};this.addWidget=function(widget){widgets.push(widget);};this.formatFloat=function(s){var i=parseFloat(s);return(isNaN(i))?0:i;};this.formatInt=function(s){var i=parseInt(s);return(isNaN(i))?0:i;};this.isDigit=function(s,config){return/^[-+]?\d*$/.test($.trim(s.replace(/[,.']/g,'')));};this.clearTableBody=function(table){if($.browser.msie){function empty(){while(this.firstChild)this.removeChild(this.firstChild);}empty.apply(table.tBodies[0]);}else{table.tBodies[0].innerHTML="";}};}});$.fn.extend({tablesorter:$.tablesorter.construct});var ts=$.tablesorter;ts.addParser({id:"text",is:function(s){return true;},format:function(s){return $.trim(s.toLocaleLowerCase());},type:"text"});ts.addParser({id:"digit",is:function(s,table){var c=table.config;return $.tablesorter.isDigit(s,c);},format:function(s){return $.tablesorter.formatFloat(s);},type:"numeric"});ts.addParser({id:"currency",is:function(s){return/^[£$€?.]/.test(s);},format:function(s){return $.tablesorter.formatFloat(s.replace(new RegExp(/[£$€]/g),""));},type:"numeric"});ts.addParser({id:"ipAddress",is:function(s){return/^\d{2,3}[\.]\d{2,3}[\.]\d{2,3}[\.]\d{2,3}$/.test(s);},format:function(s){var a=s.split("."),r="",l=a.length;for(var i=0;i<l;i++){var item=a[i];if(item.length==2){r+="0"+item;}else{r+=item;}}return $.tablesorter.formatFloat(r);},type:"numeric"});ts.addParser({id:"url",is:function(s){return/^(https?|ftp|file):\/\/$/.test(s);},format:function(s){return jQuery.trim(s.replace(new RegExp(/(https?|ftp|file):\/\//),''));},type:"text"});ts.addParser({id:"isoDate",is:function(s){return/^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(s);},format:function(s){return $.tablesorter.formatFloat((s!="")?new Date(s.replace(new RegExp(/-/g),"/")).getTime():"0");},type:"numeric"});ts.addParser({id:"percent",is:function(s){return/\%$/.test($.trim(s));},format:function(s){return $.tablesorter.formatFloat(s.replace(new RegExp(/%/g),""));},type:"numeric"});ts.addParser({id:"usLongDate",is:function(s){return s.match(new RegExp(/^[A-Za-z]{3,10}\.? [0-9]{1,2}, ([0-9]{4}|'?[0-9]{2}) (([0-2]?[0-9]:[0-5][0-9])|([0-1]?[0-9]:[0-5][0-9]\s(AM|PM)))$/));},format:function(s){return $.tablesorter.formatFloat(new Date(s).getTime());},type:"numeric"});ts.addParser({id:"shortDate",is:function(s){return/\d{1,2}[\/\-]\d{1,2}[\/\-]\d{2,4}/.test(s);},format:function(s,table){var c=table.config;s=s.replace(/\-/g,"/");if(c.dateFormat=="us"){s=s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{4})/,"$3/$1/$2");}else if(c.dateFormat=="uk"){s=s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{4})/,"$3/$2/$1");}else if(c.dateFormat=="dd/mm/yy"||c.dateFormat=="dd-mm-yy"){s=s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{2})/,"$1/$2/$3");}return $.tablesorter.formatFloat(new Date(s).getTime());},type:"numeric"});ts.addParser({id:"time",is:function(s){return/^(([0-2]?[0-9]:[0-5][0-9])|([0-1]?[0-9]:[0-5][0-9]\s(am|pm)))$/.test(s);},format:function(s){return $.tablesorter.formatFloat(new Date("2000/01/01 "+s).getTime());},type:"numeric"});ts.addParser({id:"metadata",is:function(s){return false;},format:function(s,table,cell){var c=table.config,p=(!c.parserMetadataName)?'sortValue':c.parserMetadataName;return $(cell).metadata()[p];},type:"numeric"});ts.addWidget({id:"zebra",format:function(table){if(table.config.debug){var time=new Date();}var $tr,row=-1,odd;$("tr:visible",table.tBodies[0]).each(function(i){$tr=$(this);if(!$tr.hasClass(table.config.cssChildRow))row++;odd=(row%2==0);$tr.removeClass(table.config.widgetZebra.css[odd?0:1]).addClass(table.config.widgetZebra.css[odd?1:0])});if(table.config.debug){$.tablesorter.benchmark("Applying Zebra widget",time);}}});})(jQuery);
 
 
 
 
30
  /*easy table*/
31
  jQuery(document).ready(function($) {
32
  $("table.tablesorter").tablesorter({
11
  *
12
  */
13
  (function($,window,undefined){$.extend({metadata:{defaults:{type:"class",name:"metadata",cre:/({.*})/,single:"metadata"},setType:function(a,b){this.defaults.type=a;this.defaults.name=b},get:function(elem,opts){function getData(data){if("string"!==typeof data){return data}if(data.indexOf("{")<0){data=eval("("+data+")")}}function getObject(data){if("string"===typeof data){data=eval("("+data+")")}return data}var settings=$.extend({},this.defaults,opts),object={},data,match,attr;if(!settings.single.length){settings.single="metadata"}data=$.data(elem,settings.single);if(data){return data}data="{}";if(settings.type=="html5"){$(elem.attributes).each(function(){var a=this.nodeName;if(a.match(/^data-/)){a=a.replace(/^data-/,"");object[a]=getObject(this.nodeValue)}})}else{if(settings.type=="class"){match=settings.cre.exec(elem.className);if(match){data=match[1]}}else if(settings.type=="elem"){if(!elem.getElementsByTagName){return}match=elem.getElementsByTagName(settings.name);if(match.length){data=$.trim(match[0].innerHTML)}}else if(undefined!==elem.getAttribute){attr=elem.getAttribute(settings.name);if(attr){data=attr}}object=getObject(data.indexOf("{")<0?"{"+data+"}":data)}if(data!=="{}"){$.data(elem,settings.single,object)}return object}}});$.fn.metadata=function(a){return $.metadata.get(this[0],a)}})(jQuery,this);
14
+
15
+ /*!
16
+ * TableSorter 2.10.8 - Client-side table sorting with ease!
17
+ * @requires jQuery v1.2.6+
18
+ *
19
+ * Copyright (c) 2007 Christian Bach
20
+ * Examples and docs at: http://tablesorter.com
21
+ * Dual licensed under the MIT and GPL licenses:
22
+ * http://www.opensource.org/licenses/mit-license.php
23
+ * http://www.gnu.org/licenses/gpl.html
24
+ *
25
+ * @type jQuery
26
+ * @name tablesorter
27
+ * @cat Plugins/Tablesorter
28
+ * @author Christian Bach/christian.bach@polyester.se
29
+ * @contributor Rob Garrison/https://github.com/Mottie/tablesorter
30
+ */
31
+
32
+ !function(e){"use strict";e.extend({tablesorter:new function(){function n(e){if(typeof console!=="undefined"&&typeof console.log!=="undefined"){console.log(e)}else{alert(e)}}function r(e,t){n(e+" ("+((new Date).getTime()-t.getTime())+"ms)")}function i(t,n,r){if(!n){return""}var i=t.config,s=i.textExtraction,o="";if(s==="simple"){if(i.supportsTextContent){o=n.textContent}else{o=e(n).text()}}else{if(typeof s==="function"){o=s(n,t,r)}else if(typeof s==="object"&&s.hasOwnProperty(r)){o=s[r](n,t,r)}else{o=i.supportsTextContent?n.textContent:e(n).text()}}return e.trim(o)}function s(e,r,s,o){var u,a=t.parsers.length,f=false,l="",c=true;while(l===""&&c){s++;if(r[s]){f=r[s].cells[o];l=i(e,f,o);if(e.config.debug){n("Checking if value was empty on row "+s+", column: "+o+': "'+l+'"')}}else{c=false}}while(--a>=0){u=t.parsers[a];if(u&&u.id!=="text"&&u.is&&u.is(l,e,f)){return u}}return t.getParserById("text")}function o(e){var r=e.config,i=r.$tbodies=r.$table.children("tbody:not(."+r.cssInfoBlock+")"),o,u,a,f,l,c,h,p="";if(i.length===0){return r.debug?n("*Empty table!* Not building a parser cache"):""}o=i[0].rows;if(o[0]){u=[];a=o[0].cells.length;for(f=0;f<a;f++){l=r.$headers.filter(":not([colspan])");l=l.add(r.$headers.filter('[colspan="1"]')).filter('[data-column="'+f+'"]:last');c=r.headers[f];h=t.getParserById(t.getData(l,c,"sorter"));r.empties[f]=t.getData(l,c,"empty")||r.emptyTo||(r.emptyToBottom?"bottom":"top");r.strings[f]=t.getData(l,c,"string")||r.stringTo||"max";if(!h){h=s(e,o,-1,f)}if(r.debug){p+="column:"+f+"; parser:"+h.id+"; string:"+r.strings[f]+"; empty: "+r.empties[f]+"\n"}u.push(h)}}if(r.debug){n(p)}r.parsers=u}function u(s){var o=s.tBodies,u=s.config,a,f,l=u.parsers,c,h,p,d,v,m,g,y,b=[];u.cache={};if(!l){return u.debug?n("*Empty table!* Not building a cache"):""}if(u.debug){y=new Date}if(u.showProcessing){t.isProcessing(s,true)}for(v=0;v<o.length;v++){u.cache[v]={row:[],normalized:[]};if(!e(o[v]).hasClass(u.cssInfoBlock)){a=o[v]&&o[v].rows.length||0;f=o[v].rows[0]&&o[v].rows[0].cells.length||0;for(p=0;p<a;++p){m=e(o[v].rows[p]);g=[];if(m.hasClass(u.cssChildRow)){u.cache[v].row[u.cache[v].row.length-1]=u.cache[v].row[u.cache[v].row.length-1].add(m);continue}u.cache[v].row.push(m);for(d=0;d<f;++d){c=i(s,m[0].cells[d],d);h=l[d].format(c,s,m[0].cells[d],d);g.push(h);if((l[d].type||"").toLowerCase()==="numeric"){b[d]=Math.max(Math.abs(h)||0,b[d]||0)}}g.push(u.cache[v].normalized.length);u.cache[v].normalized.push(g)}u.cache[v].colMax=b}}if(u.showProcessing){t.isProcessing(s)}if(u.debug){r("Building cache for "+a+" rows",y)}}function a(n,i){var s=n.config,o=n.tBodies,u=[],a=s.cache,f,l,c,h,p,d,v,m,g,y,b,w;if(!a[0]){return}if(s.debug){w=new Date}for(g=0;g<o.length;g++){p=e(o[g]);if(p.length&&!p.hasClass(s.cssInfoBlock)){d=t.processTbody(n,p,true);f=a[g].row;l=a[g].normalized;c=l.length;h=c?l[0].length-1:0;for(v=0;v<c;v++){b=l[v][h];u.push(f[b]);if(!s.appender||!s.removeRows){y=f[b].length;for(m=0;m<y;m++){d.append(f[b][m])}}}t.processTbody(n,d,false)}}if(s.appender){s.appender(n,u)}if(s.debug){r("Rebuilt table",w)}if(!i){t.applyWidget(n)}e(n).trigger("sortEnd",n)}function f(t){var n=[],r={},i=0,s=e(t).find("thead:eq(0), tfoot").children("tr"),o,u,a,f,l,c,h,p,d,v,m,g;for(o=0;o<s.length;o++){c=s[o].cells;for(u=0;u<c.length;u++){l=c[u];h=l.parentNode.rowIndex;p=h+"-"+l.cellIndex;d=l.rowSpan||1;v=l.colSpan||1;if(typeof n[h]==="undefined"){n[h]=[]}for(a=0;a<n[h].length+1;a++){if(typeof n[h][a]==="undefined"){m=a;break}}r[p]=m;i=Math.max(m,i);e(l).attr({"data-column":m});for(a=h;a<h+d;a++){if(typeof n[a]==="undefined"){n[a]=[]}g=n[a];for(f=m;f<m+v;f++){g[f]="x"}}}}t.config.columns=i;return r}function l(e){return/^d/i.test(e)||e===1}function c(i){var s=f(i),o,u,a,c,h,d,v,m=i.config;m.headerList=[];m.headerContent=[];if(m.debug){v=new Date}c=m.cssIcon?'<i class="'+m.cssIcon+'"></i>':"";m.$headers=e(i).find(m.selectorHeaders).each(function(n){u=e(this);o=m.headers[n];m.headerContent[n]=this.innerHTML;h=m.headerTemplate.replace(/\{content\}/g,this.innerHTML).replace(/\{icon\}/g,c);if(m.onRenderTemplate){a=m.onRenderTemplate.apply(u,[n,h]);if(a&&typeof a==="string"){h=a}}this.innerHTML='<div class="tablesorter-header-inner">'+h+"</div>";if(m.onRenderHeader){m.onRenderHeader.apply(u,[n])}this.column=s[this.parentNode.rowIndex+"-"+this.cellIndex];this.order=l(t.getData(u,o,"sortInitialOrder")||m.sortInitialOrder)?[1,0,2]:[0,1,2];this.count=-1;this.lockedOrder=false;d=t.getData(u,o,"lockedOrder")||false;if(typeof d!=="undefined"&&d!==false){this.order=this.lockedOrder=l(d)?[1,1,1]:[0,0,0]}u.addClass(m.cssHeader);m.headerList[n]=this;u.parent().addClass(m.cssHeaderRow);u.attr("tabindex",0)});p(i);if(m.debug){r("Built headers:",v);n(m.$headers)}}function h(e,t,n){var r=e.config;r.$table.find(r.selectorRemove).remove();o(e);u(e);E(r.$table,t,n)}function p(n){var r,i=n.config;i.$headers.each(function(n,s){r=t.getData(s,i.headers[n],"sorter")==="false";s.sortDisabled=r;e(s)[r?"addClass":"removeClass"]("sorter-false")})}function d(t){var n,r,i,s,o=t.config,u=o.sortList,a=[o.cssAsc,o.cssDesc],f=e(t).find("tfoot tr").children().removeClass(a.join(" "));o.$headers.removeClass(a.join(" "));s=u.length;for(r=0;r<s;r++){if(u[r][1]!==2){n=o.$headers.not(".sorter-false").filter('[data-column="'+u[r][0]+'"]'+(s===1?":last":""));if(n.length){for(i=0;i<n.length;i++){if(!n[i].sortDisabled){n.eq(i).addClass(a[u[r][1]]);if(f.length){f.filter('[data-column="'+u[r][0]+'"]').eq(i).addClass(a[u[r][1]])}}}}}}}function v(t){if(t.config.widthFixed&&e(t).find("colgroup").length===0){var n=e("<colgroup>"),r=e(t).width();e(t.tBodies[0]).find("tr:first").children("td").each(function(){n.append(e("<col>").css("width",parseInt(e(this).width()/r*1e3,10)/10+"%"))});e(t).prepend(n)}}function m(t,n){var r,i,s,o=t.config,u=n||o.sortList;o.sortList=[];e.each(u,function(t,n){r=[parseInt(n[0],10),parseInt(n[1],10)];s=o.headerList[r[0]];if(s){o.sortList.push(r);i=e.inArray(r[1],s.order);s.count=i>=0?i:r[1]%(o.sortReset?3:2)}})}function g(e,t){return e&&e[t]?e[t].type||"":""}function y(n,r,i){var s,o,u,f,l,c=n.config,h=!i[c.sortMultiSortKey],p=e(n);p.trigger("sortStart",n);r.count=i[c.sortResetKey]?2:(r.count+1)%(c.sortReset?3:2);if(c.sortRestart){o=r;c.$headers.each(function(){if(this!==o&&(h||!e(this).is("."+c.cssDesc+",."+c.cssAsc))){this.count=-1}})}o=r.column;if(h){c.sortList=[];if(c.sortForce!==null){s=c.sortForce;for(u=0;u<s.length;u++){if(s[u][0]!==o){c.sortList.push(s[u])}}}f=r.order[r.count];if(f<2){c.sortList.push([o,f]);if(r.colSpan>1){for(u=1;u<r.colSpan;u++){c.sortList.push([o+u,f])}}}}else{if(c.sortAppend&&c.sortList.length>1){if(t.isValueInArray(c.sortAppend[0][0],c.sortList)){c.sortList.pop()}}if(t.isValueInArray(o,c.sortList)){for(u=0;u<c.sortList.length;u++){l=c.sortList[u];f=c.headerList[l[0]];if(l[0]===o){l[1]=f.order[f.count];if(l[1]===2){c.sortList.splice(u,1);f.count=-1}}}}else{f=r.order[r.count];if(f<2){c.sortList.push([o,f]);if(r.colSpan>1){for(u=1;u<r.colSpan;u++){c.sortList.push([o+u,f])}}}}}if(c.sortAppend!==null){s=c.sortAppend;for(u=0;u<s.length;u++){if(s[u][0]!==o){c.sortList.push(s[u])}}}p.trigger("sortBegin",n);setTimeout(function(){d(n);b(n);a(n)},1)}function b(t){var n=0,i=t.config,s=i.sortList,o=s.length,u=t.tBodies.length,a,f,l,c,h,p,d,v,m,y;if(i.serverSideSorting||!i.cache[0]){return}if(i.debug){a=new Date}for(l=0;l<u;l++){h=i.cache[l].colMax;p=i.cache[l].normalized;d=p.length;y=p&&p[0]?p[0].length-1:0;p.sort(function(r,u){for(f=0;f<o;f++){c=s[f][0];m=s[f][1];v=/n/i.test(g(i.parsers,c))?"Numeric":"Text";v+=m===0?"":"Desc";if(/Numeric/.test(v)&&i.strings[c]){if(typeof i.string[i.strings[c]]==="boolean"){n=(m===0?1:-1)*(i.string[i.strings[c]]?-1:1)}else{n=i.strings[c]?i.string[i.strings[c]]||0:0}}var a=e.tablesorter["sort"+v](t,r[c],u[c],c,h[c],n);if(a){return a}}return r[y]-u[y]})}if(i.debug){r("Sorting on "+s.toString()+" and dir "+m+" time",a)}}function w(e,t){e.trigger("updateComplete");if(typeof t==="function"){t(e[0])}}function E(e,t,n){if(t!==false&&!e[0].isProcessing){e.trigger("sorton",[e[0].config.sortList,function(){w(e,n)}])}else{w(e,n)}}function S(n){var r=n.config,s=r.$table,f,l;r.$headers.find(r.selectorSort).add(r.$headers.filter(r.selectorSort)).unbind("mousedown.tablesorter mouseup.tablesorter sort.tablesorter keypress.tablesorter").bind("mousedown.tablesorter mouseup.tablesorter sort.tablesorter keypress.tablesorter",function(t,i){if((t.which||t.button)!==1&&!/sort|keypress/.test(t.type)||t.type==="keypress"&&t.which!==13){return false}if(t.type==="mouseup"&&i!==true&&(new Date).getTime()-l>250){return false}if(t.type==="mousedown"){l=(new Date).getTime();return t.target.tagName==="INPUT"?"":!r.cancelSelection}if(r.delayInit&&!r.cache){u(n)}var s=/TH|TD/.test(this.tagName)?e(this):e(this).parents("th, td").filter(":first"),o=s[0];if(!o.sortDisabled){y(n,o,t)}});if(r.cancelSelection){r.$headers.attr("unselectable","on").bind("selectstart",false).css({"user-select":"none",MozUserSelect:"none"})}s.unbind("sortReset update updateRows updateCell updateAll addRows sorton appendCache applyWidgetId applyWidgets refreshWidgets destroy mouseup mouseleave ".split(" ").join(".tablesorter ")).bind("sortReset.tablesorter",function(e){e.stopPropagation();r.sortList=[];d(n);b(n);a(n)}).bind("updateAll.tablesorter",function(e,r,i){e.stopPropagation();t.refreshWidgets(n,true,true);t.restoreHeaders(n);c(n);S(n);h(n,r,i)}).bind("update.tablesorter updateRows.tablesorter",function(e,t,r){e.stopPropagation();p(n);h(n,t,r)}).bind("updateCell.tablesorter",function(t,o,u,a){t.stopPropagation();s.find(r.selectorRemove).remove();var f,l,c,h=s.find("tbody"),p=h.index(e(o).parents("tbody").filter(":first")),d=e(o).parents("tr").filter(":first");o=e(o)[0];if(h.length&&p>=0){l=h.eq(p).find("tr").index(d);c=o.cellIndex;f=r.cache[p].normalized[l].length-1;r.cache[p].row[n.config.cache[p].normalized[l][f]]=d;r.cache[p].normalized[l][c]=r.parsers[c].format(i(n,o,c),n,o,c);E(s,u,a)}}).bind("addRows.tablesorter",function(e,t,u,a){e.stopPropagation();var l,c=t.filter("tr").length,h=[],p=t[0].cells.length,d=s.find("tbody").index(t.parents("tbody").filter(":first"));if(!r.parsers){o(n)}for(l=0;l<c;l++){for(f=0;f<p;f++){h[f]=r.parsers[f].format(i(n,t[l].cells[f],f),n,t[l].cells[f],f)}h.push(r.cache[d].row.length);r.cache[d].row.push([t[l]]);r.cache[d].normalized.push(h);h=[]}E(s,u,a)}).bind("sorton.tablesorter",function(e,t,r,i){e.stopPropagation();s.trigger("sortStart",this);m(n,t);d(n);s.trigger("sortBegin",this);b(n);a(n,i);if(typeof r==="function"){r(n)}}).bind("appendCache.tablesorter",function(e,t,r){e.stopPropagation();a(n,r);if(typeof t==="function"){t(n)}}).bind("applyWidgetId.tablesorter",function(e,i){e.stopPropagation();t.getWidgetById(i).format(n,r,r.widgetOptions)}).bind("applyWidgets.tablesorter",function(e,r){e.stopPropagation();t.applyWidget(n,r)}).bind("refreshWidgets.tablesorter",function(e,r,i){e.stopPropagation();t.refreshWidgets(n,r,i)}).bind("destroy.tablesorter",function(e,r,i){e.stopPropagation();t.destroy(n,r,i)})}var t=this;t.version="2.10.8";t.parsers=[];t.widgets=[];t.defaults={theme:"default",widthFixed:false,showProcessing:false,headerTemplate:"{content}",onRenderTemplate:null,onRenderHeader:null,cancelSelection:true,dateFormat:"mmddyyyy",sortMultiSortKey:"shiftKey",sortResetKey:"ctrlKey",usNumberFormat:true,delayInit:false,serverSideSorting:false,headers:{},ignoreCase:true,sortForce:null,sortList:[],sortAppend:null,sortInitialOrder:"asc",sortLocaleCompare:false,sortReset:false,sortRestart:false,emptyTo:"bottom",stringTo:"max",textExtraction:"simple",textSorter:null,widgets:[],widgetOptions:{zebra:["even","odd"]},initWidgets:true,initialized:null,tableClass:"tablesorter",cssAsc:"tablesorter-headerAsc",cssChildRow:"tablesorter-childRow",cssDesc:"tablesorter-headerDesc",cssHeader:"tablesorter-header",cssHeaderRow:"tablesorter-headerRow",cssIcon:"tablesorter-icon",cssInfoBlock:"tablesorter-infoOnly",cssProcessing:"tablesorter-processing",selectorHeaders:"> thead th, > thead td",selectorSort:"th, td",selectorRemove:".remove-me",debug:false,headerList:[],empties:{},strings:{},parsers:[]};t.log=n;t.benchmark=r;t.construct=function(r){return this.each(function(){if(!this.tHead||this.tBodies.length===0||this.hasInitialized===true){return this.config&&this.config.debug?n("stopping initialization! No thead, tbody or tablesorter has already been initialized"):""}var i=e(this),s=this,a,f="",l=e.metadata;s.hasInitialized=false;s.isProcessing=true;s.config={};a=e.extend(true,s.config,t.defaults,r);e.data(s,"tablesorter",a);if(a.debug){e.data(s,"startoveralltimer",new Date)}a.supportsTextContent=e("<span>x</span>")[0].textContent==="x";a.supportsDataObject=parseFloat(e.fn.jquery)>=1.4;a.string={max:1,min:-1,"max+":1,"max-":-1,zero:0,none:0,"null":0,top:true,bottom:false};if(!/tablesorter\-/.test(i.attr("class"))){f=a.theme!==""?" tablesorter-"+a.theme:""}a.$table=i.addClass(a.tableClass+f);a.$tbodies=i.children("tbody:not(."+a.cssInfoBlock+")");c(s);v(s);o(s);if(!a.delayInit){u(s)}S(s);if(a.supportsDataObject&&typeof i.data().sortlist!=="undefined"){a.sortList=i.data().sortlist}else if(l&&i.metadata()&&i.metadata().sortlist){a.sortList=i.metadata().sortlist}t.applyWidget(s,true);if(a.sortList.length>0){i.trigger("sorton",[a.sortList,{},!a.initWidgets])}else if(a.initWidgets){t.applyWidget(s)}if(a.showProcessing){i.unbind("sortBegin.tablesorter sortEnd.tablesorter").bind("sortBegin.tablesorter sortEnd.tablesorter",function(e){t.isProcessing(s,e.type==="sortBegin")})}s.hasInitialized=true;s.isProcessing=false;if(a.debug){t.benchmark("Overall initialization time",e.data(s,"startoveralltimer"))}i.trigger("tablesorter-initialized",s);if(typeof a.initialized==="function"){a.initialized(s)}})};t.isProcessing=function(n,r,i){n=e(n);var s=n[0].config,o=i||n.find("."+s.cssHeader);if(r){if(s.sortList.length>0){o=o.filter(function(){return this.sortDisabled?false:t.isValueInArray(parseFloat(e(this).attr("data-column")),s.sortList)})}o.addClass(s.cssProcessing)}else{o.removeClass(s.cssProcessing)}};t.processTbody=function(t,n,r){var i;if(r){t.isProcessing=true;n.before('<span class="tablesorter-savemyplace"/>');i=e.fn.detach?n.detach():n.remove();return i}i=e(t).find("span.tablesorter-savemyplace");n.insertAfter(i);i.remove();t.isProcessing=false};t.clearTableBody=function(t){e(t)[0].config.$tbodies.empty()};t.restoreHeaders=function(t){var n=t.config;n.$table.find(n.selectorHeaders).each(function(t){if(e(this).find(".tablesorter-header-inner").length){e(this).html(n.headerContent[t])}})};t.destroy=function(n,r,i){n=e(n)[0];if(!n.hasInitialized){return}t.refreshWidgets(n,true,true);var s=e(n),o=n.config,u=s.find("thead:first"),a=u.find("tr."+o.cssHeaderRow).removeClass(o.cssHeaderRow),f=s.find("tfoot:first > tr").children("th, td");u.find("tr").not(a).remove();s.removeData("tablesorter").unbind("sortReset update updateAll updateRows updateCell addRows sorton appendCache applyWidgetId applyWidgets refreshWidgets destroy mouseup mouseleave keypress sortBegin sortEnd ".split(" ").join(".tablesorter "));o.$headers.add(f).removeClass(o.cssHeader+" "+o.cssAsc+" "+o.cssDesc).removeAttr("data-column");a.find(o.selectorSort).unbind("mousedown.tablesorter mouseup.tablesorter keypress.tablesorter");t.restoreHeaders(n);if(r!==false){s.removeClass(o.tableClass+" tablesorter-"+o.theme)}n.hasInitialized=false;if(typeof i==="function"){i(n)}};t.regex=[/(^([+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?)?$|^0x[0-9a-f]+$|\d+)/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];t.sortText=function(e,n,r,i){if(n===r){return 0}var s=e.config,o=s.string[s.empties[i]||s.emptyTo],u=t.regex,a,f,l,c,h,p,d,v;if(n===""&&o!==0){return typeof o==="boolean"?o?-1:1:-o||-1}if(r===""&&o!==0){return typeof o==="boolean"?o?1:-1:o||1}if(typeof s.textSorter==="function"){return s.textSorter(n,r,e,i)}a=n.replace(u[0],"\\0$1\\0").replace(/\\0$/,"").replace(/^\\0/,"").split("\\0");l=r.replace(u[0],"\\0$1\\0").replace(/\\0$/,"").replace(/^\\0/,"").split("\\0");f=parseInt(n.match(u[2]),16)||a.length!==1&&n.match(u[1])&&Date.parse(n);c=parseInt(r.match(u[2]),16)||f&&r.match(u[1])&&Date.parse(r)||null;if(c){if(f<c){return-1}if(f>c){return 1}}v=Math.max(a.length,l.length);for(d=0;d<v;d++){h=isNaN(a[d])?a[d]||0:parseFloat(a[d])||0;p=isNaN(l[d])?l[d]||0:parseFloat(l[d])||0;if(isNaN(h)!==isNaN(p)){return isNaN(h)?1:-1}if(typeof h!==typeof p){h+="";p+=""}if(h<p){return-1}if(h>p){return 1}}return 0};t.sortTextDesc=function(e,n,r,i){if(n===r){return 0}var s=e.config,o=s.string[s.empties[i]||s.emptyTo];if(n===""&&o!==0){return typeof o==="boolean"?o?-1:1:o||1}if(r===""&&o!==0){return typeof o==="boolean"?o?1:-1:-o||-1}if(typeof s.textSorter==="function"){return s.textSorter(r,n,e,i)}return t.sortText(e,r,n)};t.getTextValue=function(e,t,n){if(t){var r,i=e?e.length:0,s=t+n;for(r=0;r<i;r++){s+=e.charCodeAt(r)}return n*s}return 0};t.sortNumeric=function(e,n,r,i,s,o){if(n===r){return 0}var u=e.config,a=u.string[u.empties[i]||u.emptyTo];if(n===""&&a!==0){return typeof a==="boolean"?a?-1:1:-a||-1}if(r===""&&a!==0){return typeof a==="boolean"?a?1:-1:a||1}if(isNaN(n)){n=t.getTextValue(n,s,o)}if(isNaN(r)){r=t.getTextValue(r,s,o)}return n-r};t.sortNumericDesc=function(e,n,r,i,s,o){if(n===r){return 0}var u=e.config,a=u.string[u.empties[i]||u.emptyTo];if(n===""&&a!==0){return typeof a==="boolean"?a?-1:1:a||1}if(r===""&&a!==0){return typeof a==="boolean"?a?1:-1:-a||-1}if(isNaN(n)){n=t.getTextValue(n,s,o)}if(isNaN(r)){r=t.getTextValue(r,s,o)}return r-n};t.characterEquivalents={a:"áàâãäąå",A:"ÁÀÂÃÄĄÅ",c:"çćč",C:"ÇĆČ",e:"éèêëěę",E:"ÉÈÊËĚĘ",i:"íìİîïı",I:"ÍÌİÎÏ",o:"óòôõö",O:"ÓÒÔÕÖ",ss:"ß",SS:"ẞ",u:"úùûüů",U:"ÚÙÛÜŮ"};t.replaceAccents=function(e){var n,r="[",i=t.characterEquivalents;if(!t.characterRegex){t.characterRegexArray={};for(n in i){if(typeof n==="string"){r+=i[n];t.characterRegexArray[n]=new RegExp("["+i[n]+"]","g")}}t.characterRegex=new RegExp(r+"]")}if(t.characterRegex.test(e)){for(n in i){if(typeof n==="string"){e=e.replace(t.characterRegexArray[n],n)}}}return e};t.isValueInArray=function(e,t){var n,r=t.length;for(n=0;n<r;n++){if(t[n][0]===e){return true}}return false};t.addParser=function(e){var n,r=t.parsers.length,i=true;for(n=0;n<r;n++){if(t.parsers[n].id.toLowerCase()===e.id.toLowerCase()){i=false}}if(i){t.parsers.push(e)}};t.getParserById=function(e){var n,r=t.parsers.length;for(n=0;n<r;n++){if(t.parsers[n].id.toLowerCase()===e.toString().toLowerCase()){return t.parsers[n]}}return false};t.addWidget=function(e){t.widgets.push(e)};t.getWidgetById=function(e){var n,r,i=t.widgets.length;for(n=0;n<i;n++){r=t.widgets[n];if(r&&r.hasOwnProperty("id")&&r.id.toLowerCase()===e.toLowerCase()){return r}}};t.applyWidget=function(n,i){n=e(n)[0];var s=n.config,o=s.widgetOptions,u=[],a,f,l,c;if(s.debug){a=new Date}if(s.widgets.length){s.widgets=e.grep(s.widgets,function(t,n){return e.inArray(t,s.widgets)===n});e.each(s.widgets||[],function(e,n){c=t.getWidgetById(n);if(c&&c.id){if(!c.priority){c.priority=10}u[e]=c}});u.sort(function(e,t){return e.priority<t.priority?-1:e.priority===t.priority?0:1});e.each(u,function(t,r){if(r){if(i){if(r.hasOwnProperty("options")){o=n.config.widgetOptions=e.extend(true,{},r.options,o)}if(r.hasOwnProperty("init")){r.init(n,r,s,o)}}else if(!i&&r.hasOwnProperty("format")){r.format(n,s,o,false)}}})}if(s.debug){l=s.widgets.length;r("Completed "+(i===true?"initializing ":"applying ")+l+" widget"+(l!==1?"s":""),a)}};t.refreshWidgets=function(r,i,s){r=e(r)[0];var o,u=r.config,a=u.widgets,f=t.widgets,l=f.length;for(o=0;o<l;o++){if(f[o]&&f[o].id&&(i||e.inArray(f[o].id,a)<0)){if(u.debug){n("Refeshing widgets: Removing "+f[o].id)}if(f[o].hasOwnProperty("remove")){f[o].remove(r,u,u.widgetOptions)}}}if(s!==true){t.applyWidget(r,i)}};t.getData=function(t,n,r){var i="",s=e(t),o,u;if(!s.length){return""}o=e.metadata?s.metadata():false;u=" "+(s.attr("class")||"");if(typeof s.data(r)!=="undefined"||typeof s.data(r.toLowerCase())!=="undefined"){i+=s.data(r)||s.data(r.toLowerCase())}else if(o&&typeof o[r]!=="undefined"){i+=o[r]}else if(n&&typeof n[r]!=="undefined"){i+=n[r]}else if(u!==" "&&u.match(" "+r+"-")){i=u.match(new RegExp("\\s"+r+"-([\\w-]+)"))[1]||""}return e.trim(i)};t.formatFloat=function(t,n){if(typeof t!=="string"||t===""){return t}var r,i=n&&n.config?n.config.usNumberFormat!==false:typeof n!=="undefined"?n:true;if(i){t=t.replace(/,/g,"")}else{t=t.replace(/[\s|\.]/g,"").replace(/,/g,".")}if(/^\s*\([.\d]+\)/.test(t)){t=t.replace(/^\s*\(/,"-").replace(/\)/,"")}r=parseFloat(t);return isNaN(r)?e.trim(t):r};t.isDigit=function(e){return isNaN(e)?/^[\-+(]?\d+[)]?$/.test(e.toString().replace(/[,.'"\s]/g,"")):true}}});var t=e.tablesorter;e.fn.extend({tablesorter:t.construct});t.addParser({id:"text",is:function(){return true},format:function(n,r){var i=r.config;if(n){n=e.trim(i.ignoreCase?n.toLocaleLowerCase():n);n=i.sortLocaleCompare?t.replaceAccents(n):n}return n},type:"text"});t.addParser({id:"digit",is:function(e){return t.isDigit(e)},format:function(n,r){var i=t.formatFloat((n||"").replace(/[^\w,. \-()]/g,""),r);return n&&typeof i==="number"?i:n?e.trim(n&&r.config.ignoreCase?n.toLocaleLowerCase():n):n},type:"numeric"});t.addParser({id:"currency",is:function(e){return/^\(?\d+[\u00a3$\u20ac\u00a4\u00a5\u00a2?.]|[\u00a3$\u20ac\u00a4\u00a5\u00a2?.]\d+\)?$/.test((e||"").replace(/[,. ]/g,""))},format:function(n,r){var i=t.formatFloat((n||"").replace(/[^\w,. \-()]/g,""),r);return n&&typeof i==="number"?i:n?e.trim(n&&r.config.ignoreCase?n.toLocaleLowerCase():n):n},type:"numeric"});t.addParser({id:"ipAddress",is:function(e){return/^\d{1,3}[\.]\d{1,3}[\.]\d{1,3}[\.]\d{1,3}$/.test(e)},format:function(e,n){var r,i=e?e.split("."):"",s="",o=i.length;for(r=0;r<o;r++){s+=("00"+i[r]).slice(-3)}return e?t.formatFloat(s,n):e},type:"numeric"});t.addParser({id:"url",is:function(e){return/^(https?|ftp|file):\/\//.test(e)},format:function(t){return t?e.trim(t.replace(/(https?|ftp|file):\/\//,"")):t},type:"text"});t.addParser({id:"isoDate",is:function(e){return/^\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}/.test(e)},format:function(e,n){return e?t.formatFloat(e!==""?(new Date(e.replace(/-/g,"/"))).getTime()||"":"",n):e},type:"numeric"});t.addParser({id:"percent",is:function(e){return/(\d\s*?%|%\s*?\d)/.test(e)&&e.length<15},format:function(e,n){return e?t.formatFloat(e.replace(/%/g,""),n):e},type:"numeric"});t.addParser({id:"usLongDate",is:function(e){return/^[A-Z]{3,10}\.?\s+\d{1,2},?\s+(\d{4})(\s+\d{1,2}:\d{2}(:\d{2})?(\s+[AP]M)?)?$/i.test(e)||/^\d{1,2}\s+[A-Z]{3,10}\s+\d{4}/i.test(e)},format:function(e,n){return e?t.formatFloat((new Date(e.replace(/(\S)([AP]M)$/i,"$1 $2"))).getTime()||"",n):e},type:"numeric"});t.addParser({id:"shortDate",is:function(e){return/(^\d{1,2}[\/\s]\d{1,2}[\/\s]\d{4})|(^\d{4}[\/\s]\d{1,2}[\/\s]\d{1,2})/.test((e||"").replace(/\s+/g," ").replace(/[\-.,]/g,"/"))},format:function(e,n,r,i){if(e){var s=n.config,o=s.headerList[i],u=o.dateFormat||t.getData(o,s.headers[i],"dateFormat")||s.dateFormat;e=e.replace(/\s+/g," ").replace(/[\-.,]/g,"/");if(u==="mmddyyyy"){e=e.replace(/(\d{1,2})[\/\s](\d{1,2})[\/\s](\d{4})/,"$3/$1/$2")}else if(u==="ddmmyyyy"){e=e.replace(/(\d{1,2})[\/\s](\d{1,2})[\/\s](\d{4})/,"$3/$2/$1")}else if(u==="yyyymmdd"){e=e.replace(/(\d{4})[\/\s](\d{1,2})[\/\s](\d{1,2})/,"$1/$2/$3")}}return e?t.formatFloat((new Date(e)).getTime()||"",n):e},type:"numeric"});t.addParser({id:"time",is:function(e){return/^(([0-2]?\d:[0-5]\d)|([0-1]?\d:[0-5]\d\s?([AP]M)))$/i.test(e)},format:function(e,n){return e?t.formatFloat((new Date("2000/01/01 "+e.replace(/(\S)([AP]M)$/i,"$1 $2"))).getTime()||"",n):e},type:"numeric"});t.addParser({id:"metadata",is:function(){return false},format:function(t,n,r){var i=n.config,s=!i.parserMetadataName?"sortValue":i.parserMetadataName;return e(r).metadata()[s]},type:"numeric"});t.addWidget({id:"zebra",priority:90,format:function(n,r,i){var s,o,u,a,f,l,c,h,p=new RegExp(r.cssChildRow,"i"),d=r.$tbodies;if(r.debug){l=new Date}for(c=0;c<d.length;c++){s=d.eq(c);h=s.children("tr").length;if(h>1){a=0;o=s.children("tr:visible");o.each(function(){u=e(this);if(!p.test(this.className)){a++}f=a%2===0;u.removeClass(i.zebra[f?1:0]).addClass(i.zebra[f?0:1])})}}if(r.debug){t.benchmark("Applying Zebra widget",l)}},remove:function(t,n,r){var i,s,o=n.$tbodies,u=(r.zebra||["even","odd"]).join(" ");for(i=0;i<o.length;i++){s=e.tablesorter.processTbody(t,o.eq(i),true);s.children().removeClass(u);e.tablesorter.processTbody(t,s,false)}}})}(jQuery)
33
+
34
  /*easy table*/
35
  jQuery(document).ready(function($) {
36
  $("table.tablesorter").tablesorter({
languages/easy-table-id_ID.mo CHANGED
Binary file
languages/easy-table-id_ID.po CHANGED
@@ -1,9 +1,9 @@
1
  msgid ""
2
  msgstr ""
3
- "Project-Id-Version: easy-table 1.3\n"
4
  "Report-Msgid-Bugs-To: \n"
5
  "POT-Creation-Date: 2013-05-13 04:14+0700\n"
6
- "PO-Revision-Date: 2013-08-20 09:28+0700\n"
7
  "Last-Translator: takien <contact@takien.com>\n"
8
  "Language-Team: takien.com <contact@takien.com>\n"
9
  "Language: id_ID\n"
1
  msgid ""
2
  msgstr ""
3
+ "Project-Id-Version: easy-table 1.4\n"
4
  "Report-Msgid-Bugs-To: \n"
5
  "POT-Creation-Date: 2013-05-13 04:14+0700\n"
6
+ "PO-Revision-Date: 2013-08-30 01:29+0700\n"
7
  "Last-Translator: takien <contact@takien.com>\n"
8
  "Language-Team: takien.com <contact@takien.com>\n"
9
  "Language: id_ID\n"
languages/english.mo CHANGED
Binary file
languages/english.po CHANGED
@@ -1,9 +1,9 @@
1
  msgid ""
2
  msgstr ""
3
- "Project-Id-Version: easy-table 1.3\n"
4
  "Report-Msgid-Bugs-To: \n"
5
  "POT-Creation-Date: 2013-05-13 04:13+0700\n"
6
- "PO-Revision-Date: 2013-08-20 09:28+0700\n"
7
  "Last-Translator: takien <contact@takien.com>\n"
8
  "Language-Team: takien.com <contact@takien.com>\n"
9
  "Language: en_US\n"
1
  msgid ""
2
  msgstr ""
3
+ "Project-Id-Version: easy-table 1.4\n"
4
  "Report-Msgid-Bugs-To: \n"
5
  "POT-Creation-Date: 2013-05-13 04:13+0700\n"
6
+ "PO-Revision-Date: 2013-08-30 01:28+0700\n"
7
  "Last-Translator: takien <contact@takien.com>\n"
8
  "Language-Team: takien.com <contact@takien.com>\n"
9
  "Language: en_US\n"
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: takien
3
  Donate link: http://takien.com/donate
4
  Tags: table,csv,csv-to-table,post,excel,csv file,widget,tablesorter
5
  Requires at least: 3.0
6
- Tested up to: 3.6
7
- Stable tag: 1.3.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -248,6 +248,9 @@ No
248
 
249
  == Changelog ==
250
 
 
 
 
251
  = 1.3.1 =
252
  * Fixed: Bug on version 1.3, fatal error on PHP prior to 5.3.0
253
 
3
  Donate link: http://takien.com/donate
4
  Tags: table,csv,csv-to-table,post,excel,csv file,widget,tablesorter
5
  Requires at least: 3.0
6
+ Tested up to: 3.8
7
+ Stable tag: 1.4
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
248
 
249
  == Changelog ==
250
 
251
+ = 1.4 =
252
+ * Updated: TableSorter JavaScript library now updated to 2.10.8 from 2.0.5b ( hope it will solve many sorting problems )
253
+
254
  = 1.3.1 =
255
  * Fixed: Bug on version 1.3, fatal error on PHP prior to 5.3.0
256