Changeset 1604010
- Timestamp:
- 02/26/2017 08:10:21 PM (9 years ago)
- Location:
- tags-page/trunk
- Files:
-
- 4 edited
-
js/webtoolkit.sortabletable.js (modified) (1 diff)
-
js/webtoolkit.sortabletable.min.js (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
-
tags-page.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tags-page/trunk/js/webtoolkit.sortabletable.js
r964339 r1604010 85 85 // define variables 86 86 var thisObject = this; 87 var sortSection = this.thead;88 87 89 88 // constructor actions 90 89 if (!(this.tbody && this.tbody[0].rows && this.tbody[0].rows.length > 0)) return; 91 90 92 if (sortSection && sortSection[0].rows && sortSection[0].rows.length > 0) { 93 var sortRow = sortSection[0].rows[0]; 94 } else { 95 return; 96 } 97 98 for (var i=0; i<sortRow.cells.length; i++) { 99 sortRow.cells[i].sTable = this; 100 sortRow.cells[i].onclick = function () { 101 this.sTable.sort(this); 102 return false; 91 function initSorting(sortSection) { 92 if (sortSection && sortSection[0].rows && sortSection[0].rows.length > 0) { 93 var sortRow = sortSection[0].rows[0]; 94 } else { 95 return; 96 } 97 98 for (var i=0; i<sortRow.cells.length; i++) { 99 sortRow.cells[i].sTable = this; 100 sortRow.cells[i].onclick = function () { 101 this.sTable.sort(this); 102 return false; 103 } 103 104 } 104 105 } 105 106 107 initSorting(this.thead); 108 initSorting(this.tfoot); 106 109 } -
tags-page/trunk/js/webtoolkit.sortabletable.min.js
r964339 r1604010 1 function SortableTable(d){ 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,d=this.getInnerText(this.tbody[0].rows[1].cells[b]),c=this.sortCaseInsensitive;d.match(/\d\d[-]+\d\d[-]+\d\d\d\d/)&&(c=this.sortDate);d.replace(/^\s+|\s+$/g,"").match(/^[\d\.]+$/)&&(c=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(c);"down"==a.getAttribute("sortdir")?(b.reverse(),a.setAttribute("sortdir","up")):a.setAttribute("sortdir","down");for(e=0;e<b.length;e++)this.tbody[0].appendChild(b[e])};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;d=this.thead;if(this.tbody&&this.tbody[0].rows&&0<this.tbody[0].rows.length&&d&&d[0].rows&&0<d[0].rows.length){d=d[0].rows[0];for(var e=0;e<d.cells.length;e++)d.cells[e].sTable=this,d.cells[e].onclick=function(){this.sTable.sort(this);return!1}}};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))}; -
tags-page/trunk/readme.txt
r1225516 r1604010 4 4 Tags: tag-cloud, tags, page, widget, taxonomy 5 5 Requires at least: 3.0 6 Tested up to: 4. 37 Stable tag: 1. 26 Tested up to: 4.7 7 Stable tag: 1.3 8 8 License: WTFPL 9 9 … … 49 49 == Changelog == 50 50 51 = 1.3 = 52 * fix: sorting did not work when clicking in table footer 51 53 = 1.2 = 52 54 * fix: virtual page not working for permalinks set to /%category%/%postname%/ -
tags-page/trunk/tags-page.php
r1225516 r1604010 4 4 Plugin URI: http://wordpress.org/plugins/tags-page/ 5 5 Description: Adds a table listing all tags registered on your website. 6 Version: 1. 26 Version: 1.3 7 7 Author: Honza Skypala 8 8 Author URI: http://www.honza.info … … 13 13 14 14 class TagsPage { 15 const version = "1. 2";15 const version = "1.3"; 16 16 private static $init_table = false; 17 17
Note: See TracChangeset
for help on using the changeset viewer.