Plugin Directory

Changeset 1610851


Ignore:
Timestamp:
03/08/2017 07:46:48 PM (9 years ago)
Author:
honza.skypala
Message:

Release 1.3.1

  • fix: failed on tables without footer
Location:
tags-page/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • tags-page/trunk/js/webtoolkit.sortabletable.js

    r1604010 r1610851  
    106106
    107107    initSorting(this.thead);
    108     initSorting(this.tfoot);
     108    if (this.tfoot.length > 0)
     109        initSorting(this.tfoot);
    109110}
  • tags-page/trunk/js/webtoolkit.sortabletable.min.js

    r1604010 r1610851  
    1 function SortableTable(d){function e(a){if(a&&a[0].rows&&0<a[0].rows.length){a=a[0].rows[0];for(var b=0;b<a.cells.length;b++)a.cells[b].sTable=this,a.cells[b].onclick=function(){this.sTable.sort(this);return!1}}}this.tbody=d.getElementsByTagName("tbody");this.thead=d.getElementsByTagName("thead");this.tfoot=d.getElementsByTagName("tfoot");this.getInnerText=function(a){if("undefined"!=typeof a.textContent)return a.textContent;if("undefined"!=typeof a.innerText)return a.innerText;if("string"==typeof a.innerHTML)return a.innerHTML.replace(/<[^<>]+>/g,"")};this.getParent=function(a,b){return null==a?null:1==a.nodeType&&a.tagName.toLowerCase()==b.toLowerCase()?a:this.getParent(a.parentNode,b)};this.sort=function(a){var b=a.cellIndex,c=this.getInnerText(this.tbody[0].rows[1].cells[b]),d=this.sortCaseInsensitive;c.match(/\d\d[-]+\d\d[-]+\d\d\d\d/)&&(d=this.sortDate);c.replace(/^\s+|\s+$/g,"").match(/^[\d\.]+$/)&&(d=this.sortNumeric);this.sortColumnIndex=b;b=[];for(j=0;j<this.tbody[0].rows.length;j++)b[j]=this.tbody[0].rows[j];b.sort(d);"down"==a.getAttribute("sortdir")?(b.reverse(),a.setAttribute("sortdir","up")):a.setAttribute("sortdir","down");for(i=0;i<b.length;i++)this.tbody[0].appendChild(b[i])};this.sortCaseInsensitive=function(a,b){aa=c.getInnerText(a.cells[c.sortColumnIndex]).toLowerCase();bb=c.getInnerText(b.cells[c.sortColumnIndex]).toLowerCase();return aa==bb?0:aa<bb?-1:1};this.sortDate=function(a,b){aa=c.getInnerText(a.cells[c.sortColumnIndex]);bb=c.getInnerText(b.cells[c.sortColumnIndex]);date1=aa.substr(6,4)+aa.substr(3,2)+aa.substr(0,2);date2=bb.substr(6,4)+bb.substr(3,2)+bb.substr(0,2);return date1==date2?0:date1<date2?-1:1};this.sortNumeric=function(a,b){aa=parseFloat(c.getInnerText(a.cells[c.sortColumnIndex]));isNaN(aa)&&(aa=0);bb=parseFloat(c.getInnerText(b.cells[c.sortColumnIndex]));isNaN(bb)&&(bb=0);return aa-bb};var c=this;this.tbody&&this.tbody[0].rows&&0<this.tbody[0].rows.length&&(e(this.thead),e(this.tfoot))};
     1function SortableTable(d){function e(a){if(a&&a[0].rows&&0<a[0].rows.length){a=a[0].rows[0];for(var b=0;b<a.cells.length;b++)a.cells[b].sTable=this,a.cells[b].onclick=function(){this.sTable.sort(this);return!1}}}this.tbody=d.getElementsByTagName("tbody");this.thead=d.getElementsByTagName("thead");this.tfoot=d.getElementsByTagName("tfoot");this.getInnerText=function(a){if("undefined"!=typeof a.textContent)return a.textContent;if("undefined"!=typeof a.innerText)return a.innerText;if("string"==typeof a.innerHTML)return a.innerHTML.replace(/<[^<>]+>/g,"")};this.getParent=function(a,b){return null==a?null:1==a.nodeType&&a.tagName.toLowerCase()==b.toLowerCase()?a:this.getParent(a.parentNode,b)};this.sort=function(a){var b=a.cellIndex,c=this.getInnerText(this.tbody[0].rows[1].cells[b]),d=this.sortCaseInsensitive;c.match(/\d\d[-]+\d\d[-]+\d\d\d\d/)&&(d=this.sortDate);c.replace(/^\s+|\s+$/g,"").match(/^[\d\.]+$/)&&(d=this.sortNumeric);this.sortColumnIndex=b;b=[];for(j=0;j<this.tbody[0].rows.length;j++)b[j]=this.tbody[0].rows[j];b.sort(d);"down"==a.getAttribute("sortdir")?(b.reverse(),a.setAttribute("sortdir","up")):a.setAttribute("sortdir","down");for(i=0;i<b.length;i++)this.tbody[0].appendChild(b[i])};this.sortCaseInsensitive=function(a,b){aa=c.getInnerText(a.cells[c.sortColumnIndex]).toLowerCase();bb=c.getInnerText(b.cells[c.sortColumnIndex]).toLowerCase();return aa==bb?0:aa<bb?-1:1};this.sortDate=function(a,b){aa=c.getInnerText(a.cells[c.sortColumnIndex]);bb=c.getInnerText(b.cells[c.sortColumnIndex]);date1=aa.substr(6,4)+aa.substr(3,2)+aa.substr(0,2);date2=bb.substr(6,4)+bb.substr(3,2)+bb.substr(0,2);return date1==date2?0:date1<date2?-1:1};this.sortNumeric=function(a,b){aa=parseFloat(c.getInnerText(a.cells[c.sortColumnIndex]));isNaN(aa)&&(aa=0);bb=parseFloat(c.getInnerText(b.cells[c.sortColumnIndex]));isNaN(bb)&&(bb=0);return aa-bb};var c=this;this.tbody&&this.tbody[0].rows&&0<this.tbody[0].rows.length&&(e(this.thead),0<this.tfoot.length&&e(this.tfoot))};
  • tags-page/trunk/readme.txt

    r1604010 r1610851  
    55Requires at least: 3.0
    66Tested up to: 4.7
    7 Stable tag: 1.3
     7Stable tag: 1.3.1
    88License: WTFPL
    99
     
    4949== Changelog ==
    5050
     51= 1.3.1 =
     52* fix: failed on tables without footer
    5153= 1.3 =
    5254* fix: sorting did not work when clicking in table footer
  • tags-page/trunk/tags-page.php

    r1604010 r1610851  
    44Plugin URI: http://wordpress.org/plugins/tags-page/
    55Description: Adds a table listing all tags registered on your website.
    6 Version: 1.3
     6Version: 1.3.1
    77Author: Honza Skypala
    88Author URI: http://www.honza.info
     
    1313
    1414class TagsPage {
    15   const version = "1.3";
     15  const version = "1.3.1";
    1616  private static $init_table = false;
    1717
Note: See TracChangeset for help on using the changeset viewer.