alphanumeric sort
84
README.markdown
Normal file
@ -0,0 +1,84 @@
|
||||
Originally posted by Jeremy Satterfield in his [blog][1], [jQuery plugins][2] and on [Snipplr][3]. This fork by [Mottie][4].
|
||||
|
||||
tablesorter is a jQuery plugin for turning a standard HTML table with THEAD and TBODY tags into a sortable table without page refreshes.
|
||||
tablesorter can successfully parse and sort many types of data including linked data in a cell.
|
||||
|
||||
###Features ([Demo][http://mottie.github.com/tablesorter/])
|
||||
|
||||
* Multi-column sorting.
|
||||
* Parsers for sorting text, alphanumeric text, URIs, integers, currency, floats, IP addresses, dates (ISO, long and short formats), time. [Add your own easily](docs/example-parsers.html)
|
||||
* Support for ROWSPAN and COLSPAN on TH elements.
|
||||
* Support secondary "hidden" sorting (e.g., maintain alphabetical sort when sorting on other criteria).
|
||||
* Extensibility via [widget system](docs/example-widgets.html).
|
||||
* Cross-browser: IE 6.0+, FF 2+, Safari 2.0+, Opera 9.0+.
|
||||
* Small code size.
|
||||
* Works with jQuery 1.2.3+
|
||||
|
||||
###Documentation
|
||||
|
||||
Included all original [document pages](http://mottie.github.com/tablesorter/docs/index.html).
|
||||
Also check out my blog post on [undocumented options](http://wowmotty.blogspot.com/2011/06/jquery-tablesorter-missing-docs.html) which I will add to the document pages when I get around to it.
|
||||
|
||||
###Licensing
|
||||
|
||||
* Copyright (c) 2007 Christian Bach
|
||||
* Main Examples and docs at: http://tablesorter.com
|
||||
* Dual licensed under the [MIT](http://www.opensource.org/licenses/mit-license.php) and [GPL](http://www.gnu.org/licenses/gpl.html) licenses:
|
||||
|
||||
###Change Log
|
||||
|
||||
#### Version 2.0.6 (2011-06-22)
|
||||
|
||||
* Forked original files and docs from [tablesorter.com](http://tablesorter.com) to GitHub.
|
||||
* Replaced alphabetical sort with an alphanumeric sort
|
||||
* This "slower" sort can be disabled by setting the `sortLocaleCompare` option to `true`
|
||||
* The `sortLocaleCompare` option's default was changed to `false`.
|
||||
* Added a very basic demo.
|
||||
* Added `tableClass` option
|
||||
* The value is "tablesorter" by default and should no longer be required in the default markup.
|
||||
* This class is applied to the table in the script and should match the css styling.
|
||||
* Each header cell now has its content wrapped with a span.
|
||||
* This allows applying the direction icon to the span instead of the entire cell.
|
||||
* Although, this might just be extra markup with the advent of multiple background images and gradient backgrounds available in CSS3.
|
||||
* Reformatted the code to make jSLint "happier".
|
||||
|
||||
### Version 2.0.5b (?)
|
||||
|
||||
* General
|
||||
* Added "cssChildRow" option - attach a child row to its parent.
|
||||
* Added "sortLocaleCompare" to use the native `String.localeCampare` method during text sort.
|
||||
* Added "onRenderHeader" function that is called when classes are added to the header cells.
|
||||
* Added "selectorHeaders" option to target the the header cells.
|
||||
* Changed multisort function
|
||||
|
||||
#### Version 2.0.3 (2008-03-17)
|
||||
|
||||
* Bug fixes - Missing semicolon, broke the minified version.
|
||||
|
||||
#### Version 2.0.2 (2008-03-14)
|
||||
|
||||
* General
|
||||
* Added support for the new metadata plugin.
|
||||
* Added support for jQuery 1.2.3.
|
||||
* Added support for decimal numbers and negative and positive digits.
|
||||
* Updated documenation and website with new examples.
|
||||
* Removed packed version.
|
||||
|
||||
* Bug fixes
|
||||
* Sort force (Thanks to David Lynch).
|
||||
|
||||
#### Version 2.0.1 (2007-09-17)
|
||||
|
||||
* General
|
||||
* Removed the need for Dimensions plugin when using the pagnation plugin thanks to offset being included in the jQuery 1.2 core.
|
||||
* Added support for jQuery 1.2.
|
||||
* Added new Minified version of tablesorter.
|
||||
* Updated documenation and website with new examples.
|
||||
|
||||
* Bug fixes
|
||||
* If row values are identical the original order is kept (Thanks to David hull).
|
||||
* If thead includes a table $('tbody:first', table) breaks (Thanks to David Hull).
|
||||
|
||||
* Speed improvements:
|
||||
* appendToTable, setting innerHTML to "" before appending new content to table body.
|
||||
* zebra widget. (Thanks to James Dempster).
|
BIN
addons/pager/icons/first.png
Normal file
After Width: | Height: | Size: 720 B |
BIN
addons/pager/icons/last.png
Normal file
After Width: | Height: | Size: 737 B |
BIN
addons/pager/icons/next.png
Normal file
After Width: | Height: | Size: 736 B |
BIN
addons/pager/icons/prev.png
Normal file
After Width: | Height: | Size: 745 B |
25
addons/pager/jquery.tablesorter.pager.css
Normal file
@ -0,0 +1,25 @@
|
||||
div.tablesorterPager {
|
||||
padding: 10px 0 10px 0;
|
||||
background-color: #D6D2C2;
|
||||
text-align: center;
|
||||
}
|
||||
div.tablesorterPager span {
|
||||
padding: 0 5px 0 5px;
|
||||
}
|
||||
div.tablesorterPager input.prev {
|
||||
width: auto;
|
||||
margin-right: 10px;
|
||||
}
|
||||
div.tablesorterPager input.next {
|
||||
width: auto;
|
||||
margin-left: 10px;
|
||||
}
|
||||
div.tablesorterPager input {
|
||||
font-size: 8px;
|
||||
width: 50px;
|
||||
border: 1px solid #330000;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
|
||||
|
184
addons/pager/jquery.tablesorter.pager.js
Normal file
@ -0,0 +1,184 @@
|
||||
(function($) {
|
||||
$.extend({
|
||||
tablesorterPager: new function() {
|
||||
|
||||
function updatePageDisplay(c) {
|
||||
var s = $(c.cssPageDisplay,c.container).val((c.page+1) + c.seperator + c.totalPages);
|
||||
}
|
||||
|
||||
function setPageSize(table,size) {
|
||||
var c = table.config;
|
||||
c.size = size;
|
||||
c.totalPages = Math.ceil(c.totalRows / c.size);
|
||||
c.pagerPositionSet = false;
|
||||
moveToPage(table);
|
||||
fixPosition(table);
|
||||
}
|
||||
|
||||
function fixPosition(table) {
|
||||
var c = table.config;
|
||||
if(!c.pagerPositionSet && c.positionFixed) {
|
||||
var c = table.config, o = $(table);
|
||||
if(o.offset) {
|
||||
c.container.css({
|
||||
top: o.offset().top + o.height() + 'px',
|
||||
position: 'absolute'
|
||||
});
|
||||
}
|
||||
c.pagerPositionSet = true;
|
||||
}
|
||||
}
|
||||
|
||||
function moveToFirstPage(table) {
|
||||
var c = table.config;
|
||||
c.page = 0;
|
||||
moveToPage(table);
|
||||
}
|
||||
|
||||
function moveToLastPage(table) {
|
||||
var c = table.config;
|
||||
c.page = (c.totalPages-1);
|
||||
moveToPage(table);
|
||||
}
|
||||
|
||||
function moveToNextPage(table) {
|
||||
var c = table.config;
|
||||
c.page++;
|
||||
if(c.page >= (c.totalPages-1)) {
|
||||
c.page = (c.totalPages-1);
|
||||
}
|
||||
moveToPage(table);
|
||||
}
|
||||
|
||||
function moveToPrevPage(table) {
|
||||
var c = table.config;
|
||||
c.page--;
|
||||
if(c.page <= 0) {
|
||||
c.page = 0;
|
||||
}
|
||||
moveToPage(table);
|
||||
}
|
||||
|
||||
|
||||
function moveToPage(table) {
|
||||
var c = table.config;
|
||||
if(c.page < 0 || c.page > (c.totalPages-1)) {
|
||||
c.page = 0;
|
||||
}
|
||||
|
||||
renderTable(table,c.rowsCopy);
|
||||
}
|
||||
|
||||
function renderTable(table,rows) {
|
||||
|
||||
var c = table.config;
|
||||
var l = rows.length;
|
||||
var s = (c.page * c.size);
|
||||
var e = (s + c.size);
|
||||
if(e > rows.length ) {
|
||||
e = rows.length;
|
||||
}
|
||||
|
||||
|
||||
var tableBody = $(table.tBodies[0]);
|
||||
|
||||
// clear the table body
|
||||
|
||||
$.tablesorter.clearTableBody(table);
|
||||
|
||||
for(var i = s; i < e; i++) {
|
||||
|
||||
//tableBody.append(rows[i]);
|
||||
|
||||
var o = rows[i];
|
||||
var l = o.length;
|
||||
for(var j=0; j < l; j++) {
|
||||
|
||||
tableBody[0].appendChild(o[j]);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
fixPosition(table,tableBody);
|
||||
|
||||
$(table).trigger("applyWidgets");
|
||||
|
||||
if( c.page >= c.totalPages ) {
|
||||
moveToLastPage(table);
|
||||
}
|
||||
|
||||
updatePageDisplay(c);
|
||||
}
|
||||
|
||||
this.appender = function(table,rows) {
|
||||
|
||||
var c = table.config;
|
||||
|
||||
c.rowsCopy = rows;
|
||||
c.totalRows = rows.length;
|
||||
c.totalPages = Math.ceil(c.totalRows / c.size);
|
||||
|
||||
renderTable(table,rows);
|
||||
};
|
||||
|
||||
this.defaults = {
|
||||
size: 10,
|
||||
offset: 0,
|
||||
page: 0,
|
||||
totalRows: 0,
|
||||
totalPages: 0,
|
||||
container: null,
|
||||
cssNext: '.next',
|
||||
cssPrev: '.prev',
|
||||
cssFirst: '.first',
|
||||
cssLast: '.last',
|
||||
cssPageDisplay: '.pagedisplay',
|
||||
cssPageSize: '.pagesize',
|
||||
seperator: "/",
|
||||
positionFixed: true,
|
||||
appender: this.appender
|
||||
};
|
||||
|
||||
this.construct = function(settings) {
|
||||
|
||||
return this.each(function() {
|
||||
|
||||
config = $.extend(this.config, $.tablesorterPager.defaults, settings);
|
||||
|
||||
var table = this, pager = config.container;
|
||||
|
||||
$(this).trigger("appendCache");
|
||||
|
||||
config.size = parseInt($(".pagesize",pager).val());
|
||||
|
||||
$(config.cssFirst,pager).click(function() {
|
||||
moveToFirstPage(table);
|
||||
return false;
|
||||
});
|
||||
$(config.cssNext,pager).click(function() {
|
||||
moveToNextPage(table);
|
||||
return false;
|
||||
});
|
||||
$(config.cssPrev,pager).click(function() {
|
||||
moveToPrevPage(table);
|
||||
return false;
|
||||
});
|
||||
$(config.cssLast,pager).click(function() {
|
||||
moveToLastPage(table);
|
||||
return false;
|
||||
});
|
||||
$(config.cssPageSize,pager).change(function() {
|
||||
setPageSize(table,parseInt($(this).val()));
|
||||
return false;
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
}
|
||||
});
|
||||
// extend plugin scope
|
||||
$.fn.extend({
|
||||
tablesorterPager: $.tablesorterPager.construct
|
||||
});
|
||||
|
||||
})(jQuery);
|
70
changelog
Normal file
@ -0,0 +1,70 @@
|
||||
tablesorter changelog
|
||||
======================
|
||||
http://tablesorter.com
|
||||
|
||||
|
||||
Changes in version 2.0.6 (2011-06-22)
|
||||
-------------------------------------
|
||||
|
||||
General
|
||||
* Forked original files and docs from [tablesorter.com](http://tablesorter.com) to GitHub.
|
||||
* Replaced alphabetical sort with an alphanumeric sort
|
||||
* This "slower" sort can be disabled by setting the `sortLocaleCompare` option to `true`
|
||||
* The `sortLocaleCompare` option's default was changed to `false`.
|
||||
* Added a very basic demo.
|
||||
* Added `tableClass` option
|
||||
* The value is "tablesorter" by default and should no longer be required in the default markup.
|
||||
* This class is applied to the table in the script and should match the css styling.
|
||||
* Each header cell now has its content wrapped with a span.
|
||||
* This allows applying the direction icon to the span instead of the entire cell.
|
||||
* Although, this might just be extra markup with the advent of multiple background images and gradient backgrounds available in CSS3.
|
||||
* Reformatted the code to make jSLint "happier".
|
||||
|
||||
|
||||
Changes in version 2.0.5b (???)
|
||||
-------------------------------------
|
||||
|
||||
* General
|
||||
* Added "cssChildRow" option
|
||||
* Added "sortLocaleCompare" to use the native `String.localeCampare` method.
|
||||
* Added "onRenderHeader" function that is called when classes are added to the header cells.
|
||||
* Added "selectorHeaders" option to target the the header cells.
|
||||
|
||||
|
||||
Changes in version 2.0.3 (2008-03-17)
|
||||
-------------------------------------
|
||||
|
||||
Bug fixes
|
||||
* Missing semicolon, broke the minified version
|
||||
|
||||
|
||||
Changes in version 2.0.2 (2008-03-14)
|
||||
-------------------------------------
|
||||
|
||||
General
|
||||
* Added support for the new metadata plugin
|
||||
* Added support for jQuery 1.2.3
|
||||
* Added support for decimal numbers and negative and positive digits
|
||||
* Updated documenation and website with new examples
|
||||
* Removed packed version.
|
||||
|
||||
Bug fixes
|
||||
* Sort force (Thanks to David Lynch)
|
||||
|
||||
|
||||
Changes in version 2.0.1 (2007-09-17)
|
||||
-------------------------------------
|
||||
|
||||
General
|
||||
* Removed the need for Dimensions plugin when using the pagnation plugin thanks to offset being included in the jQuery 1.2 core.
|
||||
* Added support for jQuery 1.2
|
||||
* Added new Minified version of tablesorter
|
||||
* Updated documenation and website with new examples
|
||||
|
||||
Bug fixes
|
||||
* If row values are identical the original order is kept (Thanks to David hull)
|
||||
* If thead includes a table $('tbody:first', table) breaks (Thanks to David Hull)
|
||||
|
||||
Speed improvements:
|
||||
* appendToTable, setting innerHTML to "" before appending new content to table body.
|
||||
* zebra widget. (Thanks to James Dempster)
|
BIN
css/blue/black-asc.gif
Normal file
After Width: | Height: | Size: 54 B |
BIN
css/blue/black-bg.gif
Normal file
After Width: | Height: | Size: 64 B |
BIN
css/blue/black-desc.gif
Normal file
After Width: | Height: | Size: 54 B |
BIN
css/blue/blue.zip
Normal file
39
css/blue/style.css
Normal file
@ -0,0 +1,39 @@
|
||||
/* Blue Theme */
|
||||
table.tablesorter {
|
||||
font-family:arial;
|
||||
background-color: #CDCDCD;
|
||||
margin:10px 0pt 15px;
|
||||
font-size: 8pt;
|
||||
width: 100%;
|
||||
text-align: left;
|
||||
}
|
||||
table.tablesorter thead tr th, table.tablesorter tfoot tr th {
|
||||
background-color: #e6EEEE;
|
||||
border: 1px solid #FFF;
|
||||
font-size: 8pt;
|
||||
padding: 4px;
|
||||
}
|
||||
table.tablesorter thead tr .header {
|
||||
background-image: url(black-bg.gif);
|
||||
background-repeat: no-repeat;
|
||||
background-position: center right;
|
||||
cursor: pointer;
|
||||
}
|
||||
table.tablesorter tbody td {
|
||||
color: #3D3D3D;
|
||||
padding: 4px;
|
||||
background-color: #FFF;
|
||||
vertical-align: top;
|
||||
}
|
||||
table.tablesorter tbody tr.odd td {
|
||||
background-color:#F0F0F6;
|
||||
}
|
||||
table.tablesorter thead tr .headerSortUp {
|
||||
background-image: url(black-asc.gif);
|
||||
}
|
||||
table.tablesorter thead tr .headerSortDown {
|
||||
background-image: url(black-desc.gif);
|
||||
}
|
||||
table.tablesorter thead tr .headerSortDown, table.tablesorter thead tr .headerSortUp {
|
||||
background-color: #8dbdd8;
|
||||
}
|
BIN
css/blue/white-asc.gif
Normal file
After Width: | Height: | Size: 54 B |
BIN
css/blue/white-bg.gif
Normal file
After Width: | Height: | Size: 64 B |
BIN
css/blue/white-desc.gif
Normal file
After Width: | Height: | Size: 54 B |
BIN
css/green/asc.png
Normal file
After Width: | Height: | Size: 2.6 KiB |
BIN
css/green/bg.png
Normal file
After Width: | Height: | Size: 2.6 KiB |
BIN
css/green/desc.png
Normal file
After Width: | Height: | Size: 2.6 KiB |
BIN
css/green/green.zip
Normal file
39
css/green/style.css
Normal file
@ -0,0 +1,39 @@
|
||||
table.tablesorter {
|
||||
font-size: 12px;
|
||||
background-color: #4D4D4D;
|
||||
width: 1024px;
|
||||
border: 1px solid #000;
|
||||
}
|
||||
table.tablesorter th {
|
||||
text-align: left;
|
||||
padding: 5px;
|
||||
background-color: #6E6E6E;
|
||||
}
|
||||
table.tablesorter td {
|
||||
color: #FFF;
|
||||
padding: 5px;
|
||||
}
|
||||
table.tablesorter .even {
|
||||
background-color: #3D3D3D;
|
||||
}
|
||||
table.tablesorter .odd {
|
||||
background-color: #6E6E6E;
|
||||
}
|
||||
table.tablesorter .header {
|
||||
background-image: url(bg.png);
|
||||
background-repeat: no-repeat;
|
||||
border-left: 1px solid #FFF;
|
||||
border-right: 1px solid #000;
|
||||
border-top: 1px solid #FFF;
|
||||
padding-left: 30px;
|
||||
padding-top: 8px;
|
||||
height: auto;
|
||||
}
|
||||
table.tablesorter .headerSortUp {
|
||||
background-image: url(asc.png);
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
table.tablesorter .headerSortDown {
|
||||
background-image: url(desc.png);
|
||||
background-repeat: no-repeat;
|
||||
}
|
40
docs/assets/ajax-content.html
Normal file
@ -0,0 +1,40 @@
|
||||
<tr>
|
||||
<td>Peter</td>
|
||||
<td>Parker</td>
|
||||
<td>28</td>
|
||||
<td>$9.99</td>
|
||||
<td>20%</td>
|
||||
<td>Jul 6, 2006 8:14 AM</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>John</td>
|
||||
<td>Hood</td>
|
||||
<td>33</td>
|
||||
<td>$19.99</td>
|
||||
<td>25%</td>
|
||||
<td>Dec 10, 2002 5:14 AM</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Clark</td>
|
||||
<td>Kent</td>
|
||||
<td>18</td>
|
||||
<td>$15.89</td>
|
||||
<td>44%</td>
|
||||
<td>Jan 12, 2003 11:14 AM</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Bruce</td>
|
||||
<td>Almighty</td>
|
||||
<td>45</td>
|
||||
<td>$153.19</td>
|
||||
<td>44%</td>
|
||||
<td>Jan 18, 2001 9:12 AM</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Bruce</td>
|
||||
<td>Evans</td>
|
||||
<td>22</td>
|
||||
<td>$13.19</td>
|
||||
<td>11%</td>
|
||||
<td>Jan 18, 2007 9:12 AM</td>
|
||||
</tr>
|
32
docs/css/jq.css
Normal file
@ -0,0 +1,32 @@
|
||||
body,div,h1{font-family:'trebuchet ms', verdana, arial;margin:0;padding:0;}
|
||||
body{background-color:#fff;color:#333;margin:0;padding:0;}
|
||||
h1{font-size:large;font-weight:400;margin:0;}
|
||||
h2{color:#333;font-size:small;font-weight:400;margin:0;}
|
||||
.demo{width:600px;margin:0 auto;}
|
||||
.demo h1,.demo h1 a{font-size:120%;text-align:center;text-decoration:none;}
|
||||
.demo p{text-align:center;}
|
||||
.demo table.tablesorter{font-size:14px;}
|
||||
pre{background-color:#eee;border:1px solid #ddd;border-left-width:5px;color:#333;font-size:small;overflow-x:auto;padding:15px;}
|
||||
pre.normal{background-color:transparent;border:none;border-left-width:0;overflow-x:auto;}
|
||||
#logo{background:url(images/jq.png);display:block;float:right;height:31px;margin-right:10px;margin-top:10px;width:110px;}
|
||||
#main{margin:0 20px 20px;padding:0 15px 15px 0;}
|
||||
#content{padding:20px;}
|
||||
#busy{background-color:#e95555;border:1px ridge #ccc;color:#eee;display:none;padding:3px;position:absolute;right:7px;top:7px;}
|
||||
hr{height:1px;}
|
||||
code{font-size:108%;font-style:normal;padding:0;}
|
||||
ul{color:#333;list-style:square;}
|
||||
#banner{margin:20px;padding-bottom:10px;text-align:left;}
|
||||
#banner *{color:#232121;font-family:Georgia, Palatino, Times New Roman;font-size:30px;font-style:normal;font-weight:400;margin:0;padding:0;}
|
||||
#banner h1{display:block;float:left;}
|
||||
#banner h1 em{color:#6cf;}
|
||||
#banner h2{float:right;font-size:26px;margin:10px 10px -10px -10px;}
|
||||
#banner h3{clear:both;display:block;font-size:12px;margin-top:-20px;}
|
||||
#banner a{border-top:1px solid #888;display:block;font-size:14px;margin:5px 0 0;padding:10px 0 0;text-align:right;width:auto;}
|
||||
a.external{background-image:url(../img/external.png);background-position:center right;background-repeat:no-repeat;padding-right:12px;}
|
||||
form{font-size:10pt;margin-bottom:20px;width:auto;}
|
||||
form fieldset{padding:10px;text-align:left;width:140px;}
|
||||
div#main h1{border-bottom:1px solid #CDCDCD;display:block;margin-top:20px;padding:10px 0 2px;}
|
||||
table#tablesorter-demo {margin: 10px 0 0 0;}
|
||||
table#options *{font-size:small;}
|
||||
p.tip em {padding: 2px; background-color: #6cf; color: #FFF;}
|
||||
div.digg {float: right;}
|
121
docs/example-ajax.html
Normal file
@ -0,0 +1,121 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-us">
|
||||
<head>
|
||||
<title>jQuery plugin: Tablesorter 2.0 - Appending table data with ajax</title>
|
||||
|
||||
<!-- jQuery -->
|
||||
<script type="text/javascript" src="js/jquery-latest.js"></script>
|
||||
|
||||
<!-- Demo stuff -->
|
||||
<link rel="stylesheet" href="css/jq.css" type="text/css" media="print, projection, screen" />
|
||||
<script type="text/javascript" src="js/chili/chili-1.8b.js"></script>
|
||||
<script type="text/javascript" src="js/docs.js"></script>
|
||||
<script type="text/javascript" src="js/examples.js"></script>
|
||||
|
||||
<!-- Tablesorter: required -->
|
||||
<link rel="stylesheet" href="../css/blue/style.css" type="text/css" media="print, projection, screen" />
|
||||
<script type="text/javascript" src="../js/jquery.tablesorter.js"></script>
|
||||
|
||||
<!-- Tablesorter: optional -->
|
||||
<script type="text/javascript" src="../addons/pager/jquery.tablesorter.pager.js"></script>
|
||||
<script type="text/javascript" src="../js/jquery.metadata.js"></script>
|
||||
|
||||
<script type="text/javascript" id="js">$(function() {
|
||||
$("table").tablesorter();
|
||||
$("#ajax-append").click(function() {
|
||||
$.get("assets/ajax-content.html", function(html) {
|
||||
// append the "ajax'd" data to the table body
|
||||
$("table tbody").append(html);
|
||||
// let the plugin know that we made a update
|
||||
$("table").trigger("update");
|
||||
// set sorting column and direction, this will sort on the first and third column
|
||||
var sorting = [[2,1],[0,0]];
|
||||
// sort on the first column
|
||||
$("table").trigger("sorton",[sorting]);
|
||||
});
|
||||
return false;
|
||||
});
|
||||
});</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="banner">
|
||||
<h1>table<em>sorter</em></h1>
|
||||
<h2>Appending table data with ajax</h2>
|
||||
<h3>Flexible client-side table sorting</h3>
|
||||
<a href="index.html">Back to documentation</a>
|
||||
</div>
|
||||
<div id="main">
|
||||
<h1>Demo</h1>
|
||||
<div id="demo">
|
||||
<table cellspacing="1" class="tablesorter">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>First Name</th>
|
||||
<th>Last Name</th>
|
||||
<th>Age</th>
|
||||
<th>Total</th>
|
||||
<th>Discount</th>
|
||||
<th>Date</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Peter</td>
|
||||
<td>Parker</td>
|
||||
<td>28</td>
|
||||
<td>$9.99</td>
|
||||
<td>20%</td>
|
||||
<td>Jul 6, 2006 8:14 AM</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>John</td>
|
||||
<td>Hood</td>
|
||||
<td>33</td>
|
||||
<td>$19.99</td>
|
||||
<td>25%</td>
|
||||
<td>Dec 10, 2002 5:14 AM</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Clark</td>
|
||||
<td>Kent</td>
|
||||
<td>18</td>
|
||||
<td>$15.89</td>
|
||||
<td>44%</td>
|
||||
<td>Jan 12, 2003 11:14 AM</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Bruce</td>
|
||||
<td>Almighty</td>
|
||||
<td>45</td>
|
||||
<td>$153.19</td>
|
||||
<td>44%</td>
|
||||
<td>Jan 18, 2001 9:12 AM</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Bruce</td>
|
||||
<td>Evans</td>
|
||||
<td>22</td>
|
||||
<td>$13.19</td>
|
||||
<td>11%</td>
|
||||
<td>Jan 18, 2007 9:12 AM</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<a href="#" id="ajax-append">Append new table data</a>
|
||||
<br/>
|
||||
<br/>
|
||||
</div>
|
||||
<p>*Note* This demo will only work when the ajax page is online - switch to jQuery v1.4.4 to test it locally</p>
|
||||
<h1>Javascript</h1>
|
||||
<div id="javascript">
|
||||
<pre class="javascript"></pre>
|
||||
</div>
|
||||
<h1>HTML</h1>
|
||||
<div id="html">
|
||||
<pre class="html"></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
79
docs/example-empty-table.html
Normal file
@ -0,0 +1,79 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-us">
|
||||
<head>
|
||||
<title>jQuery plugin: Tablesorter 2.0 - Initializing tablesorter on a empty table</title>
|
||||
|
||||
<!-- jQuery -->
|
||||
<script type="text/javascript" src="js/jquery-latest.js"></script>
|
||||
|
||||
<!-- Demo stuff -->
|
||||
<link rel="stylesheet" href="css/jq.css" type="text/css" media="print, projection, screen" />
|
||||
<script type="text/javascript" src="js/chili/chili-1.8b.js"></script>
|
||||
<script type="text/javascript" src="js/docs.js"></script>
|
||||
<script type="text/javascript" src="js/examples.js"></script>
|
||||
|
||||
<!-- Tablesorter: required -->
|
||||
<link rel="stylesheet" href="../css/blue/style.css" type="text/css" media="print, projection, screen" />
|
||||
<script type="text/javascript" src="../js/jquery.tablesorter.js"></script>
|
||||
|
||||
<script type="text/javascript" id="js">$(document).ready(function() {
|
||||
$("table").tablesorter();
|
||||
$("#append").click(function() {
|
||||
// add some html
|
||||
var html = "<tr><td>Peter</td><td>Parker</td><td>28</td><td>$9.99</td><td>20%</td><td>Jul 6, 2006 8:14 AM</td></tr>";
|
||||
html += "<tr><td>John</td><td>Hood</td><td>33</td><td>$19.99</td><td>25%</td><td>Dec 10, 2002 5:14 AM</td></tr><tr><td>Clark</td><td>Kent</td><td>18</td><td>$15.89</td><td>44%</td><td>Jan 12, 2003 11:14 AM</td></tr>";
|
||||
html += "<tr><td>Bruce</td><td>Almighty</td><td>45</td><td>$153.19</td><td>44%</td><td>Jan 18, 2001 9:12 AM</td></tr>";
|
||||
// append new html to table body
|
||||
$("table tbody").append(html);
|
||||
// let the plugin know that we made a update
|
||||
$("table").trigger("update");
|
||||
// set sorting column and direction, this will sort on the first and third column
|
||||
var sorting = [[2,1],[0,0]];
|
||||
// sort on the first column
|
||||
$("table").trigger("sorton",[sorting]);
|
||||
return false;
|
||||
});
|
||||
});</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="banner">
|
||||
<h1>table<em>sorter</em></h1>
|
||||
<h2>Initializing tablesorter on a empty table</h2>
|
||||
<h3>Flexible client-side table sorting</h3>
|
||||
<a href="index.html">Back to documentation</a>
|
||||
</div>
|
||||
<div id="main">
|
||||
<h1>Demo</h1>
|
||||
<div id="demo">
|
||||
<table cellspacing="1" class="tablesorter">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>First Name</th>
|
||||
<th>Last Name</th>
|
||||
<th>Age</th>
|
||||
<th>Total</th>
|
||||
<th>Discount</th>
|
||||
<th>Date</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<a href="#" id="append">Append new table data</a>
|
||||
<br/>
|
||||
<br/>
|
||||
</div>
|
||||
<h1>Javascript</h1>
|
||||
<div id="javascript">
|
||||
<pre class="javascript"></pre>
|
||||
</div>
|
||||
<h1>HTML</h1>
|
||||
<div id="html">
|
||||
<pre class="html"></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
113
docs/example-extending-defaults.html
Normal file
@ -0,0 +1,113 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-us">
|
||||
<head>
|
||||
<title>jQuery plugin: Tablesorter 2.0 - Extending default options</title>
|
||||
|
||||
<!-- jQuery -->
|
||||
<script type="text/javascript" src="js/jquery-latest.js"></script>
|
||||
|
||||
<!-- Demo stuff -->
|
||||
<link rel="stylesheet" href="css/jq.css" type="text/css" media="print, projection, screen" />
|
||||
<script type="text/javascript" src="js/chili/chili-1.8b.js"></script>
|
||||
<script type="text/javascript" src="js/docs.js"></script>
|
||||
<script type="text/javascript" src="js/examples.js"></script>
|
||||
|
||||
<!-- Tablesorter: required -->
|
||||
<link rel="stylesheet" href="../css/blue/style.css" type="text/css" media="print, projection, screen" />
|
||||
<script type="text/javascript" src="../js/jquery.tablesorter.js"></script>
|
||||
|
||||
<!-- Tablesorter: optional -->
|
||||
<script type="text/javascript" src="../addons/pager/jquery.tablesorter.pager.js"></script>
|
||||
<script type="text/javascript" src="../js/jquery.metadata.js"></script>
|
||||
|
||||
<script type="text/javascript" id="js">$(function() {
|
||||
// extend the default setting to always include the zebra widget.
|
||||
$.tablesorter.defaults.widgets = ['zebra'];
|
||||
|
||||
// extend the default setting to always sort on the first column
|
||||
$.tablesorter.defaults.sortList = [[0,0]];
|
||||
|
||||
// call the tablesorter plugin
|
||||
$("table").tablesorter();
|
||||
}); </script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="banner">
|
||||
<h1>table<em>sorter</em></h1>
|
||||
<h2>Extending default options</h2>
|
||||
<h3>Flexible client-side table sorting</h3>
|
||||
<a href="index.html">Back to documentation</a>
|
||||
</div>
|
||||
<div id="main">
|
||||
<h1>Demo</h1>
|
||||
<div id="demo">
|
||||
<table cellspacing="1" class="tablesorter">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>First Name</th>
|
||||
<th>Last Name</th>
|
||||
<th>Age</th>
|
||||
<th>Total</th>
|
||||
<th>Discount</th>
|
||||
<th>Date</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Peter</td>
|
||||
<td>Parker</td>
|
||||
<td>28</td>
|
||||
<td>$9.99</td>
|
||||
<td>20%</td>
|
||||
<td>Jul 6, 2006 8:14 AM</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>John</td>
|
||||
<td>Hood</td>
|
||||
<td>33</td>
|
||||
<td>$19.99</td>
|
||||
<td>25%</td>
|
||||
<td>Dec 10, 2002 5:14 AM</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Clark</td>
|
||||
<td>Kent</td>
|
||||
<td>18</td>
|
||||
<td>$15.89</td>
|
||||
<td>44%</td>
|
||||
<td>Jan 12, 2003 11:14 AM</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Bruce</td>
|
||||
<td>Almighty</td>
|
||||
<td>45</td>
|
||||
<td>$153.19</td>
|
||||
<td>44%</td>
|
||||
|
||||
<td>Jan 18, 2001 9:12 AM</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Bruce</td>
|
||||
<td>Evans</td>
|
||||
<td>22</td>
|
||||
<td>$13.19</td>
|
||||
<td>11%</td>
|
||||
<td>Jan 18, 2007 9:12 AM</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<h1>Javascript</h1>
|
||||
<div id="javascript">
|
||||
<pre class="javascript"></pre>
|
||||
</div>
|
||||
<h1>HTML</h1>
|
||||
<div id="html">
|
||||
<pre class="html"></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
112
docs/example-meta-headers.html
Normal file
@ -0,0 +1,112 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-us">
|
||||
<head>
|
||||
<title>jQuery plugin: Tablesorter 2.0 - Disable headers using metadata</title>
|
||||
|
||||
<!-- jQuery -->
|
||||
<script type="text/javascript" src="js/jquery-latest.js"></script>
|
||||
|
||||
<!-- Demo stuff -->
|
||||
<link rel="stylesheet" href="css/jq.css" type="text/css" media="print, projection, screen" />
|
||||
<script type="text/javascript" src="js/chili/chili-1.8b.js"></script>
|
||||
<script type="text/javascript" src="js/docs.js"></script>
|
||||
<script type="text/javascript" src="js/examples.js"></script>
|
||||
|
||||
<!-- Tablesorter: required -->
|
||||
<link rel="stylesheet" href="../css/blue/style.css" type="text/css" media="print, projection, screen" />
|
||||
<script type="text/javascript" src="../js/jquery.tablesorter.js"></script>
|
||||
|
||||
<!-- Tablesorter: optional -->
|
||||
<script type="text/javascript" src="../addons/pager/jquery.tablesorter.pager.js"></script>
|
||||
<script type="text/javascript" src="../js/jquery.metadata.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
window.tableFile="table-metadata-disable.html";
|
||||
</script>
|
||||
<script type="text/javascript" id="js">$(function() {
|
||||
// call the tablesorter plugin, the magic happens in the markup
|
||||
$("table").tablesorter();
|
||||
}); </script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="banner">
|
||||
<h1>table<em>sorter</em></h1>
|
||||
<h2>Disable headers using metadata</h2>
|
||||
<h3>Flexible client-side table sorting</h3>
|
||||
<a href="index.html">Back to documentation</a>
|
||||
</div>
|
||||
<div id="main">
|
||||
<h1>Demo</h1>
|
||||
<div id="demo">
|
||||
<table cellspacing="1" class="tablesorter">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="{sorter: false}">First Name</th>
|
||||
<th>Last Name</th>
|
||||
<th>Age</th>
|
||||
<th>Total</th>
|
||||
<th class="{sorter: false}">Discount</th>
|
||||
<th>Date</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Peter</td>
|
||||
<td>Parker</td>
|
||||
<td>28</td>
|
||||
<td>$9.99</td>
|
||||
<td>20%</td>
|
||||
|
||||
<td>Jul 6, 2006 8:14 AM</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>John</td>
|
||||
<td>Hood</td>
|
||||
<td>33</td>
|
||||
<td>$19.99</td>
|
||||
<td>25%</td>
|
||||
|
||||
<td>Dec 10, 2002 5:14 AM</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Clark</td>
|
||||
<td>Kent</td>
|
||||
<td>18</td>
|
||||
<td>$15.89</td>
|
||||
<td>44%</td>
|
||||
<td>Jan 12, 2003 11:14 AM</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Bruce</td>
|
||||
<td>Almighty</td>
|
||||
<td>45</td>
|
||||
<td>$153.19</td>
|
||||
<td>44%</td>
|
||||
|
||||
<td>Jan 18, 2001 9:12 AM</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Bruce</td>
|
||||
<td>Evans</td>
|
||||
<td>22</td>
|
||||
<td>$13.19</td>
|
||||
<td>11%</td>
|
||||
<td>Jan 18, 2007 9:12 AM</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<h1>Javascript</h1>
|
||||
<div id="javascript">
|
||||
<pre class="javascript"></pre>
|
||||
</div>
|
||||
<h1>HTML</h1>
|
||||
<div id="html">
|
||||
<pre class="html"></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
104
docs/example-meta-parsers.html
Normal file
@ -0,0 +1,104 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-us">
|
||||
<head>
|
||||
<title>jQuery plugin: Tablesorter 2.0 - Setting column parser using metadata</title>
|
||||
|
||||
<!-- jQuery -->
|
||||
<script type="text/javascript" src="js/jquery-latest.js"></script>
|
||||
|
||||
<!-- Demo stuff -->
|
||||
<link rel="stylesheet" href="css/jq.css" type="text/css" media="print, projection, screen" />
|
||||
<script type="text/javascript" src="js/chili/chili-1.8b.js"></script>
|
||||
<script type="text/javascript" src="js/docs.js"></script>
|
||||
<script type="text/javascript" src="js/examples.js"></script>
|
||||
|
||||
<!-- Tablesorter: required -->
|
||||
<link rel="stylesheet" href="../css/blue/style.css" type="text/css" media="print, projection, screen" />
|
||||
<script type="text/javascript" src="../js/jquery.tablesorter.js"></script>
|
||||
<script type="text/javascript" src="../js/jquery.metadata.js"></script>
|
||||
<script type="text/javascript" src="../addons/pager/jquery.tablesorter.pager.js"></script>
|
||||
|
||||
<script type="text/javascript" id="js">$(document).ready(function() {
|
||||
// call the tablesorter plugin, the magic happens in the markup
|
||||
$("table").tablesorter();
|
||||
});</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="banner">
|
||||
<h1>table<em>sorter</em></h1>
|
||||
<h2>Setting column parser using metadata</h2>
|
||||
<h3>Flexible client-side table sorting</h3>
|
||||
<a href="index.html">Back to documentation</a>
|
||||
</div>
|
||||
<div id="main">
|
||||
<h1>Demo</h1>
|
||||
<div id="demo">
|
||||
<table cellspacing="1" class="tablesorter">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="{sorter: 'text'}">First Name</th>
|
||||
<th>Last Name</th>
|
||||
<th>Age</th>
|
||||
<th>Total</th>
|
||||
<th class="{sorter: 'percent'}">Discount</th>
|
||||
<th>Date</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Peter</td>
|
||||
<td>Parker</td>
|
||||
<td>28</td>
|
||||
<td>$9.99</td>
|
||||
<td>20%</td>
|
||||
<td>Jul 6, 2006 8:14 AM</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>John</td>
|
||||
<td>Hood</td>
|
||||
<td>33</td>
|
||||
<td>$19.99</td>
|
||||
<td>25%</td>
|
||||
<td>Dec 10, 2002 5:14 AM</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Clark</td>
|
||||
<td>Kent</td>
|
||||
<td>18</td>
|
||||
<td>$15.89</td>
|
||||
<td>44%</td>
|
||||
<td>Jan 12, 2003 11:14 AM</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Bruce</td>
|
||||
<td>Almighty</td>
|
||||
<td>45</td>
|
||||
<td>$153.19</td>
|
||||
<td>44%</td>
|
||||
<td>Jan 18, 2001 9:12 AM</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Bruce</td>
|
||||
<td>Evans</td>
|
||||
<td>22</td>
|
||||
<td>$13.19</td>
|
||||
<td>11%</td>
|
||||
<td>Jan 18, 2007 9:12 AM</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<h1>Javascript</h1>
|
||||
<div id="javascript">
|
||||
<pre class="javascript"></pre>
|
||||
</div>
|
||||
<h1>HTML</h1>
|
||||
<div id="html">
|
||||
<pre class="html"></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
108
docs/example-meta-sort-list.html
Normal file
@ -0,0 +1,108 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-us">
|
||||
<head>
|
||||
<title>jQuery plugin: Tablesorter 2.0 - Setting initial sorting order with metadata</title>
|
||||
|
||||
<!-- jQuery -->
|
||||
<script type="text/javascript" src="js/jquery-latest.js"></script>
|
||||
|
||||
<!-- Demo stuff -->
|
||||
<link rel="stylesheet" href="css/jq.css" type="text/css" media="print, projection, screen" />
|
||||
<script type="text/javascript" src="js/chili/chili-1.8b.js"></script>
|
||||
<script type="text/javascript" src="js/docs.js"></script>
|
||||
<script type="text/javascript" src="js/examples.js"></script>
|
||||
|
||||
<!-- Tablesorter: required -->
|
||||
<link rel="stylesheet" href="../css/blue/style.css" type="text/css" media="print, projection, screen" />
|
||||
<script type="text/javascript" src="../js/jquery.tablesorter.js"></script>
|
||||
|
||||
<!-- Tablesorter: optional -->
|
||||
<script type="text/javascript" src="../addons/pager/jquery.tablesorter.pager.js"></script>
|
||||
<script type="text/javascript" src="../js/jquery.metadata.js"></script>
|
||||
|
||||
<script type="text/javascript" id="js">$(function() {
|
||||
// call the tablesorter plugin, the magic happens in the markup
|
||||
$("table").tablesorter();
|
||||
});</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="banner">
|
||||
<h1>table<em>sorter</em></h1>
|
||||
<h2>Setting initial sorting order with metadata</h2>
|
||||
<h3>Flexible client-side table sorting</h3>
|
||||
<a href="index.html">Back to documentation</a>
|
||||
</div>
|
||||
<div id="main">
|
||||
<h1>Demo</h1>
|
||||
<div id="demo">
|
||||
<!-- sortlist is appended to the table using the class attribute and is picked up by metadata plugin -->
|
||||
<table cellspacing="1" class="tablesorter {sortlist: [[0,0],[4,0]]}">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>First Name</th>
|
||||
<th>Last Name</th>
|
||||
<th>Age</th>
|
||||
<th>Total</th>
|
||||
<th>Discount</th>
|
||||
<th>Date</th>
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Peter</td>
|
||||
<td>Parker</td>
|
||||
<td>28</td>
|
||||
<td>$9.99</td>
|
||||
<td>20%</td>
|
||||
<td>Jul 6, 2006 8:14 AM</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>John</td>
|
||||
<td>Hood</td>
|
||||
<td>33</td>
|
||||
<td>$19.99</td>
|
||||
<td>25%</td>
|
||||
<td>Dec 10, 2002 5:14 AM</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Clark</td>
|
||||
<td>Kent</td>
|
||||
<td>18</td>
|
||||
<td>$15.89</td>
|
||||
<td>44%</td>
|
||||
<td>Jan 12, 2003 11:14 AM</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Bruce</td>
|
||||
<td>Almighty</td>
|
||||
<td>45</td>
|
||||
<td>$153.19</td>
|
||||
<td>44%</td>
|
||||
<td>Jan 18, 2001 9:12 AM</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Bruce</td>
|
||||
<td>Evans</td>
|
||||
<td>22</td>
|
||||
<td>$13.19</td>
|
||||
<td>11%</td>
|
||||
<td>Jan 18, 2007 9:12 AM</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<h1>Javascript</h1>
|
||||
<div id="javascript">
|
||||
<pre class="javascript"></pre>
|
||||
</div>
|
||||
<h1>HTML</h1>
|
||||
<div id="html">
|
||||
<pre class="html"></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
117
docs/example-option-debug.html
Normal file
@ -0,0 +1,117 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-us">
|
||||
<head>
|
||||
<title>jQuery plugin: Tablesorter 2.0 - Enabling debug mode</title>
|
||||
|
||||
<!-- jQuery -->
|
||||
<script type="text/javascript" src="js/jquery-latest.js"></script>
|
||||
|
||||
<!-- Demo stuff -->
|
||||
<link rel="stylesheet" href="css/jq.css" type="text/css" media="print, projection, screen" />
|
||||
<script type="text/javascript" src="js/chili/chili-1.8b.js"></script>
|
||||
<script type="text/javascript" src="js/docs.js"></script>
|
||||
<script type="text/javascript" src="js/examples.js"></script>
|
||||
|
||||
<!-- Tablesorter: required -->
|
||||
<link rel="stylesheet" href="../css/blue/style.css" type="text/css" media="print, projection, screen" />
|
||||
<script type="text/javascript" src="../js/jquery.tablesorter.js"></script>
|
||||
|
||||
<!-- Tablesorter: optional -->
|
||||
<script type="text/javascript" src="../addons/pager/jquery.tablesorter.pager.js"></script>
|
||||
<script type="text/javascript" src="../js/jquery.metadata.js"></script>
|
||||
|
||||
<script type="text/javascript" id="js">$(document).ready(function() {
|
||||
// call the tablesorter plugin
|
||||
$("table").tablesorter({
|
||||
// enable debug mode
|
||||
debug: true
|
||||
});
|
||||
}); </script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="banner">
|
||||
<h1>table<em>sorter</em></h1>
|
||||
<h2>Enabling debug mode</h2>
|
||||
<h3>Flexible client-side table sorting</h3>
|
||||
<a href="index.html">Back to documentation</a>
|
||||
</div>
|
||||
<div id="main">
|
||||
|
||||
<p class="tip">
|
||||
<em>NOTE!</em> If firebug is installed the debuging information will be displayed in the firebug console.
|
||||
</p>
|
||||
|
||||
<h1>Demo</h1>
|
||||
<div id="demo">
|
||||
|
||||
<table cellspacing="1" class="tablesorter">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>First Name</th>
|
||||
<th>Last Name</th>
|
||||
<th>Age</th>
|
||||
<th>Total</th>
|
||||
<th>Discount</th>
|
||||
<th>Date</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Peter</td>
|
||||
<td>Parker</td>
|
||||
<td>28</td>
|
||||
<td>$9.99</td>
|
||||
<td>20%</td>
|
||||
<td>Jul 6, 2006 8:14 AM</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>John</td>
|
||||
<td>Hood</td>
|
||||
<td>33</td>
|
||||
<td>$19.99</td>
|
||||
<td>25%</td>
|
||||
<td>Dec 10, 2002 5:14 AM</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Clark</td>
|
||||
<td>Kent</td>
|
||||
<td>18</td>
|
||||
<td>$15.89</td>
|
||||
<td>44%</td>
|
||||
<td>Jan 12, 2003 11:14 AM</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Bruce</td>
|
||||
<td>Almighty</td>
|
||||
<td>45</td>
|
||||
<td>$153.19</td>
|
||||
<td>44%</td>
|
||||
<td>Jan 18, 2001 9:12 AM</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Bruce</td>
|
||||
<td>Evans</td>
|
||||
<td>22</td>
|
||||
<td>$13.19</td>
|
||||
<td>11%</td>
|
||||
<td>Jan 18, 2007 9:12 AM</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
|
||||
<h1>Javascript</h1>
|
||||
<div id="javascript">
|
||||
<pre class="javascript"></pre>
|
||||
</div>
|
||||
<h1>HTML</h1>
|
||||
<div id="html">
|
||||
<pre class="html"></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
109
docs/example-option-digits.html
Normal file
@ -0,0 +1,109 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-us">
|
||||
<head>
|
||||
<title>jQuery plugin: Tablesorter 2.0 - Enabling debug mode</title>
|
||||
|
||||
<!-- jQuery -->
|
||||
<script type="text/javascript" src="js/jquery-latest.js"></script>
|
||||
|
||||
<!-- Demo stuff -->
|
||||
<link rel="stylesheet" href="css/jq.css" type="text/css" media="print, projection, screen" />
|
||||
<script type="text/javascript" src="js/chili/chili-1.8b.js"></script>
|
||||
<script type="text/javascript" src="js/docs.js"></script>
|
||||
<script type="text/javascript" src="js/examples.js"></script>
|
||||
|
||||
<!-- Tablesorter: required -->
|
||||
<link rel="stylesheet" href="../css/blue/style.css" type="text/css" media="print, projection, screen" />
|
||||
<script type="text/javascript" src="../js/jquery.tablesorter.js"></script>
|
||||
|
||||
<!-- Tablesorter: optional -->
|
||||
<script type="text/javascript" src="../addons/pager/jquery.tablesorter.pager.js"></script>
|
||||
|
||||
<script type="text/javascript" id="js">$(function() {
|
||||
// call the tablesorter plugin
|
||||
$("table").tablesorter();
|
||||
});</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="banner">
|
||||
<h1>table<em>sorter</em></h1>
|
||||
<h2>Dealing with digits</h2>
|
||||
<h3>Flexible client-side table sorting</h3>
|
||||
<a href="index.html">Back to documentation</a>
|
||||
</div>
|
||||
<div id="main">
|
||||
|
||||
<h1>Demo</h1>
|
||||
<div id="demo">
|
||||
|
||||
<table cellspacing="1" class="tablesorter">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>First Name</th>
|
||||
<th>Last Name</th>
|
||||
<th>Age</th>
|
||||
<th>Total</th>
|
||||
<th>Discount</th>
|
||||
<th>Diff</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Peter</td>
|
||||
<td>Parker</td>
|
||||
<td>28</td>
|
||||
<td>9.99</td>
|
||||
<td>20.3%</td>
|
||||
<td>+3</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>John</td>
|
||||
<td>Hood</td>
|
||||
<td>33</td>
|
||||
<td>19.99</td>
|
||||
<td>25.1%</td>
|
||||
<td>-7</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Clark</td>
|
||||
<td>Kent</td>
|
||||
<td>18</td>
|
||||
<td>15.89</td>
|
||||
<td>44.2%</td>
|
||||
<td>-15</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Bruce</td>
|
||||
<td>Almighty</td>
|
||||
<td>45</td>
|
||||
<td>153.19</td>
|
||||
<td>44%</td>
|
||||
<td>+19</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Bruce</td>
|
||||
<td>Evans</td>
|
||||
<td>56</td>
|
||||
<td>153.19</td>
|
||||
<td>23%</td>
|
||||
<td>+9</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
|
||||
<h1>Javascript</h1>
|
||||
<div id="javascript">
|
||||
<pre class="javascript"></pre>
|
||||
</div>
|
||||
<h1>HTML</h1>
|
||||
<div id="html">
|
||||
<pre class="html"></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
112
docs/example-option-sort-force.html
Normal file
@ -0,0 +1,112 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-us">
|
||||
<head>
|
||||
<title>jQuery plugin: Tablesorter 2.0 - Force a default sorting order</title>
|
||||
|
||||
<!-- jQuery -->
|
||||
<script type="text/javascript" src="js/jquery-latest.js"></script>
|
||||
|
||||
<!-- Demo stuff -->
|
||||
<link rel="stylesheet" href="css/jq.css" type="text/css" media="print, projection, screen" />
|
||||
<script type="text/javascript" src="js/chili/chili-1.8b.js"></script>
|
||||
<script type="text/javascript" src="js/docs.js"></script>
|
||||
<script type="text/javascript" src="js/examples.js"></script>
|
||||
|
||||
<!-- Tablesorter: required -->
|
||||
<link rel="stylesheet" href="../css/blue/style.css" type="text/css" media="print, projection, screen" />
|
||||
<script type="text/javascript" src="../js/jquery.tablesorter.js"></script>
|
||||
|
||||
<!-- Tablesorter: optional -->
|
||||
<script type="text/javascript" src="../addons/pager/jquery.tablesorter.pager.js"></script>
|
||||
|
||||
<script type="text/javascript" id="js">$(function() {
|
||||
// call the tablesorter plugin
|
||||
$("table").tablesorter({
|
||||
// set forced sort on the fourth column and i decending order.
|
||||
sortForce: [[0,0]]
|
||||
});
|
||||
});</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="banner">
|
||||
<h1>table<em>sorter</em></h1>
|
||||
<h2>Force a default sorting order</h2>
|
||||
<h3>Flexible client-side table sorting</h3>
|
||||
<a href="index.html">Back to documentation</a>
|
||||
</div>
|
||||
<div id="main">
|
||||
<h1>Demo</h1>
|
||||
<div id="demo">
|
||||
<table cellspacing="1" class="tablesorter">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>First Name</th>
|
||||
<th>Last Name</th>
|
||||
<th>Age</th>
|
||||
<th>Total</th>
|
||||
<th>Discount</th>
|
||||
<th>Date</th>
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Peter</td>
|
||||
<td>Parker</td>
|
||||
<td>28</td>
|
||||
<td>$9.99</td>
|
||||
<td>20%</td>
|
||||
|
||||
<td>Jul 6, 2006 8:14 AM</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>John</td>
|
||||
<td>Hood</td>
|
||||
<td>33</td>
|
||||
<td>$19.99</td>
|
||||
<td>25%</td>
|
||||
|
||||
<td>Dec 10, 2002 5:14 AM</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Clark</td>
|
||||
<td>Kent</td>
|
||||
<td>18</td>
|
||||
<td>$15.89</td>
|
||||
<td>44%</td>
|
||||
<td>Jan 12, 2003 11:14 AM</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Bruce</td>
|
||||
<td>Almighty</td>
|
||||
<td>45</td>
|
||||
<td>$153.19</td>
|
||||
<td>44%</td>
|
||||
|
||||
<td>Jan 18, 2001 9:12 AM</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Bruce</td>
|
||||
<td>Evans</td>
|
||||
<td>22</td>
|
||||
<td>$13.19</td>
|
||||
<td>11%</td>
|
||||
<td>Jan 18, 2007 9:12 AM</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<h1>Javascript</h1>
|
||||
<div id="javascript">
|
||||
<pre class="javascript"></pre>
|
||||
</div>
|
||||
<h1>HTML</h1>
|
||||
<div id="html">
|
||||
<pre class="html"></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
109
docs/example-option-sort-key.html
Normal file
@ -0,0 +1,109 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-us">
|
||||
<head>
|
||||
<title>jQuery plugin: Tablesorter 2.0 - Change multi-column sorting key</title>
|
||||
|
||||
<!-- jQuery -->
|
||||
<script type="text/javascript" src="js/jquery-latest.js"></script>
|
||||
|
||||
<!-- Demo stuff -->
|
||||
<link rel="stylesheet" href="css/jq.css" type="text/css" media="print, projection, screen" />
|
||||
<script type="text/javascript" src="js/chili/chili-1.8b.js"></script>
|
||||
<script type="text/javascript" src="js/docs.js"></script>
|
||||
<script type="text/javascript" src="js/examples.js"></script>
|
||||
|
||||
<!-- Tablesorter: required -->
|
||||
<link rel="stylesheet" href="../css/blue/style.css" type="text/css" media="print, projection, screen" />
|
||||
<script type="text/javascript" src="../js/jquery.tablesorter.js"></script>
|
||||
|
||||
<!-- Tablesorter: optional -->
|
||||
<script type="text/javascript" src="../addons/pager/jquery.tablesorter.pager.js"></script>
|
||||
<script type="text/javascript" src="../js/jquery.metadata.js"></script>
|
||||
|
||||
<script type="text/javascript" id="js">$(function() {
|
||||
// call the tablesorter plugin
|
||||
$("table").tablesorter({
|
||||
// change the multi sort key from the default shift to alt button
|
||||
sortMultiSortKey: 'altKey'
|
||||
});
|
||||
}); </script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="banner">
|
||||
<h1>table<em>sorter</em></h1>
|
||||
<h2>Change multi-column sorting key</h2>
|
||||
<h3>Flexible client-side table sorting</h3>
|
||||
<a href="index.html">Back to documentation</a>
|
||||
</div>
|
||||
<div id="main">
|
||||
<h1>Demo</h1>
|
||||
<div id="demo">
|
||||
<table cellspacing="1" class="tablesorter">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>First Name</th>
|
||||
<th>Last Name</th>
|
||||
<th>Age</th>
|
||||
<th>Total</th>
|
||||
<th>Discount</th>
|
||||
<th>Date</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Peter</td>
|
||||
<td>Parker</td>
|
||||
<td>28</td>
|
||||
<td>$9.99</td>
|
||||
<td>20%</td>
|
||||
<td>Jul 6, 2006 8:14 AM</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>John</td>
|
||||
<td>Hood</td>
|
||||
<td>33</td>
|
||||
<td>$19.99</td>
|
||||
<td>25%</td>
|
||||
<td>Dec 10, 2002 5:14 AM</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Clark</td>
|
||||
<td>Kent</td>
|
||||
<td>18</td>
|
||||
<td>$15.89</td>
|
||||
<td>44%</td>
|
||||
<td>Jan 12, 2003 11:14 AM</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Bruce</td>
|
||||
<td>Almighty</td>
|
||||
<td>45</td>
|
||||
<td>$153.19</td>
|
||||
<td>44%</td>
|
||||
<td>Jan 18, 2001 9:12 AM</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Bruce</td>
|
||||
<td>Evans</td>
|
||||
<td>22</td>
|
||||
<td>$13.19</td>
|
||||
<td>11%</td>
|
||||
<td>Jan 18, 2007 9:12 AM</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<h1>Javascript</h1>
|
||||
<div id="javascript">
|
||||
<pre class="javascript"></pre>
|
||||
</div>
|
||||
<h1>HTML</h1>
|
||||
<div id="html">
|
||||
<pre class="html"></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
112
docs/example-option-sort-list.html
Normal file
@ -0,0 +1,112 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-us">
|
||||
<head>
|
||||
<title>jQuery plugin: Tablesorter 2.0 - Set a initial sorting order</title>
|
||||
|
||||
<!-- jQuery -->
|
||||
<script type="text/javascript" src="js/jquery-latest.js"></script>
|
||||
|
||||
<!-- Demo stuff -->
|
||||
<link rel="stylesheet" href="css/jq.css" type="text/css" media="print, projection, screen" />
|
||||
<script type="text/javascript" src="js/chili/chili-1.8b.js"></script>
|
||||
<script type="text/javascript" src="js/docs.js"></script>
|
||||
<script type="text/javascript" src="js/examples.js"></script>
|
||||
|
||||
<!-- Tablesorter: required -->
|
||||
<link rel="stylesheet" href="../css/blue/style.css" type="text/css" media="print, projection, screen" />
|
||||
<script type="text/javascript" src="../js/jquery.tablesorter.js"></script>
|
||||
|
||||
<!-- Tablesorter: optional -->
|
||||
<script type="text/javascript" src="../addons/pager/jquery.tablesorter.pager.js"></script>
|
||||
|
||||
<script type="text/javascript" id="js">$(function() {
|
||||
// call the tablesorter plugin
|
||||
$("table").tablesorter({
|
||||
// sort on the first column and third column, order asc
|
||||
sortList: [[0,0],[2,0]]
|
||||
});
|
||||
}); </script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="banner">
|
||||
<h1>table<em>sorter</em></h1>
|
||||
<h2>Set a initial sorting order</h2>
|
||||
<h3>Flexible client-side table sorting</h3>
|
||||
<a href="index.html">Back to documentation</a>
|
||||
</div>
|
||||
<div id="main">
|
||||
<h1>Demo</h1>
|
||||
<div id="demo">
|
||||
<table cellspacing="1" class="tablesorter">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>First Name</th>
|
||||
<th>Last Name</th>
|
||||
<th>Age</th>
|
||||
<th>Total</th>
|
||||
<th>Discount</th>
|
||||
<th>Date</th>
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Peter</td>
|
||||
<td>Parker</td>
|
||||
<td>28</td>
|
||||
<td>$9.99</td>
|
||||
<td>20%</td>
|
||||
|
||||
<td>Jul 6, 2006 8:14 AM</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>John</td>
|
||||
<td>Hood</td>
|
||||
<td>33</td>
|
||||
<td>$19.99</td>
|
||||
<td>25%</td>
|
||||
|
||||
<td>Dec 10, 2002 5:14 AM</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Clark</td>
|
||||
<td>Kent</td>
|
||||
<td>18</td>
|
||||
<td>$15.89</td>
|
||||
<td>44%</td>
|
||||
<td>Jan 12, 2003 11:14 AM</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Bruce</td>
|
||||
<td>Almighty</td>
|
||||
<td>45</td>
|
||||
<td>$153.19</td>
|
||||
<td>44%</td>
|
||||
|
||||
<td>Jan 18, 2001 9:12 AM</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Bruce</td>
|
||||
<td>Evans</td>
|
||||
<td>22</td>
|
||||
<td>$13.19</td>
|
||||
<td>11%</td>
|
||||
<td>Jan 18, 2007 9:12 AM</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<h1>Javascript</h1>
|
||||
<div id="javascript">
|
||||
<pre class="javascript"></pre>
|
||||
</div>
|
||||
<h1>HTML</h1>
|
||||
<div id="html">
|
||||
<pre class="html"></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
109
docs/example-option-sort-order.html
Normal file
@ -0,0 +1,109 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-us">
|
||||
<head>
|
||||
<title>jQuery plugin: Tablesorter 2.0 - Set a initial sort order</title>
|
||||
|
||||
<!-- jQuery -->
|
||||
<script type="text/javascript" src="js/jquery-latest.js"></script>
|
||||
|
||||
<!-- Demo stuff -->
|
||||
<link rel="stylesheet" href="css/jq.css" type="text/css" media="print, projection, screen" />
|
||||
<script type="text/javascript" src="js/chili/chili-1.8b.js"></script>
|
||||
<script type="text/javascript" src="js/docs.js"></script>
|
||||
<script type="text/javascript" src="js/examples.js"></script>
|
||||
|
||||
<!-- Tablesorter: required -->
|
||||
<link rel="stylesheet" href="../css/blue/style.css" type="text/css" media="print, projection, screen" />
|
||||
<script type="text/javascript" src="../js/jquery.tablesorter.js"></script>
|
||||
|
||||
<!-- Tablesorter: optional -->
|
||||
<script type="text/javascript" src="../addons/pager/jquery.tablesorter.pager.js"></script>
|
||||
<script type="text/javascript" src="../js/jquery.metadata.js"></script>
|
||||
|
||||
<script type="text/javascript" id="js">$(function() {
|
||||
// call the tablesorter plugin
|
||||
$("table").tablesorter({
|
||||
// change the default sorting order from 'asc' to 'desc'
|
||||
sortInitialOrder: "desc"
|
||||
});
|
||||
}); </script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="banner">
|
||||
<h1>table<em>sorter</em></h1>
|
||||
<h2>Set a initial sorting order</h2>
|
||||
<h3>Flexible client-side table sorting</h3>
|
||||
<a href="index.html">Back to documentation</a>
|
||||
</div>
|
||||
<div id="main">
|
||||
<h1>Demo</h1>
|
||||
<div id="demo">
|
||||
<table cellspacing="1" class="tablesorter">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>First Name</th>
|
||||
<th>Last Name</th>
|
||||
<th>Age</th>
|
||||
<th>Total</th>
|
||||
<th>Discount</th>
|
||||
<th>Date</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Peter</td>
|
||||
<td>Parker</td>
|
||||
<td>28</td>
|
||||
<td>$9.99</td>
|
||||
<td>20%</td>
|
||||
<td>Jul 6, 2006 8:14 AM</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>John</td>
|
||||
<td>Hood</td>
|
||||
<td>33</td>
|
||||
<td>$19.99</td>
|
||||
<td>25%</td>
|
||||
<td>Dec 10, 2002 5:14 AM</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Clark</td>
|
||||
<td>Kent</td>
|
||||
<td>18</td>
|
||||
<td>$15.89</td>
|
||||
<td>44%</td>
|
||||
<td>Jan 12, 2003 11:14 AM</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Bruce</td>
|
||||
<td>Almighty</td>
|
||||
<td>45</td>
|
||||
<td>$153.19</td>
|
||||
<td>44%</td>
|
||||
<td>Jan 18, 2001 9:12 AM</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Bruce</td>
|
||||
<td>Evans</td>
|
||||
<td>22</td>
|
||||
<td>$13.19</td>
|
||||
<td>11%</td>
|
||||
<td>Jan 18, 2007 9:12 AM</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<h1>Javascript</h1>
|
||||
<div id="javascript">
|
||||
<pre class="javascript"></pre>
|
||||
</div>
|
||||
<h1>HTML</h1>
|
||||
<div id="html">
|
||||
<pre class="html"></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
89
docs/example-option-text-extraction.html
Normal file
@ -0,0 +1,89 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-us">
|
||||
<head>
|
||||
<title>jQuery plugin: Tablesorter 2.0 - Dealing with markup inside cells</title>
|
||||
|
||||
<!-- jQuery -->
|
||||
<script type="text/javascript" src="js/jquery-latest.js"></script>
|
||||
|
||||
<!-- Demo stuff -->
|
||||
<link rel="stylesheet" href="css/jq.css" type="text/css" media="print, projection, screen" />
|
||||
<script type="text/javascript" src="js/chili/chili-1.8b.js"></script>
|
||||
<script type="text/javascript" src="js/docs.js"></script>
|
||||
<script type="text/javascript" src="js/examples.js"></script>
|
||||
|
||||
<!-- Tablesorter: required -->
|
||||
<link rel="stylesheet" href="../css/blue/style.css" type="text/css" media="print, projection, screen" />
|
||||
<script type="text/javascript" src="../js/jquery.tablesorter.js"></script>
|
||||
|
||||
<!-- Tablesorter: optional -->
|
||||
<script type="text/javascript" src="../addons/pager/jquery.tablesorter.pager.js"></script>
|
||||
<script type="text/javascript" src="../js/jquery.metadata.js"></script>
|
||||
|
||||
<script type="text/javascript" id="js">$(document).ready(function() {
|
||||
// call the tablesorter plugin
|
||||
$("table").tablesorter({
|
||||
// define a custom text extraction function
|
||||
textExtraction: function(node) {
|
||||
// extract data from markup and return it
|
||||
return node.childNodes[0].childNodes[0].innerHTML;
|
||||
}
|
||||
});
|
||||
}); </script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="banner">
|
||||
<h1>table<em>sorter</em></h1>
|
||||
<h2>Dealing with markup inside cells</h2>
|
||||
<h3>Flexible client-side table sorting</h3>
|
||||
<a href="index.html">Back to documentation</a>
|
||||
</div>
|
||||
<div id="main">
|
||||
<h1>Demo</h1>
|
||||
<div id="demo">
|
||||
<table cellspacing="1" class="tablesorter">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>First Name</th>
|
||||
<th>Last Name</th>
|
||||
<th>Age</th>
|
||||
<th>Total</th>
|
||||
<th>Discount</th>
|
||||
<th>Date</th>
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><strong><em>Peter</em></strong></td>
|
||||
<td><strong><em>Parker</em></strong></td>
|
||||
<td><strong><em>28</em></strong></td>
|
||||
<td><strong><em>$9.99</em></strong></td>
|
||||
<td><strong><em>20%</em></strong></td>
|
||||
<td><strong><em>Jul 6, 2006 8:14 AM</em></strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong><em>John</em></strong></td>
|
||||
<td><strong><em>Hood</em></strong></td>
|
||||
<td><strong><em>33</em></strong></td>
|
||||
<td><strong><em>$19.99</em></strong></td>
|
||||
<td><strong><em>25%</em></strong></td>
|
||||
<td><strong><em>Dec 10, 2002 5:14 AM</em></strong></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<h1>Javascript</h1>
|
||||
<div id="javascript">
|
||||
<pre class="javascript"></pre>
|
||||
</div>
|
||||
<h1>HTML</h1>
|
||||
<div id="html">
|
||||
<pre class="html"></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
119
docs/example-options-headers.html
Normal file
@ -0,0 +1,119 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-us">
|
||||
<head>
|
||||
<title>jQuery plugin: Tablesorter 2.0 - Disable headers using options</title>
|
||||
|
||||
<!-- jQuery -->
|
||||
<script type="text/javascript" src="js/jquery-latest.js"></script>
|
||||
|
||||
<!-- Demo stuff -->
|
||||
<link rel="stylesheet" href="css/jq.css" type="text/css" media="print, projection, screen" />
|
||||
<script type="text/javascript" src="js/chili/chili-1.8b.js"></script>
|
||||
<script type="text/javascript" src="js/docs.js"></script>
|
||||
<script type="text/javascript" src="js/examples.js"></script>
|
||||
|
||||
<!-- Tablesorter: required -->
|
||||
<link rel="stylesheet" href="../css/blue/style.css" type="text/css" media="print, projection, screen" />
|
||||
<script type="text/javascript" src="../js/jquery.tablesorter.js"></script>
|
||||
|
||||
<!-- Tablesorter: optional -->
|
||||
<script type="text/javascript" src="../addons/pager/jquery.tablesorter.pager.js"></script>
|
||||
<script type="text/javascript" src="../js/jquery.metadata.js"></script>
|
||||
|
||||
<script type="text/javascript" id="js">$(function(){
|
||||
$("table").tablesorter({
|
||||
// pass the headers argument and assing a object
|
||||
headers: {
|
||||
// assign the secound column (we start counting zero)
|
||||
1: {
|
||||
// disable it by setting the property sorter to false
|
||||
sorter: false
|
||||
},
|
||||
// assign the third column (we start counting zero)
|
||||
2: {
|
||||
// disable it by setting the property sorter to false
|
||||
sorter: false
|
||||
}
|
||||
}
|
||||
});
|
||||
});</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="banner">
|
||||
<h1>table<em>sorter</em></h1>
|
||||
<h2>Disable headers using options</h2>
|
||||
<h3>Flexible client-side table sorting</h3>
|
||||
<a href="index.html">Back to documentation</a>
|
||||
</div>
|
||||
<div id="main">
|
||||
<h1>Demo</h1>
|
||||
<div id="demo">
|
||||
<table cellspacing="1" class="tablesorter">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>First Name</th>
|
||||
<th>Last Name</th>
|
||||
<th>Age</th>
|
||||
<th>Total</th>
|
||||
<th>Discount</th>
|
||||
<th>Date</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Peter</td>
|
||||
<td>Parker</td>
|
||||
<td>28</td>
|
||||
<td>$9.99</td>
|
||||
<td>20%</td>
|
||||
<td>Jul 6, 2006 8:14 AM</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>John</td>
|
||||
<td>Hood</td>
|
||||
<td>33</td>
|
||||
<td>$19.99</td>
|
||||
<td>25%</td>
|
||||
<td>Dec 10, 2002 5:14 AM</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Clark</td>
|
||||
<td>Kent</td>
|
||||
<td>18</td>
|
||||
<td>$15.89</td>
|
||||
<td>44%</td>
|
||||
<td>Jan 12, 2003 11:14 AM</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Bruce</td>
|
||||
<td>Almighty</td>
|
||||
<td>45</td>
|
||||
<td>$153.19</td>
|
||||
<td>44%</td>
|
||||
<td>Jan 18, 2001 9:12 AM</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Bruce</td>
|
||||
<td>Evans</td>
|
||||
<td>22</td>
|
||||
<td>$13.19</td>
|
||||
<td>11%</td>
|
||||
<td>Jan 18, 2007 9:12 AM</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<h1>Javascript</h1>
|
||||
<div id="javascript">
|
||||
<pre class="javascript"></pre>
|
||||
</div>
|
||||
<h1>HTML</h1>
|
||||
<div id="html">
|
||||
<pre class="html"></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
306
docs/example-pager.html
Normal file
112
docs/example-parsers.html
Normal file
@ -0,0 +1,112 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-us">
|
||||
<head>
|
||||
<title>jQuery plugin: Tablesorter 2.0 - Writing custom parsers</title>
|
||||
|
||||
<!-- jQuery -->
|
||||
<script type="text/javascript" src="js/jquery-latest.js"></script>
|
||||
|
||||
<!-- Demo stuff -->
|
||||
<link rel="stylesheet" href="css/jq.css" type="text/css" media="print, projection, screen" />
|
||||
<script type="text/javascript" src="js/chili/chili-1.8b.js"></script>
|
||||
<script type="text/javascript" src="js/docs.js"></script>
|
||||
<script type="text/javascript" src="js/examples.js"></script>
|
||||
|
||||
<!-- Tablesorter: required -->
|
||||
<link rel="stylesheet" href="../css/blue/style.css" type="text/css" media="print, projection, screen" />
|
||||
<script type="text/javascript" src="../js/jquery.tablesorter.js"></script>
|
||||
<script type="text/javascript" src="../addons/pager/jquery.tablesorter.pager.js"></script>
|
||||
<script type="text/javascript" id="js">// add parser through the tablesorter addParser method
|
||||
$.tablesorter.addParser({
|
||||
// set a unique id
|
||||
id: 'grades',
|
||||
is: function(s) {
|
||||
// return false so this parser is not auto detected
|
||||
return false;
|
||||
},
|
||||
format: function(s) {
|
||||
// format your data for normalization
|
||||
return s.toLowerCase().replace(/good/,2).replace(/medium/,1).replace(/bad/,0);
|
||||
},
|
||||
// set type, either numeric or text
|
||||
type: 'numeric'
|
||||
});
|
||||
|
||||
$(function() {
|
||||
$("table").tablesorter({
|
||||
headers: {
|
||||
6: {
|
||||
sorter:'grades'
|
||||
}
|
||||
}
|
||||
});
|
||||
});</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="banner">
|
||||
<h1>table<em>sorter</em></h1>
|
||||
<h2>Writing custom parsers</h2>
|
||||
<h3>Flexible client-side table sorting</h3>
|
||||
<a href="index.html">Back to documentation</a>
|
||||
</div>
|
||||
<div id="main">
|
||||
<h1>Demo</h1>
|
||||
<div id="demo">
|
||||
|
||||
<table cellspacing="1" class="tablesorter">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Major</th>
|
||||
<th>Gender</th>
|
||||
<th>English</th>
|
||||
<th>Japanese</th>
|
||||
<th>Calculus</th>
|
||||
<th>Overall grades</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Student01</td>
|
||||
<td>Languages</td>
|
||||
<td>male</td>
|
||||
<td>80</td>
|
||||
<td>70</td>
|
||||
<td>75</td>
|
||||
<td>bad</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Student02</td>
|
||||
<td>Mathematics</td>
|
||||
<td>male</td>
|
||||
<td>90</td>
|
||||
<td>88</td>
|
||||
<td>100</td>
|
||||
<td>good</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Student03</td>
|
||||
<td>Languages</td>
|
||||
<td>female</td>
|
||||
<td>85</td>
|
||||
<td>95</td>
|
||||
<td>80</td>
|
||||
<td>medium</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<h1>Javascript</h1>
|
||||
<div id="javascript">
|
||||
<pre class="javascript"></pre>
|
||||
</div>
|
||||
<h1>HTML</h1>
|
||||
<div id="html">
|
||||
<pre class="html"></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
111
docs/example-trigger-sort.html
Normal file
@ -0,0 +1,111 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-us">
|
||||
<head>
|
||||
<title>jQuery plugin: Tablesorter 2.0 - Sort table using a link outside the table</title>
|
||||
|
||||
<!-- jQuery -->
|
||||
<script type="text/javascript" src="js/jquery-latest.js"></script>
|
||||
|
||||
<!-- Demo stuff -->
|
||||
<link rel="stylesheet" href="css/jq.css" type="text/css" media="print, projection, screen" />
|
||||
<script type="text/javascript" src="js/chili/chili-1.8b.js"></script>
|
||||
<script type="text/javascript" src="js/docs.js"></script>
|
||||
<script type="text/javascript" src="js/examples.js"></script>
|
||||
|
||||
<!-- Tablesorter: required -->
|
||||
<link rel="stylesheet" href="../css/blue/style.css" type="text/css" media="print, projection, screen" />
|
||||
<script type="text/javascript" src="../js/jquery.tablesorter.js"></script>
|
||||
<script type="text/javascript" src="../addons/pager/jquery.tablesorter.pager.js"></script>
|
||||
|
||||
<script type="text/javascript" id="js">$(function() {
|
||||
$("table").tablesorter();
|
||||
$("#trigger-link").click(function() {
|
||||
// set sorting column and direction, this will sort on the first and third column the column index starts at zero
|
||||
var sorting = [[0,0],[2,0]];
|
||||
// sort on the first column
|
||||
$("table").trigger("sorton",[sorting]);
|
||||
// return false to stop default link action
|
||||
return false;
|
||||
});
|
||||
});</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="banner">
|
||||
<h1>table<em>sorter</em></h1>
|
||||
<h2>Sort table using a link outside the table</h2>
|
||||
<h3>Flexible client-side table sorting</h3>
|
||||
<a href="index.html">Back to documentation</a>
|
||||
</div>
|
||||
<div id="main">
|
||||
<h1>Demo</h1>
|
||||
<div id="demo">
|
||||
<table cellspacing="1" class="tablesorter">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>First Name</th>
|
||||
<th>Last Name</th>
|
||||
<th>Age</th>
|
||||
<th>Total</th>
|
||||
<th>Discount</th>
|
||||
<th>Date</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Peter</td>
|
||||
<td>Parker</td>
|
||||
<td>28</td>
|
||||
<td>$9.99</td>
|
||||
<td>20%</td>
|
||||
<td>Jul 6, 2006 8:14 AM</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>John</td>
|
||||
<td>Hood</td>
|
||||
<td>33</td>
|
||||
<td>$19.99</td>
|
||||
<td>25%</td>
|
||||
<td>Dec 10, 2002 5:14 AM</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Clark</td>
|
||||
<td>Kent</td>
|
||||
<td>18</td>
|
||||
<td>$15.89</td>
|
||||
<td>44%</td>
|
||||
<td>Jan 12, 2003 11:14 AM</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Bruce</td>
|
||||
<td>Almighty</td>
|
||||
<td>45</td>
|
||||
<td>$153.19</td>
|
||||
<td>44%</td>
|
||||
<td>Jan 18, 2001 9:12 AM</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Bruce</td>
|
||||
<td>Evans</td>
|
||||
<td>22</td>
|
||||
<td>$13.19</td>
|
||||
<td>11%</td>
|
||||
<td>Jan 18, 2007 9:12 AM</td>
|
||||
</tr>
|
||||
</tbody></table>
|
||||
<a href="#" id="trigger-link">Sort first and third columns</a>
|
||||
</div>
|
||||
<br/>
|
||||
<br/>
|
||||
<h1>Javascript</h1>
|
||||
<div id="javascript">
|
||||
<pre class="javascript"></pre>
|
||||
</div>
|
||||
<h1>HTML</h1>
|
||||
<div id="html">
|
||||
<pre class="html"></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
1097
docs/example-triggers.html
Normal file
119
docs/example-update-cell.html
Normal file
@ -0,0 +1,119 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-us">
|
||||
<head>
|
||||
<title>jQuery plugin: Tablesorter 2.0 - Appending table data with ajax</title>
|
||||
|
||||
<!-- jQuery -->
|
||||
<script type="text/javascript" src="js/jquery-latest.js"></script>
|
||||
|
||||
<!-- Demo stuff -->
|
||||
<link rel="stylesheet" href="css/jq.css" type="text/css" media="print, projection, screen" />
|
||||
<script type="text/javascript" src="js/chili/chili-1.8b.js"></script>
|
||||
<script type="text/javascript" src="js/docs.js"></script>
|
||||
<script type="text/javascript" src="js/examples.js"></script>
|
||||
|
||||
<!-- Tablesorter: required -->
|
||||
<link rel="stylesheet" href="../css/blue/style.css" type="text/css" media="print, projection, screen" />
|
||||
<script type="text/javascript" src="../js/jquery.tablesorter.js"></script>
|
||||
|
||||
<script type="text/javascript" id="js">
|
||||
$(document).ready(function() {
|
||||
$("table").tablesorter();
|
||||
$("table tbody td.discount").click(function() {
|
||||
// randomize a number
|
||||
var discount = '$' + Math.round(Math.random() * Math.random() * 100) + '.' + Math.round(Math.random() * Math.random() * 100);
|
||||
$(this).text(discount);
|
||||
$("table").trigger("updateCell",[this]);
|
||||
// set sorting column and direction, this will sort on the first and third column
|
||||
var sorting = [[3,1]];
|
||||
// sort on the first column
|
||||
$("table").trigger("sorton",[sorting]);
|
||||
return false;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="banner">
|
||||
<h1>table<em>sorter</em></h1>
|
||||
<h2>Updating the table cache</h2>
|
||||
<h3>Flexible client-side table sorting</h3>
|
||||
<a href="index.html">Back to documentation</a>
|
||||
</div>
|
||||
<div id="main">
|
||||
<h1>Demo</h1>
|
||||
<div id="demo">
|
||||
<table cellspacing="1" class="tablesorter">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>First Name</th>
|
||||
<th>Last Name</th>
|
||||
<th>Age</th>
|
||||
<th>Total</th>
|
||||
<th>Discount</th>
|
||||
<th>Date</th>
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Peter</td>
|
||||
<td>Parker</td>
|
||||
<td>28</td>
|
||||
<td class="discount">$9.99</td>
|
||||
<td>20%</td>
|
||||
|
||||
<td>Jul 6, 2006 8:14 AM</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>John</td>
|
||||
<td>Hood</td>
|
||||
<td>33</td>
|
||||
<td class="discount">$19.99</td>
|
||||
<td>25%</td>
|
||||
|
||||
<td>Dec 10, 2002 5:14 AM</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Clark</td>
|
||||
<td>Kent</td>
|
||||
<td>18</td>
|
||||
<td class="discount">$15.89</td>
|
||||
<td>44%</td>
|
||||
<td>Jan 12, 2003 11:14 AM</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Bruce</td>
|
||||
<td>Almighty</td>
|
||||
<td>45</td>
|
||||
<td class="discount">$153.19</td>
|
||||
<td>44%</td>
|
||||
|
||||
<td>Jan 18, 2001 9:12 AM</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Bruce</td>
|
||||
<td>Evans</td>
|
||||
<td>22</td>
|
||||
<td class="discount">$13.19</td>
|
||||
<td>11%</td>
|
||||
<td>Jan 18, 2007 9:12 AM</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<br/>
|
||||
<br/>
|
||||
</div>
|
||||
<h1>Javascript</h1>
|
||||
<div id="javascript">
|
||||
<pre class="javascript"></pre>
|
||||
</div>
|
||||
<h1>HTML</h1>
|
||||
<div id="html">
|
||||
<pre class="html"></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
348
docs/example-widgets.html
Normal file
@ -0,0 +1,348 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-us">
|
||||
<head>
|
||||
<title>jQuery plugin: Tablesorter 2.0 - Writing custom widgets</title>
|
||||
|
||||
<!-- jQuery -->
|
||||
<script type="text/javascript" src="js/jquery-latest.js"></script>
|
||||
|
||||
<!-- Demo stuff -->
|
||||
<link rel="stylesheet" href="css/jq.css" type="text/css" media="print, projection, screen" />
|
||||
<script type="text/javascript" src="js/chili/chili-1.8b.js"></script>
|
||||
<script type="text/javascript" src="js/docs.js"></script>
|
||||
|
||||
<!-- Tablesorter: required -->
|
||||
<link rel="stylesheet" href="../css/blue/style.css" type="text/css" media="print, projection, screen" />
|
||||
<script type="text/javascript" src="../js/jquery.tablesorter.js"></script>
|
||||
<script type="text/javascript" src="../addons/pager/jquery.tablesorter.pager.js"></script>
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
// add new widget called repeatHeaders
|
||||
$.tablesorter.addWidget({
|
||||
// give the widget a id
|
||||
id: "repeatHeaders",
|
||||
// format is called when the on init and when a sorting has finished
|
||||
format: function(table) {
|
||||
// cache and collect all TH headers
|
||||
if(!this.headers) {
|
||||
var h = this.headers = [];
|
||||
$("thead th",table).each(function() {
|
||||
h.push(
|
||||
"<th>" + $(this).text() + "</th>"
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
// remove appended headers by classname.
|
||||
$("tr.repated-header",table).remove();
|
||||
|
||||
// loop all tr elements and insert a copy of the "headers"
|
||||
for(var i=0; i < table.tBodies[0].rows.length; i++) {
|
||||
// insert a copy of the table head every 10th row
|
||||
if((i%5) == 4) {
|
||||
$("tbody tr:eq(" + i + ")",table).before(
|
||||
$("<tr></tr>").addClass("repated-header").html(this.headers.join(""))
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// call the tablesorter plugin and assign widgets with id "zebra" (Default widget in the core) and the newly created "repeatHeaders"
|
||||
$("table").tablesorter({
|
||||
widgets: ['zebra','repeatHeaders']
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="banner">
|
||||
<h1>table<em>sorter</em></h1>
|
||||
<h2>Writing custom widgets</h2>
|
||||
<h3>Flexible client-side table sorting</h3>
|
||||
<a href="index.html">Back to documentation</a>
|
||||
</div>
|
||||
<div id="main">
|
||||
|
||||
<h1>Javascript</h1>
|
||||
<pre class="javascript">
|
||||
// add new widget called repeatHeaders
|
||||
$.tablesorter.addWidget({
|
||||
// give the widget a id
|
||||
id: "repeatHeaders",
|
||||
// format is called when the on init and when a sorting has finished
|
||||
format: function(table) {
|
||||
// cache and collect all TH headers
|
||||
if(!this.headers) {
|
||||
var h = this.headers = [];
|
||||
$("thead th",table).each(function() {
|
||||
h.push(
|
||||
"<th>" + $(this).text() + "</th>"
|
||||
);
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
// remove appended headers by classname.
|
||||
$("tr.repated-header",table).remove();
|
||||
|
||||
// loop all tr elements and insert a copy of the "headers"
|
||||
for(var i=0; i < table.tBodies[0].rows.length; i++) {
|
||||
// insert a copy of the table head every 10th row
|
||||
if((i%5) == 4) {
|
||||
$("tbody tr:eq(" + i + ")",table).before(
|
||||
$("<tr></tr>").html(this.headers.join(""))
|
||||
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// call the tablesorter plugin and assign widgets with id "zebra" (Default widget in the core) and the newly created "repeatHeaders"
|
||||
$("table").tablesorter({
|
||||
widgets: ['zebra','repeatHeaders']
|
||||
});
|
||||
</pre>
|
||||
|
||||
<h1>Demo</h1>
|
||||
<table cellspacing="1" class="tablesorter">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Major</th>
|
||||
<th>Sex</th>
|
||||
<th>English</th>
|
||||
<th>Japanese</th>
|
||||
<th>Calculus</th>
|
||||
<th>Geometry</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Major</th>
|
||||
<th>Sex</th>
|
||||
<th>English</th>
|
||||
<th>Japanese</th>
|
||||
<th>Calculus</th>
|
||||
<th>Geometry</th>
|
||||
</tr>
|
||||
</tfoot>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Student01</td>
|
||||
<td>Languages</td>
|
||||
<td>male</td>
|
||||
<td>80</td>
|
||||
<td>70</td>
|
||||
<td>75</td>
|
||||
<td>80</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Student02</td>
|
||||
<td>Mathematics</td>
|
||||
<td>male</td>
|
||||
<td>90</td>
|
||||
<td>88</td>
|
||||
<td>100</td>
|
||||
<td>90</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Student03</td>
|
||||
<td>Languages</td>
|
||||
<td>female</td>
|
||||
<td>85</td>
|
||||
<td>95</td>
|
||||
<td>80</td>
|
||||
<td>85</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Student04</td>
|
||||
<td>Languages</td>
|
||||
<td>male</td>
|
||||
<td>60</td>
|
||||
<td>55</td>
|
||||
<td>100</td>
|
||||
<td>100</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Student05</td>
|
||||
<td>Languages</td>
|
||||
<td>female</td>
|
||||
<td>68</td>
|
||||
<td>80</td>
|
||||
<td>95</td>
|
||||
<td>80</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Student06</td>
|
||||
<td>Mathematics</td>
|
||||
<td>male</td>
|
||||
<td>100</td>
|
||||
<td>99</td>
|
||||
<td>100</td>
|
||||
<td>90</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Student07</td>
|
||||
<td>Mathematics</td>
|
||||
<td>male</td>
|
||||
<td>85</td>
|
||||
<td>68</td>
|
||||
<td>90</td>
|
||||
<td>90</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Student08</td>
|
||||
<td>Languages</td>
|
||||
<td>male</td>
|
||||
<td>100</td>
|
||||
<td>90</td>
|
||||
<td>90</td>
|
||||
<td>85</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Student09</td>
|
||||
<td>Mathematics</td>
|
||||
<td>male</td>
|
||||
<td>80</td>
|
||||
<td>50</td>
|
||||
<td>65</td>
|
||||
<td>75</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Student10</td>
|
||||
<td>Languages</td>
|
||||
<td>male</td>
|
||||
<td>85</td>
|
||||
<td>100</td>
|
||||
<td>100</td>
|
||||
<td>90</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Student11</td>
|
||||
<td>Languages</td>
|
||||
<td>male</td>
|
||||
<td>86</td>
|
||||
<td>85</td>
|
||||
<td>100</td>
|
||||
<td>100</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Student12</td>
|
||||
<td>Mathematics</td>
|
||||
<td>female</td>
|
||||
<td>100</td>
|
||||
<td>75</td>
|
||||
<td>70</td>
|
||||
<td>85</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Student13</td>
|
||||
<td>Languages</td>
|
||||
<td>female</td>
|
||||
<td>100</td>
|
||||
<td>80</td>
|
||||
<td>100</td>
|
||||
<td>90</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Student14</td>
|
||||
<td>Languages</td>
|
||||
<td>female</td>
|
||||
<td>50</td>
|
||||
<td>45</td>
|
||||
<td>55</td>
|
||||
<td>90</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Student15</td>
|
||||
<td>Languages</td>
|
||||
<td>male</td>
|
||||
<td>95</td>
|
||||
<td>35</td>
|
||||
<td>100</td>
|
||||
<td>90</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Student16</td>
|
||||
<td>Languages</td>
|
||||
<td>female</td>
|
||||
<td>100</td>
|
||||
<td>50</td>
|
||||
<td>30</td>
|
||||
<td>70</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Student17</td>
|
||||
<td>Languages</td>
|
||||
<td>female</td>
|
||||
<td>80</td>
|
||||
<td>100</td>
|
||||
<td>55</td>
|
||||
<td>65</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Student18</td>
|
||||
<td>Mathematics</td>
|
||||
<td>male</td>
|
||||
<td>30</td>
|
||||
<td>49</td>
|
||||
<td>55</td>
|
||||
<td>75</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Student19</td>
|
||||
<td>Languages</td>
|
||||
<td>male</td>
|
||||
<td>68</td>
|
||||
<td>90</td>
|
||||
<td>88</td>
|
||||
<td>70</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Student20</td>
|
||||
<td>Mathematics</td>
|
||||
<td>male</td>
|
||||
<td>40</td>
|
||||
<td>45</td>
|
||||
<td>40</td>
|
||||
<td>80</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Student21</td>
|
||||
<td>Languages</td>
|
||||
<td>male</td>
|
||||
<td>50</td>
|
||||
<td>45</td>
|
||||
<td>100</td>
|
||||
<td>100</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Student22</td>
|
||||
<td>Mathematics</td>
|
||||
<td>male</td>
|
||||
<td>100</td>
|
||||
<td>99</td>
|
||||
<td>100</td>
|
||||
<td>90</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Student23</td>
|
||||
<td>Languages</td>
|
||||
<td>female</td>
|
||||
<td>85</td>
|
||||
<td>80</td>
|
||||
<td>80</td>
|
||||
<td>80</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
BIN
docs/img/external.png
Normal file
After Width: | Height: | Size: 165 B |
553
docs/index.html
Normal file
@ -0,0 +1,553 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-us">
|
||||
<head>
|
||||
<title>jQuery plugin: Tablesorter 2.0</title>
|
||||
|
||||
<!-- jQuery -->
|
||||
<script type="text/javascript" src="js/jquery-latest.js"></script>
|
||||
|
||||
<!-- Demo stuff -->
|
||||
<link rel="stylesheet" href="css/jq.css" type="text/css" media="print, projection, screen" />
|
||||
<script type="text/javascript" src="js/chili/chili-1.8b.js"></script>
|
||||
<script type="text/javascript" src="js/docs.js"></script>
|
||||
|
||||
<!-- Tablesorter: required -->
|
||||
<link rel="stylesheet" href="../css/blue/style.css" type="text/css" media="print, projection, screen" />
|
||||
<script type="text/javascript" src="../js/jquery.tablesorter.js"></script>
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
$("#tablesorter-demo").tablesorter({sortList:[[0,0],[2,1]], widgets: ['zebra']});
|
||||
$("#options").tablesorter({sortList: [[0,0]], headers: { 3:{sorter: false}, 4:{sorter: false}}});
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="banner">
|
||||
<h1>table<em>sorter</em></h1>
|
||||
<h2>Documentation</h2>
|
||||
<h3>Flexible client-side table sorting</h3>
|
||||
<a href="#"></a>
|
||||
</div>
|
||||
<div id="main">
|
||||
<div class="digg">
|
||||
</div>
|
||||
|
||||
<p>
|
||||
<strong>Author:</strong> <a class="external" href="http://lovepeacenukes.com">Christian Bach</a><br />
|
||||
<strong>Version:</strong> 2.0.6 (<a href="../changelog">changelog</a>)<br />
|
||||
<strong>Licence:</strong>
|
||||
Dual licensed under <a class="external" href="http://www.opensource.org/licenses/mit-license.php">MIT</a>
|
||||
or <a class="external" href="http://www.opensource.org/licenses/gpl-license.php">GPL</a> licenses.
|
||||
</p>
|
||||
|
||||
<p class="tip update">
|
||||
<em>Update!</em> New version!, and the tablesorter docs are now available in russian, head over to <a class="external" href="http://tablesorter.ru/docs/">tablesorter.ru</a>
|
||||
</p>
|
||||
|
||||
<p class="tip">
|
||||
<em>Helping out!</em> If you like tablesorter and you're feeling generous, take a look at my <a class="external" href="http://www.amazon.com/gp/registry/wishlist/3VAOWCL63NEA6/ref=wl_web/">Amazon Wish List</a> or make a donation.
|
||||
</p>
|
||||
|
||||
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
|
||||
<input type="hidden" name="cmd" value="_donations">
|
||||
<input type="hidden" name="business" value="christian.bach@polyester.se">
|
||||
<input type="hidden" name="lc" value="US">
|
||||
<input type="hidden" name="item_name" value="Tablesorter donation">
|
||||
<input type="hidden" name="no_note" value="0">
|
||||
<input type="hidden" name="currency_code" value="USD">
|
||||
<input type="hidden" name="bn" value="PP-DonationsBF:btn_donateCC_LG.gif:NonHostedGuest">
|
||||
<input type="image" src="https://www.paypal.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
|
||||
<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
|
||||
</form>
|
||||
|
||||
<p>Comments and love letters can be sent to: <span class="email">christian at tablesorter dot com</span>.</p>
|
||||
|
||||
<p> </p>
|
||||
|
||||
<!--
|
||||
<p class="tip">
|
||||
<em>Help!</em> keep tablesorter.com up and running. If you like tablesorter, have a couple of bucks over or just feel like it. Please donate.</p>
|
||||
</p>
|
||||
|
||||
<form name="_xclick" action="https://www.paypal.com/cgi-bin/webscr" method="post">
|
||||
<input type="hidden" name="cmd" value="_xclick">
|
||||
<input type="hidden" name="business" value="christian.bach@polyester.se">
|
||||
<input type="hidden" name="item_name" value="Tablesorter donation">
|
||||
<input type="hidden" name="currency_code" value="USD">
|
||||
<input type="hidden" name="amount" value="10.00">
|
||||
<input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-but04.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
|
||||
</form>
|
||||
-->
|
||||
|
||||
|
||||
|
||||
<a name="Contents"></a>
|
||||
<h1>Contents</h1>
|
||||
<ol>
|
||||
<li><a href="#Introduction">Introduction</a></li>
|
||||
<li><a href="#Demo">Demo</a></li>
|
||||
<li><a href="#Getting-Started">Getting started</a></li>
|
||||
|
||||
<li><a href="#Examples">Examples</a></li>
|
||||
|
||||
<li><a href="#Configuration">Configuration</a></li>
|
||||
<li><a href="#Download">Download</a></li>
|
||||
<li><a href="#Compatibility">Compatibility</a></li>
|
||||
<li><a href="#Support">Support</a></li>
|
||||
<li><a href="#Credits">Credits</a></li>
|
||||
</ol>
|
||||
|
||||
<a name="Introduction"></a>
|
||||
<h1>Introduction</h1>
|
||||
<p>
|
||||
tablesorter is a <a class="external" href="http://jquery.com">jQuery</a> plugin for turning a
|
||||
standard HTML table with THEAD and TBODY tags into a sortable table without page refreshes.
|
||||
tablesorter can successfully parse and sort many types of data including linked data in a cell.
|
||||
It has many useful features including:
|
||||
</p>
|
||||
|
||||
<ul>
|
||||
<li>Multi-column sorting</li>
|
||||
<li>Parsers for sorting text, URIs, integers, currency, floats, IP addresses, dates (ISO, long and short formats), time. <a href="example-parsers.html">Add your own easily</a></li>
|
||||
<!--
|
||||
<li>Support for ROWSPAN and COLSPAN on TH elements</li>
|
||||
-->
|
||||
<li>Support secondary "hidden" sorting (e.g., maintain alphabetical sort when sorting on other criteria)</li>
|
||||
<li>Extensibility via <a href="example-widgets.html">widget system</a></li>
|
||||
<li>Cross-browser: IE 6.0+, FF 2+, Safari 2.0+, Opera 9.0+</li>
|
||||
<li>Small code size</li>
|
||||
|
||||
</ul>
|
||||
|
||||
<a name="Demo"></a>
|
||||
<h1>Demo</h1>
|
||||
|
||||
<table id="tablesorter-demo" class="tablesorter" border="0" cellpadding="0" cellspacing="1">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>First Name</th>
|
||||
<th>Last Name</th>
|
||||
<th>Age</th>
|
||||
<th>Total</th>
|
||||
<th>Discount</th>
|
||||
<th>Difference</th>
|
||||
<th>Date</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Peter</td>
|
||||
<td>Parker</td>
|
||||
<td>28</td>
|
||||
<td>$9.99</td>
|
||||
<td>20.9%</td>
|
||||
<td>+12.1</td>
|
||||
<td>Jul 6, 2006 8:14 AM</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>John</td>
|
||||
<td>Hood</td>
|
||||
<td>33</td>
|
||||
<td>$19.99</td>
|
||||
<td>25%</td>
|
||||
<td>+12</td>
|
||||
<td>Dec 10, 2002 5:14 AM</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Clark</td>
|
||||
<td>Kent</td>
|
||||
<td>18</td>
|
||||
<td>$15.89</td>
|
||||
<td>44%</td>
|
||||
<td>-26</td>
|
||||
<td>Jan 12, 2003 11:14 AM</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Bruce</td>
|
||||
<td>Almighty</td>
|
||||
<td>45</td>
|
||||
<td>$153.19</td>
|
||||
<td>44.7%</td>
|
||||
<td>+77</td>
|
||||
<td>Jan 18, 2001 9:12 AM</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Bruce</td>
|
||||
<td>Evans</td>
|
||||
<td>22</td>
|
||||
<td>$13.19</td>
|
||||
<td>11%</td>
|
||||
<td>-100.9</td>
|
||||
<td>Jan 18, 2007 9:12 AM</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Bruce</td>
|
||||
<td>Evans</td>
|
||||
<td>22</td>
|
||||
<td>$13.19</td>
|
||||
<td>11%</td>
|
||||
<td>0</td>
|
||||
<td>Jan 18, 2007 9:12 AM</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<p class="tip">
|
||||
<em>TIP!</em> Sort multiple columns simultaneously by holding down the shift key and clicking a second, third or even fourth column header!
|
||||
</p>
|
||||
|
||||
|
||||
<a name="Getting-Started"></a>
|
||||
<h1>Getting started</h1>
|
||||
<p>
|
||||
To use the tablesorter plugin, include the <a class="external" href="http://jquery.com">jQuery</a>
|
||||
library and the tablesorter plugin inside the <code><head></code> tag
|
||||
of your HTML document:
|
||||
</p>
|
||||
|
||||
<pre class="javascript">
|
||||
<script type="text/javascript" src="/path/to/jquery-latest.js"></script>
|
||||
<script type="text/javascript" src="/path/to/jquery.tablesorter.js"></script>
|
||||
</pre>
|
||||
|
||||
|
||||
<p>tablesorter works on standard HTML tables. You must include THEAD and TBODY tags:</p>
|
||||
|
||||
<pre class="html">
|
||||
<table id="myTable" class="tablesorter">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Last Name</th>
|
||||
<th>First Name</th>
|
||||
<th>Email</th>
|
||||
<th>Due</th>
|
||||
<th>Web Site</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Smith</td>
|
||||
<td>John</td>
|
||||
<td>jsmith@gmail.com</td>
|
||||
<td>$50.00</td>
|
||||
<td>http://www.jsmith.com</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Bach</td>
|
||||
<td>Frank</td>
|
||||
<td>fbach@yahoo.com</td>
|
||||
<td>$50.00</td>
|
||||
<td>http://www.frank.com</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Doe</td>
|
||||
<td>Jason</td>
|
||||
<td>jdoe@hotmail.com</td>
|
||||
<td>$100.00</td>
|
||||
<td>http://www.jdoe.com</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Conway</td>
|
||||
<td>Tim</td>
|
||||
<td>tconway@earthlink.net</td>
|
||||
<td>$50.00</td>
|
||||
<td>http://www.timconway.com</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table></pre>
|
||||
|
||||
<p>Start by telling tablesorter to sort your table when the document is loaded:</p>
|
||||
|
||||
<pre class="javascript">
|
||||
$(function(){
|
||||
$("#myTable").tablesorter();
|
||||
});</pre>
|
||||
|
||||
<p>
|
||||
Click on the headers and you'll see that your table is now sortable! You can
|
||||
also pass in configuration options when you initialize the table. This tells
|
||||
tablesorter to sort on the first and second column in ascending order.
|
||||
</p>
|
||||
|
||||
<pre class="javascript">
|
||||
$(function(){
|
||||
$("#myTable").tablesorter( {sortList: [[0,0], [1,0]]} );
|
||||
});</pre>
|
||||
|
||||
<p class="tip">
|
||||
<em>NOTE!</em> tablesorter will auto-detect most data types including numbers, dates, ip-adresses for more information see <a href="#Examples">Examples</a>
|
||||
</p>
|
||||
|
||||
<a name="Examples"></a>
|
||||
<h1>Examples</h1>
|
||||
<p>
|
||||
These examples will show what's possible with tablesorter. You need Javascript enabled to
|
||||
run these samples, just like you and your users will need Javascript enabled to use tablesorter.
|
||||
</p>
|
||||
|
||||
<strong>Basic</strong>
|
||||
<ul>
|
||||
<li><a href="example-option-sort-list.html">Set a initial sorting order using options</a></li>
|
||||
<li><a href="example-option-digits.html">Dealing with digits!</a></li>
|
||||
<li><a href="example-options-headers.html">Disable header using options</a></li>
|
||||
<li><a href="example-trigger-sort.html">Sort table using a link outside the table</a></li>
|
||||
<li><a href="example-option-sort-force.html">Force a default sorting order</a></li>
|
||||
<li><a href="example-option-sort-key.html">Change the default multi-sorting key</a></li>
|
||||
<li><a href="example-option-sort-order.html">Direction of initial sort</a></li>
|
||||
</ul>
|
||||
<strong>Metadata - setting inline options</strong>
|
||||
<ul>
|
||||
<li><a href="example-meta-sort-list.html">Set a initial sorting order using metadata</a></li>
|
||||
<li><a href="example-meta-headers.html">Disable header using metadata</a></li>
|
||||
<li><a href="example-meta-parsers.html">Setting column parser using metadata</a></li>
|
||||
</ul>
|
||||
|
||||
<strong>Advanced</strong>
|
||||
<ul>
|
||||
<li><a href="example-triggers.html">Triggers sortEnd and sortStart(Displaying sorting progress)</a></li>
|
||||
<li><a href="example-ajax.html">Appending table data with ajax</a></li>
|
||||
<li><a href="example-empty-table.html">Initializing tablesorter on a empty table</a></li>
|
||||
<li><a href="example-update-cell.html">Update the table after cell content has changed</a></li>
|
||||
<li><a href="example-option-text-extraction.html">Dealing with markup inside cells</a></li>
|
||||
<li><a href="example-extending-defaults.html">Extending default options</a></li>
|
||||
<li><a href="example-option-debug.html">Enableing debug mode</a></li>
|
||||
<li><a href="example-parsers.html">Parser, writing your own</a></li>
|
||||
<li><a href="example-widgets.html">Widgets, writing your own</a></li>
|
||||
</ul>
|
||||
|
||||
<strong>Companion plugins</strong>
|
||||
<ul>
|
||||
<li><a href="example-pager.html">Pager plugin</a></li>
|
||||
</ul>
|
||||
|
||||
<a name="Configuration"></a>
|
||||
<h1>Configuration</h1>
|
||||
|
||||
<p>
|
||||
tablesorter has many options you can pass in at initialization to achieve different effects:
|
||||
</p>
|
||||
|
||||
<table id="options" class="tablesorter" border="0" cellpadding="0" cellspacing="1">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Property</th>
|
||||
<th>Type</th>
|
||||
<th>Default</th>
|
||||
<th>Description</th>
|
||||
<th>Link</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>sortList</td>
|
||||
<td>Array</td>
|
||||
<td>null</td>
|
||||
<td>An array of instructions for per-column sorting and direction in the format: <code>[[columnIndex, sortDirection], ... ]</code> where columnIndex is a zero-based index for your columns left-to-right and sortDirection is 0 for Ascending and 1 for Descending. A valid argument that sorts ascending first by column 1 and then column 2 looks like: <code>[[0,0],[1,0]]</code></td>
|
||||
<td><a href="example-option-sort-list.html">Example</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>sortInitialOrder</td>
|
||||
<td>String</td>
|
||||
<td>asc</td>
|
||||
<td>When clicking the header for the first time, the direction it sorts. Valid arguments are "asc" for Ascending or "desc" for Descending.</td>
|
||||
<td><a href="example-option-sort-order.html">Example</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>sortMultiSortKey</td>
|
||||
<td>String</td>
|
||||
<td>shiftKey</td>
|
||||
<td>The key used to select more than one column for multi-column sorting. Defaults to the shift key. Other options might be ctrlKey, altKey. <br/>Reference: <a class="external" href="http://developer.mozilla.org/en/docs/DOM:event#Properties">http://developer.mozilla.org/en/docs/DOM:event#Properties</a></td>
|
||||
<td><a href="example-option-sort-key.html">Example</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>textExtraction</td>
|
||||
<td>String Or Function</td>
|
||||
<td>simple</td>
|
||||
<td>
|
||||
Defines which method is used to extract data from a table cell for sorting.
|
||||
Built-in options include "simple" and "complex". Use complex if you have data marked up
|
||||
inside of a table cell like: <code><td><strong><em>123 Main Street</em></strong></td></code>.
|
||||
Complex can be slow in large tables so consider writing your own text extraction function "myTextExtraction" which you define like:
|
||||
<pre class="javascript">var myTextExtraction = function(node){
|
||||
// extract data from markup and return it
|
||||
return node.childNodes[0].childNodes[0].innerHTML;
|
||||
}
|
||||
$(function(){
|
||||
$("#myTable").tableSorter( {textExtraction: myTextExtraction} );
|
||||
});</pre>
|
||||
|
||||
tablesorter will pass a jQuery object containing the contents of the current cell for you to parse and return. Thanks to Josh Nathanson for the examples.
|
||||
</td>
|
||||
<td><a href="example-option-text-extraction.html">Example</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>headers</td>
|
||||
<td>Object</td>
|
||||
<td>null</td>
|
||||
<td>
|
||||
An object of instructions for per-column controls in the format: <code>headers: { 0: { option: setting }, ... }</code> For example, to disable
|
||||
sorting on the first two columns of a table: <code>headers: { 0: { sorter: false}, 1: {sorter: false} }</code>
|
||||
</td>
|
||||
<td><a href="example-options-headers.html">Example</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>sortForce</td>
|
||||
<td>Array</td>
|
||||
<td>null</td>
|
||||
<td>Use to add an additional forced sort that will be appended to the dynamic selections by the user. For example, can be used to sort people alphabetically after some other user-selected sort that results in rows with the same value like dates or money due. It can help prevent data from appearing as though it has a random secondary sort.</td>
|
||||
<td><a href="example-option-sort-force.html">Example</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>widthFixed</td>
|
||||
<td>Boolean</td>
|
||||
<td>false</td>
|
||||
<td>Indicates if tablesorter should apply fixed widths to the table columns. This is useful for the Pager companion. Requires the <a href="#Download-Addons">jQuery dimension plugin</a> to work.</a></td>
|
||||
<td><a href="example-pager.html">Example</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>cancelSelection</td>
|
||||
<td>Boolean</td>
|
||||
<td>true</td>
|
||||
<td>Indicates if tablesorter should disable selection of text in the table header (TH). Makes header behave more like a button.</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>cssHeader</td>
|
||||
<td>String</td>
|
||||
<td>"header"</td>
|
||||
<td>The CSS style used to style the header in its unsorted state. Example from the blue skin:
|
||||
<pre class="css">
|
||||
th.header {
|
||||
background-image: url(../img/small.gif);
|
||||
cursor: pointer;
|
||||
font-weight: bold;
|
||||
background-repeat: no-repeat;
|
||||
background-position: center left;
|
||||
padding-left: 20px;
|
||||
border-right: 1px solid #dad9c7;
|
||||
margin-left: -1px;
|
||||
}</pre>
|
||||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>cssAsc</td>
|
||||
<td>String</td>
|
||||
<td>"headerSortUp"</td>
|
||||
<td>The CSS style used to style the header when sorting ascending. Example from the blue skin:
|
||||
<pre class="css">
|
||||
th.headerSortUp {
|
||||
background-image: url(../img/small_asc.gif);
|
||||
background-color: #3399FF;
|
||||
}
|
||||
</pre>
|
||||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>cssDesc</td>
|
||||
<td>String</td>
|
||||
<td>"headerSortDown"</td>
|
||||
<td>The CSS style used to style the header when sorting descending. Example from the blue skin:
|
||||
<pre class="css">
|
||||
th.headerSortDown {
|
||||
background-image: url(../img/small_desc.gif);
|
||||
background-color: #3399FF;
|
||||
}
|
||||
</pre>
|
||||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>debug</td>
|
||||
<td>Boolean</td>
|
||||
<td>false</td>
|
||||
<td>
|
||||
Boolean flag indicating if tablesorter should display debuging information usefull for development.
|
||||
</td>
|
||||
<td><a href="example-option-debug.html">Example</a></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
<a name="Download"></a>
|
||||
<h1>Download</h1>
|
||||
|
||||
<p><strong>Full release</strong> - Plugin, Documentation, Add-ons, Themes <a href="http://github.com/Mottie/tablesorter/downloads">jquery.tablesorter.zip</a></p>
|
||||
|
||||
|
||||
<p><strong>Pick n choose</strong> - Place at least the required files in a directory on your webserver that is accessible to a web browser. Record this location.</p>
|
||||
|
||||
<strong id="Download-Required">Required:</strong>
|
||||
<ul>
|
||||
<li><a class="external" href="http://docs.jquery.com/Downloading_jQuery#Download_jQuery">jQuery</a> (1.2.1 or higher)</li>
|
||||
<li><a href="../js/jquery.tablesorter.min.js">jquery.tablesorter.min.js</a> (12kb, Minified for production - please put the file on your server)</li>
|
||||
</ul>
|
||||
|
||||
<strong id="Download-Addons">Optional/Add-Ons:</strong>
|
||||
<ul>
|
||||
<li><a class="external" href="http://plugins.jquery.com/files/jquery.metadata.2.1.zip">jQuery Metadata 2.1</a> (3,7kb <strong>Required for setting <a href="#Examples">inline options</a></strong>)</li>
|
||||
<!--
|
||||
<li><a class="external" href="http://dev.jquery.com/browser/trunk/plugins/dimensions/jquery.dimensions.
|
||||
.js?format=raw">jquery.dimensions.pack.js</a> (5,1kb, <a href="http://dean.edwards.name/packer/" class="external">packed</a>, for production. <strong>Required: for the <a href="example-pager.html">tablesorter pagination plugin</a></strong>)</li>
|
||||
-->
|
||||
<li><a href="../js/jquery.tablesorter.js">jquery.tablesorter.js</a> (17,7kb, for development)</li>
|
||||
<li><a href="../addons/pager/jquery.tablesorter.pager.js">jquery.tablesorter.pager.js</a> (3,6kb, <a href="example-pager.html">tablesorter pagination plugin</a>)</li>
|
||||
</ul>
|
||||
|
||||
<!--
|
||||
<strong id="Download-Widgets">Widgets:</strong>
|
||||
<ul>
|
||||
<li><a class="external" href="http://www.jdempster.com/category/code/jquery/tablesortercookiewidget/">Cookie Widget</a>, By <a class="external" href="http://www.jdempster.com/">James Dempster</a></li>
|
||||
</ul>
|
||||
-->
|
||||
|
||||
<strong id="Download-Themes">Themes:</strong>
|
||||
<ul>
|
||||
<li><a href="../css/green/green.zip">Green Skin</a> - Images and CSS styles for green themed headers</li>
|
||||
<li><a href="../css/blue/blue.zip">Blue Skin</a> - Images and CSS styles for blue themed headers (as seen in the examples)</li>
|
||||
</ul>
|
||||
|
||||
<a name="Compatibility"></a>
|
||||
<h1>Browser Compatibility</h1>
|
||||
|
||||
<p>tablesorter has been tested successfully in the following browsers with Javascript enabled:</p>
|
||||
<ul>
|
||||
<li>Firefox 2+</li>
|
||||
<li>Internet Explorer 6+</li>
|
||||
<li>Safari 2+</li>
|
||||
<li>Opera 9+</li>
|
||||
<li>Konqueror</li>
|
||||
</ul>
|
||||
|
||||
<p><a class="external" href="http://docs.jquery.com/Browser_Compatibility">jQuery Browser Compatibility</a></p>
|
||||
|
||||
<a name="Support"></a>
|
||||
<h1>Support</h1>
|
||||
<p>
|
||||
Support is available through the
|
||||
<a class="external" href="http://jquery.com/discuss/">jQuery Mailing List</a>.
|
||||
</p>
|
||||
<p>Access to the jQuery Mailing List is also available through <a class="external" href="http://www.nabble.com/JQuery-f15494.html">Nabble Forums</a>.</p>
|
||||
|
||||
|
||||
<a name="Credits"></a>
|
||||
<h1>Credits</h1>
|
||||
<p>
|
||||
Written by <a class="external" href="http://lovepeacenukes.com">Christian Bach</a>.
|
||||
</p>
|
||||
<p>
|
||||
Documentation written by <a class="external" href="http://www.ghidinelli.com">Brian Ghidinelli</a>,
|
||||
based on <a class="external" href="http://malsup.com/jquery/">Mike Alsup's</a> great documention.
|
||||
</p>
|
||||
<p>
|
||||
<a class="external" href="http://ejohn.org">John Resig</a> for the fantastic <a class="external" href="http://jquery.com">jQuery</a>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
392
docs/js/chili/chili-1.8b.js
Normal file
@ -0,0 +1,392 @@
|
||||
/*
|
||||
===============================================================================
|
||||
Chili is the jQuery code highlighter plugin
|
||||
...............................................................................
|
||||
Copyright 2007 / Andrea Ercolino
|
||||
-------------------------------------------------------------------------------
|
||||
LICENSE: http://www.opensource.org/licenses/mit-license.php
|
||||
WEBSITE: http://noteslog.com/chili/
|
||||
===============================================================================
|
||||
|
||||
===============================================================================
|
||||
Metaobjects is the jQuery metadata plugin on steroids
|
||||
...............................................................................
|
||||
Copyright 2007 / Andrea Ercolino
|
||||
-------------------------------------------------------------------------------
|
||||
LICENSE: http://www.opensource.org/licenses/mit-license.php
|
||||
WEBSITE: http://noteslog.com/metaobjects/
|
||||
===============================================================================
|
||||
*/
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
( function($) {
|
||||
|
||||
ChiliBook = { //implied global
|
||||
|
||||
version: "1.8b" // 2007-05-26
|
||||
|
||||
, automatic: true
|
||||
, automaticSelector: "code"
|
||||
|
||||
, codeLanguage: function( el ) {
|
||||
var recipeName = $( el ).attr( "class" );
|
||||
return recipeName ? recipeName : '';
|
||||
}
|
||||
|
||||
, metadataSelector: "object.chili" // use an empty string for not executing
|
||||
|
||||
, recipeLoading: true
|
||||
, recipeFolder: "" // used like: recipeFolder + recipeName + '.js'
|
||||
, stylesheetLoading: true
|
||||
, stylesheetFolder: "" // used like: stylesheetFolder + recipeName + '.css'
|
||||
|
||||
, defaultReplacement: '<span class="$0">$$</span>'
|
||||
|
||||
, replaceSpace: " " // use an empty string for not replacing
|
||||
, replaceTab: "    " // use an empty string for not replacing
|
||||
, replaceNewLine: " <br/>" // use an empty string for not replacing
|
||||
|
||||
, recipes: {} //repository
|
||||
, queue: {} //register
|
||||
|
||||
//fix for IE: copy of PREformatted text strips off all html, losing newlines
|
||||
, preFixCopy: document.selection && document.selection.createRange
|
||||
, preContent: ""
|
||||
, preElement: null
|
||||
};
|
||||
|
||||
|
||||
$.metaobjects = function( options ) {
|
||||
|
||||
options = $.extend( {
|
||||
context: document
|
||||
, clean: true
|
||||
, selector: 'object.metaobject'
|
||||
}, options );
|
||||
|
||||
function jsValue( value ) {
|
||||
eval( 'value = ' + value + ";" );
|
||||
return value;
|
||||
}
|
||||
|
||||
return $( options.selector, options.context )
|
||||
.each( function() {
|
||||
|
||||
var settings = { target: this.parentNode };
|
||||
$( '> param[@name=metaparam]', this )
|
||||
.each( function() {
|
||||
$.extend( settings, jsValue( this.value ) );
|
||||
} );
|
||||
|
||||
$( '> param', this )
|
||||
.not( '[@name=metaparam]' )
|
||||
.each( function() {
|
||||
var name = this.name, value = jsValue( this.value );
|
||||
$( settings.target )
|
||||
.each( function() {
|
||||
this[ name ] = value;
|
||||
} );
|
||||
} );
|
||||
|
||||
if( options.clean ) {
|
||||
$( this ).remove();
|
||||
}
|
||||
} );
|
||||
};
|
||||
|
||||
$.fn.chili = function( options ) {
|
||||
var book = $.extend( {}, ChiliBook, options || {} );
|
||||
|
||||
function cook( ingredients, recipe ) {
|
||||
|
||||
function prepareStep( stepName, step ) {
|
||||
var exp = ( typeof step.exp == "string" ) ? step.exp : step.exp.source;
|
||||
steps.push( {
|
||||
stepName: stepName
|
||||
, exp: "(" + exp + ")"
|
||||
, length: 1 // add 1 to account for the newly added parentheses
|
||||
+ (exp // count number of submatches in here
|
||||
.replace( /\\./g, "%" ) // disable any escaped character
|
||||
.replace( /\[.*?\]/g, "%" ) // disable any character class
|
||||
.match( /\((?!\?)/g ) // match any open parenthesis, not followed by a ?
|
||||
|| [] // make sure it is an empty array if there are no matches
|
||||
).length // get the number of matches
|
||||
, replacement: (step.replacement) ? step.replacement : book.defaultReplacement
|
||||
} );
|
||||
} // function prepareStep( stepName, step )
|
||||
|
||||
function knowHow() {
|
||||
var prevLength = 0;
|
||||
var exps = new Array;
|
||||
for (var i = 0; i < steps.length; i++) {
|
||||
var exp = steps[ i ].exp;
|
||||
// adjust backreferences
|
||||
exp = exp.replace( /\\\\|\\(\d+)/g, function( m, aNum ) {
|
||||
return !aNum ? m : "\\" + ( prevLength + 1 + parseInt( aNum, 10 ) );
|
||||
} );
|
||||
exps.push( exp );
|
||||
prevLength += steps[ i ].length;
|
||||
}
|
||||
var source = exps.join( "|" );
|
||||
return new RegExp( source, (recipe.ignoreCase) ? "gi" : "g" );
|
||||
} // function knowHow()
|
||||
|
||||
function escapeHTML( str ) {
|
||||
return str.replace( /&/g, "&" ).replace( /</g, "<" );
|
||||
} // function escapeHTML( str )
|
||||
|
||||
function replaceSpaces( str ) {
|
||||
return str.replace( / +/g, function( spaces ) {
|
||||
return spaces.replace( / /g, replaceSpace );
|
||||
} );
|
||||
} // function replaceSpaces( str )
|
||||
|
||||
function filter( str ) {
|
||||
str = escapeHTML( str );
|
||||
if( replaceSpace ) {
|
||||
str = replaceSpaces( str );
|
||||
}
|
||||
return str;
|
||||
} // function filter( str )
|
||||
|
||||
function chef( matched ) {
|
||||
var i = 0; // iterate steps
|
||||
var j = 1; // iterate chef's arguments
|
||||
var step;
|
||||
while( step = steps[ i++ ] ) {
|
||||
var aux = arguments; // this unmasks chef's arguments inside the next function
|
||||
if( aux[ j ] ) {
|
||||
var pattern = /(\\\$)|(?:\$\$)|(?:\$(\d+))/g;
|
||||
var replacement = step.replacement
|
||||
.replace( pattern, function( m, escaped, K ) {
|
||||
var bit = '';
|
||||
if( escaped ) { /* \$ */
|
||||
return "$";
|
||||
}
|
||||
else if( !K ) { /* $$ */
|
||||
return filter( aux[ j ] );
|
||||
}
|
||||
else if( K == "0" ) { /* $0 */
|
||||
return step.stepName;
|
||||
}
|
||||
else { /* $K */
|
||||
return filter( aux[ j + parseInt( K, 10 ) ] );
|
||||
}
|
||||
} );
|
||||
|
||||
var offset = arguments[ arguments.length - 2 ];
|
||||
var input = arguments[ arguments.length - 1 ];
|
||||
var unmatched = input.substring( lastIndex, offset );
|
||||
lastIndex = offset + matched.length; // lastIndex for the next call to chef
|
||||
|
||||
perfect += filter( unmatched ) + replacement; // use perfect for all the replacing
|
||||
return replacement;
|
||||
}
|
||||
else {
|
||||
j+= step.length;
|
||||
}
|
||||
}
|
||||
} // function chef( matched )
|
||||
|
||||
var replaceSpace = book.replaceSpace;
|
||||
var steps = new Array;
|
||||
for( var stepName in recipe.steps ) {
|
||||
prepareStep( stepName, recipe.steps[ stepName ] );
|
||||
}
|
||||
|
||||
var perfect = ""; //replace doesn't provide a handle to the ongoing partially replaced string
|
||||
var lastIndex = 0; //regexp.lastIndex is available after a string.match, but not in a string.replace
|
||||
ingredients.replace( knowHow(), chef );
|
||||
var lastUnmatched = ingredients.substring( lastIndex, ingredients.length );
|
||||
perfect += filter( lastUnmatched );
|
||||
|
||||
return perfect;
|
||||
|
||||
} // function cook( ingredients, recipe )
|
||||
|
||||
function checkCSS( stylesheetPath ) {
|
||||
if( ! book.queue[ stylesheetPath ] ) {
|
||||
var e = document.createElement( "link" );
|
||||
e.rel = "stylesheet";
|
||||
e.type = "text/css";
|
||||
e.href = stylesheetPath;
|
||||
document.getElementsByTagName( "head" )[0].appendChild( e );
|
||||
|
||||
book.queue[ stylesheetPath ] = true;
|
||||
}
|
||||
} // function checkCSS( recipeName )
|
||||
|
||||
function makeDish( el, recipePath ) {
|
||||
var recipe = book.recipes[ recipePath ];
|
||||
if( ! recipe ) {
|
||||
return;
|
||||
}
|
||||
var chunks = el && el.childNodes && el.childNodes.length;
|
||||
if( chunks && chunks > 1 ) {
|
||||
return;
|
||||
}
|
||||
var ingredients = el.childNodes[0] && el.childNodes[0].data;
|
||||
if( ! ingredients ) {
|
||||
return;
|
||||
}
|
||||
// hack for IE: \r is used instead of \n
|
||||
ingredients = ingredients.replace(/\r\n?/g, "\n");
|
||||
|
||||
var dish = cook( ingredients, recipe ); // all happens here
|
||||
|
||||
if( book.replaceTab ) {
|
||||
dish = dish.replace( /\t/g, book.replaceTab );
|
||||
}
|
||||
if( book.replaceNewLine ) {
|
||||
dish = dish.replace( /\n/g, book.replaceNewLine );
|
||||
}
|
||||
|
||||
$( el ).html( dish );
|
||||
if( ChiliBook.preFixCopy ) {
|
||||
$( el )
|
||||
.parents()
|
||||
.filter( "pre" )
|
||||
.bind( "mousedown", function() {
|
||||
ChiliBook.preElement = this;
|
||||
} )
|
||||
.bind( "mouseup", function() {
|
||||
if( ChiliBook.preElement == this ) {
|
||||
ChiliBook.preContent = document.selection.createRange().htmlText;
|
||||
}
|
||||
} )
|
||||
;
|
||||
}
|
||||
} // function makeDish( el )
|
||||
|
||||
function getPath( recipeName, options ) {
|
||||
var settingsDef = {
|
||||
recipeFolder: book.recipeFolder
|
||||
, recipeFile: recipeName + ".js"
|
||||
, stylesheetFolder: book.stylesheetFolder
|
||||
, stylesheetFile: recipeName + ".css"
|
||||
};
|
||||
var settings;
|
||||
if( options && typeof options == "object" ) {
|
||||
settings = $.extend( settingsDef, options );
|
||||
}
|
||||
else {
|
||||
settings = settingsDef;
|
||||
}
|
||||
return {
|
||||
recipe : settings.recipeFolder + settings.recipeFile
|
||||
, stylesheet: settings.stylesheetFolder + settings.stylesheetFile
|
||||
};
|
||||
} //function getPath( recipeName, options )
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// initializations
|
||||
if( book.metadataSelector ) {
|
||||
$.metaobjects( { context: this, selector: book.metadataSelector } );
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// the coloring starts here
|
||||
this
|
||||
.each( function() {
|
||||
var el = this;
|
||||
var recipeName = book.codeLanguage( el );
|
||||
if( '' != recipeName ) {
|
||||
var path = getPath( recipeName, el.chili );
|
||||
if( book.recipeLoading || el.chili ) {
|
||||
/* dynamic setups come here */
|
||||
if( ! book.queue[ path.recipe ] ) {
|
||||
/* this is a new recipe to download */
|
||||
try {
|
||||
book.queue[ path.recipe ] = [ el ];
|
||||
$.getJSON( path.recipe, function( recipeLoaded ) {
|
||||
recipeLoaded.path = path.recipe;
|
||||
book.recipes[ path.recipe ] = recipeLoaded;
|
||||
if( book.stylesheetLoading ) {
|
||||
checkCSS( path.stylesheet );
|
||||
}
|
||||
var q = book.queue[ path.recipe ];
|
||||
for( var i = 0, iTop = q.length; i < iTop; i++ ) {
|
||||
makeDish( q[ i ], path.recipe );
|
||||
}
|
||||
} );
|
||||
}
|
||||
catch( recipeNotAvailable ) {
|
||||
alert( "the recipe for '" + recipeName + "' was not found in '" + path.recipe + "'" );
|
||||
}
|
||||
}
|
||||
else {
|
||||
/* not a new recipe, so just enqueue this element */
|
||||
book.queue[ path.recipe ].push( el );
|
||||
}
|
||||
/* a recipe could have been already downloaded */
|
||||
makeDish( el, path.recipe );
|
||||
}
|
||||
else {
|
||||
/* static setups come here */
|
||||
makeDish( el, path.recipe );
|
||||
}
|
||||
}
|
||||
} );
|
||||
|
||||
return this;
|
||||
//-----------------------------------------------------------------------------
|
||||
};
|
||||
|
||||
//main
|
||||
$( function() {
|
||||
|
||||
if( ChiliBook.automatic ) {
|
||||
if( ChiliBook.elementPath ) {
|
||||
//preserve backward compatibility
|
||||
ChiliBook.automaticSelector = ChiliBook.elementPath;
|
||||
if( ChiliBook.elementClass ) {
|
||||
ChiliBook.codeLanguage = function ( el ) {
|
||||
var selectClass = new RegExp( "\\b" + ChiliBook.elementClass + "\\b", "gi" );
|
||||
var elClass = $( el ).attr( "class" );
|
||||
if( ! elClass ) {
|
||||
return '';
|
||||
}
|
||||
var recipeName = $.trim( elClass.replace( selectClass, "" ) );
|
||||
return recipeName;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
$( ChiliBook.automaticSelector ).chili();
|
||||
}
|
||||
|
||||
if( ChiliBook.preFixCopy ) {
|
||||
function preformatted( text ) {
|
||||
if( '' == text ) {
|
||||
return "";
|
||||
}
|
||||
do {
|
||||
var newline_flag = (new Date()).valueOf();
|
||||
}
|
||||
while( text.indexOf( newline_flag ) > -1 );
|
||||
text = text.replace( /\<br[^>]*?\>/ig, newline_flag );
|
||||
var el = document.createElement( '<pre>' );
|
||||
el.innerHTML = text;
|
||||
text = el.innerText.replace( new RegExp( newline_flag, "g" ), '\r\n' );
|
||||
return text;
|
||||
}
|
||||
|
||||
$( "body" )
|
||||
.bind( "copy", function() {
|
||||
if( '' != ChiliBook.preContent ) {
|
||||
window.clipboardData.setData( 'Text', preformatted( ChiliBook.preContent ) );
|
||||
event.returnValue = false;
|
||||
}
|
||||
} )
|
||||
.bind( "mousedown", function() {
|
||||
ChiliBook.preContent = "";
|
||||
} )
|
||||
.bind( "mouseup", function() {
|
||||
ChiliBook.preElement = null;
|
||||
} )
|
||||
;
|
||||
}
|
||||
|
||||
} );
|
||||
|
||||
} ) ( jQuery );
|
1
docs/js/chili/chili-1.8b.pack.js
Normal file
18
docs/js/chili/cplusplus.css
Normal file
@ -0,0 +1,18 @@
|
||||
/*
|
||||
===============================================================================
|
||||
Chili is the jQuery code highlighter plugin
|
||||
...............................................................................
|
||||
Copyright 2007 / Andrea Ercolino
|
||||
-------------------------------------------------------------------------------
|
||||
LICENSE: http://www.opensource.org/licenses/mit-license.php
|
||||
WEBSITE: http://noteslog.com/chili/
|
||||
===============================================================================
|
||||
*/
|
||||
|
||||
.cplusplus .mlcom { color: #4040c2; }
|
||||
.cplusplus .com { color: green; }
|
||||
.cplusplus .string { color: teal; }
|
||||
.cplusplus .keyword { color: navy; font-weight: bold; }
|
||||
.cplusplus .datatype { color: blue; }
|
||||
.cplusplus .preproc { color: red; }
|
||||
.cplusplus .number { color: red; }
|
22
docs/js/chili/cplusplus.js
Normal file
@ -0,0 +1,22 @@
|
||||
/*
|
||||
===============================================================================
|
||||
Chili is the jQuery code highlighter plugin
|
||||
...............................................................................
|
||||
Copyright 2007 / Andrea Ercolino
|
||||
-------------------------------------------------------------------------------
|
||||
LICENSE: http://www.opensource.org/licenses/mit-license.php
|
||||
WEBSITE: http://noteslog.com/chili/
|
||||
===============================================================================
|
||||
*/
|
||||
|
||||
{
|
||||
steps: {
|
||||
mlcom : { exp: /\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\// }
|
||||
, com : { exp: /\/\/.*/ }
|
||||
, preproc : { exp: /[\^\n]\s*#\w+/ }
|
||||
, string : { exp: /(?:\'[^\'\\\n]*(?:\\.[^\'\\\n]*)*\')|(?:\"[^\"\\\n]*(?:\\.[^\"\\\n]*)*\")/ }
|
||||
, number : { exp: /\b[+-]?(?:\d*\.?\d+|\d+\.?\d*)(?:[eE][+-]?\d+)?\b/ }
|
||||
, datatype: { exp: /\b(?:ATOM|BOOL|BOOLEAN|BYTE|CHAR|COLORREF|DWORD|DWORD32|DWORD64|DWORDLONG|DWORD_PTR|FILE|FLOAT|HACCEL|HALF_PTR|HANDLE|HBITMAP|HBRUSH|HCOLORSPACE|HCONV|HCONVLIST|HCURSOR|HDC|HDDEDATA|HDESK|HDROP|HDWP|HENHMETAFILE|HFILE|HFONT|HGDIOBJ|HGLOBAL|HHOOK|HICON|HINSTANCE|HKEY|HKL|HLOCAL|HMENU|HMETAFILE|HMODULE|HMONITOR|HPALETTE|HPEN|HRESULT|HRGN|HRSRC|HSZ|HWINSTA|HWND|INT|INT32|INT64|INT_PTR|LANGID|LCID|LCTYPE|LGRPID|LONG|LONG32|LONG64|LONGLONG|LONG_PTR|LPARAM|LPBOOL|LPBYTE|LPCOLORREF|LPCSTR|LPCTSTR|LPCVOID|LPCWSTR|LPDWORD|LPHANDLE|LPINT|LPLONG|LPSTR|LPTSTR|LPVOID|LPWORD|LPWSTR|LRESULT|PBOOL|PBOOLEAN|PBYTE|PCHAR|PCSTR|PCTSTR|PCWSTR|PDWORD32|PDWORD64|PDWORDLONG|PDWORD_PTR|PFLOAT|PHALF_PTR|PHANDLE|PHKEY|PINT|PINT32|PINT64|PINT_PTR|PLCID|PLONG|PLONG32|PLONG64|PLONGLONG|PLONG_PTR|POINTER_32|POINTER_64|PSHORT|PSIZE_T|PSSIZE_T|PSTR|PTBYTE|PTCHAR|PTSTR|PUCHAR|PUHALF_PTR|PUINT|PUINT32|PUINT64|PUINT_PTR|PULONG|PULONG32|PULONG64|PULONGLONG|PULONG_PTR|PUSHORT|PVOID|PWCHAR|PWORD|PWSTR|SC_HANDLE|SC_LOCK|SERVICE_STATUS_HANDLE|SHORT|SIZE_T|SSIZE_T|TBYTE|TCHAR|UCHAR|UHALF_PTR|UINT|UINT32|UINT64|UINT_PTR|ULONG|ULONG32|ULONG64|ULONGLONG|ULONG_PTR|USHORT|USN|VOID|WCHAR|WORD|WPARAM|_EXCEPTION_POINTERS|_FPIEEE_RECORD|_HEAPINFO|_HFILE|_PNH|__finddata64_t|__int16|__int32|__int64|__int8|__stat64|__time64_t|__timeb64|__wchar_t|__wfinddata64_t|_complex|_dev_t|_diskfree_t|_exception|_finddata_t|_finddatai64_t|_off_t|_onexit_t|_purecall_handler|_stat|_stati64|_timeb|_utimbuf|_wfinddata_t|_wfinddatai64_t|bool|char|clock_t|div_t|double|float|fpos_t|int|intptr_t|jmp_buf|lconv|ldiv_t|long|mbstate_t|ptrdiff_t|short|sig_atomic_t|signed|size_t|terminate_function|time_t|tm|uintptr_t|va_list|wchar_t|wctrans_t|wctype_t|wint_t)\b/ }
|
||||
, keyword : { exp: /\b(?:__declspec|__exception|__finally|__try|break|case|catch|class|const|const_cast|continue|default|delete|deprecated|dllexport|dllimport|do|dynamic_cast|else|enum|explicit|extern|false|for|friend|goto|if|inline|mutable|naked|namespace|new|noinline|noreturn|nothrow|private|protected|public|register|reinterpret_cast|return|selectany|sizeof|static|static_cast|struct|switch|template|this|thread|throw|true|try|typedef|typeid|typename|union|using|uuid|virtual|void|volatile|whcar_t|while)\b/ }
|
||||
}
|
||||
}
|
17
docs/js/chili/csharp.css
Normal file
@ -0,0 +1,17 @@
|
||||
/*
|
||||
===============================================================================
|
||||
Chili is the jQuery code highlighter plugin
|
||||
...............................................................................
|
||||
Copyright 2007 / Andrea Ercolino
|
||||
-------------------------------------------------------------------------------
|
||||
LICENSE: http://www.opensource.org/licenses/mit-license.php
|
||||
WEBSITE: http://noteslog.com/chili/
|
||||
===============================================================================
|
||||
*/
|
||||
|
||||
.csharp .mlcom { color: #4040c2; }
|
||||
.csharp .com { color: green; }
|
||||
.csharp .string { color: teal; }
|
||||
.csharp .keyword { color: navy; font-weight: bold; }
|
||||
.csharp .preproc { color: red; }
|
||||
.csharp .number { color: red; }
|
21
docs/js/chili/csharp.js
Normal file
@ -0,0 +1,21 @@
|
||||
/*
|
||||
===============================================================================
|
||||
Chili is the jQuery code highlighter plugin
|
||||
...............................................................................
|
||||
Copyright 2007 / Andrea Ercolino
|
||||
-------------------------------------------------------------------------------
|
||||
LICENSE: http://www.opensource.org/licenses/mit-license.php
|
||||
WEBSITE: http://noteslog.com/chili/
|
||||
===============================================================================
|
||||
*/
|
||||
|
||||
{
|
||||
steps: {
|
||||
mlcom : { exp: /\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\// }
|
||||
, com : { exp: /\/\/.*/ }
|
||||
, string : { exp: /(?:\'[^\'\\\n]*(?:\\.[^\'\\\n]*)*\')|(?:\"[^\"\\\n]*(?:\\.[^\"\\\n]*)*\")/ }
|
||||
, preproc: { exp: /^\s*#.*/ }
|
||||
, number : { exp: /\b[+-]?(?:\d*\.?\d+|\d+\.?\d*)(?:[eE][+-]?\d+)?\b/ }
|
||||
, keyword: { exp: /\b(?:abstract|as|base|bool|break|byte|case|catch|char|checked|class|const|continue|decimal|default|delegate|do|double|else|enum|event|explicit|extern|false|finally|fixed|float|for|foreach|get|goto|if|implicit|in|int|interface|internal|is|lock|long|namespace|new|null|object|operator|out|override|params|private|protected|public|readonly|ref|return|sbyte|sealed|set|short|sizeof|stackalloc|static|string|struct|switch|this|throw|true|try|typeof|uint|ulong|unchecked|unsafe|ushort|using|virtual|void|while)\b/ }
|
||||
}
|
||||
}
|
17
docs/js/chili/css.css
Normal file
@ -0,0 +1,17 @@
|
||||
/*
|
||||
===============================================================================
|
||||
Chili is the jQuery code highlighter plugin
|
||||
...............................................................................
|
||||
Copyright 2007 / Andrea Ercolino
|
||||
-------------------------------------------------------------------------------
|
||||
LICENSE: http://www.opensource.org/licenses/mit-license.php
|
||||
WEBSITE: http://noteslog.com/chili/
|
||||
===============================================================================
|
||||
*/
|
||||
|
||||
.css .mlcom { color: #4040c2; }
|
||||
.css .color { color: green; }
|
||||
.css .string { color: teal; }
|
||||
.css .attrib { color: navy; font-weight: bold; }
|
||||
.css .value { color: blue; }
|
||||
.css .number { color: red; }
|
21
docs/js/chili/css.js
Normal file
@ -0,0 +1,21 @@
|
||||
/*
|
||||
===============================================================================
|
||||
Chili is the jQuery code highlighter plugin
|
||||
...............................................................................
|
||||
Copyright 2007 / Andrea Ercolino
|
||||
-------------------------------------------------------------------------------
|
||||
LICENSE: http://www.opensource.org/licenses/mit-license.php
|
||||
WEBSITE: http://noteslog.com/chili/
|
||||
===============================================================================
|
||||
*/
|
||||
|
||||
{
|
||||
steps: {
|
||||
mlcom : { exp: /\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\// }
|
||||
, string: { exp: /(?:\'[^\'\\\n]*(?:\\.[^\'\\\n]*)*\')|(?:\"[^\"\\\n]*(?:\\.[^\"\\\n]*)*\")/ }
|
||||
, number: { exp: /(?:\b[+-]?(?:\d*\.?\d+|\d+\.?\d*))(?:%|(?:(?:px|pt|em|)\b))/ }
|
||||
, attrib: { exp: /\b(?:z-index|x-height|word-spacing|widths|width|widows|white-space|volume|voice-family|visibility|vertical-align|units-per-em|unicode-range|unicode-bidi|text-transform|text-shadow|text-indent|text-decoration|text-align|table-layout|stress|stemv|stemh|src|speech-rate|speak-punctuation|speak-numeral|speak-header|speak|slope|size|right|richness|quotes|position|play-during|pitch-range|pitch|pause-before|pause-after|pause|page-break-inside|page-break-before|page-break-after|page|padding-top|padding-right|padding-left|padding-bottom|padding|overflow|outline-width|outline-style|outline-color|outline|orphans|min-width|min-height|max-width|max-height|mathline|marks|marker-offset|margin-top|margin-right|margin-left|margin-bottom|margin|list-style-type|list-style-position|list-style-image|list-style|line-height|letter-spacing|height|font-weight|font-variant|font-style|font-stretch|font-size-adjust|font-size|font-family|font|float|empty-cells|elevation|display|direction|descent|definition-src|cursor|cue-before|cue-after|cue|counter-reset|counter-increment|content|color|clip|clear|centerline|caption-side|cap-height|bottom|border-width|border-top-width|border-top-style|border-top-color|border-top|border-style|border-spacing|border-right-width|border-right-style|border-right-color|border-right|border-left-width|border-left-style|border-left-color|border-left|border-color|border-collapse|border-bottom-width|border-bottom-style|border-bottom-color|border-bottom|border|bbox|baseline|background-repeat|background-position|background-image|background-color|background-attachment|background|azimuth|ascent)\b/ }
|
||||
, value : { exp: /\b(?:xx-small|xx-large|x-soft|x-small|x-slow|x-low|x-loud|x-large|x-high|x-fast|wider|wait|w-resize|visible|url|uppercase|upper-roman|upper-latin|upper-alpha|underline|ultra-expanded|ultra-condensed|tv|tty|transparent|top|thin|thick|text-top|text-bottom|table-row-group|table-row|table-header-group|table-footer-group|table-column-group|table-column|table-cell|table-caption|sw-resize|super|sub|status-bar|static|square|spell-out|speech|solid|soft|smaller|small-caption|small-caps|small|slower|slow|silent|show|separate|semi-expanded|semi-condensed|se-resize|scroll|screen|s-resize|run-in|rtl|rightwards|right-side|right|ridge|rgb|repeat-y|repeat-x|repeat|relative|projection|print|pre|portrait|pointer|overline|outside|outset|open-quote|once|oblique|nw-resize|nowrap|normal|none|no-repeat|no-open-quote|no-close-quote|ne-resize|narrower|n-resize|move|mix|middle|message-box|medium|marker|ltr|lowercase|lower-roman|lower-latin|lower-greek|lower-alpha|lower|low|loud|local|list-item|line-through|lighter|level|leftwards|left-side|left|larger|large|landscape|justify|italic|invert|inside|inset|inline-table|inline|icon|higher|high|hide|hidden|help|hebrew|handheld|groove|format|fixed|faster|fast|far-right|far-left|fantasy|extra-expanded|extra-condensed|expanded|embossed|embed|e-resize|double|dotted|disc|digits|default|decimal-leading-zero|decimal|dashed|cursive|crosshair|cross|crop|counters|counter|continuous|condensed|compact|collapse|code|close-quote|circle|center-right|center-left|center|caption|capitalize|braille|bottom|both|bolder|bold|block|blink|bidi-override|below|behind|baseline|avoid|auto|aural|attr|armenian|always|all|absolute|above)\b/ }
|
||||
, color : { exp: /(?:\#[a-zA-Z0-9]{3,6})|(?:yellow|white|teal|silver|red|purple|olive|navy|maroon|lime|green|gray|fuchsia|blue|black|aqua)/ }
|
||||
}
|
||||
}
|
17
docs/js/chili/delphi.css
Normal file
@ -0,0 +1,17 @@
|
||||
/*
|
||||
===============================================================================
|
||||
Chili is the jQuery code highlighter plugin
|
||||
...............................................................................
|
||||
Copyright 2007 / Andrea Ercolino
|
||||
-------------------------------------------------------------------------------
|
||||
LICENSE: http://www.opensource.org/licenses/mit-license.php
|
||||
WEBSITE: http://noteslog.com/chili/
|
||||
===============================================================================
|
||||
*/
|
||||
|
||||
.delphi .mlcom { color: #4040c2; }
|
||||
.delphi .com { color: green; }
|
||||
.delphi .string { color: teal; }
|
||||
.delphi .keyword { color: navy; font-weight: bold; }
|
||||
.delphi .direct { color: red; }
|
||||
.delphi .number { color: red; }
|
21
docs/js/chili/delphi.js
Normal file
@ -0,0 +1,21 @@
|
||||
/*
|
||||
===============================================================================
|
||||
Chili is the jQuery code highlighter plugin
|
||||
...............................................................................
|
||||
Copyright 2007 / Andrea Ercolino
|
||||
-------------------------------------------------------------------------------
|
||||
LICENSE: http://www.opensource.org/licenses/mit-license.php
|
||||
WEBSITE: http://noteslog.com/chili/
|
||||
===============================================================================
|
||||
*/
|
||||
|
||||
{
|
||||
steps: {
|
||||
mlcom : { exp: /(?:\(\*[\s\S]*?\*\))|(?:{(?!\$)[\s\S]*?})/ }
|
||||
, com : { exp: /\/\/.*/ }
|
||||
, string : { exp: /(?:\'[^\'\\\n]*(?:\\.[^\'\\\n]*)*\')/ }
|
||||
, number : { exp: /(?:\b[+-]?(?:\d*\.?\d+|\d+\.?\d*)(?:[eE][+-]?\d+)?\b)|(?:\$[a-zA-Z0-9]+\b)/ }
|
||||
, direct : { exp: /\{\$[a-zA-Z]+ .+\}/ }
|
||||
, keyword: { exp: /\b(?:abs|addr|and|ansichar|ansistring|array|as|asm|begin|boolean|byte|cardinal|case|char|class|comp|const|constructor|currency|destructor|div|do|double|downto|else|end|except|exports|extended|false|file|finalization|finally|for|function|goto|if|implementation|in|inherited|initialization|int64|integer|interface|is|label|library|longint|longword|mod|nil|not|object|of|on|or|packed|pansichar|pansistring|pchar|pcurrency|pdatetime|pextended|pint64|pointer|private|procedure|program|property|protected|pshortstring|pstring|public|published|pvariant|pwidechar|pwidestring|raise|real|real48|record|repeat|set|shl|shortint|shortstring|shr|single|smallint|string|then|threadvar|to|true|try|type|unit|until|uses|val|var|varirnt|while|widechar|widestring|with|word|write|writeln|xor)\b/ }
|
||||
}
|
||||
}
|
17
docs/js/chili/html.css
Normal file
@ -0,0 +1,17 @@
|
||||
/*
|
||||
===============================================================================
|
||||
Chili is the jQuery code highlighter plugin
|
||||
...............................................................................
|
||||
Copyright 2007 / Andrea Ercolino
|
||||
-------------------------------------------------------------------------------
|
||||
LICENSE: http://www.opensource.org/licenses/mit-license.php
|
||||
WEBSITE: http://noteslog.com/chili/
|
||||
===============================================================================
|
||||
*/
|
||||
|
||||
.html .php { color: red; font-weight: bold; }
|
||||
.html .tag { color: navy; font-weight: bold; }
|
||||
.html .aname { color: purple; }
|
||||
.html .avalue { color: fuchsia; }
|
||||
.html .mlcom { color: green; }
|
||||
.html .entity { color: teal; }
|
23
docs/js/chili/html.js
Normal file
@ -0,0 +1,23 @@
|
||||
/*
|
||||
===============================================================================
|
||||
Chili is the jQuery code highlighter plugin
|
||||
...............................................................................
|
||||
Copyright 2007 / Andrea Ercolino
|
||||
-------------------------------------------------------------------------------
|
||||
LICENSE: http://www.opensource.org/licenses/mit-license.php
|
||||
WEBSITE: http://noteslog.com/chili/
|
||||
===============================================================================
|
||||
*/
|
||||
|
||||
{
|
||||
steps: {
|
||||
mlcom : { exp: /\<!--(?:.|\n)*?--\>/ }
|
||||
, tag : { exp: /(?:\<\!?[\w:]+)|(?:\>)|(?:\<\/[\w:]+\>)|(?:\/\>)/ }
|
||||
, php : { exp: /(?:\<\?php\s)|(?:\<\?)|(?:\?\>)/ }
|
||||
, aname : { exp: /\s+?[\w-]+:?\w+(?=\s*=)/ }
|
||||
, avalue: {
|
||||
exp: /(=\s*)(([\"\'])(?:(?:[^\3\\]*?(?:\3\3|\\.))*?[^\3\\]*?)\3)/
|
||||
, replacement: '$1<span class="$0">$2</span>' }
|
||||
, entity: { exp: /&[\w#]+?;/ }
|
||||
}
|
||||
}
|
17
docs/js/chili/java.css
Normal file
@ -0,0 +1,17 @@
|
||||
/*
|
||||
===============================================================================
|
||||
Chili is the jQuery code highlighter plugin
|
||||
...............................................................................
|
||||
Copyright 2007 / Andrea Ercolino
|
||||
-------------------------------------------------------------------------------
|
||||
LICENSE: http://www.opensource.org/licenses/mit-license.php
|
||||
WEBSITE: http://noteslog.com/chili/
|
||||
===============================================================================
|
||||
*/
|
||||
|
||||
.java .mlcom { color: #4040c2; }
|
||||
.java .com { color: green; }
|
||||
.java .string { color: teal; }
|
||||
.java .meta { color: red; }
|
||||
.java .keyword { color: navy; font-weight: bold; }
|
||||
.java .number { color: red; }
|
21
docs/js/chili/java.js
Normal file
@ -0,0 +1,21 @@
|
||||
/*
|
||||
===============================================================================
|
||||
Chili is the jQuery code highlighter plugin
|
||||
...............................................................................
|
||||
Copyright 2007 / Andrea Ercolino
|
||||
-------------------------------------------------------------------------------
|
||||
LICENSE: http://www.opensource.org/licenses/mit-license.php
|
||||
WEBSITE: http://noteslog.com/chili/
|
||||
===============================================================================
|
||||
*/
|
||||
|
||||
{
|
||||
steps: {
|
||||
mlcom : { exp: /\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\// }
|
||||
, com : { exp: /\/\/.*/ }
|
||||
, string : { exp: /(?:\'[^\'\\\n]*(?:\\.[^\'\\\n]*)*\')|(?:\"[^\"\\\n]*(?:\\.[^\"\\\n]*)*\")/ }
|
||||
, number : { exp: /(?:\b[+-]?(?:\d*\.?\d+|\d+\.?\d*)(?:[eE][+-]?\d+)?\b)|(?:0x[a-f0-9]+)\b/ }
|
||||
, meta : { exp: /(?!\@interface\b)\@[\$\w]+\b/ }
|
||||
, keyword: { exp: /\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|extends|false|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|native|new|null|package|private|protected|public|return|short|static|strictfp|super|switch|synchronized|this|throw|throws|transient|true|try|void|volatile|while)\b/ }
|
||||
}
|
||||
}
|
18
docs/js/chili/javascript.css
Normal file
@ -0,0 +1,18 @@
|
||||
/*
|
||||
===============================================================================
|
||||
Chili is the jQuery code highlighter plugin
|
||||
...............................................................................
|
||||
Copyright 2007 / Andrea Ercolino
|
||||
-------------------------------------------------------------------------------
|
||||
LICENSE: http://www.opensource.org/licenses/mit-license.php
|
||||
WEBSITE: http://noteslog.com/chili/
|
||||
===============================================================================
|
||||
*/
|
||||
|
||||
.javascript .mlcom { color: #4040c2; }
|
||||
.javascript .com { color: green; }
|
||||
.javascript .regexp { color: maroon; }
|
||||
.javascript .string { color: teal; }
|
||||
.javascript .keywords { color: navy; font-weight: bold; }
|
||||
.javascript .global { color: blue; }
|
||||
.javascript .numbers { color: red; }
|
22
docs/js/chili/javascript.js
Normal file
@ -0,0 +1,22 @@
|
||||
/*
|
||||
===============================================================================
|
||||
Chili is the jQuery code highlighter plugin
|
||||
...............................................................................
|
||||
Copyright 2007 / Andrea Ercolino
|
||||
-------------------------------------------------------------------------------
|
||||
LICENSE: http://www.opensource.org/licenses/mit-license.php
|
||||
WEBSITE: http://noteslog.com/chili/
|
||||
===============================================================================
|
||||
*/
|
||||
|
||||
{
|
||||
steps: {
|
||||
mlcom : { exp: /\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\// }
|
||||
, com : { exp: /\/\/.*/ }
|
||||
, regexp : { exp: /\/[^\/\\\n]*(?:\\.[^\/\\\n]*)*\/[gim]*/ }
|
||||
, string : { exp: /(?:\'[^\'\\\n]*(?:\\.[^\'\\\n]*)*\')|(?:\"[^\"\\\n]*(?:\\.[^\"\\\n]*)*\")/ }
|
||||
, numbers : { exp: /\b[+-]?(?:\d*\.?\d+|\d+\.?\d*)(?:[eE][+-]?\d+)?\b/ }
|
||||
, keywords: { exp: /\b(arguments|break|case|catch|continue|default|delete|do|else|false|for|function|if|in|instanceof|new|null|return|switch|this|true|try|typeof|var|void|while|with)\b/ }
|
||||
, global : { exp: /\b(toString|valueOf|window|self|element|prototype|constructor|document|escape|unescape|parseInt|parseFloat|setTimeout|clearTimeout|setInterval|clearInterval|NaN|isNaN|Infinity)\b/ }
|
||||
}
|
||||
}
|
30
docs/js/chili/js-jquery/javascript.css
Normal file
@ -0,0 +1,30 @@
|
||||
/*
|
||||
===============================================================================
|
||||
Chili is the jQuery code highlighter plugin
|
||||
...............................................................................
|
||||
Copyright 2007 / Andrea Ercolino
|
||||
-------------------------------------------------------------------------------
|
||||
LICENSE: http://www.opensource.org/licenses/mit-license.php
|
||||
WEBSITE: http://noteslog.com/chili/
|
||||
===============================================================================
|
||||
*/
|
||||
|
||||
.javascript .mlcom { color: #4040c2; }
|
||||
.javascript .com { color: green; }
|
||||
.javascript .regexp { color: maroon; }
|
||||
.javascript .string { color: teal; }
|
||||
.javascript .keywords { color: navy; font-weight: bold; }
|
||||
.javascript .global { color: blue; }
|
||||
.javascript .numbers { color: red; }
|
||||
|
||||
.javascript .jquery .object { color: red; font-weight: bold; }
|
||||
.javascript .jquery .private { background-color: #CCCC99; }
|
||||
.javascript .jquery .attributes { background-color: #CCCC00; }
|
||||
.javascript .jquery .traversing { background-color: #CCCC00; }
|
||||
.javascript .jquery .manipulation { background-color: #CCCC00; }
|
||||
.javascript .jquery .utilities { background-color: #CCCCFF; }
|
||||
.javascript .jquery .core { background-color: #7F7FFF; color: white; }
|
||||
.javascript .jquery .ajax { background-color: #7F7FFF; color: #FFD400; }
|
||||
.javascript .jquery .css { background-color: #999900; color: white; }
|
||||
.javascript .jquery .effects { background-color: #FFAA00; }
|
||||
.javascript .jquery .events { background-color: #FFD400; }
|
68
docs/js/chili/js-jquery/javascript.js
Normal file
@ -0,0 +1,68 @@
|
||||
/*
|
||||
===============================================================================
|
||||
Chili is the jQuery code highlighter plugin
|
||||
...............................................................................
|
||||
Copyright 2007 / Andrea Ercolino
|
||||
-------------------------------------------------------------------------------
|
||||
LICENSE: http://www.opensource.org/licenses/mit-license.php
|
||||
WEBSITE: http://noteslog.com/chili/
|
||||
===============================================================================
|
||||
*/
|
||||
|
||||
{
|
||||
steps:
|
||||
{
|
||||
mlcom : { exp: /\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\// }
|
||||
, com : { exp: /\/\/.*/ }
|
||||
, regexp : { exp: /\/[^\/\\\n]*(?:\\.[^\/\\\n]*)*\/[gim]*/ }
|
||||
, string : { exp: /(?:\'[^\'\\\n]*(?:\\.[^\'\\\n]*)*\')|(?:\"[^\"\\\n]*(?:\\.[^\"\\\n]*)*\")/ }
|
||||
, numbers : { exp: /\b[+-]?(?:\d*\.?\d+|\d+\.?\d*)(?:[eE][+-]?\d+)?\b/ }
|
||||
, keywords: { exp: /\b(arguments|break|case|catch|continue|default|delete|do|else|false|for|function|if|in|instanceof|new|null|return|switch|this|true|try|typeof|var|void|while|with)\b/ }
|
||||
, global : { exp: /\b(toString|valueOf|window|element|prototype|constructor|document|escape|unescape|parseInt|parseFloat|setTimeout|clearTimeout|setInterval|clearInterval|NaN|isNaN|Infinity)\b/ }
|
||||
|
||||
, "jquery utilities" : {
|
||||
exp : /(?:\$\.browser|\$\.each|\$\.extend|\$\.grep|\$\.map|\$\.merge|\$\.trim)\b/
|
||||
, replacement: '<span class="jquery" title="$0"><span class="global">$$</span></span>'
|
||||
}
|
||||
,"jquery private" : {
|
||||
exp : /(?:\$\.find|\$\.parents|\$\.sibling|\.domManip|\.eventTesting|\.extend|\.get|\.init|\.jquery|\.pushStack)\b/
|
||||
, replacement: '<span class="jquery" title="$0"><span class="private">$$</span></span>'
|
||||
}
|
||||
,"jquery ajax" : {
|
||||
exp : /(?:\$\.ajax|\$\.ajaxSetup|\$\.ajaxTimeout|\$\.get|\$\.getIfModified|\$\.getJSON|\$\.getScript|\$\.post|.ajaxComplete|.ajaxError|.ajaxSend|.ajaxStart|.ajaxStop|.ajaxSuccess|.load|.loadIfModified|.serialize)\b/
|
||||
, replacement: '<span class="jquery" title="$0"><span class="ajax">$$</span></span>'
|
||||
}
|
||||
, "jquery object" : {
|
||||
exp : /jQuery|\$(?=\W)/
|
||||
, replacement: '<span class="jquery" title="$0"><span class="object">$$</span></span>'
|
||||
}
|
||||
,"jquery core" : {
|
||||
exp : /\$\.extend|\$\.noConflict|\.(?:each|eq|get|gt|index|lt|size)\b/
|
||||
, replacement: '<span class="jquery" title="$0"><span class="core">$$</span></span>'
|
||||
}
|
||||
,"jquery css" : {
|
||||
exp : /\.(?:css|height|width)\b/
|
||||
, replacement: '<span class="jquery" title="$0"><span class="css">$$</span></span>'
|
||||
}
|
||||
,"jquery attributes" : {
|
||||
exp : /\.(?:addClass|attr|html|removeAttr|removeClass|text|toggleClass|val)\b/
|
||||
, replacement: '<span class="jquery" title="$0"><span class="attributes">$$</span></span>'
|
||||
}
|
||||
,"jquery traversing" : {
|
||||
exp : /\.(?:add|children|contains|end|filter|find|is|next|not|parent|parents|prev|siblings)\b/
|
||||
, replacement: '<span class="jquery" title="$0"><span class="traversing">$$</span></span>'
|
||||
}
|
||||
,"jquery manipulation": {
|
||||
exp : /\.(?:after|append|appendTo|before|clone|empty|insertAfter|insertBefore|prepend|prependTo|remove|wrap)\b/
|
||||
, replacement: '<span class="jquery" title="$0"><span class="manipulation">$$</span></span>'
|
||||
}
|
||||
,"jquery effects" : {
|
||||
exp : /\.(?:animate|fadeIn|fadeOut|fadeTo|hide|show|slideDown|slideToggle|slideUp|toggle)\b/
|
||||
, replacement: '<span class="jquery" title="$0"><span class="effects">$$</span></span>'
|
||||
}
|
||||
,"jquery events" : {
|
||||
exp : /\.(?:bind|blur|change|click|dblclick|error|focus|hover|keydown|keypress|keyup|load|mousedown|mousemove|mouseout|mouseover|mouseup|one|ready|resize|scroll|select|submit|toggle|trigger|unbind|unload)\b/
|
||||
, replacement: '<span class="jquery" title="$0"><span class="events">$$</span></span>'
|
||||
}
|
||||
}
|
||||
}
|
20
docs/js/chili/lotusscript.css
Normal file
@ -0,0 +1,20 @@
|
||||
/*
|
||||
===============================================================================
|
||||
Chili is the jQuery code highlighter plugin
|
||||
...............................................................................
|
||||
Copyright 2007 / Andrea Ercolino
|
||||
-------------------------------------------------------------------------------
|
||||
LICENSE: http://www.opensource.org/licenses/mit-license.php
|
||||
WEBSITE: http://noteslog.com/chili/
|
||||
===============================================================================
|
||||
*/
|
||||
|
||||
.lotusscript .mlcom { color: #4040c2; }
|
||||
.lotusscript .com { color: green; }
|
||||
.lotusscript .mlstr { color: red; }
|
||||
.lotusscript .str { color: teal; }
|
||||
.lotusscript .keyd { color: fuchsia; }
|
||||
.lotusscript .keyw { color: maroon; font-weight: bold; }
|
||||
.lotusscript .directive { color: #5f5f5f; }
|
||||
.lotusscript .notes { color: navy; }
|
||||
.lotusscript .notesui { color: purple; }
|
27
docs/js/chili/lotusscript.js
Normal file
@ -0,0 +1,27 @@
|
||||
/*
|
||||
===============================================================================
|
||||
Chili is the jQuery code highlighter plugin
|
||||
...............................................................................
|
||||
Copyright 2007 / Andrea Ercolino
|
||||
-------------------------------------------------------------------------------
|
||||
LICENSE: http://www.opensource.org/licenses/mit-license.php
|
||||
WEBSITE: http://noteslog.com/chili/
|
||||
===============================================================================
|
||||
*/
|
||||
|
||||
{
|
||||
ignoreCase: true
|
||||
, steps: {
|
||||
mlcom : { exp : /((?:^|\n)%REM\b.*)((?:.|\n)*?)(\n%END\s*REM\b.*)/
|
||||
,replacement: '<span class="directive">$1</span><span class="mlcom">$2</span><span class="directive">$3</span>'
|
||||
}
|
||||
, com : { exp : /(?:\'.*)|(?:\bREM\b.*)/ }
|
||||
, mlstr : { exp : /(?:\{[^}]*\})|(?:\|[^|]*\|)/ }
|
||||
, str : { exp : /(?:\"[^\"].*?\")|\"\"/ }
|
||||
, keyd : { exp : /\b(?:Bin|Chr|Command|Curdir|Curdrive|Date|Dir|Environ|Error|Format|Hex|Implode|Input|Inputb|Inputbox|Inputbp|Lcase|Left|Leftb|Leftbp|Leftc|Ltrim|Mid|Midb|Midbp|Midc|Oct|Right|Rightb|Rightbp|Rightc|Rtrim|Space|Str|String|Strleft|Strleftback|Strright|Strrightback|Strtoken|Time|Trim|Ucase|Uchr|Ustring)[$](?:\s)/ }
|
||||
, keyw : { exp : /\b(?:Abs|Access|Acos|Activateapp|Alias|And|Any|Appactivate|Append|Arrayappend|Arraygetindex|Arrayreplace|Arrayunique|As|Asc|Asin|Atn|Atn2|Base|Beep|Bin|Binary|Bind|Boolean|Byte|Byval|Call|Case|Cbool|Cbyte|Ccur|Cdat|Cdbl|Chdir|Chdrive|Chr|Cint|Class|Clng|Close|Codelock|Codelockcheck|Codeunlock|Command|Compare|Const|Cos|Createlock|Csng|Cstr|Curdir|Curdrive|Currency|Cvar|Cvdate|Datatype|Date|Datenumber|Dateserial|Datevalue|Day|Declare|Defbool|Defbyte|Defcur|Defdbl|Defint|Deflng|Defsng|Defstr|Defvar|Delete|Destroylock|Dim|Dir|Do|Doevents|Double|Else|Elseif|End|Environ|Eof|Eqv|Erase|Erl|Err|Error|Evaluate|Event|Execute|Exit|Exp|Explicit|False|Fileattr|Filecopy|Filedatetime|Filelen|Fix|For|Forall|Format|Fraction|Freefile|From|Fulltrim|Function|Get|Getattr|Getfileattr|Getthreadinfo|Gosub|Goto|Hex|Hour|If|Imesetmode|Imestatus|Imp|Implode|In|Input|Inputb|Inputbox|Inputbp|Instr|Instrb|Instrbp|Instrc|Int|Integer|Is|Isa|Isarray|Isdate|Iselement|Isempty|Islist|Isnull|Isnumeric|Isobject|Isscalar|Isunknown|Join|Kill|Lbound|Lcase|Left|Leftb|Leftbp|Leftc|Len|Lenb|Lenbp|Lenc|Let|Lib|Like|Line|List|Listtag|Lmbcs|Loc|Lock|Lof|Log|Long|Loop|Lset|Lsi_info|Lsserver|Ltrim|Me|Messagebox|Mid|Midb|Midbp|Midc|Minute|Mkdir|Mod|Month|Msgbox|Name|New|Next|Nocase|Nopitch|Not|Nothing|Now|Null|Oct|On|Open|Option|Or|Output|Pi|Pitch|Preserve|Print|Private|Property|Public|Published|Put|Random|Randomize|Read|Redim|Remove|Replace|Reset|Resume|Return|Right|Rightb|Rightbp|Rightc|Rmdir|Rnd|Round|Rset|Rtrim|Second|Seek|Select|Sendkeys|Set|Setattr|Setfileattr|Sgn|Shared|Shell|Sin|Single|Sleep|Space|Spc|Split|Sqr|Static|Step|Stop|Str|Strcomp|Strcompare|Strconv|String|Strleft|Strleftback|Strright|Strrightback|Strtoken|Sub|Tab|Tan|Text|Then|Time|Timenumber|Timer|Timeserial|Timevalue|To|Today|Trim|True|Type|Typename|Ubound|Ucase|Uchr|Uni|Unicode|Unlock|Until|Use|Uselsx|Ustring|Val|Variant|Vartype|Weekday|Wend|While|Width|With|Write|Xor|Year|Yield)\b/ }
|
||||
, directive: { exp : /((?:^|\n)(?:%else|%elseif|%end|%if)\b)|(?:(?:^|\n)%include\b.*)/ }
|
||||
, notes : { exp : /\b(?:NotesACL|NotesACLEntry|NotesAdministrationProcess|NotesAgent|NotesColorObject|NotesDatabase|NotesDateRange|NotesDateTime|NotesDbDirectory|NotesDocument|NotesDocumentCollection|NotesDOMAttributeNode|NotesDOMCDATASectionNode|NotesDOMCharacterDataNode|NotesDOMCommentNode|NotesDOMDocumentFragmentNode|NotesDOMDocumentNode|NotesDOMDocumentTypeNode|NotesDOMElementNode|NotesDOMEntityNode|NotesDOMEntityReferenceNode|NotesDOMNamedNodeMap|NotesDOMNode|NotesDOMNodeList|NotesDOMNotationNode|NotesDOMParser|NotesDOMProcessingInstructionNode|NotesDOMTextNode|NotesDOMXMLDeclNode|NotesDXLExporter|NotesDXLImporter|NotesEmbeddedObject|NotesForm|NotesInternational|NotesItem|NotesLog|NotesMIMEEntity|NotesMIMEHeader|NotesName|NotesNewsLetter|NotesNoteCollection|NotesOutline|NotesOutlineEntry|NotesRegistration|NotesReplication|NotesReplicationEntry|NotesRichTextDocLink|NotesRichTextItem|NotesRichTextNavigator|NotesRichTextParagraphStyle|NotesRichTextRange|NotesRichTextSection|NotesRichTextStyle|NotesRichTextTab|NotesRichTextTable|NotesSAXAttributeList|NotesSAXException|NotesSAXParser|NotesSession|NotesStream|NotesTimer|NotesView|NotesViewColumn|NotesViewEntry|NotesViewEntryCollection|NotesViewNavigator|NotesXMLProcessor|NotesXSLTransformer)\b/ }
|
||||
, notesui : { exp : /\b(?:Button|Field|Navigator|NotesUIDatabase|NotesUIDocument|NotesUIScheduler|NotesUIView|NotesUIWorkspace)\b/ }
|
||||
}
|
||||
}
|
22
docs/js/chili/mysql.css
Normal file
@ -0,0 +1,22 @@
|
||||
/*
|
||||
===============================================================================
|
||||
Chili is the jQuery code highlighter plugin
|
||||
...............................................................................
|
||||
Copyright 2007 / Andrea Ercolino
|
||||
-------------------------------------------------------------------------------
|
||||
LICENSE: http://www.opensource.org/licenses/mit-license.php
|
||||
WEBSITE: http://noteslog.com/chili/
|
||||
===============================================================================
|
||||
*/
|
||||
|
||||
.mysql .function { color: #e17100; }
|
||||
.mysql .keyword { color: navy; font-weight: bold; }
|
||||
.mysql .mlcom { color: gray; }
|
||||
.mysql .com { color: green; }
|
||||
.mysql .number { color: red; }
|
||||
.mysql .hexnum { color: red; font-weight: bold; }
|
||||
.mysql .string { color: purple; }
|
||||
.mysql .quid { color: fuchsia; }
|
||||
.mysql .id { color: maroon; }
|
||||
.mysql .value { color: gray; font-weight: bold; }
|
||||
.mysql .variable { color: #4040c2; }
|
32
docs/js/chili/mysql.js
Normal file
@ -0,0 +1,32 @@
|
||||
/*
|
||||
===============================================================================
|
||||
Chili is the jQuery code highlighter plugin
|
||||
...............................................................................
|
||||
Copyright 2007 / Andrea Ercolino
|
||||
-------------------------------------------------------------------------------
|
||||
LICENSE: http://www.opensource.org/licenses/mit-license.php
|
||||
WEBSITE: http://noteslog.com/chili/
|
||||
===============================================================================
|
||||
*/
|
||||
|
||||
{
|
||||
ignoreCase: true
|
||||
, steps: {
|
||||
mlcom : { exp: /\/\*[^*]*\*+([^\/][^*]*\*+)*\// }
|
||||
, com : { exp: /(?:--\s+.*)|(?:[^\\]\#.*)/ }
|
||||
, string : { exp: /([\"\'])(?:(?:[^\1\\\r\n]*?(?:\1\1|\\.))*[^\1\\\r\n]*?)\1/ }
|
||||
, quid : { exp: /(`)(?:(?:[^\1\\\r\n]*?(?:\1\1|\\.))*[^\1\\\r\n]*?)\1/ }
|
||||
, value : { exp: /\b(?:NULL|TRUE|FALSE)\b/ }
|
||||
, number : { exp: /\b[+-]?(\d*\.?\d+|\d+\.?\d*)([eE][+-]?\d+)?\b/ }
|
||||
, hexnum : { exp: /\b0[xX][\dA-Fa-f]+\b|\b[xX]([\'\"])[\dA-Fa-f]+\1/ }
|
||||
, op : { exp: /!=|&&|<|<<|<=|<=>|<>|=|>|>=|>>|\|\|/ }
|
||||
, variable : { exp: /@([$.\w]+|([`\"\'])(?:(?:[^\2\\\r\n]*?(?:\2\2|\\.))*[^\2\\\r\n]*?)\2)/
|
||||
, replacement: '<span class="keyword">@</span><span class="variable">$1</span>'
|
||||
}
|
||||
, keyword : { exp: /\b(?:A(?:CTION|DD|FTER|G(?:AINST|GREGATE)|L(?:GORITHM|L|TER)|N(?:ALYZE|D|Y)|S(?:C(?:II|)|ENSITIVE|)|UTO_INCREMENT|VG(?:_ROW_LENGTH|))|B(?:ACKUP|DB|E(?:FORE|GIN|RKELEYDB|TWEEN)|I(?:GINT|N(?:ARY|LOG)|T)|LOB|O(?:OL(?:EAN|)|TH)|TREE|Y(?:TE|))|C(?:A(?:CHE|LL|S(?:CADE(?:D|)|E))|H(?:A(?:IN|NGE(?:D|)|R(?:ACTER|SET|))|ECK(?:SUM|))|IPHER|L(?:IENT|OSE)|O(?:DE|L(?:LAT(?:E|ION)|UMN(?:S|))|M(?:M(?:ENT|IT(?:TED|))|P(?:ACT|RESSED))|N(?:CURRENT|DITION|NECTION|S(?:ISTENT|TRAINT)|T(?:AINS|INUE)|VERT))|R(?:EATE|OSS)|U(?:BE|R(?:RENT_(?:DATE|TIME(?:STAMP|)|USER)|SOR)))|D(?:A(?:T(?:A(?:BASE(?:S|)|)|E(?:TIME|))|Y(?:_(?:HOUR|MI(?:CROSECOND|NUTE)|SECOND)|))|E(?:ALLOCATE|C(?:IMAL|LARE|)|F(?:AULT|INER)|L(?:AY(?:ED|_KEY_WRITE)|ETE)|S(?:C(?:RIBE|)|_KEY_FILE)|TERMINISTIC)|I(?:RECTORY|S(?:ABLE|CARD|TINCT(?:ROW|))|V)|O(?:UBLE|)|ROP|U(?:AL|MPFILE|PLICATE)|YNAMIC)|E(?:ACH|LSE(?:IF|)|N(?:ABLE|CLOSED|D|GINE(?:S|)|UM)|RRORS|SCAPE(?:D|)|VENTS|X(?:ECUTE|I(?:STS|T)|P(?:ANSION|LAIN)|TENDED))|F(?:A(?:LSE|ST)|ETCH|I(?:ELDS|LE|RST|XED)|L(?:OAT(?:4|8|)|USH)|O(?:R(?:CE|EIGN|)|UND)|R(?:AC_SECOND|OM)|U(?:LL(?:TEXT|)|NCTION))|G(?:E(?:OMETRY(?:COLLECTION|)|T_FORMAT)|LOBAL|R(?:ANT(?:S|)|OUP))|H(?:A(?:NDLER|SH|VING)|ELP|IGH_PRIORITY|O(?:STS|UR(?:_(?:MI(?:CROSECOND|NUTE)|SECOND)|)))|I(?:DENTIFIED|F|GNORE|MPORT|N(?:DEX(?:ES|)|FILE|N(?:ER|O(?:BASE|DB))|OUT|SE(?:NSITIVE|RT(?:_METHOD|))|T(?:1|2|3|4|8|E(?:GER|RVAL)|O|)|VOKER|)|O_THREAD|S(?:OLATION|SUER|)|TERATE)|JOIN|K(?:EY(?:S|)|ILL)|L(?:A(?:NGUAGE|ST)|E(?:A(?:DING|VE(?:S|))|FT|VEL)|I(?:KE|MIT|NES(?:TRING|))|O(?:AD|C(?:AL(?:TIME(?:STAMP|)|)|K(?:S|))|GS|NG(?:BLOB|TEXT|)|OP|W_PRIORITY))|M(?:A(?:STER(?:_(?:CONNECT_RETRY|HOST|LOG_(?:FILE|POS)|P(?:ASSWORD|ORT)|S(?:ERVER_ID|SL(?:_(?:C(?:A(?:PATH|)|ERT|IPHER)|KEY)|))|USER)|)|TCH|X_(?:CONNECTIONS_PER_HOUR|QUERIES_PER_HOUR|ROWS|U(?:PDATES_PER_HOUR|SER_CONNECTIONS)))|E(?:DIUM(?:BLOB|INT|TEXT|)|RGE)|I(?:CROSECOND|DDLEINT|GRATE|N(?:UTE(?:_(?:MICROSECOND|SECOND)|)|_ROWS))|O(?:D(?:E|IF(?:IES|Y)|)|NTH)|U(?:LTI(?:LINESTRING|PO(?:INT|LYGON))|TEX))|N(?:A(?:ME(?:S|)|T(?:IONAL|URAL))|CHAR|DB(?:CLUSTER|)|E(?:W|XT)|O(?:NE|T|_WRITE_TO_BINLOG|)|U(?:LL|MERIC)|VARCHAR)|O(?:FFSET|LD_PASSWORD|N(?:E(?:_SHOT|)|)|P(?:EN|TI(?:MIZE|ON(?:ALLY|)))|R(?:DER|)|UT(?:ER|FILE|))|P(?:A(?:CK_KEYS|RTIAL|SSWORD)|HASE|O(?:INT|LYGON)|R(?:E(?:CISION|PARE|V)|I(?:MARY|VILEGES)|OCE(?:DURE|SS(?:LIST|)))|URGE)|QU(?:ARTER|ERY|ICK)|R(?:AID(?:0|_(?:CHUNKS(?:IZE|)|TYPE))|E(?:A(?:D(?:S|)|L)|COVER|DUNDANT|FERENCES|GEXP|L(?:AY_(?:LOG_(?:FILE|POS)|THREAD)|EASE|OAD)|NAME|P(?:AIR|EAT(?:ABLE|)|L(?:ACE|ICATION))|QUIRE|S(?:ET|T(?:ORE|RICT)|UME)|TURN(?:S|)|VOKE)|IGHT|LIKE|O(?:LL(?:BACK|UP)|UTINE|W(?:S|_FORMAT|))|TREE)|S(?:AVEPOINT|CHEMA(?:S|)|E(?:C(?:OND(?:_MICROSECOND|)|URITY)|LECT|NSITIVE|PARATOR|RIAL(?:IZABLE|)|SSION|T)|H(?:ARE|OW|UTDOWN)|I(?:GNED|MPLE)|LAVE|MALLINT|NAPSHOT|O(?:ME|NAME|UNDS)|P(?:ATIAL|ECIFIC)|QL(?:EXCEPTION|STATE|WARNING|_(?:B(?:IG_RESULT|UFFER_RESULT)|CA(?:CHE|LC_FOUND_ROWS)|NO_CACHE|SMALL_RESULT|T(?:HREAD|SI_(?:DAY|FRAC_SECOND|HOUR|M(?:INUTE|ONTH)|QUARTER|SECOND|WEEK|YEAR)))|)|SL|T(?:A(?:RT(?:ING|)|TUS)|O(?:P|RAGE)|R(?:AIGHT_JOIN|I(?:NG|PED)))|U(?:BJECT|PER|SPEND))|T(?:ABLE(?:S(?:PACE|)|)|E(?:MP(?:ORARY|TABLE)|RMINATED|XT)|HEN|I(?:ME(?:STAMP(?:ADD|DIFF|)|)|NY(?:BLOB|INT|TEXT))|O|R(?:A(?:ILING|NSACTION)|IGGER(?:S|)|U(?:E|NCATE))|YPE(?:S|))|U(?:N(?:COMMITTED|D(?:EFINED|O)|I(?:CODE|ON|QUE)|KNOWN|LOCK|SIGNED|TIL)|P(?:DATE|GRADE)|S(?:AGE|E(?:R(?:_RESOURCES|)|_FRM|)|ING)|TC_(?:DATE|TIME(?:STAMP|)))|V(?:A(?:LUE(?:S|)|R(?:BINARY|CHAR(?:ACTER|)|IABLES|YING))|IEW)|W(?:ARNINGS|EEK|H(?:E(?:N|RE)|ILE)|ITH|ORK|RITE)|X(?:509|A|OR)|YEAR(?:_MONTH|)|ZEROFILL)\b/
|
||||
}
|
||||
, func : { exp: /\b(?:A(?:BS|COS|DD(?:DATE|TIME)|ES_(?:DECRYPT|ENCRYPT)|REA|S(?:BINARY|IN|TEXT|WK(?:B|T))|TAN(?:2|))|B(?:ENCHMARK|I(?:N|T_(?:AND|COUNT|LENGTH|OR|XOR)))|C(?:AST|E(?:IL(?:ING|)|NTROID)|HAR(?:ACTER_LENGTH|_LENGTH)|O(?:ALESCE|ERCIBILITY|MPRESS|N(?:CAT(?:_WS|)|NECTION_ID|V(?:ERT_TZ|))|S|T|UNT)|R(?:C32|OSSES)|UR(?:DATE|TIME))|D(?:A(?:TE(?:DIFF|_(?:ADD|FORMAT|SUB))|Y(?:NAME|OF(?:MONTH|WEEK|YEAR)))|E(?:CODE|GREES|S_(?:DECRYPT|ENCRYPT))|I(?:MENSION|SJOINT))|E(?:LT|N(?:C(?:ODE|RYPT)|DPOINT|VELOPE)|QUALS|X(?:P(?:ORT_SET|)|T(?:ERIORRING|RACT)))|F(?:I(?:ELD|ND_IN_SET)|LOOR|O(?:RMAT|UND_ROWS)|ROM_(?:DAYS|UNIXTIME))|G(?:E(?:OM(?:COLLFROM(?:TEXT|WKB)|ETRY(?:COLLECTIONFROM(?:TEXT|WKB)|FROM(?:TEXT|WKB)|N|TYPE)|FROM(?:TEXT|WKB))|T_LOCK)|LENGTH|R(?:EATEST|OUP_(?:CONCAT|UNIQUE_USERS)))|HEX|I(?:FNULL|N(?:ET_(?:ATON|NTOA)|STR|TER(?:IORRINGN|SECTS))|S(?:CLOSED|EMPTY|NULL|SIMPLE|_(?:FREE_LOCK|USED_LOCK)))|L(?:AST_(?:DAY|INSERT_ID)|CASE|E(?:AST|NGTH)|INE(?:FROM(?:TEXT|WKB)|STRINGFROM(?:TEXT|WKB))|N|O(?:AD_FILE|CATE|G(?:10|2|)|WER)|PAD|TRIM)|M(?:A(?:KE(?:DATE|TIME|_SET)|STER_POS_WAIT|X)|BR(?:CONTAINS|DISJOINT|EQUAL|INTERSECTS|OVERLAPS|TOUCHES|WITHIN)|D5|I(?:D|N)|LINEFROM(?:TEXT|WKB)|ONTHNAME|PO(?:INTFROM(?:TEXT|WKB)|LYFROM(?:TEXT|WKB))|ULTI(?:LINESTRINGFROM(?:TEXT|WKB)|PO(?:INTFROM(?:TEXT|WKB)|LYGONFROM(?:TEXT|WKB))))|N(?:AME_CONST|OW|U(?:LLIF|M(?:GEOMETRIES|INTERIORRINGS|POINTS)))|O(?:CT(?:ET_LENGTH|)|RD|VERLAPS)|P(?:ERIOD_(?:ADD|DIFF)|I|O(?:INT(?:FROM(?:TEXT|WKB)|N)|LY(?:FROM(?:TEXT|WKB)|GONFROM(?:TEXT|WKB))|SITION|W(?:ER|)))|QUOTE|R(?:A(?:DIANS|ND)|E(?:LEASE_LOCK|VERSE)|O(?:UND|W_COUNT)|PAD|TRIM)|S(?:E(?:C_TO_TIME|SSION_USER)|HA(?:1|)|I(?:GN|N)|LEEP|OUNDEX|PACE|QRT|RID|T(?:ARTPOINT|D(?:DEV(?:_(?:POP|SAMP)|)|)|R(?:CMP|_TO_DATE))|U(?:B(?:DATE|STR(?:ING(?:_INDEX|)|)|TIME)|M)|YS(?:DATE|TEM_USER))|T(?:AN|IME(?:DIFF|_(?:FORMAT|TO_SEC))|O(?:UCHES|_DAYS)|RIM)|U(?:CASE|N(?:COMPRESS(?:ED_LENGTH|)|HEX|I(?:QUE_USERS|X_TIMESTAMP))|PPER|UID)|V(?:AR(?:IANCE|_(?:POP|SAMP))|ERSION)|W(?:EEK(?:DAY|OFYEAR)|ITHIN)|X|Y(?:EARWEEK|))(?=\()/ }
|
||||
, id : { exp: /[$\w]+/ }
|
||||
}
|
||||
}
|
||||
|
24
docs/js/chili/php.css
Normal file
@ -0,0 +1,24 @@
|
||||
/*
|
||||
===============================================================================
|
||||
Chili is the jQuery code highlighter plugin
|
||||
...............................................................................
|
||||
Copyright 2007 / Andrea Ercolino
|
||||
-------------------------------------------------------------------------------
|
||||
LICENSE: http://www.opensource.org/licenses/mit-license.php
|
||||
WEBSITE: http://noteslog.com/chili/
|
||||
===============================================================================
|
||||
*/
|
||||
|
||||
.php .com { color: green; }
|
||||
.php .const1 { color: red; }
|
||||
.php .const2 { color: red; }
|
||||
.php .func { color: #e17100; }
|
||||
.php .global { color: red; }
|
||||
.php .keyword { color: navy; font-weight: bold; }
|
||||
.php .mlcom { color: gray; }
|
||||
.php .name { color: maroon; }
|
||||
.php .number { color: red; }
|
||||
.php .string1 { color: purple; }
|
||||
.php .string2 { color: fuchsia; }
|
||||
.php .value { color: gray; font-weight: bold; }
|
||||
.php .variable { color: #4040c2; }
|
31
docs/js/chili/php.js
Normal file
64
docs/js/chili/recipes.css
Normal file
@ -0,0 +1,64 @@
|
||||
/*
|
||||
===============================================================================
|
||||
Chili is the jQuery code highlighter plugin
|
||||
...............................................................................
|
||||
Copyright 2007 / Andrea Ercolino
|
||||
-------------------------------------------------------------------------------
|
||||
LICENSE: http://www.opensource.org/licenses/mit-license.php
|
||||
WEBSITE: http://noteslog.com/chili/
|
||||
===============================================================================
|
||||
*/
|
||||
|
||||
/*
|
||||
this file shows how to configure a static setup
|
||||
it must be linked from the head of a page like:
|
||||
<link rel="stylesheet" type="text/css" href="chili/recipes.css"/>
|
||||
*/
|
||||
|
||||
.html .php { color: red; font-weight: bold; }
|
||||
.html .tag { color: navy; font-weight: bold; }
|
||||
.html .aname { color: purple; }
|
||||
.html .avalue { color: fuchsia; }
|
||||
.html .mlcom { color: green; }
|
||||
.html .entity { color: teal; }
|
||||
|
||||
.javascript .mlcom { color: #4040c2; }
|
||||
.javascript .com { color: green; }
|
||||
.javascript .regexp { color: maroon; }
|
||||
.javascript .string { color: teal; }
|
||||
.javascript .keywords { color: navy; font-weight: bold; }
|
||||
.javascript .global { color: blue; }
|
||||
.javascript .numbers { color: red; }
|
||||
|
||||
.mysql .function { color: #e17100; }
|
||||
.mysql .keyword { color: navy; font-weight: bold; }
|
||||
.mysql .mlcom { color: gray; }
|
||||
.mysql .com { color: green; }
|
||||
.mysql .number { color: red; }
|
||||
.mysql .hexnum { color: red; font-weight: bold; }
|
||||
.mysql .string { color: purple; }
|
||||
.mysql .quid { color: fuchsia; }
|
||||
.mysql .id { color: maroon; }
|
||||
.mysql .value { color: gray; font-weight: bold; }
|
||||
.mysql .variable { color: #4040c2; }
|
||||
|
||||
.php .com { color: green; }
|
||||
.php .const1 { color: red; }
|
||||
.php .const2 { color: red; }
|
||||
.php .func { color: #e17100; }
|
||||
.php .global { color: red; }
|
||||
.php .keyword { color: navy; font-weight: bold; }
|
||||
.php .mlcom { color: gray; }
|
||||
.php .name { color: maroon; }
|
||||
.php .number { color: red; }
|
||||
.php .string1 { color: purple; }
|
||||
.php .string2 { color: fuchsia; }
|
||||
.php .value { color: gray; font-weight: bold; }
|
||||
.php .variable { color: #4040c2; }
|
||||
|
||||
.css .mlcom { color: #4040c2; }
|
||||
.css .color { color: green; }
|
||||
.css .string { color: teal; }
|
||||
.css .attrib { color: navy; font-weight: bold; }
|
||||
.css .value { color: blue; }
|
||||
.css .number { color: red; }
|
98
docs/js/chili/recipes.js
Normal file
@ -0,0 +1,98 @@
|
||||
/*
|
||||
===============================================================================
|
||||
Chili is the jQuery code highlighter plugin
|
||||
...............................................................................
|
||||
Copyright 2007 / Andrea Ercolino
|
||||
-------------------------------------------------------------------------------
|
||||
LICENSE: http://www.opensource.org/licenses/mit-license.php
|
||||
WEBSITE: http://noteslog.com/chili/
|
||||
===============================================================================
|
||||
*/
|
||||
|
||||
/*
|
||||
this file shows how to configure a static setup
|
||||
it must be linked from the head of a page like:
|
||||
<script type="text/javascript" src="chili/recipes.js"></script>
|
||||
*/
|
||||
|
||||
ChiliBook.recipeLoading = false;
|
||||
|
||||
|
||||
ChiliBook.recipes[ "html.js" ] =
|
||||
{
|
||||
steps: {
|
||||
mlcom : { exp: /\<!--(?:.|\n)*?--\>/ }
|
||||
, tag : { exp: /(?:\<\!?[\w:]+)|(?:\>)|(?:\<\/[\w:]+\>)|(?:\/\>)/ }
|
||||
, php : { exp: /(?:\<\?php\s)|(?:\<\?)|(?:\?\>)/ }
|
||||
, aname : { exp: /\s+?[\w-]+:?\w+(?=\s*=)/ }
|
||||
, avalue: { exp: /(=\s*)(([\"\'])(?:(?:[^\3\\]*?(?:\3\3|\\.))*?[^\3\\]*?)\3)/
|
||||
, replacement: '$1<span class="$0">$2</span>' }
|
||||
, entity: { exp: /&[\w#]+?;/ }
|
||||
}
|
||||
};
|
||||
|
||||
ChiliBook.recipes[ "javascript.js" ] =
|
||||
{
|
||||
steps: {
|
||||
mlcom : { exp: /\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\// }
|
||||
, com : { exp: /\/\/.*/ }
|
||||
, regexp : { exp: /\/[^\/\\\n]*(?:\\.[^\/\\\n]*)*\/[gim]*/ }
|
||||
, string : { exp: /(?:\'[^\'\\\n]*(?:\\.[^\'\\\n]*)*\')|(?:\"[^\"\\\n]*(?:\\.[^\"\\\n]*)*\")/ }
|
||||
, numbers : { exp: /\b[+-]?(?:\d*\.?\d+|\d+\.?\d*)(?:[eE][+-]?\d+)?\b/ }
|
||||
, keywords: { exp: /\b(arguments|break|case|catch|continue|default|delete|do|else|false|for|function|if|in|instanceof|new|null|return|switch|this|true|try|typeof|var|void|while|with)\b/ }
|
||||
, global : { exp: /\b(toString|valueOf|window|self|element|prototype|constructor|document|escape|unescape|parseInt|parseFloat|setTimeout|clearTimeout|setInterval|clearInterval|NaN|isNaN|Infinity)\b/ }
|
||||
}
|
||||
};
|
||||
|
||||
ChiliBook.recipes[ "mysql.js" ] =
|
||||
{
|
||||
ignoreCase: true
|
||||
, steps: {
|
||||
mlcom : { exp: /\/\*[^*]*\*+([^\/][^*]*\*+)*\// }
|
||||
, com : { exp: /(?:--\s+.*)|(?:[^\\]\#.*)/ }
|
||||
, string : { exp: /([\"\'])(?:(?:[^\1\\\r\n]*?(?:\1\1|\\.))*[^\1\\\r\n]*?)\1/ }
|
||||
, quid : { exp: /(`)(?:(?:[^\1\\\r\n]*?(?:\1\1|\\.))*[^\1\\\r\n]*?)\1/ }
|
||||
, value : { exp: /\b(?:NULL|TRUE|FALSE)\b/ }
|
||||
, number : { exp: /\b[+-]?(\d*\.?\d+|\d+\.?\d*)([eE][+-]?\d+)?\b/ }
|
||||
, hexnum : { exp: /\b0[xX][\dA-Fa-f]+\b|\b[xX]([\'\"])[\dA-Fa-f]+\1/ }
|
||||
, op : { exp: /!=|&&|<|<<|<=|<=>|<>|=|>|>=|>>|\|\|/ }
|
||||
, variable : { exp: /@([$.\w]+|([`\"\'])(?:(?:[^\2\\\r\n]*?(?:\2\2|\\.))*[^\2\\\r\n]*?)\2)/
|
||||
, replacement: '<span class="keyword">@</span><span class="variable">$1</span>' }
|
||||
, keyword : { exp: /\b(?:A(?:CTION|DD|FTER|G(?:AINST|GREGATE)|L(?:GORITHM|L|TER)|N(?:ALYZE|D|Y)|S(?:C(?:II|)|ENSITIVE|)|UTO_INCREMENT|VG(?:_ROW_LENGTH|))|B(?:ACKUP|DB|E(?:FORE|GIN|RKELEYDB|TWEEN)|I(?:GINT|N(?:ARY|LOG)|T)|LOB|O(?:OL(?:EAN|)|TH)|TREE|Y(?:TE|))|C(?:A(?:CHE|LL|S(?:CADE(?:D|)|E))|H(?:A(?:IN|NGE(?:D|)|R(?:ACTER|SET|))|ECK(?:SUM|))|IPHER|L(?:IENT|OSE)|O(?:DE|L(?:LAT(?:E|ION)|UMN(?:S|))|M(?:M(?:ENT|IT(?:TED|))|P(?:ACT|RESSED))|N(?:CURRENT|DITION|NECTION|S(?:ISTENT|TRAINT)|T(?:AINS|INUE)|VERT))|R(?:EATE|OSS)|U(?:BE|R(?:RENT_(?:DATE|TIME(?:STAMP|)|USER)|SOR)))|D(?:A(?:T(?:A(?:BASE(?:S|)|)|E(?:TIME|))|Y(?:_(?:HOUR|MI(?:CROSECOND|NUTE)|SECOND)|))|E(?:ALLOCATE|C(?:IMAL|LARE|)|F(?:AULT|INER)|L(?:AY(?:ED|_KEY_WRITE)|ETE)|S(?:C(?:RIBE|)|_KEY_FILE)|TERMINISTIC)|I(?:RECTORY|S(?:ABLE|CARD|TINCT(?:ROW|))|V)|O(?:UBLE|)|ROP|U(?:AL|MPFILE|PLICATE)|YNAMIC)|E(?:ACH|LSE(?:IF|)|N(?:ABLE|CLOSED|D|GINE(?:S|)|UM)|RRORS|SCAPE(?:D|)|VENTS|X(?:ECUTE|I(?:STS|T)|P(?:ANSION|LAIN)|TENDED))|F(?:A(?:LSE|ST)|ETCH|I(?:ELDS|LE|RST|XED)|L(?:OAT(?:4|8|)|USH)|O(?:R(?:CE|EIGN|)|UND)|R(?:AC_SECOND|OM)|U(?:LL(?:TEXT|)|NCTION))|G(?:E(?:OMETRY(?:COLLECTION|)|T_FORMAT)|LOBAL|R(?:ANT(?:S|)|OUP))|H(?:A(?:NDLER|SH|VING)|ELP|IGH_PRIORITY|O(?:STS|UR(?:_(?:MI(?:CROSECOND|NUTE)|SECOND)|)))|I(?:DENTIFIED|F|GNORE|MPORT|N(?:DEX(?:ES|)|FILE|N(?:ER|O(?:BASE|DB))|OUT|SE(?:NSITIVE|RT(?:_METHOD|))|T(?:1|2|3|4|8|E(?:GER|RVAL)|O|)|VOKER|)|O_THREAD|S(?:OLATION|SUER|)|TERATE)|JOIN|K(?:EY(?:S|)|ILL)|L(?:A(?:NGUAGE|ST)|E(?:A(?:DING|VE(?:S|))|FT|VEL)|I(?:KE|MIT|NES(?:TRING|))|O(?:AD|C(?:AL(?:TIME(?:STAMP|)|)|K(?:S|))|GS|NG(?:BLOB|TEXT|)|OP|W_PRIORITY))|M(?:A(?:STER(?:_(?:CONNECT_RETRY|HOST|LOG_(?:FILE|POS)|P(?:ASSWORD|ORT)|S(?:ERVER_ID|SL(?:_(?:C(?:A(?:PATH|)|ERT|IPHER)|KEY)|))|USER)|)|TCH|X_(?:CONNECTIONS_PER_HOUR|QUERIES_PER_HOUR|ROWS|U(?:PDATES_PER_HOUR|SER_CONNECTIONS)))|E(?:DIUM(?:BLOB|INT|TEXT|)|RGE)|I(?:CROSECOND|DDLEINT|GRATE|N(?:UTE(?:_(?:MICROSECOND|SECOND)|)|_ROWS))|O(?:D(?:E|IF(?:IES|Y)|)|NTH)|U(?:LTI(?:LINESTRING|PO(?:INT|LYGON))|TEX))|N(?:A(?:ME(?:S|)|T(?:IONAL|URAL))|CHAR|DB(?:CLUSTER|)|E(?:W|XT)|O(?:NE|T|_WRITE_TO_BINLOG|)|U(?:LL|MERIC)|VARCHAR)|O(?:FFSET|LD_PASSWORD|N(?:E(?:_SHOT|)|)|P(?:EN|TI(?:MIZE|ON(?:ALLY|)))|R(?:DER|)|UT(?:ER|FILE|))|P(?:A(?:CK_KEYS|RTIAL|SSWORD)|HASE|O(?:INT|LYGON)|R(?:E(?:CISION|PARE|V)|I(?:MARY|VILEGES)|OCE(?:DURE|SS(?:LIST|)))|URGE)|QU(?:ARTER|ERY|ICK)|R(?:AID(?:0|_(?:CHUNKS(?:IZE|)|TYPE))|E(?:A(?:D(?:S|)|L)|COVER|DUNDANT|FERENCES|GEXP|L(?:AY_(?:LOG_(?:FILE|POS)|THREAD)|EASE|OAD)|NAME|P(?:AIR|EAT(?:ABLE|)|L(?:ACE|ICATION))|QUIRE|S(?:ET|T(?:ORE|RICT)|UME)|TURN(?:S|)|VOKE)|IGHT|LIKE|O(?:LL(?:BACK|UP)|UTINE|W(?:S|_FORMAT|))|TREE)|S(?:AVEPOINT|CHEMA(?:S|)|E(?:C(?:OND(?:_MICROSECOND|)|URITY)|LECT|NSITIVE|PARATOR|RIAL(?:IZABLE|)|SSION|T)|H(?:ARE|OW|UTDOWN)|I(?:GNED|MPLE)|LAVE|MALLINT|NAPSHOT|O(?:ME|NAME|UNDS)|P(?:ATIAL|ECIFIC)|QL(?:EXCEPTION|STATE|WARNING|_(?:B(?:IG_RESULT|UFFER_RESULT)|CA(?:CHE|LC_FOUND_ROWS)|NO_CACHE|SMALL_RESULT|T(?:HREAD|SI_(?:DAY|FRAC_SECOND|HOUR|M(?:INUTE|ONTH)|QUARTER|SECOND|WEEK|YEAR)))|)|SL|T(?:A(?:RT(?:ING|)|TUS)|O(?:P|RAGE)|R(?:AIGHT_JOIN|I(?:NG|PED)))|U(?:BJECT|PER|SPEND))|T(?:ABLE(?:S(?:PACE|)|)|E(?:MP(?:ORARY|TABLE)|RMINATED|XT)|HEN|I(?:ME(?:STAMP(?:ADD|DIFF|)|)|NY(?:BLOB|INT|TEXT))|O|R(?:A(?:ILING|NSACTION)|IGGER(?:S|)|U(?:E|NCATE))|YPE(?:S|))|U(?:N(?:COMMITTED|D(?:EFINED|O)|I(?:CODE|ON|QUE)|KNOWN|LOCK|SIGNED|TIL)|P(?:DATE|GRADE)|S(?:AGE|E(?:R(?:_RESOURCES|)|_FRM|)|ING)|TC_(?:DATE|TIME(?:STAMP|)))|V(?:A(?:LUE(?:S|)|R(?:BINARY|CHAR(?:ACTER|)|IABLES|YING))|IEW)|W(?:ARNINGS|EEK|H(?:E(?:N|RE)|ILE)|ITH|ORK|RITE)|X(?:509|A|OR)|YEAR(?:_MONTH|)|ZEROFILL)\b/ }
|
||||
, func : { exp: /\b(?:A(?:BS|COS|DD(?:DATE|TIME)|ES_(?:DECRYPT|ENCRYPT)|REA|S(?:BINARY|IN|TEXT|WK(?:B|T))|TAN(?:2|))|B(?:ENCHMARK|I(?:N|T_(?:AND|COUNT|LENGTH|OR|XOR)))|C(?:AST|E(?:IL(?:ING|)|NTROID)|HAR(?:ACTER_LENGTH|_LENGTH)|O(?:ALESCE|ERCIBILITY|MPRESS|N(?:CAT(?:_WS|)|NECTION_ID|V(?:ERT_TZ|))|S|T|UNT)|R(?:C32|OSSES)|UR(?:DATE|TIME))|D(?:A(?:TE(?:DIFF|_(?:ADD|FORMAT|SUB))|Y(?:NAME|OF(?:MONTH|WEEK|YEAR)))|E(?:CODE|GREES|S_(?:DECRYPT|ENCRYPT))|I(?:MENSION|SJOINT))|E(?:LT|N(?:C(?:ODE|RYPT)|DPOINT|VELOPE)|QUALS|X(?:P(?:ORT_SET|)|T(?:ERIORRING|RACT)))|F(?:I(?:ELD|ND_IN_SET)|LOOR|O(?:RMAT|UND_ROWS)|ROM_(?:DAYS|UNIXTIME))|G(?:E(?:OM(?:COLLFROM(?:TEXT|WKB)|ETRY(?:COLLECTIONFROM(?:TEXT|WKB)|FROM(?:TEXT|WKB)|N|TYPE)|FROM(?:TEXT|WKB))|T_LOCK)|LENGTH|R(?:EATEST|OUP_(?:CONCAT|UNIQUE_USERS)))|HEX|I(?:FNULL|N(?:ET_(?:ATON|NTOA)|STR|TER(?:IORRINGN|SECTS))|S(?:CLOSED|EMPTY|NULL|SIMPLE|_(?:FREE_LOCK|USED_LOCK)))|L(?:AST_(?:DAY|INSERT_ID)|CASE|E(?:AST|NGTH)|INE(?:FROM(?:TEXT|WKB)|STRINGFROM(?:TEXT|WKB))|N|O(?:AD_FILE|CATE|G(?:10|2|)|WER)|PAD|TRIM)|M(?:A(?:KE(?:DATE|TIME|_SET)|STER_POS_WAIT|X)|BR(?:CONTAINS|DISJOINT|EQUAL|INTERSECTS|OVERLAPS|TOUCHES|WITHIN)|D5|I(?:D|N)|LINEFROM(?:TEXT|WKB)|ONTHNAME|PO(?:INTFROM(?:TEXT|WKB)|LYFROM(?:TEXT|WKB))|ULTI(?:LINESTRINGFROM(?:TEXT|WKB)|PO(?:INTFROM(?:TEXT|WKB)|LYGONFROM(?:TEXT|WKB))))|N(?:AME_CONST|OW|U(?:LLIF|M(?:GEOMETRIES|INTERIORRINGS|POINTS)))|O(?:CT(?:ET_LENGTH|)|RD|VERLAPS)|P(?:ERIOD_(?:ADD|DIFF)|I|O(?:INT(?:FROM(?:TEXT|WKB)|N)|LY(?:FROM(?:TEXT|WKB)|GONFROM(?:TEXT|WKB))|SITION|W(?:ER|)))|QUOTE|R(?:A(?:DIANS|ND)|E(?:LEASE_LOCK|VERSE)|O(?:UND|W_COUNT)|PAD|TRIM)|S(?:E(?:C_TO_TIME|SSION_USER)|HA(?:1|)|I(?:GN|N)|LEEP|OUNDEX|PACE|QRT|RID|T(?:ARTPOINT|D(?:DEV(?:_(?:POP|SAMP)|)|)|R(?:CMP|_TO_DATE))|U(?:B(?:DATE|STR(?:ING(?:_INDEX|)|)|TIME)|M)|YS(?:DATE|TEM_USER))|T(?:AN|IME(?:DIFF|_(?:FORMAT|TO_SEC))|O(?:UCHES|_DAYS)|RIM)|U(?:CASE|N(?:COMPRESS(?:ED_LENGTH|)|HEX|I(?:QUE_USERS|X_TIMESTAMP))|PPER|UID)|V(?:AR(?:IANCE|_(?:POP|SAMP))|ERSION)|W(?:EEK(?:DAY|OFYEAR)|ITHIN)|X|Y(?:EARWEEK|))(?=\()/ }
|
||||
, id : { exp: /[$\w]+/ }
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
ChiliBook.recipes[ "php.js" ] =
|
||||
{
|
||||
steps: {
|
||||
mlcom : { exp: /\/\*[^*]*\*+([^\/][^*]*\*+)*\// }
|
||||
, com : { exp: /(?:\/\/.*)|(?:[^\\]\#.*)/ }
|
||||
, string1 : { exp: /\'[^\'\\]*(?:\\.[^\'\\]*)*\'/ }
|
||||
, string2 : { exp: /\"[^\"\\]*(?:\\.[^\"\\]*)*\"/ }
|
||||
, value : { exp: /\b(?:[Nn][Uu][Ll][Ll]|[Tt][Rr][Uu][Ee]|[Ff][Aa][Ll][Ss][Ee])\b/ }
|
||||
, number : { exp: /\b[+-]?(\d*\.?\d+|\d+\.?\d*)([eE][+-]?\d+)?\b/ }
|
||||
, const1 : { exp: /\b(?:DEFAULT_INCLUDE_PATH|E_(?:ALL|CO(?:MPILE_(?:ERROR|WARNING)|RE_(?:ERROR|WARNING))|ERROR|NOTICE|PARSE|STRICT|USER_(?:ERROR|NOTICE|WARNING)|WARNING)|P(?:EAR_(?:EXTENSION_DIR|INSTALL_DIR)|HP_(?:BINDIR|CONFIG_FILE_(?:PATH|SCAN_DIR)|DATADIR|E(?:OL|XTENSION_DIR)|INT_(?:MAX|SIZE)|L(?:IBDIR|OCALSTATEDIR)|O(?:S|UTPUT_HANDLER_(?:CONT|END|START))|PREFIX|S(?:API|HLIB_SUFFIX|YSCONFDIR)|VERSION))|__COMPILER_HALT_OFFSET__)\b/ }
|
||||
, const2 : { exp: /\b(?:A(?:B(?:DAY_(?:1|2|3|4|5|6|7)|MON_(?:1(?:0|1|2|)|2|3|4|5|6|7|8|9))|LT_DIGITS|M_STR|SSERT_(?:ACTIVE|BAIL|CALLBACK|QUIET_EVAL|WARNING))|C(?:ASE_(?:LOWER|UPPER)|HAR_MAX|O(?:DESET|NNECTION_(?:ABORTED|NORMAL|TIMEOUT)|UNT_(?:NORMAL|RECURSIVE))|R(?:EDITS_(?:ALL|DOCS|FULLPAGE|G(?:ENERAL|ROUP)|MODULES|QA|SAPI)|NCYSTR|YPT_(?:BLOWFISH|EXT_DES|MD5|S(?:ALT_LENGTH|TD_DES)))|URRENCY_SYMBOL)|D(?:AY_(?:1|2|3|4|5|6|7)|ECIMAL_POINT|IRECTORY_SEPARATOR|_(?:FMT|T_FMT))|E(?:NT_(?:COMPAT|NOQUOTES|QUOTES)|RA(?:_(?:D_(?:FMT|T_FMT)|T_FMT|YEAR)|)|XTR_(?:IF_EXISTS|OVERWRITE|PREFIX_(?:ALL|I(?:F_EXISTS|NVALID)|SAME)|SKIP))|FRAC_DIGITS|GROUPING|HTML_(?:ENTITIES|SPECIALCHARS)|IN(?:FO_(?:ALL|C(?:ONFIGURATION|REDITS)|ENVIRONMENT|GENERAL|LICENSE|MODULES|VARIABLES)|I_(?:ALL|PERDIR|SYSTEM|USER)|T_(?:CURR_SYMBOL|FRAC_DIGITS))|L(?:C_(?:ALL|C(?:OLLATE|TYPE)|M(?:ESSAGES|ONETARY)|NUMERIC|TIME)|O(?:CK_(?:EX|NB|SH|UN)|G_(?:A(?:LERT|UTH(?:PRIV|))|C(?:ONS|R(?:IT|ON))|D(?:AEMON|EBUG)|E(?:MERG|RR)|INFO|KERN|L(?:OCAL(?:0|1|2|3|4|5|6|7)|PR)|MAIL|N(?:DELAY|EWS|O(?:TICE|WAIT))|ODELAY|P(?:ERROR|ID)|SYSLOG|U(?:SER|UCP)|WARNING)))|M(?:ON_(?:1(?:0|1|2|)|2|3|4|5|6|7|8|9|DECIMAL_POINT|GROUPING|THOUSANDS_SEP)|_(?:1_PI|2_(?:PI|SQRTPI)|E|L(?:N(?:10|2)|OG(?:10E|2E))|PI(?:_(?:2|4)|)|SQRT(?:1_2|2)))|N(?:EGATIVE_SIGN|O(?:EXPR|STR)|_(?:CS_PRECEDES|S(?:EP_BY_SPACE|IGN_POSN)))|P(?:ATH(?:INFO_(?:BASENAME|DIRNAME|EXTENSION)|_SEPARATOR)|M_STR|OSITIVE_SIGN|_(?:CS_PRECEDES|S(?:EP_BY_SPACE|IGN_POSN)))|RADIXCHAR|S(?:EEK_(?:CUR|END|SET)|ORT_(?:ASC|DESC|NUMERIC|REGULAR|STRING)|TR_PAD_(?:BOTH|LEFT|RIGHT))|T(?:HOUS(?:ANDS_SEP|EP)|_FMT(?:_AMPM|))|YES(?:EXPR|STR))\b/ }
|
||||
, global : { exp: /(?:\$GLOBALS|\$_COOKIE|\$_ENV|\$_FILES|\$_GET|\$_POST|\$_REQUEST|\$_SERVER|\$_SESSION|\$php_errormsg)\b/ }
|
||||
, keyword : { exp: /\b(?:__CLASS__|__FILE__|__FUNCTION__|__LINE__|__METHOD__|abstract|and|array|as|break|case|catch|cfunction|class|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|eval|exception|exit|extends|extends|final|for|foreach|function|global|if|implements|include|include_once|interface|isset|list|new|old_function|or|php_user_filter|print|private|protected|public|require|require_once|return|static|switch|this|throw|try|unset|use|var|while|xor)\b/ }
|
||||
, variable: { exp: /\$(\w+)/
|
||||
, replacement: '<span class="keyword">$</span><span class="variable">$1</span>' }
|
||||
, heredoc : { exp: /(\<\<\<\s*)(\w+)((?:(?!\2).*\n)+)(\2)\b/
|
||||
, replacement: '<span class="keyword">$1</span><span class="string1">$2</span><span class="string2">$3</span><span class="string1">$4</span>' }
|
||||
}
|
||||
};
|
||||
|
||||
ChiliBook.recipes[ "css.js" ] =
|
||||
{
|
||||
steps: {
|
||||
mlcom : { exp: /\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\// }
|
||||
, string: { exp: /(?:\'[^\'\\\n]*(?:\\.[^\'\\\n]*)*\')|(?:\"[^\"\\\n]*(?:\\.[^\"\\\n]*)*\")/ }
|
||||
, number: { exp: /(?:\b[+-]?(?:\d*\.?\d+|\d+\.?\d*))(?:%|(?:(?:px|pt|em|)\b))/ }
|
||||
, attrib: { exp: /\b(?:z-index|x-height|word-spacing|widths|width|widows|white-space|volume|voice-family|visibility|vertical-align|units-per-em|unicode-range|unicode-bidi|text-transform|text-shadow|text-indent|text-decoration|text-align|table-layout|stress|stemv|stemh|src|speech-rate|speak-punctuation|speak-numeral|speak-header|speak|slope|size|right|richness|quotes|position|play-during|pitch-range|pitch|pause-before|pause-after|pause|page-break-inside|page-break-before|page-break-after|page|padding-top|padding-right|padding-left|padding-bottom|padding|overflow|outline-width|outline-style|outline-color|outline|orphans|min-width|min-height|max-width|max-height|mathline|marks|marker-offset|margin-top|margin-right|margin-left|margin-bottom|margin|list-style-type|list-style-position|list-style-image|list-style|line-height|letter-spacing|height|font-weight|font-variant|font-style|font-stretch|font-size-adjust|font-size|font-family|font|float|empty-cells|elevation|display|direction|descent|definition-src|cursor|cue-before|cue-after|cue|counter-reset|counter-increment|content|color|clip|clear|centerline|caption-side|cap-height|bottom|border-width|border-top-width|border-top-style|border-top-color|border-top|border-style|border-spacing|border-right-width|border-right-style|border-right-color|border-right|border-left-width|border-left-style|border-left-color|border-left|border-color|border-collapse|border-bottom-width|border-bottom-style|border-bottom-color|border-bottom|border|bbox|baseline|background-repeat|background-position|background-image|background-color|background-attachment|background|azimuth|ascent)\b/ }
|
||||
, value : { exp: /\b(?:xx-small|xx-large|x-soft|x-small|x-slow|x-low|x-loud|x-large|x-high|x-fast|wider|wait|w-resize|visible|url|uppercase|upper-roman|upper-latin|upper-alpha|underline|ultra-expanded|ultra-condensed|tv|tty|transparent|top|thin|thick|text-top|text-bottom|table-row-group|table-row|table-header-group|table-footer-group|table-column-group|table-column|table-cell|table-caption|sw-resize|super|sub|status-bar|static|square|spell-out|speech|solid|soft|smaller|small-caption|small-caps|small|slower|slow|silent|show|separate|semi-expanded|semi-condensed|se-resize|scroll|screen|s-resize|run-in|rtl|rightwards|right-side|right|ridge|rgb|repeat-y|repeat-x|repeat|relative|projection|print|pre|portrait|pointer|overline|outside|outset|open-quote|once|oblique|nw-resize|nowrap|normal|none|no-repeat|no-open-quote|no-close-quote|ne-resize|narrower|n-resize|move|mix|middle|message-box|medium|marker|ltr|lowercase|lower-roman|lower-latin|lower-greek|lower-alpha|lower|low|loud|local|list-item|line-through|lighter|level|leftwards|left-side|left|larger|large|landscape|justify|italic|invert|inside|inset|inline-table|inline|icon|higher|high|hide|hidden|help|hebrew|handheld|groove|format|fixed|faster|fast|far-right|far-left|fantasy|extra-expanded|extra-condensed|expanded|embossed|embed|e-resize|double|dotted|disc|digits|default|decimal-leading-zero|decimal|dashed|cursive|crosshair|cross|crop|counters|counter|continuous|condensed|compact|collapse|code|close-quote|circle|center-right|center-left|center|caption|capitalize|braille|bottom|both|bolder|bold|block|blink|bidi-override|below|behind|baseline|avoid|auto|aural|attr|armenian|always|all|absolute|above)\b/ }
|
||||
, color : { exp: /(?:\#[a-zA-Z0-9]{3,6})|(?:yellow|white|teal|silver|red|purple|olive|navy|maroon|lime|green|gray|fuchsia|blue|black|aqua)/ }
|
||||
}
|
||||
}
|
22
docs/js/docs.js
Normal file
@ -0,0 +1,22 @@
|
||||
/* Stop IE flicker */
|
||||
if ($.browser.msie == true) document.execCommand('BackgroundImageCache', false, true);
|
||||
ChiliBook.recipeFolder = "js/chili/";
|
||||
ChiliBook.stylesheetFolder = "js/chili/"
|
||||
|
||||
jQuery.fn.antispam = function() {
|
||||
return this.each(function(){
|
||||
var email = $(this).text().toLowerCase().replace(/\sdot/g,'.').replace(/\sat/g,'@').replace(/\s+/g,'');
|
||||
var URI = "mailto:" + email;
|
||||
$(this).hide().before(
|
||||
$("<a></a>").attr("href",URI).addClass("external").text(email)
|
||||
);
|
||||
});
|
||||
};
|
||||
|
||||
$(function() {
|
||||
$("pre.javascript").chili();
|
||||
$("pre.html").chili();
|
||||
$("pre.css").chili();
|
||||
$("a.external").each(function() {this.target = '_new'});
|
||||
$("span.email").antispam();
|
||||
});
|
29
docs/js/examples.js
Normal file
@ -0,0 +1,29 @@
|
||||
$(function() {
|
||||
|
||||
// get javascript source
|
||||
$("#javascript pre").text($("#js").html());
|
||||
|
||||
if($("#demo").size() > 0) {
|
||||
// old school chaining...
|
||||
var html = $("#demo").html()
|
||||
.toLowerCase()
|
||||
.replace(/\n|\t|\r/g,'')
|
||||
.replace(/<td/g,'\t\t\t<td')
|
||||
.replace(/<\/td>/g,'</td>\n')
|
||||
.replace(/<th/g,'\t\t\t<th')
|
||||
.replace(/<\/th>/g,'</th>\n')
|
||||
.replace(/<\/tr>/g,'\t\t</tr>')
|
||||
.replace(/<tr>/g,'\n\t\t<tr>\n')
|
||||
.replace(/<thead/g,'\n\t<thead>')
|
||||
.replace(/<\/thead>/g,'\n\t</thead>')
|
||||
.replace(/<tbody/g,'\n\t<tbody')
|
||||
.replace(/<\/tbody>/g,'\n\t</tbody>')
|
||||
.replace(/<\/table>/g,'\n</table>')
|
||||
.replace(/-->/g,'-->\n');
|
||||
|
||||
$("#html pre").text(html);
|
||||
}
|
||||
$("pre.javascript").chili();
|
||||
$("pre.html").chili();
|
||||
$("pre.css").chili();
|
||||
});
|
8936
docs/js/jquery-latest.js
vendored
Normal file
52
index.html
Normal file
@ -0,0 +1,52 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Basic Tablesorter Demo</title>
|
||||
|
||||
<!-- Demo styling -->
|
||||
<link href="docs/css/jq.css" rel="stylesheet">
|
||||
|
||||
<!-- jQuery: required (tablesorter works with jQuery 1.2.3+) -->
|
||||
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.min.js"></script>
|
||||
|
||||
<!-- Pick a theme, load the plugin & initialize plugin -->
|
||||
<link href="css/blue/style.css" rel="stylesheet">
|
||||
<script src="js/jquery.tablesorter.js"></script>
|
||||
<script>
|
||||
$(function(){
|
||||
$('table').tablesorter();
|
||||
});
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div class="demo">
|
||||
<h1><a href="https://github.com/Mottie/tablesorter">TableSorter v2.0.6</a></h1>
|
||||
<p>By Christian Bach, updated 6/22/2011 by Rob G<br><a href="docs/index.html">Docs included</a></p>
|
||||
|
||||
<table class="tablesorter">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>AlphaNumeric Sort *New*</th>
|
||||
<th>Numeric</th>
|
||||
<th>Alphabetical</th>
|
||||
<th>Sites</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr><td>abc 123</td><td>10</td><td>Koala</td><td>http://www.google.com</td></tr>
|
||||
<tr><td>abc 1</td><td>234</td><td>Ox</td><td>http://www.yahoo.com</td></tr>
|
||||
<tr><td>abc 9</td><td>10</td><td>Girafee</td><td>http://www.facebook.com</td></tr>
|
||||
<tr><td>zyx 24</td><td>767</td><td>Bison</td><td>http://www.whitehouse.gov/</td></tr>
|
||||
<tr><td>abc 11</td><td>3</td><td>Chimp</td><td>http://www.ucla.edu/</td></tr>
|
||||
<tr><td>abc 2</td><td>56</td><td>Elephant</td><td>http://www.wikipedia.org/</td></tr>
|
||||
<tr><td>abc 9</td><td>155</td><td>Lion</td><td>http://www.nytimes.com/</td></tr>
|
||||
<tr><td>ABC 10</td><td>87</td><td>Zebra</td><td>http://www.google.com</td></tr>
|
||||
<tr><td>zyx 1</td><td>999</td><td>Koala</td><td>http://www.mit.edu/</td></tr>
|
||||
<tr><td>zyx 12</td><td>0</td><td>Llama</td><td>http://www.nasa.gov/</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
</body></html>
|
148
js/jquery.metadata.js
Normal file
@ -0,0 +1,148 @@
|
||||
/*
|
||||
* Metadata - jQuery plugin for parsing metadata from elements
|
||||
*
|
||||
* Copyright (c) 2006 John Resig, Yehuda Katz, J<EFBFBD>örn Zaefferer, Paul McLanahan
|
||||
*
|
||||
* Dual licensed under the MIT and GPL licenses:
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
* http://www.gnu.org/licenses/gpl.html
|
||||
*
|
||||
* Revision: $Id: jquery.metadata.js 3640 2007-10-11 18:34:38Z pmclanahan $
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Sets the type of metadata to use. Metadata is encoded in JSON, and each property
|
||||
* in the JSON will become a property of the element itself.
|
||||
*
|
||||
* There are four supported types of metadata storage:
|
||||
*
|
||||
* attr: Inside an attribute. The name parameter indicates *which* attribute.
|
||||
*
|
||||
* class: Inside the class attribute, wrapped in curly braces: { }
|
||||
*
|
||||
* elem: Inside a child element (e.g. a script tag). The
|
||||
* name parameter indicates *which* element.
|
||||
* html5: Values are stored in data-* attributes.
|
||||
*
|
||||
* The metadata for an element is loaded the first time the element is accessed via jQuery.
|
||||
*
|
||||
* As a result, you can define the metadata type, use $(expr) to load the metadata into the elements
|
||||
* matched by expr, then redefine the metadata type and run another $(expr) for other elements.
|
||||
*
|
||||
* @name $.metadata.setType
|
||||
*
|
||||
* @example <p id="one" class="some_class {item_id: 1, item_label: 'Label'}">This is a p</p>
|
||||
* @before $.metadata.setType("class")
|
||||
* @after $("#one").metadata().item_id == 1; $("#one").metadata().item_label == "Label"
|
||||
* @desc Reads metadata from the class attribute
|
||||
*
|
||||
* @example <p id="one" class="some_class" data="{item_id: 1, item_label: 'Label'}">This is a p</p>
|
||||
* @before $.metadata.setType("attr", "data")
|
||||
* @after $("#one").metadata().item_id == 1; $("#one").metadata().item_label == "Label"
|
||||
* @desc Reads metadata from a "data" attribute
|
||||
*
|
||||
* @example <p id="one" class="some_class"><script>{item_id: 1, item_label: 'Label'}</script>This is a p</p>
|
||||
* @before $.metadata.setType("elem", "script")
|
||||
* @after $("#one").metadata().item_id == 1; $("#one").metadata().item_label == "Label"
|
||||
* @desc Reads metadata from a nested script element
|
||||
*
|
||||
* @example <p id="one" class="some_class" data-item_id="1" data-item_label="Label">This is a p</p>
|
||||
* @before $.metadata.setType("html5")
|
||||
* @after $("#one").metadata().item_id == 1; $("#one").metadata().item_label == "Label"
|
||||
* @desc Reads metadata from a series of data-* attributes
|
||||
*
|
||||
* @param String type The encoding type
|
||||
* @param String name The name of the attribute to be used to get metadata (optional)
|
||||
* @cat Plugins/Metadata
|
||||
* @descr Sets the type of encoding to be used when loading metadata for the first time
|
||||
* @type undefined
|
||||
* @see metadata()
|
||||
*/
|
||||
|
||||
(function($) {
|
||||
|
||||
$.extend({
|
||||
metadata : {
|
||||
defaults : {
|
||||
type: 'class',
|
||||
name: 'metadata',
|
||||
cre: /({.*})/,
|
||||
single: 'metadata'
|
||||
},
|
||||
setType: function( type, name ){
|
||||
this.defaults.type = type;
|
||||
this.defaults.name = name;
|
||||
},
|
||||
get: function( elem, opts ){
|
||||
var settings = $.extend({},this.defaults,opts);
|
||||
// check for empty string in single property
|
||||
if ( !settings.single.length ) settings.single = 'metadata';
|
||||
|
||||
var data = $.data(elem, settings.single);
|
||||
// returned cached data if it already exists
|
||||
if ( data ) return data;
|
||||
|
||||
data = "{}";
|
||||
|
||||
var getData = function(data) {
|
||||
if(typeof data != "string") return data;
|
||||
|
||||
if( data.indexOf('{') < 0 ) {
|
||||
data = eval("(" + data + ")");
|
||||
}
|
||||
}
|
||||
|
||||
var getObject = function(data) {
|
||||
if(typeof data != "string") return data;
|
||||
|
||||
data = eval("(" + data + ")");
|
||||
return data;
|
||||
}
|
||||
|
||||
if ( settings.type == "html5" ) {
|
||||
var object = {};
|
||||
$( elem.attributes ).each(function() {
|
||||
var name = this.nodeName;
|
||||
if(name.match(/^data-/)) name = name.replace(/^data-/, '');
|
||||
else return true;
|
||||
object[name] = getObject(this.nodeValue);
|
||||
});
|
||||
} else {
|
||||
if ( settings.type == "class" ) {
|
||||
var m = settings.cre.exec( elem.className );
|
||||
if ( m )
|
||||
data = m[1];
|
||||
} else if ( settings.type == "elem" ) {
|
||||
if( !elem.getElementsByTagName ) return;
|
||||
var e = elem.getElementsByTagName(settings.name);
|
||||
if ( e.length )
|
||||
data = $.trim(e[0].innerHTML);
|
||||
} else if ( elem.getAttribute != undefined ) {
|
||||
var attr = elem.getAttribute( settings.name );
|
||||
if ( attr )
|
||||
data = attr;
|
||||
}
|
||||
object = getObject(data.indexOf("{") < 0 ? "{" + data + "}" : data);
|
||||
}
|
||||
|
||||
$.data( elem, settings.single, object );
|
||||
return object;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Returns the metadata object for the first member of the jQuery object.
|
||||
*
|
||||
* @name metadata
|
||||
* @descr Returns element's metadata object
|
||||
* @param Object opts An object contianing settings to override the defaults
|
||||
* @type jQuery
|
||||
* @cat Plugins/Metadata
|
||||
*/
|
||||
$.fn.metadata = function( opts ){
|
||||
return $.metadata.get( this[0], opts );
|
||||
};
|
||||
|
||||
})(jQuery);
|
921
js/jquery.tablesorter.js
Normal file
@ -0,0 +1,921 @@
|
||||
/*
|
||||
* TableSorter 2.0 - Client-side table sorting with ease!
|
||||
* Version 2.0.6
|
||||
* @requires jQuery v1.2.3
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* @description Create a sortable table with multi-column sorting capabilitys
|
||||
*
|
||||
* @example $('table').tablesorter();
|
||||
* @desc Create a simple tablesorter interface.
|
||||
*
|
||||
* @example $('table').tablesorter({ sortList:[[0,0],[1,0]] });
|
||||
* @desc Create a tablesorter interface and sort on the first and secound column column headers.
|
||||
*
|
||||
* @example $('table').tablesorter({ headers: { 0: { sorter: false}, 1: {sorter: false} } });
|
||||
* @desc Create a tablesorter interface and disableing the first and second column headers.
|
||||
*
|
||||
* @example $('table').tablesorter({ headers: { 0: {sorter:"integer"}, 1: {sorter:"currency"} } });
|
||||
* @desc Create a tablesorter interface and set a column parser for the first and second column.
|
||||
*
|
||||
* @param Object settings An object literal containing key/value pairs to provide optional settings.
|
||||
*
|
||||
* @option String cssHeader (optional) A string of the class name to be appended to sortable tr elements in the thead of the table.
|
||||
* Default value: "header"
|
||||
*
|
||||
* @option String cssAsc (optional) A string of the class name to be appended to sortable tr elements in the thead on a ascending sort.
|
||||
* Default value: "headerSortUp"
|
||||
*
|
||||
* @option String cssDesc (optional) A string of the class name to be appended to sortable tr elements in the thead on a descending sort.
|
||||
* Default value: "headerSortDown"
|
||||
*
|
||||
* @option String sortInitialOrder (optional) A string of the inital sorting order can be asc or desc.
|
||||
* Default value: "asc"
|
||||
*
|
||||
* @option String sortMultisortKey (optional) A string of the multi-column sort key.
|
||||
* Default value: "shiftKey"
|
||||
*
|
||||
* @option String textExtraction (optional) A string of the text-extraction method to use. For complex html structures inside td
|
||||
* cell set this option to "complex", on large tables the complex option can be slow.
|
||||
* Default value: "simple"
|
||||
*
|
||||
* @option Object headers (optional) An array containing the forces sorting rules. This option let's you specify a default sorting rule.
|
||||
* Default value: null
|
||||
*
|
||||
* @option Array sortList (optional) An array containing the forces sorting rules. This option let's you specify a default sorting rule.
|
||||
* Default value: null
|
||||
*
|
||||
* @option Array sortForce (optional) An array containing forced sorting rules. This option let's you specify a default sorting rule,
|
||||
* which is prepended to user-selected rules.
|
||||
* Default value: null
|
||||
*
|
||||
* @option Boolean sortLocaleCompare (optional) Boolean flag indicating whatever to use String.localeCampare method or not.
|
||||
* Default set to true.
|
||||
*
|
||||
* @option Array sortAppend (optional) An array containing forced sorting rules. This option let's you specify a default sorting rule,
|
||||
* which is appended to user-selected rules.
|
||||
* Default value: null
|
||||
*
|
||||
* @option Boolean widthFixed (optional) Boolean flag indicating if tablesorter should apply fixed widths to the table columns.
|
||||
* This is useful when using the pager companion plugin. This options requires the dimension jquery plugin.
|
||||
* Default value: false
|
||||
*
|
||||
* @option Boolean cancelSelection (optional) Boolean flag indicating if tablesorter should cancel selection of the table headers text.
|
||||
* Default value: true
|
||||
*
|
||||
* @option Boolean debug (optional) Boolean flag indicating if tablesorter should display debuging information usefull for development.
|
||||
*
|
||||
* @type jQuery
|
||||
* @name tablesorter
|
||||
* @cat Plugins/Tablesorter
|
||||
* @author Christian Bach/christian.bach@polyester.se
|
||||
*/
|
||||
(function($){
|
||||
$.extend({
|
||||
tablesorter: new function(){
|
||||
|
||||
var parsers = [], widgets = [], tbl;
|
||||
this.defaults = {
|
||||
cssHeader: "header",
|
||||
cssAsc: "headerSortUp",
|
||||
cssDesc: "headerSortDown",
|
||||
cssChildRow: "expand-child",
|
||||
sortInitialOrder: "asc",
|
||||
sortMultiSortKey: "shiftKey",
|
||||
sortForce: null,
|
||||
sortAppend: null,
|
||||
sortLocaleCompare: false,
|
||||
textExtraction: "simple",
|
||||
parsers: {},
|
||||
widgets: [],
|
||||
widgetZebra: { css: ["even", "odd"] },
|
||||
headers: {},
|
||||
widthFixed: false,
|
||||
cancelSelection: true,
|
||||
sortList: [],
|
||||
headerList: [],
|
||||
dateFormat: "us",
|
||||
decimal: /\.|\,/g,
|
||||
onRenderHeader: null,
|
||||
selectorHeaders: 'thead th',
|
||||
tableClass : 'tablesorter',
|
||||
debug: false
|
||||
};
|
||||
|
||||
/* debuging utils */
|
||||
function log(s) {
|
||||
if (typeof console !== "undefined" && typeof console.debug !== "undefined") {
|
||||
console.log(s);
|
||||
} else {
|
||||
alert(s);
|
||||
}
|
||||
}
|
||||
|
||||
function benchmark(s, d) {
|
||||
log(s + "," + (new Date().getTime() - d.getTime()) + "ms");
|
||||
}
|
||||
|
||||
this.benchmark = benchmark;
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
/* parsers utils */
|
||||
function getParserById(name) {
|
||||
var i, l = parsers.length;
|
||||
for (i = 0; i < l; i++) {
|
||||
if (parsers[i].id.toLowerCase() === name.toLowerCase()) {
|
||||
return parsers[i];
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function getNodeFromRowAndCellIndex(rows, rowIndex, cellIndex) {
|
||||
return rows[rowIndex].cells[cellIndex];
|
||||
}
|
||||
|
||||
function trimAndGetNodeText(config, node) {
|
||||
return $.trim(getElementText(config, node));
|
||||
}
|
||||
|
||||
function detectParserForColumn(table, rows, rowIndex, cellIndex) {
|
||||
var i, l = parsers.length,
|
||||
node = false,
|
||||
nodeValue = '',
|
||||
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 (i = 1; i < l; i++) {
|
||||
if (parsers[i].is(nodeValue, table, node)) {
|
||||
return parsers[i];
|
||||
}
|
||||
}
|
||||
// 0 is always the generic parser (text)
|
||||
return parsers[0];
|
||||
}
|
||||
|
||||
function buildParserCache(table, $headers) {
|
||||
if (table.tBodies.length === 0) { return; } // In the case of empty tables
|
||||
var rows = table.tBodies[0].rows, list, cells, l, i, p, parsersDebug = "";
|
||||
if (rows[0]) {
|
||||
list = [];
|
||||
cells = rows[0].cells;
|
||||
l = cells.length;
|
||||
for (i = 0; i < l; i++) {
|
||||
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;
|
||||
}
|
||||
|
||||
/* utils */
|
||||
function buildCache(table) {
|
||||
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: []
|
||||
},
|
||||
i, j, c, cols, cacheTime;
|
||||
if (table.config.debug) {
|
||||
cacheTime = new Date();
|
||||
}
|
||||
for (i = 0; i < totalRows; ++i) {
|
||||
/** Add the table data to main data array */
|
||||
c = $(table.tBodies[0].rows[i]);
|
||||
cols = [];
|
||||
// if this is a child row, add it to the last row's children and
|
||||
// continue to the next row
|
||||
if (c.hasClass(table.config.cssChildRow)) {
|
||||
cache.row[cache.row.length - 1] = cache.row[cache.row.length - 1].add(c);
|
||||
// go to the next for loop
|
||||
continue;
|
||||
}
|
||||
cache.row.push(c);
|
||||
for (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); // add position for rowCache
|
||||
cache.normalized.push(cols);
|
||||
cols = null;
|
||||
}
|
||||
if (table.config.debug) {
|
||||
benchmark("Building cache for " + totalRows + " rows:", cacheTime);
|
||||
}
|
||||
return cache;
|
||||
}
|
||||
|
||||
function getWidgetById(name) {
|
||||
var i, l = widgets.length;
|
||||
for (i = 0; i < l; i++) {
|
||||
if (widgets[i].id.toLowerCase() === name.toLowerCase()) {
|
||||
return widgets[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function applyWidget(table) {
|
||||
var c = table.config.widgets,
|
||||
i, l = c.length;
|
||||
for (i = 0; i < l; i++) {
|
||||
getWidgetById(c[i]).format(table);
|
||||
}
|
||||
}
|
||||
|
||||
function appendToTable(table, cache) {
|
||||
var c = cache,
|
||||
r = c.row,
|
||||
n = c.normalized,
|
||||
totalRows = n.length,
|
||||
checkCell = (n[0].length - 1),
|
||||
tableBody = $(table.tBodies[0]),
|
||||
rows = [],
|
||||
i, j, l, pos, appendTime;
|
||||
if (table.config.debug) {
|
||||
appendTime = new Date();
|
||||
}
|
||||
for (i = 0; i < totalRows; i++) {
|
||||
pos = n[i][checkCell];
|
||||
rows.push(r[pos]);
|
||||
if (!table.config.appender) {
|
||||
l = r[pos].length;
|
||||
for (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);
|
||||
}
|
||||
// apply table widgets
|
||||
applyWidget(table);
|
||||
// trigger sortend
|
||||
setTimeout(function () {
|
||||
$(table).trigger("sortEnd");
|
||||
}, 0);
|
||||
}
|
||||
|
||||
// from:
|
||||
// http://www.javascripttoolbox.com/lib/table/examples.php
|
||||
// http://www.javascripttoolbox.com/temp/table_cellindex.html
|
||||
function computeTableHeaderCellIndexes(t) {
|
||||
var matrix = [],
|
||||
lookup = {},
|
||||
thead = t.getElementsByTagName('THEAD')[0],
|
||||
trs = thead.getElementsByTagName('TR'),
|
||||
i, j, k, l, c, cells, rowIndex, cellId, rowSpan, colSpan, firstAvailCol, matrixrow;
|
||||
for (i = 0; i < trs.length; i++) {
|
||||
cells = trs[i].cells;
|
||||
for (j = 0; j < cells.length; j++) {
|
||||
c = cells[j];
|
||||
rowIndex = c.parentNode.rowIndex;
|
||||
cellId = rowIndex + "-" + c.cellIndex;
|
||||
rowSpan = c.rowSpan || 1;
|
||||
colSpan = c.colSpan || 1;
|
||||
if (typeof(matrix[rowIndex]) === "undefined") {
|
||||
matrix[rowIndex] = [];
|
||||
}
|
||||
// Find first available column in the first row
|
||||
for (k = 0; k < matrix[rowIndex].length + 1; k++) {
|
||||
if (typeof(matrix[rowIndex][k]) === "undefined") {
|
||||
firstAvailCol = k;
|
||||
break;
|
||||
}
|
||||
}
|
||||
lookup[cellId] = firstAvailCol;
|
||||
for (k = rowIndex; k < rowIndex + rowSpan; k++) {
|
||||
if (typeof(matrix[k]) === "undefined") {
|
||||
matrix[k] = [];
|
||||
}
|
||||
matrixrow = matrix[k];
|
||||
for (l = firstAvailCol; l < firstAvailCol + colSpan; l++) {
|
||||
matrixrow[l] = "x";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return lookup;
|
||||
}
|
||||
|
||||
function formatSortingOrder(v) {
|
||||
if (typeof(v) !== "Number") {
|
||||
return (v.toLowerCase() === "desc") ? 1 : 0;
|
||||
} else {
|
||||
return (v === 1) ? 1 : 0;
|
||||
}
|
||||
}
|
||||
|
||||
function checkHeaderMetadata(cell) {
|
||||
return (($.metadata) && ($(cell).metadata().sorter === false));
|
||||
}
|
||||
|
||||
function checkHeaderOptions(table, i) {
|
||||
return ((table.config.headers[i]) && (table.config.headers[i].sorter === false));
|
||||
}
|
||||
|
||||
function checkHeaderOptionsSortingLocked(table, i) {
|
||||
if ((table.config.headers[i]) && (table.config.headers[i].lockedOrder)) { return table.config.headers[i].lockedOrder; }
|
||||
return false;
|
||||
}
|
||||
|
||||
function buildHeaders(table) {
|
||||
var meta = ($.metadata) ? true : false,
|
||||
header_index = computeTableHeaderCellIndexes(table),
|
||||
time, $tableHeaders;
|
||||
if (table.config.debug) {
|
||||
time = new Date();
|
||||
}
|
||||
$tableHeaders = $(table.config.selectorHeaders, table)
|
||||
.wrapInner("<span/>")
|
||||
.each(function (index) {
|
||||
this.column = header_index[this.parentNode.rowIndex + "-" + this.cellIndex];
|
||||
// this.column = index;
|
||||
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); }
|
||||
}
|
||||
// add cell to headerList
|
||||
table.config.headerList[index] = this;
|
||||
});
|
||||
if (table.config.debug) {
|
||||
benchmark("Built headers:", time);
|
||||
log($tableHeaders);
|
||||
}
|
||||
return $tableHeaders;
|
||||
}
|
||||
|
||||
function checkCellColSpan(table, rows, row) {
|
||||
var i, cell, arr = [],
|
||||
r = table.tHead.rows,
|
||||
c = r[row].cells;
|
||||
for (i = 0; i < c.length; i++) {
|
||||
cell = c[i];
|
||||
if (cell.colSpan > 1) {
|
||||
arr = arr.concat(checkCellColSpan(table, rows, row++)); // what is headerArr?
|
||||
} else {
|
||||
if (table.tHead.length === 1 || (cell.rowSpan > 1 || !r[row + 1])) {
|
||||
arr.push(cell);
|
||||
}
|
||||
}
|
||||
}
|
||||
return arr;
|
||||
}
|
||||
|
||||
function isValueInArray(v, a) {
|
||||
var i, l = a.length;
|
||||
for (i = 0; i < l; i++) {
|
||||
if (a[i][0] === v) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function setHeadersCss(table, $headers, list, css) {
|
||||
// remove all header information
|
||||
$headers.removeClass(css[0]).removeClass(css[1]);
|
||||
var h = [], i, l;
|
||||
$headers.each(function (offset) {
|
||||
if (!this.sortDisabled) {
|
||||
h[this.column] = $(this);
|
||||
}
|
||||
});
|
||||
l = list.length;
|
||||
for (i = 0; i < l; i++) {
|
||||
h[list[i][0]].addClass(css[list[i][1]]);
|
||||
}
|
||||
}
|
||||
|
||||
function fixColumnWidth(table, $headers) {
|
||||
var c = table.config, colgroup;
|
||||
if (c.widthFixed) {
|
||||
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 i, s, o, c = table.config,
|
||||
l = sortList.length;
|
||||
for (i = 0; i < l; i++) {
|
||||
s = sortList[i];
|
||||
o = c.headerList[s[0]];
|
||||
o.count = s[1];
|
||||
o.count++;
|
||||
}
|
||||
}
|
||||
|
||||
function getCachedSortType(parsers, i) {
|
||||
return parsers[i].type;
|
||||
}
|
||||
|
||||
/* sorting methods - reverted sorting method back to version 2.0.3 */
|
||||
function multisort(table,sortList,cache){
|
||||
var dynamicExp = "var sortWrapper = function(a,b) {",
|
||||
l = sortList.length, sortTime, i, c, s, e, order, orgOrderCol;
|
||||
if (table.config.debug) { sortTime = new Date(); }
|
||||
for (i=0; i < l; i++) {
|
||||
c = sortList[i][0];
|
||||
order = sortList[i][1];
|
||||
s = (getCachedSortType(table.config.parsers,c) === "text") ? ((order === 0) ? "sortText" : "sortTextDesc") : ((order === 0) ? "sortNumeric" : "sortNumericDesc");
|
||||
e = "e" + i;
|
||||
dynamicExp += "var " + e + " = " + s + "(a[" + c + "],b[" + c + "]); ";
|
||||
dynamicExp += "if (" + e + ") { return " + e + "; } ";
|
||||
dynamicExp += "else { ";
|
||||
}
|
||||
// if value is the same keep orignal order
|
||||
orgOrderCol = cache.normalized[0].length - 1;
|
||||
dynamicExp += "return a[" + orgOrderCol + "]-b[" + orgOrderCol + "];";
|
||||
for(i=0; i < l; i++) {
|
||||
dynamicExp += "}; ";
|
||||
}
|
||||
dynamicExp += "return 0; ";
|
||||
dynamicExp += "}; ";
|
||||
eval(dynamicExp);
|
||||
cache.normalized.sort(sortWrapper);
|
||||
if (table.config.debug) { benchmark("Sorting on " + sortList.toString() + " and dir " + order+ " time:", sortTime); }
|
||||
return cache;
|
||||
}
|
||||
|
||||
// http://www.webdeveloper.com/forum/showthread.php?t=107909
|
||||
function sortText(a, b){
|
||||
if ($.data(tbl[0], "tablesorter").sortLocaleCompare) { return a.localeCompare(b); }
|
||||
if (a === b) { return 0; }
|
||||
try {
|
||||
var cnt = 0, ax, t, x = /^(\.)?\d/,
|
||||
L = Math.min(a.length, b.length) + 1;
|
||||
while (cnt < L && a.charAt(cnt) === b.charAt(cnt) && x.test(b.substring(cnt)) === false && x.test(a.substring(cnt)) === false) { cnt++; }
|
||||
a = a.substring(cnt);
|
||||
b = b.substring(cnt);
|
||||
if (x.test(a) || x.test(b)) {
|
||||
if (x.test(a) === false) {
|
||||
return (a) ? 1 : -1;
|
||||
} else if (x.test(b) === false) {
|
||||
return (b) ? -1 : 1;
|
||||
} else {
|
||||
t = parseFloat(a) - parseFloat(b);
|
||||
if (t !== 0) { return t; } else { t = a.search(/[^\.\d]/); }
|
||||
if (t === -1) { t = b.search(/[^\.\d]/); }
|
||||
a = a.substring(t);
|
||||
b = b.substring(t);
|
||||
}
|
||||
}
|
||||
return (a > b) ? 1 : -1;
|
||||
} catch (er) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
function sortTextDesc(a,b){
|
||||
if ($.data(tbl[0], "tablesorter").sortLocaleCompare) { return b.localeCompare(a); }
|
||||
return -sortText(a,b);
|
||||
}
|
||||
|
||||
function sortNumeric(a, b) {
|
||||
return a - b;
|
||||
}
|
||||
|
||||
function sortNumericDesc(a, b) {
|
||||
return b - a;
|
||||
}
|
||||
|
||||
/* public methods */
|
||||
this.construct = function(settings){
|
||||
return this.each(function(){
|
||||
// if no thead or tbody quit.
|
||||
if (!this.tHead || !this.tBodies) { return; }
|
||||
// declare
|
||||
var $this, $document, $headers, cache, config, shiftDown = 0,
|
||||
sortOrder, sortCSS, totalRows, $cell, i, j, a, s, o;
|
||||
// new blank config object
|
||||
this.config = {};
|
||||
// merge and extend.
|
||||
config = $.extend(this.config, $.tablesorter.defaults, settings);
|
||||
// store common expression for speed
|
||||
tbl = $this = $(this).addClass(this.config.tableClass);
|
||||
// save the settings where they read
|
||||
$.data(this, "tablesorter", config);
|
||||
// build headers
|
||||
$headers = buildHeaders(this);
|
||||
// try to auto detect column type, and store in tables config
|
||||
this.config.parsers = buildParserCache(this, $headers);
|
||||
// build the cache for the tbody cells
|
||||
cache = buildCache(this);
|
||||
// get the css class names, could be done else where.
|
||||
sortCSS = [config.cssDesc, config.cssAsc];
|
||||
// fixate columns if the users supplies the fixedWidth option
|
||||
fixColumnWidth(this);
|
||||
// apply event handling to headers
|
||||
// this is to big, perhaps break it out?
|
||||
$headers
|
||||
.click(function(e){
|
||||
totalRows = ($this[0].tBodies[0] && $this[0].tBodies[0].rows.length) || 0;
|
||||
if (!this.sortDisabled && totalRows > 0) {
|
||||
// Only call sortStart if sorting is enabled.
|
||||
$this.trigger("sortStart");
|
||||
// store exp, for speed
|
||||
$cell = $(this);
|
||||
// get current column index
|
||||
i = this.column;
|
||||
// get current column sort order
|
||||
this.order = this.count++ % 2;
|
||||
// always sort on the locked order.
|
||||
if(this.lockedOrder) { this.order = this.lockedOrder; }
|
||||
// user only whants to sort on one
|
||||
// column
|
||||
if (!e[config.sortMultiSortKey]) {
|
||||
// flush the sort list
|
||||
config.sortList = [];
|
||||
if (config.sortForce !== null) {
|
||||
a = config.sortForce;
|
||||
for (j = 0; j < a.length; j++) {
|
||||
if (a[j][0] !== i) {
|
||||
config.sortList.push(a[j]);
|
||||
}
|
||||
}
|
||||
}
|
||||
// add column to sort list
|
||||
config.sortList.push([i, this.order]);
|
||||
// multi column sorting
|
||||
} else {
|
||||
// the user has clicked on an all
|
||||
// ready sortet column.
|
||||
if (isValueInArray(i, config.sortList)) {
|
||||
// revers the sorting direction
|
||||
// for all tables.
|
||||
for (j = 0; j < config.sortList.length; j++) {
|
||||
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 {
|
||||
// add column to sort list array
|
||||
config.sortList.push([i, this.order]);
|
||||
}
|
||||
}
|
||||
setTimeout(function () {
|
||||
// set css for headers
|
||||
setHeadersCss($this[0], $headers, config.sortList, sortCSS);
|
||||
appendToTable(
|
||||
$this[0], multisort(
|
||||
$this[0], config.sortList, cache)
|
||||
);
|
||||
}, 1);
|
||||
// stop normal event by returning false
|
||||
return false;
|
||||
}
|
||||
// cancel selection
|
||||
})
|
||||
.mousedown(function(){
|
||||
if (config.cancelSelection) {
|
||||
this.onselectstart = function(){
|
||||
return false;
|
||||
};
|
||||
return false;
|
||||
}
|
||||
});
|
||||
// apply easy methods that trigger binded events
|
||||
$this
|
||||
.bind("update", function(){
|
||||
var me = this;
|
||||
setTimeout(function(){
|
||||
// rebuild parsers.
|
||||
me.config.parsers = buildParserCache(
|
||||
me, $headers);
|
||||
// rebuild the cache map
|
||||
cache = buildCache(me);
|
||||
}, 1);
|
||||
})
|
||||
.bind("updateCell", function(e, cell) {
|
||||
var config = this.config,
|
||||
// get position from the dom.
|
||||
pos = [(cell.parentNode.rowIndex - 1), cell.cellIndex];
|
||||
// update cache
|
||||
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;
|
||||
// update and store the sortlist
|
||||
var sortList = config.sortList;
|
||||
// update header count index
|
||||
updateHeaderSortCount(this, sortList);
|
||||
// set css for headers
|
||||
setHeadersCss(this, $headers, sortList, sortCSS);
|
||||
// sort the table and append it to the dom
|
||||
appendToTable(this, multisort(this, sortList, cache));
|
||||
})
|
||||
.bind("appendCache", function () {
|
||||
appendToTable(this, cache);
|
||||
})
|
||||
.bind("applyWidgetId", function (e, id) {
|
||||
getWidgetById(id).format(this);
|
||||
})
|
||||
.bind("applyWidgets", function () {
|
||||
// apply widgets
|
||||
applyWidget(this);
|
||||
});
|
||||
if ($.metadata && ($(this).metadata() && $(this).metadata().sortlist)) {
|
||||
config.sortList = $(this).metadata().sortlist;
|
||||
}
|
||||
// if user has supplied a sort list to constructor.
|
||||
if (config.sortList.length > 0) {
|
||||
$this.trigger("sorton", [config.sortList]);
|
||||
}
|
||||
// apply widgets
|
||||
applyWidget(this);
|
||||
});
|
||||
};
|
||||
this.addParser = function(parser) {
|
||||
var i, l = parsers.length, a = true;
|
||||
for (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, 10);
|
||||
return (isNaN(i)) ? 0 : i;
|
||||
};
|
||||
this.isDigit = function (s, config) {
|
||||
// replace all an wanted chars and match.
|
||||
return (/^[\-+]?\d*$/).test($.trim(s.replace(/[,.']/g, '')));
|
||||
};
|
||||
this.clearTableBody = function (table) {
|
||||
if ($.browser.msie) {
|
||||
var empty = function() {
|
||||
while (this.firstChild) {
|
||||
this.removeChild(this.firstChild);
|
||||
}
|
||||
};
|
||||
empty.apply(table.tBodies[0]);
|
||||
} else {
|
||||
table.tBodies[0].innerHTML = "";
|
||||
}
|
||||
};
|
||||
}
|
||||
})();
|
||||
|
||||
// extend plugin scope
|
||||
$.fn.extend({
|
||||
tablesorter: $.tablesorter.construct
|
||||
});
|
||||
|
||||
// make shortcut
|
||||
var ts = $.tablesorter;
|
||||
|
||||
// add default parsers
|
||||
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 i, item, a = s.split("."),
|
||||
r = "",
|
||||
l = a.length;
|
||||
for (i = 0; i < l; i++) {
|
||||
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 $.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") {
|
||||
// reformat the string in ISO format
|
||||
s = s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{4})/, "$3/$1/$2");
|
||||
} else if (c.dateFormat === "uk") {
|
||||
// reformat the string in ISO format
|
||||
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"
|
||||
});
|
||||
|
||||
// add default widgets
|
||||
ts.addWidget({
|
||||
id: "zebra",
|
||||
format: function(table) {
|
||||
var $tr, row = -1,
|
||||
odd, time;
|
||||
if (table.config.debug) {
|
||||
time = new Date();
|
||||
}
|
||||
// loop through the visible rows
|
||||
$("tr:visible", table.tBodies[0]).each(function (i) {
|
||||
$tr = $(this);
|
||||
// style children rows the same way the parent
|
||||
// row was styled
|
||||
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);
|
7
js/jquery.tablesorter.min.js
vendored
Normal file
184
js/jquery.tablesorter.pager.js
Normal file
@ -0,0 +1,184 @@
|
||||
(function($) {
|
||||
$.extend({
|
||||
tablesorterPager: new function() {
|
||||
|
||||
function updatePageDisplay(c) {
|
||||
var s = $(c.cssPageDisplay,c.container).val((c.page+1) + c.seperator + c.totalPages);
|
||||
}
|
||||
|
||||
function setPageSize(table,size) {
|
||||
var c = table.config;
|
||||
c.size = size;
|
||||
c.totalPages = Math.ceil(c.totalRows / c.size);
|
||||
c.pagerPositionSet = false;
|
||||
moveToPage(table);
|
||||
fixPosition(table);
|
||||
}
|
||||
|
||||
function fixPosition(table) {
|
||||
var c = table.config;
|
||||
if(!c.pagerPositionSet && c.positionFixed) {
|
||||
var c = table.config, o = $(table);
|
||||
if(o.offset) {
|
||||
c.container.css({
|
||||
top: o.offset().top + o.height() + 'px',
|
||||
position: 'absolute'
|
||||
});
|
||||
}
|
||||
c.pagerPositionSet = true;
|
||||
}
|
||||
}
|
||||
|
||||
function moveToFirstPage(table) {
|
||||
var c = table.config;
|
||||
c.page = 0;
|
||||
moveToPage(table);
|
||||
}
|
||||
|
||||
function moveToLastPage(table) {
|
||||
var c = table.config;
|
||||
c.page = (c.totalPages-1);
|
||||
moveToPage(table);
|
||||
}
|
||||
|
||||
function moveToNextPage(table) {
|
||||
var c = table.config;
|
||||
c.page++;
|
||||
if(c.page >= (c.totalPages-1)) {
|
||||
c.page = (c.totalPages-1);
|
||||
}
|
||||
moveToPage(table);
|
||||
}
|
||||
|
||||
function moveToPrevPage(table) {
|
||||
var c = table.config;
|
||||
c.page--;
|
||||
if(c.page <= 0) {
|
||||
c.page = 0;
|
||||
}
|
||||
moveToPage(table);
|
||||
}
|
||||
|
||||
|
||||
function moveToPage(table) {
|
||||
var c = table.config;
|
||||
if(c.page < 0 || c.page > (c.totalPages-1)) {
|
||||
c.page = 0;
|
||||
}
|
||||
|
||||
renderTable(table,c.rowsCopy);
|
||||
}
|
||||
|
||||
function renderTable(table,rows) {
|
||||
|
||||
var c = table.config;
|
||||
var l = rows.length;
|
||||
var s = (c.page * c.size);
|
||||
var e = (s + c.size);
|
||||
if(e > rows.length ) {
|
||||
e = rows.length;
|
||||
}
|
||||
|
||||
|
||||
var tableBody = $(table.tBodies[0]);
|
||||
|
||||
// clear the table body
|
||||
|
||||
$.tablesorter.clearTableBody(table);
|
||||
|
||||
for(var i = s; i < e; i++) {
|
||||
|
||||
//tableBody.append(rows[i]);
|
||||
|
||||
var o = rows[i];
|
||||
var l = o.length;
|
||||
for(var j=0; j < l; j++) {
|
||||
|
||||
tableBody[0].appendChild(o[j]);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
fixPosition(table,tableBody);
|
||||
|
||||
$(table).trigger("applyWidgets");
|
||||
|
||||
if( c.page >= c.totalPages ) {
|
||||
moveToLastPage(table);
|
||||
}
|
||||
|
||||
updatePageDisplay(c);
|
||||
}
|
||||
|
||||
this.appender = function(table,rows) {
|
||||
|
||||
var c = table.config;
|
||||
|
||||
c.rowsCopy = rows;
|
||||
c.totalRows = rows.length;
|
||||
c.totalPages = Math.ceil(c.totalRows / c.size);
|
||||
|
||||
renderTable(table,rows);
|
||||
};
|
||||
|
||||
this.defaults = {
|
||||
size: 10,
|
||||
offset: 0,
|
||||
page: 0,
|
||||
totalRows: 0,
|
||||
totalPages: 0,
|
||||
container: null,
|
||||
cssNext: '.next',
|
||||
cssPrev: '.prev',
|
||||
cssFirst: '.first',
|
||||
cssLast: '.last',
|
||||
cssPageDisplay: '.pagedisplay',
|
||||
cssPageSize: '.pagesize',
|
||||
seperator: "/",
|
||||
positionFixed: true,
|
||||
appender: this.appender
|
||||
};
|
||||
|
||||
this.construct = function(settings) {
|
||||
|
||||
return this.each(function() {
|
||||
|
||||
config = $.extend(this.config, $.tablesorterPager.defaults, settings);
|
||||
|
||||
var table = this, pager = config.container;
|
||||
|
||||
$(this).trigger("appendCache");
|
||||
|
||||
config.size = parseInt($(".pagesize",pager).val());
|
||||
|
||||
$(config.cssFirst,pager).click(function() {
|
||||
moveToFirstPage(table);
|
||||
return false;
|
||||
});
|
||||
$(config.cssNext,pager).click(function() {
|
||||
moveToNextPage(table);
|
||||
return false;
|
||||
});
|
||||
$(config.cssPrev,pager).click(function() {
|
||||
moveToPrevPage(table);
|
||||
return false;
|
||||
});
|
||||
$(config.cssLast,pager).click(function() {
|
||||
moveToLastPage(table);
|
||||
return false;
|
||||
});
|
||||
$(config.cssPageSize,pager).change(function() {
|
||||
setPageSize(table,parseInt($(this).val()));
|
||||
return false;
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
}
|
||||
});
|
||||
// extend plugin scope
|
||||
$.fn.extend({
|
||||
tablesorterPager: $.tablesorterPager.construct
|
||||
});
|
||||
|
||||
})(jQuery);
|