Added missing docs!

This commit is contained in:
Rob Garrison 2011-07-17 10:01:18 -05:00
parent b139516d91
commit 98eee6dc72
72 changed files with 5263 additions and 11997 deletions

View File

@ -1,82 +1,39 @@
tablesorter is a jQuery plugin for turning a standard HTML table with THEAD and TBODY tags into a sortable table without page refreshes. 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. tablesorter can successfully parse and sort many types of data including linked data in a cell.
###Features ([Demo](http://mottie.github.com/tablesorter/)) See [Alpha-numeric sort Demo](http://mottie.github.com/tablesorter/) & [Full Documentation](http://mottie.github.com/tablesorter/docs/)
###Features
* Multi-column sorting. * 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) * Parsers for sorting text, alphanumeric text, URIs, integers, currency, floats, IP addresses, dates (ISO, long and short formats), time. [Add your own easily](http://mottie.github.com/tablesorter/docs/example-parsers.html)
* Support for ROWSPAN and COLSPAN on TH elements. * Support for ROWSPAN and COLSPAN on TH elements.
* Support secondary "hidden" sorting (e.g., maintain alphabetical sort when sorting on other criteria). * Support secondary "hidden" sorting (e.g., maintain alphabetical sort when sorting on other criteria).
* Extensibility via [widget system](docs/example-widgets.html). * Extensibility via [widget system](http://mottie.github.com/tablesorter/docs/example-widgets.html).
* Cross-browser: IE 6.0+, FF 2+, Safari 2.0+, Opera 9.0+. * Cross-browser: IE 6.0+, FF 2+, Safari 2.0+, Opera 9.0+.
* Small code size. * Small code size.
* Works with jQuery 1.2.3+ * Works with jQuery 1.2.3+
###Documentation ###Documentation
Included all original [document pages](http://mottie.github.com/tablesorter/docs/index.html). Included all original [document pages](http://mottie.github.com/tablesorter/docs/index.html) with updates from my blog post on [undocumented options](http://wowmotty.blogspot.com/2011/06/jquery-tablesorter-missing-docs.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 ###Licensing
* Copyright (c) 2007 Christian Bach * Copyright (c) 2007 Christian Bach
* Main Examples and docs at: http://tablesorter.com * Main Examples and docs at: [http://tablesorter.com](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: * 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 ###Change Log
#### Version 2.0.6 (2011-06-22) View the [complete listing here](changelog.markdown).
* Forked original files and docs from [tablesorter.com](http://tablesorter.com) to GitHub. #### Version 2.0.7 (2011-07-17)
* 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 (?) * Added "pagerChange" and "pagerComplete" events to the pager plugin which trigger on the table. See the [pager demo](http://mottie.github.com/tablesorter/docs/example-pager.html) for an example on how to bind to them.
* Added the "sortAppend" since the option was there, but apparently the code wasn't.
* General * Added missing documentation from [my blog post](http://wowmotty.blogspot.com/2011/06/jquery-tablesorter-missing-docs.html)
* Added "cssChildRow" option - attach a child row to its parent. * This included a few new example pages: apply widgets, child rows, render header, sort append and zebra widget.
* Added "sortLocaleCompare" to use the native `String.localeCampare` method during text sort. * Added a methods and events table.
* Added "onRenderHeader" function that is called when classes are added to the header cells. * Fixed the minified version. Apparently sorting functions called by the eval were removed by the Google Closure Compiler. Resolved by using "Whitespace only" optimization.
* Added "selectorHeaders" option to target the the header cells. * Fixed syntax highlighting; updated Chili.
* 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).

View File

@ -20,6 +20,3 @@ div.tablesorterPager input {
border: 1px solid #330000; border: 1px solid #330000;
text-align: center; text-align: center;
} }

View File

@ -1,184 +1,165 @@
(function($) { (function($) {
$.extend({ $.extend({tablesorterPager: new function() {
tablesorterPager: new function() {
function updatePageDisplay(c) { var updatePageDisplay = function(table,c) {
var s = $(c.cssPageDisplay,c.container).val((c.page+1) + c.seperator + c.totalPages); var s = $(c.cssPageDisplay,c.container).val((c.page+1) + c.seperator + c.totalPages);
$(table).trigger('pagerComplete', c);
},
fixPosition = function(table) {
var c = table.config, o = $(table);
if (!c.pagerPositionSet && c.positionFixed) {
if (o.offset) {
c.container.css({
top: o.offset().top + o.height() + 'px',
position: 'absolute'
});
}
c.pagerPositionSet = true;
} }
},
function setPageSize(table,size) { renderTable = function(table,rows) {
var c = table.config; var i, j, o,
c.size = size; tableBody,
c.totalPages = Math.ceil(c.totalRows / c.size); c = table.config,
c.pagerPositionSet = false; l = rows.length,
moveToPage(table); s = (c.page * c.size),
fixPosition(table); e = (s + c.size);
$(table).trigger('pagerChange',c);
if (e > rows.length ) {
e = rows.length;
} }
tableBody = $(table.tBodies[0]);
function fixPosition(table) { // clear the table body
var c = table.config; $.tablesorter.clearTableBody(table);
if(!c.pagerPositionSet && c.positionFixed) { for(i = s; i < e; i++) {
var c = table.config, o = $(table); //tableBody.append(rows[i]);
if(o.offset) { o = rows[i];
c.container.css({ l = o.length;
top: o.offset().top + o.height() + 'px', for (j = 0; j < l; j++) {
position: 'absolute' tableBody[0].appendChild(o[j]);
});
}
c.pagerPositionSet = true;
} }
} }
fixPosition(table,tableBody);
$(table).trigger("applyWidgets");
if( c.page >= c.totalPages ) {
moveToLastPage(table);
}
updatePageDisplay(table,c);
},
function moveToFirstPage(table) { moveToPage = function(table) {
var c = table.config; var c = table.config;
if(c.page < 0 || c.page > (c.totalPages-1)) {
c.page = 0; c.page = 0;
moveToPage(table);
} }
renderTable(table,c.rowsCopy);
},
function moveToLastPage(table) { setPageSize = function(table,size) {
var c = table.config; var c = table.config;
c.size = size;
c.totalPages = Math.ceil(c.totalRows / c.size);
c.pagerPositionSet = false;
moveToPage(table);
fixPosition(table);
},
moveToFirstPage = function(table) {
var c = table.config;
c.page = 0;
moveToPage(table);
},
moveToLastPage = function(table) {
var c = table.config;
c.page = (c.totalPages-1);
moveToPage(table);
},
moveToNextPage = function(table) {
var c = table.config;
c.page++;
if(c.page >= (c.totalPages-1)) {
c.page = (c.totalPages-1); c.page = (c.totalPages-1);
moveToPage(table);
} }
moveToPage(table);
},
function moveToNextPage(table) { moveToPrevPage = function(table) {
var c = table.config; var c = table.config;
c.page++; c.page--;
if(c.page >= (c.totalPages-1)) { if(c.page <= 0) {
c.page = (c.totalPages-1); c.page = 0;
}
moveToPage(table);
} }
moveToPage(table);
};
function moveToPrevPage(table) { this.appender = function(table,rows) {
var c = table.config; var c = table.config;
c.page--; c.rowsCopy = rows;
if(c.page <= 0) { c.totalRows = rows.length;
c.page = 0; c.totalPages = Math.ceil(c.totalRows / c.size);
} renderTable(table,rows);
moveToPage(table); };
}
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
};
function moveToPage(table) { this.construct = function(settings) {
var c = table.config; return this.each(function() {
if(c.page < 0 || c.page > (c.totalPages-1)) { var config = $.extend(this.config, $.tablesorterPager.defaults, settings),
c.page = 0; table = this,
} pager = config.container;
$(this).trigger("appendCache");
renderTable(table,c.rowsCopy); config.size = parseInt($(".pagesize",pager).val(), 10);
}
function renderTable(table,rows) { $(config.cssFirst,pager).click(function() {
moveToFirstPage(table);
var c = table.config; return false;
var l = rows.length; });
var s = (c.page * c.size); $(config.cssNext,pager).click(function() {
var e = (s + c.size); moveToNextPage(table);
if(e > rows.length ) { return false;
e = rows.length; });
} $(config.cssPrev,pager).click(function() {
moveToPrevPage(table);
return false;
var tableBody = $(table.tBodies[0]); });
$(config.cssLast,pager).click(function() {
// clear the table body moveToLastPage(table);
return false;
$.tablesorter.clearTableBody(table); });
$(config.cssPageSize,pager).change(function() {
for(var i = s; i < e; i++) { setPageSize(table,parseInt($(this).val(), 10));
return false;
//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 });
}); // extend plugin scope
$.fn.extend({
tablesorterPager: $.tablesorterPager.construct
});
})(jQuery); })(jQuery);

View File

@ -0,0 +1,2 @@
/* tablesorter pager plugin */
(function(d){d.extend({tablesorterPager:new function(){var k=function(b){var a=b.config,b=d(b);if(!a.pagerPositionSet&&a.positionFixed)b.offset&&a.container.css({top:b.offset().top+b.height()+"px",position:"absolute"}),a.pagerPositionSet=!0},m=function(b,a){var c,f,h,i,e=b.config,g=a.length;c=e.page*e.size;var j=c+e.size;d(b).trigger("pagerChange",e);if(j>a.length)j=a.length;i=d(b.tBodies[0]);for(d.tablesorter.clearTableBody(b);c<j;c++){h=a[c];g=h.length;for(f=0;f<g;f++)i[0].appendChild(h[f])}k(b, i);d(b).trigger("applyWidgets");e.page>=e.totalPages&&l(b);d(e.cssPageDisplay,e.container).val(e.page+1+e.seperator+e.totalPages);d(b).trigger("pagerComplete",e)},g=function(b){var a=b.config;if(a.page<0||a.page>a.totalPages-1)a.page=0;m(b,a.rowsCopy)},l=function(b){var a=b.config;a.page=a.totalPages-1;g(b)};this.appender=function(b,a){var c=b.config;c.rowsCopy=a;c.totalRows=a.length;c.totalPages=Math.ceil(c.totalRows/c.size);m(b,a)};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:!0,appender:this.appender};this.construct=function(b){return this.each(function(){var a=d.extend(this.config,d.tablesorterPager.defaults,b),c=this,f=a.container;d(this).trigger("appendCache");a.size=parseInt(d(".pagesize",f).val(),10);d(a.cssFirst,f).click(function(){c.config.page=0;g(c);return!1});d(a.cssNext,f).click(function(){var a= c.config;a.page++;if(a.page>=a.totalPages-1)a.page=a.totalPages-1;g(c);return!1});d(a.cssPrev,f).click(function(){var a=c.config;a.page--;if(a.page<=0)a.page=0;g(c);return!1});d(a.cssLast,f).click(function(){l(c);return!1});d(a.cssPageSize,f).change(function(){var a=parseInt(d(this).val(),10),b=c.config;b.size=a;b.totalPages=Math.ceil(b.totalRows/b.size);b.pagerPositionSet=!1;g(c);k(c);return!1})})}}});d.fn.extend({tablesorterPager:d.tablesorterPager.construct})})(jQuery);

View File

@ -1,70 +0,0 @@
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)

67
changelog.markdown Normal file
View File

@ -0,0 +1,67 @@
###TableSorter Change Log
#### Version 2.0.7 (2011-07-17)
* Added "pagerChange" and "pagerComplete" events to the pager plugin which trigger on the table. See the [pager demo](http://mottie.github.com/tablesorter/docs/example-pager.html) for an example on how to bind to them.
* Added the "sortAppend" since the option was there, but apparently the code wasn't.
* Added missing documentation from [my blog post](http://wowmotty.blogspot.com/2011/06/jquery-tablesorter-missing-docs.html)
* This included a few new example pages: apply widgets, child rows, render header, sort append and zebra widget.
* Added a methods and events table.
* Fixed the minified version. Apparently sorting functions called by the eval were removed by the Google Closure Compiler. Resolved by using "Whitespace only" optimization.
* Fixed syntax highlighting; updated Chili.
#### 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).

Binary file not shown.

View File

@ -1,8 +1,8 @@
/* Blue Theme */ /* Blue Theme */
table.tablesorter { table.tablesorter {
font-family:arial; font-family: arial;
background-color: #CDCDCD; background-color: #CDCDCD;
margin:10px 0pt 15px; margin: 10px 0pt 15px;
font-size: 8pt; font-size: 8pt;
width: 100%; width: 100%;
text-align: left; text-align: left;
@ -10,6 +10,7 @@ table.tablesorter {
table.tablesorter thead tr th, table.tablesorter tfoot tr th { table.tablesorter thead tr th, table.tablesorter tfoot tr th {
background-color: #e6EEEE; background-color: #e6EEEE;
border: 1px solid #FFF; border: 1px solid #FFF;
border-collapse: collapse;
font-size: 8pt; font-size: 8pt;
padding: 4px; padding: 4px;
} }
@ -26,7 +27,7 @@ table.tablesorter tbody td {
vertical-align: top; vertical-align: top;
} }
table.tablesorter tbody tr.odd td { table.tablesorter tbody tr.odd td {
background-color:#F0F0F6; background-color: #F0F0F6;
} }
table.tablesorter thead tr .headerSortUp { table.tablesorter thead tr .headerSortUp {
background-image: url(black-asc.gif); background-image: url(black-asc.gif);
@ -35,5 +36,5 @@ table.tablesorter thead tr .headerSortDown {
background-image: url(black-desc.gif); background-image: url(black-desc.gif);
} }
table.tablesorter thead tr .headerSortDown, table.tablesorter thead tr .headerSortUp { table.tablesorter thead tr .headerSortDown, table.tablesorter thead tr .headerSortUp {
background-color: #8dbdd8; background-color: #8dbdd8;
} }

Binary file not shown.

View File

@ -6,7 +6,12 @@ h2{color:#333;font-size:small;font-weight:400;margin:0;}
.demo h1,.demo h1 a{font-size:120%;text-align:center;text-decoration:none;} .demo h1,.demo h1 a{font-size:120%;text-align:center;text-decoration:none;}
.demo p{text-align:center;} .demo p{text-align:center;}
.demo table.tablesorter{font-size:14px;} .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;} table.info{border:#000 1px solid;border-collapse:collapse;margin:10px 0 0 10px;}
table.tablesorter table.info tbody th,table.tablesorter table.info tbody td{border:#000 1px solid;}
table.tablesorter table.info tbody th{background:#eee;}
pre,#display{overflow-x:auto;padding:15px;border:1px solid #ddd;border-left-width:5px;}
pre,#display,code.hilight{background-color:#eee;color:#333;font-size:small;list-style:none;}
a code.hilight {text-decoration:underline;}
pre.normal{background-color:transparent;border:none;border-left-width:0;overflow-x:auto;} 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;} #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;} #main{margin:0 20px 20px;padding:0 15px 15px 0;}
@ -27,6 +32,8 @@ form{font-size:10pt;margin-bottom:20px;width:auto;}
form fieldset{padding:10px;text-align:left;width:140px;} 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;} 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#tablesorter-demo {margin: 10px 0 0 0;}
table#options *{font-size:small;} table#options *,table#methods *,table#events *{font-size:small;}
p.tip em {padding: 2px; background-color: #6cf; color: #FFF;} p.tip em {padding: 2px; background-color: #6cf; color: #FFF;}
span.tip em {padding: 0 2px;background-color: #00ce53; color: #fff; font-size:90%; }
div.digg {float: right;} div.digg {float: right;}
.next-up { padding-top: 10px; font-size: 90%; }

View File

@ -1,120 +1,133 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" <!DOCTYPE html>
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-us">
<head> <head>
<meta charset="utf-8">
<title>jQuery plugin: Tablesorter 2.0 - Appending table data with ajax</title> <title>jQuery plugin: Tablesorter 2.0 - Appending table data with ajax</title>
<!-- jQuery --> <!-- jQuery -->
<script type="text/javascript" src="js/jquery-latest.js"></script> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
<!-- Demo stuff --> <!-- Demo stuff -->
<link rel="stylesheet" href="css/jq.css" type="text/css" media="print, projection, screen" /> <link rel="stylesheet" href="css/jq.css">
<script type="text/javascript" src="js/chili/chili-1.8b.js"></script> <script src="js/chili/jquery.chili-2.2.js"></script>
<script type="text/javascript" src="js/docs.js"></script> <script src="js/chili/recipes.js"></script>
<script type="text/javascript" src="js/examples.js"></script> <script src="js/docs.js"></script>
<!-- Tablesorter: required --> <!-- Tablesorter: required -->
<link rel="stylesheet" href="../css/blue/style.css" type="text/css" media="print, projection, screen" /> <link rel="stylesheet" href="../css/blue/style.css">
<script type="text/javascript" src="../js/jquery.tablesorter.js"></script> <script src="../js/jquery.tablesorter.js"></script>
<!-- Tablesorter: optional --> <script id="js">$(function() {
<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(); $("table").tablesorter();
$("#ajax-append").click(function() { $("#ajax-append").click(function() {
$.get("assets/ajax-content.html", function(html) {
// append the "ajax'd" data to the table body $.get("assets/ajax-content.html", function(html) {
$("table tbody").append(html);
// append the "ajax'd" data to the table body
$("table tbody").append(html);
// let the plugin know that we made a update // let the plugin know that we made a update
$("table").trigger("update"); $("table").trigger("update");
// set sorting column and direction, this will sort on the first and third column // set sorting column and direction, this will sort on the first and third column
var sorting = [[2,1],[0,0]]; var sorting = [[2,1],[0,0]];
// sort on the first column $("table").trigger("sorton", [sorting]);
$("table").trigger("sorton",[sorting]);
}); });
return false; return false;
}); });
});</script> });</script>
</head> </head>
<body> <body>
<div id="banner"> <div id="banner">
<h1>table<em>sorter</em></h1> <h1>table<em>sorter</em></h1>
<h2>Appending table data with ajax</h2> <h2>Appending table data with ajax</h2>
<h3>Flexible client-side table sorting</h3> <h3>Flexible client-side table sorting</h3>
<a href="index.html">Back to documentation</a> <a href="index.html">Back to documentation</a>
</div> </div>
<div id="main"> <div id="main">
<h1>Demo</h1> <h1>Demo</h1>
<div id="demo"> <div id="demo"><table class="tablesorter">
<table cellspacing="1" class="tablesorter"> <thead>
<thead> <tr>
<tr> <th>First Name</th>
<th>First Name</th> <th>Last Name</th>
<th>Last Name</th> <th>Age</th>
<th>Age</th> <th>Total</th>
<th>Total</th> <th>Discount</th>
<th>Discount</th> <th>Date</th>
<th>Date</th> </tr>
</tr> </thead>
</thead> <tbody>
<tbody> <tr>
<tr> <td>Peter</td>
<td>Peter</td> <td>Parker</td>
<td>Parker</td> <td>28</td>
<td>28</td> <td>$9.99</td>
<td>$9.99</td> <td>20%</td>
<td>20%</td> <td>Jul 6, 2006 8:14 AM</td>
<td>Jul 6, 2006 8:14 AM</td> </tr>
</tr> <tr>
<tr> <td>John</td>
<td>John</td> <td>Hood</td>
<td>Hood</td> <td>33</td>
<td>33</td> <td>$19.99</td>
<td>$19.99</td> <td>25%</td>
<td>25%</td> <td>Dec 10, 2002 5:14 AM</td>
<td>Dec 10, 2002 5:14 AM</td> </tr>
</tr> <tr>
<tr> <td>Clark</td>
<td>Clark</td> <td>Kent</td>
<td>Kent</td> <td>18</td>
<td>18</td> <td>$15.89</td>
<td>$15.89</td> <td>44%</td>
<td>44%</td> <td>Jan 12, 2003 11:14 AM</td>
<td>Jan 12, 2003 11:14 AM</td> </tr>
</tr> <tr>
<tr> <td>Bruce</td>
<td>Bruce</td> <td>Almighty</td>
<td>Almighty</td> <td>45</td>
<td>45</td> <td>$153.19</td>
<td>$153.19</td> <td>44%</td>
<td>44%</td> <td>Jan 18, 2001 9:12 AM</td>
<td>Jan 18, 2001 9:12 AM</td> </tr>
</tr> <tr>
<tr> <td>Bruce</td>
<td>Bruce</td> <td>Evans</td>
<td>Evans</td> <td>22</td>
<td>22</td> <td>$13.19</td>
<td>$13.19</td> <td>11%</td>
<td>11%</td> <td>Jan 18, 2007 9:12 AM</td>
<td>Jan 18, 2007 9:12 AM</td> </tr>
</tr> </tbody>
</tbody> </table>
</table>
<a href="#" id="ajax-append">Append new table data</a> <a href="#" id="ajax-append">Append new table data</a></div>
<br/>
<br/> <p class="tip">
</div> <em>NOTE!</em> With the latest version of jQuery, this demo will only work when the ajax page is hosted online; This page is using jQuery v1.4.4 so it will work locally.
<p>*Note* This demo will only work when the ajax page is online - switch to jQuery v1.4.4 to test it locally</p> </p>
<h1>Javascript</h1> <h1>Javascript</h1>
<div id="javascript"> <div id="javascript">
<pre class="javascript"></pre> <pre class="js"></pre>
</div> </div>
<h1>HTML</h1> <h1>HTML</h1>
<div id="html"> <div id="html">
<pre class="html"></pre> <pre class="html"></pre>
</div> </div>
<div class="next-up">
<hr />
Next up: <a href="example-update-cell.html">Advanced: Update the table after cell content has changed &rsaquo;&rsaquo;</a>
</div>
</div> </div>
</body> </body>

View File

@ -0,0 +1,129 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>jQuery plugin: Tablesorter 2.0 - applyWidgetId vs. applyWidgets</title>
<!-- jQuery -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.min.js"></script>
<!-- Demo stuff -->
<link rel="stylesheet" href="css/jq.css">
<script src="js/chili/jquery.chili-2.2.js"></script>
<script src="js/chili/recipes.js"></script>
<script src="js/docs.js"></script>
<!-- Tablesorter: required -->
<link rel="stylesheet" href="../css/blue/style.css">
<script src="../js/jquery.tablesorter.js"></script>
<script id="js">$(function() {
// call the tablesorter plugin
$("table").tablesorter();
$("button.applyid").click(function(){
// This method needs to be applied after each sort
$('table').trigger('applyWidgetId', ['zebra']);
});
$("button.apply").click(function(){
// Update the list of widgets to apply to the table (add or remove)
$("table").data("tablesorter").widgets = ["zebra"];
// This method applies the widget - no need to keep updating
$('table').trigger('applyWidgets');
});
});</script>
</head>
<body>
<div id="banner">
<h1>table<em>sorter</em></h1>
<h2>applyWidgetId versus applyWidgets</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> Click on [ Apply Widget Id ], then sort the table a few times... then click on [ Apply Widgets ] and sort again.
</p>
<h1>Demo</h1>
<br>
<div id="demo"><button class="applyid">Apply Widget Id</button> <button class="apply">Apply Widgets</button>
<table 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="js"></pre>
</div>
<h1>HTML</h1>
<div id="html">
<pre class="html"></pre>
</div>
<div class="next-up">
<hr />
Next up: <a href="example-zebra.html">Basic: Applying the zebra stripe widget &rsaquo;&rsaquo;</a>
</div>
</div>
</body>
</html>

View File

@ -0,0 +1,425 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>jQuery plugin: Tablesorter 2.0 - Child Rows</title>
<!-- jQuery -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.min.js"></script>
<!-- Demo stuff -->
<link rel="stylesheet" href="css/jq.css">
<script src="js/chili/jquery.chili-2.2.js"></script>
<script src="js/chili/recipes.js"></script>
<script src="js/docs.js"></script>
<!-- Tablesorter: required -->
<link rel="stylesheet" href="../css/blue/style.css">
<script src="../js/jquery.tablesorter.js"></script>
<!-- Tablesorter: optional -->
<script src="../addons/pager/jquery.tablesorter.pager.js"></script>
<script id="js">$(function() {
$(".tablesorter")
.tablesorter({
// this is the default setting
cssChildRow: "expand-child"
})
.tablesorterPager({
container: $("#pager"),
positionFixed: false
});
// hide child rows
$('.expand-child td').hide();
// Toggle child row content (td), not hiding the row since we are using rowspan
// Using delegate because the pager plugin rebuilds the table after each page change
// "delegate" works in jQuery 1.4.2+; use "live" back to v1.3; for older jQuery - SOL
$('.tablesorter').delegate('.toggle', 'click' ,function(){
// use "nextUntil" to toggle multiple child rows
// toggle table cells instead of the row
$(this).closest('tr').nextUntil('tr:not(.expand-child)').find('td').toggle();
return false;
});
});</script>
</head>
<body>
<div id="banner">
<h1>table<em>sorter</em></h1>
<h2>Working with Child Rows</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> Click the link in the Order # column to reveal the hidden child row cells
(<a href="http://www.pengoworks.com/workshop/jquery/tablesorter/tablesorter.htm">original demo</a>).
</p>
<h1>Demo</h1>
<div id="demo"><table class="tablesorter">
<colgroup>
<col width="85" />
<col width="250" />
<col width="100" />
<col width="90" />
<col width="70" />
</colgroup>
<thead>
<tr>
<th>Order #</th>
<th>Customer</th>
<th>PO</th>
<th>Date</th>
<th>Total</th>
</tr>
</thead>
<tbody>
<!-- First row expanded to reveal the layout -->
<tr>
<td rowspan="2"> <!-- rowspan="2" makes the table look nicer -->
<a href="#" class="toggle">SO71774</a> <!-- link to toggle view of the child row -->
</td>
<td>Good Toys</td>
<td>PO348186287</td>
<td>Jul 20, 2007</td>
<td>$972.78</td>
</tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Shipping Address</div><div>99700 Bell Road<br>Auburn, California 95603</div></td></tr>
<tr><td rowspan="2"><a href="#" class="toggle">SO71775</a></td><td>Cycle Clearance</td><td>PO58159451</td><td>May 6, 2007</td><td>$2,313.13</td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Shipping Address</div><div>2255 254th Avenue Se<br>Albany, Oregon 97321</div></td></tr>
<tr><td rowspan="2"><a href="#" class="toggle">SO71776</a></td><td>West Side Mart</td><td>PO19952192051</td><td>May 12, 2007</td><td>$87.09</td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Shipping Address</div><div>251 The Metro Center<br>Wokingham, England RG41 1QW</div></td></tr>
<tr><td rowspan="3"><a href="#" class="toggle">SO71777</a></td><td>Demand Distributors</td><td>PO20097113391</td><td>Apr 26, 2007</td><td>$1,267.82</td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Comment</div><div>Please send ATTN: Judy</div></td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Shipping Address</div><div>25102 Springwater<br>Wenatchee, Washington 98801</div></td></tr>
<tr><td rowspan="2"><a href="#" class="toggle">SO71778</a></td><td>Purchase Mart</td><td>PO19894146890</td><td>Apr 18, 2007</td><td>$1,503.98</td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Shipping Address</div><div>Wrentham Village<br>Wrentham, Massachusetts 02093</div></td></tr>
<tr><td rowspan="2"><a href="#" class="toggle">SO71779</a></td><td>Initial Bike Company</td><td>PO19633118218</td><td>Dec 20, 2007</td><td>$48,425.55</td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Shipping Address</div><div>789 West Alameda<br>Westminster, Colorado 80030</div></td></tr>
<tr><td rowspan="2"><a href="#" class="toggle">SO71780</a></td><td>Nearby Cycle Shop</td><td>PO19604173239</td><td>Aug 29, 2007</td><td>$42,452.65</td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Shipping Address</div><div>Burgess Hill<br>Edward Way<br>West Sussex, England RH15 9UD</div></td></tr>
<tr><td rowspan="3"><a href="#" class="toggle">SO71781</a></td><td>Sundry Sporting Goods</td><td>PO19401117806</td><td>Mar 9, 2008</td><td>$29,262.41</td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Comment</div><div>Please send ATTN: Rudolph</div></td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Shipping Address</div><div>595 Burning Street<br>Vancouver, British Columbia V7L 4J4</div></td></tr>
<tr><td rowspan="2"><a href="#" class="toggle">SO71782</a></td><td>Professional Sales and Service</td><td>PO19372114749</td><td>Jul 27, 2007</td><td>$43,962.79</td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Shipping Address</div><div>57251 Serene Blvd<br>Van Nuys, California 91411</div></td></tr>
<tr><td rowspan="2"><a href="#" class="toggle">SO71783</a></td><td>Eastside Department Store</td><td>PO19343113609</td><td>May 15, 2007</td><td>$92,663.56</td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Shipping Address</div><div>9992 Whipple Rd<br>Union City, California 94587</div></td></tr>
<tr><td rowspan="2"><a href="#" class="toggle">SO71784</a></td><td>Action Bicycle Specialists</td><td>PO19285135919</td><td>Nov 30, 2007</td><td>$119,960.82</td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Shipping Address</div><div>Warrington Ldc Unit 25/2<br>Woolston, England WA1 4SY</div></td></tr>
<tr><td rowspan="3"><a href="#" class="toggle">SO71785</a></td><td>Metro Cycle Shop</td><td>PO19169115427</td><td>Feb 1, 2008</td><td>$39,805.12</td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Comment</div><div>Please send ATTN: Henry</div></td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Shipping Address</div><div>2507 Pacific Ave S<br>Tacoma, Washington 98403</div></td></tr>
<tr><td rowspan="2"><a href="#" class="toggle">SO71786</a></td><td>Greater Bike Store</td><td>PO17690128583</td><td>Dec 7, 2007</td><td>$4,657.19</td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Shipping Address</div><div>55 Lakeshore Blvd East<br>Toronto, Ontario M4B 1V6</div></td></tr>
<tr><td rowspan="2"><a href="#" class="toggle">SO71787</a></td><td>Fun Toys and Bikes</td><td>PO18038111279</td><td>Jun 1, 2007</td><td>$38,211.11</td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Shipping Address</div><div>6500 East Grant Road<br>Tucson, Arizona 85701</div></td></tr>
<tr><td rowspan="2"><a href="#" class="toggle">SO71788</a></td><td>Reliable Retail Center</td><td>PO17951176595</td><td>Jul 10, 2007</td><td>$1,806.12</td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Shipping Address</div><div>609 Evans Avenue<br>Toronto, Ontario M4B 1V4</div></td></tr>
<tr><td rowspan="3"><a href="#" class="toggle">SO71789</a></td><td>Eastside Parts Shop</td><td>PO17516128941</td><td>May 22, 2007</td><td>$143.50</td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Comment</div><div>Please send ATTN: Andrew</div></td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Shipping Address</div><div>7000 Victoria Park Avenue<br>Toronto, Ontario M4B 1V4</div></td></tr>
<tr><td rowspan="2"><a href="#" class="toggle">SO71790</a></td><td>Successful Sales Company</td><td>PO17487184338</td><td>Apr 15, 2007</td><td>$5,306.48</td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Shipping Address</div><div>7009 Sw Hall Blvd.<br>Tigard, Oregon 97223</div></td></tr>
<tr><td rowspan="2"><a href="#" class="toggle">SO71791</a></td><td>Convenient Sales and Service</td><td>PO17139191080</td><td>Nov 14, 2007</td><td>$26,692.85</td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Shipping Address</div><div>950 Gateway Street<br>Springfield, Oregon 97477</div></td></tr>
<tr><td rowspan="2"><a href="#" class="toggle">SO71792</a></td><td>Corner Bicycle Supply</td><td>PO17545115036</td><td>Mar 17, 2008</td><td>$67,683.32</td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Shipping Address</div><div>2511 Baker Road<br>Toronto, Ontario M4B 1V7</div></td></tr>
<tr><td rowspan="3"><a href="#" class="toggle">SO71793</a></td><td>Mountain Toy Store</td><td>PO17226152414</td><td>Sep 5, 2007</td><td>$1,943.93</td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Comment</div><div>Please send ATTN: Marvin</div></td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Shipping Address</div><div>First Colony Mall<br>Sugar Land, Texas 77478</div></td></tr>
<tr><td rowspan="2"><a href="#" class="toggle">SO71794</a></td><td>Vigorous Exercise Company</td><td>PO17574111985</td><td>Dec 14, 2007</td><td>$87,770.74</td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Shipping Address</div><div>9950 Ferrand Drive, 9th Floor<br>Toronto, Ontario M4B 1V4</div></td></tr>
<tr><td rowspan="2"><a href="#" class="toggle">SO71795</a></td><td>Bike Part Wholesalers</td><td>PO17371184627</td><td>Feb 6, 2008</td><td>$41,224.10</td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Shipping Address</div><div>254a Baker Street<br>Botany<br>Sydney, New South Wales 1002</div></td></tr>
<tr><td rowspan="2"><a href="#" class="toggle">SO71796</a></td><td>Extreme Riding Supplies</td><td>PO17052159664</td><td>Jul 13, 2007</td><td>$63,686.27</td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Shipping Address</div><div>Riverside<br>Sherman Oaks, California 91403</div></td></tr>
<tr><td rowspan="3"><a href="#" class="toggle">SO71797</a></td><td>Riding Cycles</td><td>PO16501134889</td><td>Dec 2, 2007</td><td>$86,222.81</td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Comment</div><div>Please send ATTN: Jon</div></td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Shipping Address</div><div>Galashiels<br>Liverpool, England L4 4HB</div></td></tr>
<tr><td rowspan="2"><a href="#" class="toggle">SO71798</a></td><td>Work and Play Association</td><td>PO16994135863</td><td>Jan 20, 2008</td><td>$40,048.63</td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Shipping Address</div><div>2533 Eureka Rd.<br>Southgate, Michigan 48195</div></td></tr>
<tr><td rowspan="2"><a href="#" class="toggle">SO71799</a></td><td>Metro Sports Equipment</td><td>PO15486196616</td><td>Oct 18, 2007</td><td>$23,080.67</td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Shipping Address</div><div>6, rue des Pyrenees<br>Saint Ouen, Loir et Cher 41100</div></td></tr>
<tr><td rowspan="2"><a href="#" class="toggle">SO71800</a></td><td>Quick Parts and Service</td><td>PO15544127760</td><td>Feb 19, 2008</td><td>$37,253.44</td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Shipping Address</div><div>99954 Boul. Laurier, Local 060, Place<br>Sainte-Foy, Quebec G1W</div></td></tr>
<tr><td rowspan="3"><a href="#" class="toggle">SO71801</a></td><td>Getaway Inn</td><td>PO15515173664</td><td>Mar 6, 2008</td><td>$47,720.54</td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Comment</div><div>Please send ATTN: Min</div></td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Shipping Address</div><div>54, avenue des Ternes<br>Saint Ouen, Loir et Cher 41100</div></td></tr>
<tr><td rowspan="2"><a href="#" class="toggle">SO71802</a></td><td>Blue-Ribbon Bike Company</td><td>PO15457184141</td><td>Sep 22, 2007</td><td>$42,013.42</td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Shipping Address</div><div>790 Shelbyville Road<br>Saint Matthews, Kentucky 40207</div></td></tr>
<tr><td rowspan="2"><a href="#" class="toggle">SO71803</a></td><td>World of Bikes</td><td>PO15341174104</td><td>Mar 1, 2008</td><td>$43,964.97</td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Shipping Address</div><div>660 Lindbergh<br>Saint Louis, Missouri 63103</div></td></tr>
<tr><td rowspan="2"><a href="#" class="toggle">SO71804</a></td><td>Bikes for Two</td><td>PO14906114459</td><td>Aug 18, 2007</td><td>$2,431.21</td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Shipping Address</div><div>63 West Beaver Creek<br>Richmond Hill, Ontario L4E 3M5</div></td></tr>
<tr><td rowspan="3"><a href="#" class="toggle">SO71805</a></td><td>Nationwide Supply</td><td>PO14703194514</td><td>Jun 27, 2007</td><td>$76,535.55</td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Comment</div><div>Please send ATTN: Pilar</div></td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Shipping Address</div><div>4250 Concord Road<br>Rhodes, New South Wales 2138</div></td></tr>
<tr><td rowspan="2"><a href="#" class="toggle">SO71806</a></td><td>Valley Toy Store</td><td>PO14790111844</td><td>Jun 2, 2007</td><td>$20,261.90</td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Shipping Address</div><div>252851 Rowan Place<br>Richmond, British Columbia V6B 3P7</div></td></tr>
<tr><td rowspan="2"><a href="#" class="toggle">SO71807</a></td><td>Courteous Bicycle Specialists</td><td>PO14935135211</td><td>Oct 28, 2007</td><td>$656.84</td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Shipping Address</div><div>995 Crescent<br>Richmond Hill, Ontario L4E 3M5</div></td></tr>
<tr><td rowspan="2"><a href="#" class="toggle">SO71808</a></td><td>Odometers and Accessories Company</td><td>PO14761198562</td><td>Oct 28, 2007</td><td>$42,231.51</td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Shipping Address</div><div>253711 Mayfield Place, Unit 150<br>Richmond, British Columbia V6B 3P7</div></td></tr>
<tr><td rowspan="3"><a href="#" class="toggle">SO71809</a></td><td>Fitness Bike Accessories</td><td>PO14645153239</td><td>Jan 12, 2008</td><td>$3,743.42</td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Comment</div><div>Please send ATTN: John</div></td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Shipping Address</div><div>Level 7<br>114 Albert Road<br>Rhodes, New South Wales 2138</div></td></tr>
<tr><td rowspan="2"><a href="#" class="toggle">SO71810</a></td><td>Two-Seater Bikes</td><td>PO13804148315</td><td>May 27, 2007</td><td>$1,093.53</td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Shipping Address</div><div>5700 Legacy Dr<br>Plano, Texas 75074</div></td></tr>
<tr><td rowspan="2"><a href="#" class="toggle">SO71811</a></td><td>Racing Toys</td><td>PO13717180066</td><td>Feb 26, 2008</td><td>$3,493.04</td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Shipping Address</div><div>9228 Via Del Sol<br>Phoenix, Arizona 85004</div></td></tr>
<tr><td rowspan="2"><a href="#" class="toggle">SO71812</a></td><td>Fashionable Bikes and Accessories</td><td>PO13543115747</td><td>Apr 28, 2007</td><td>$35,146.04</td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Shipping Address</div><div>Sports Store At Park City<br>Park City, Utah 84098</div></td></tr>
<tr><td rowspan="3"><a href="#" class="toggle">SO71813</a></td><td>Liquidation Sales</td><td>PO13630186295</td><td>Jan 17, 2008</td><td>$12,707.47</td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Comment</div><div>Please send ATTN: Jenny</div></td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Shipping Address</div><div>No. 6<br>Millenium Court<br>Perth, South Australia 6006</div></td></tr>
<tr><td rowspan="2"><a href="#" class="toggle">SO71814</a></td><td>Our Sporting Goods Store</td><td>PO12818173864</td><td>May 31, 2007</td><td>$7,517.54</td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Shipping Address</div><div>6030 Conroy Road<br>Ottawa, Ontario K4B 1S3</div></td></tr>
<tr><td rowspan="2"><a href="#" class="toggle">SO71815</a></td><td>Thrifty Parts and Sales</td><td>PO13021155785</td><td>Jan 1, 2008</td><td>$1,261.44</td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Shipping Address</div><div>Oxnard Outlet<br>Oxnard, California 93030</div></td></tr>
<tr><td rowspan="2"><a href="#" class="toggle">SO71816</a></td><td>Engineered Bike Systems</td><td>PO12992180445</td><td>Jul 29, 2007</td><td>$3,754.97</td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Shipping Address</div><div>123 Camelia Avenue<br>Oxnard, California 93030</div></td></tr>
<tr><td rowspan="3"><a href="#" class="toggle">SO71817</a></td><td>Home Town Bike Store</td><td>PO12905185178</td><td>May 21, 2007</td><td>$689.96</td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Comment</div><div>Please send ATTN: Danielle</div></td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Shipping Address</div><div>955 Green Valley Crescent<br>Ottawa, Ontario K4B 1S1</div></td></tr>
<tr><td rowspan="2"><a href="#" class="toggle">SO71818</a></td><td>Utilitarian Sporting Goods</td><td>PO12470139718</td><td>Apr 25, 2007</td><td>$61,356.31</td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Shipping Address</div><div>4635 S. Harrison Blvd.<br>Ogden, Utah 84401</div></td></tr>
<tr><td rowspan="2"><a href="#" class="toggle">SO71819</a></td><td>Fabrikam Inc., West</td><td>PO12354153257</td><td>May 19, 2007</td><td>$41,746.15</td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Shipping Address</div><div>46460 West Oaks Drive<br>Novi, Michigan 48375</div></td></tr>
<tr><td rowspan="2"><a href="#" class="toggle">SO71820</a></td><td>Racing Sales and Service</td><td>PO12673129941</td><td>Apr 26, 2007</td><td>$68,686.02</td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Shipping Address</div><div>510, avenue de Villiers<br>Orleans, Loiret 45000</div></td></tr>
<tr><td rowspan="3"><a href="#" class="toggle">SO71821</a></td><td>Bike Goods </td><td>PO11977190694</td><td>May 25, 2007</td><td>$5,904.88</td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Comment</div><div>Please send ATTN: Gary</div></td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Shipping Address</div><div>254075 Biscayne Blvd.<br>North Miami Beach, Florida 33162</div></td></tr>
<tr><td rowspan="2"><a href="#" class="toggle">SO71822</a></td><td>Popular Bike Lines</td><td>PO11774139099</td><td>Dec 19, 2007</td><td>$31,191.60</td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Shipping Address</div><div>Level 7<br>80 Arthur Street<br>Newcastle, New South Wales 2300</div></td></tr>
<tr><td rowspan="2"><a href="#" class="toggle">SO71823</a></td><td>Enterprise Center</td><td>PO11310159994</td><td>Sep 7, 2007</td><td>$2,818.81</td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Shipping Address</div><div>Kurfürstenstr 574<br>München, Hessen 80074</div></td></tr>
<tr><td rowspan="2"><a href="#" class="toggle">SO71824</a></td><td>Outdoor Equipment Store</td><td>PO11455162600</td><td>Oct 29, 2007</td><td>$115,117.41</td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Shipping Address</div><div>6 Cotton Road<br>Nashua, New Hampshire 03064</div></td></tr>
<tr><td rowspan="3"><a href="#" class="toggle">SO71825</a></td><td>One Bike Company</td><td>PO11165197222</td><td>Dec 28, 2007</td><td>$4,824.62</td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Comment</div><div>Please send ATTN: Shanay</div></td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Shipping Address</div><div>5 place Ville-Marie<br>Montreal, Quebec H1Y 2H7</div></td></tr>
<tr><td rowspan="2"><a href="#" class="toggle">SO71826</a></td><td>Rodeway Bike Store</td><td>PO11397155355</td><td>Oct 29, 2007</td><td>$40,083.06</td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Shipping Address</div><div>Winterfeldtstr 5557<br>Kreditorenbuchhaltung<br>Münster, Saarland 48001</div></td></tr>
<tr><td rowspan="2"><a href="#" class="toggle">SO71827</a></td><td>Metal Processing Company</td><td>PO11107195325</td><td>Aug 22, 2007</td><td>$9,247.52</td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Shipping Address</div><div>770 Notre Datme Quest Bureau 800<br>Montreal, Quebec H1Y 2H7</div></td></tr>
<tr><td rowspan="2"><a href="#" class="toggle">SO71828</a></td><td>Grand Industries</td><td>PO11194153355</td><td>Aug 10, 2007</td><td>$52,553.87</td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Shipping Address</div><div>6333 Cote Vertu<br>Montreal, Quebec H1Y 2H7</div></td></tr>
<tr><td rowspan="3"><a href="#" class="toggle">SO71829</a></td><td>Family Cycle Store</td><td>PO10962123279</td><td>Jul 16, 2007</td><td>$40,095.88</td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Comment</div><div>Please send ATTN: James</div></td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Shipping Address</div><div>660 Saint-Jacques, Bureau 400<br>Montreal, Quebec H1Y 2H8</div></td></tr>
<tr><td rowspan="2"><a href="#" class="toggle">SO71830</a></td><td>Petroleum Products Distributors</td><td>PO10875112195</td><td>Nov 8, 2007</td><td>$55,088.00</td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Shipping Address</div><div>20225 Lansing Ave<br>Montreal, Quebec H1Y 2H7</div></td></tr>
<tr><td rowspan="2"><a href="#" class="toggle">SO71831</a></td><td>Tachometers and Accessories</td><td>PO10295111084</td><td>Aug 8, 2007</td><td>$2,228.06</td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Shipping Address</div><div>Wymbush<br>Milton Keynes, England MK8 8DF</div></td></tr>
<tr><td rowspan="2"><a href="#" class="toggle">SO71832</a></td><td>Closest Bicycle Store</td><td>PO10353140756</td><td>Sep 3, 2007</td><td>$39,531.61</td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Shipping Address</div><div>Garamonde Drive, Wymbush<br>PO Box 4023<br>Milton Keynes, England MK8 8ZD</div></td></tr>
<tr><td rowspan="3"><a href="#" class="toggle">SO71833</a></td><td>Another Bicycle Company</td><td>PO10411123072</td><td>Jan 26, 2008</td><td>$70,377.54</td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Comment</div><div>Please send ATTN: Stanley</div></td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Shipping Address</div><div>567 Sw Mcloughlin Blvd<br>Milwaukie, Oregon 97222</div></td></tr>
<tr><td rowspan="2"><a href="#" class="toggle">SO71834</a></td><td>Rustic Bike Store</td><td>PO377116268</td><td>Feb 22, 2008</td><td>$2,310.51</td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Shipping Address</div><div>Buergermeister-ulrich-str 3000<br>Buchhaltung<br>Augsburg, Bayern 86150</div></td></tr>
<tr><td rowspan="2"><a href="#" class="toggle">SO71835</a></td><td>Running and Cycling Gear</td><td>PO870120974</td><td>Jun 13, 2007</td><td>$71,605.92</td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Shipping Address</div><div>No. 60 Bellis Fair Parkway<br>Bellingham, Washington 98225</div></td></tr>
<tr><td rowspan="2"><a href="#" class="toggle">SO71836</a></td><td>Safe Cycles Shop</td><td>PO841118259</td><td>Sep 13, 2007</td><td>$90,216.85</td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Shipping Address</div><div>2681 Eagle Peak<br>Bellevue, Washington 98004</div></td></tr>
<tr><td rowspan="3"><a href="#" class="toggle">SO71837</a></td><td>Riders Company</td><td>PO1624180133</td><td>Aug 24, 2007</td><td>$39,989.36</td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Comment</div><div>Please send ATTN: Kim</div></td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Shipping Address</div><div>Tanger Factory<br>Branch, Minnesota 55056</div></td></tr>
<tr><td rowspan="2"><a href="#" class="toggle">SO71838</a></td><td>Cycles Sales and Repair</td><td>PO1305123041</td><td>Sep 7, 2007</td><td>$15,165.23</td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Shipping Address</div><div>3387, rue Marbeuf<br>Bobigny, Seine Saint Denis 93000</div></td></tr>
<tr><td rowspan="2"><a href="#" class="toggle">SO71839</a></td><td>Front Runner Bikes</td><td>PO1537119063</td><td>Jan 26, 2008</td><td>$75,173.33</td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Shipping Address</div><div>DeSouth Square<br>Bradenton, Florida 34205</div></td></tr>
<tr><td rowspan="2"><a href="#" class="toggle">SO71840</a></td><td>Community Department Stores</td><td>PO1450191043</td><td>Oct 2, 2007</td><td>$1,234.39</td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Shipping Address</div><div>3639, rue des Grands Champs<br>Boulogne-sur-Mer, Pas de Calais 62200</div></td></tr>
<tr><td rowspan="3"><a href="#" class="toggle">SO71841</a></td><td>Rural Cycle Emporium</td><td>PO1798133189</td><td>Nov 23, 2007</td><td>$112,758.77</td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Comment</div><div>Please send ATTN: Kathleen</div></td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Shipping Address</div><div>6388 Lake City Way<br>Burnaby, British Columbia V5A 3A6</div></td></tr>
<tr><td rowspan="2"><a href="#" class="toggle">SO71842</a></td><td>Price-Cutter Discount Bikes</td><td>PO1740169151</td><td>Nov 22, 2007</td><td>$12.91</td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Shipping Address</div><div>6700 Boul Taschereau<br>Brossard, Quebec J4Z 1C5</div></td></tr>
<tr><td rowspan="2"><a href="#" class="toggle">SO71843</a></td><td>Future Bikes</td><td>PO2001122796</td><td>Jun 24, 2007</td><td>$7,775.72</td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Shipping Address</div><div>67255 - 8th Street N.E., Suite 350<br>Calgary, Alberta T2P 2G8</div></td></tr>
<tr><td rowspan="2"><a href="#" class="toggle">SO71844</a></td><td>Sales and Supply Company</td><td>PO2813198985</td><td>Jun 12, 2007</td><td>$48,077.41</td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Shipping Address</div><div>Corporate Ofc A/p<br>123 Fourth Ave<br>Chantilly, Virginia 20151</div></td></tr>
<tr><td rowspan="3"><a href="#" class="toggle">SO71845</a></td><td>Trailblazing Sports</td><td>PO2697119362</td><td>Mar 4, 2008</td><td>$45,992.37</td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Comment</div><div>Please send ATTN: Frank</div></td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Shipping Address</div><div>251340 E. South St.<br>Cerritos, California 90703</div></td></tr>
<tr><td rowspan="2"><a href="#" class="toggle">SO71846</a></td><td>Sports Store</td><td>PO2378131604</td><td>Jul 2, 2007</td><td>$2,711.41</td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Shipping Address</div><div>Internet House, 3399 Science Park<br>Cambridge, England CB4 4BZ</div></td></tr>
<tr><td rowspan="2"><a href="#" class="toggle">SO71847</a></td><td>Camping and Sports Store</td><td>PO18502143784</td><td>Jul 15, 2007</td><td>$119,981.15</td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Shipping Address</div><div>400-25155 West Pender St<br>Vancouver, British Columbia V7L 4J4</div></td></tr>
<tr><td rowspan="2"><a href="#" class="toggle">SO71848</a></td><td>Locks Company</td><td>PO18763153352</td><td>Nov 9, 2007</td><td>$16,667.88</td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Shipping Address</div><div>70259 West Sunnyview Ave<br>Visalia, California 93291</div></td></tr>
<tr><td rowspan="3"><a href="#" class="toggle">SO71849</a></td><td>Principal Bike Company</td><td>PO18125130930</td><td>Jan 18, 2008</td><td>$25,746.16</td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Comment</div><div>Please send ATTN: Alvaro</div></td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Shipping Address</div><div>Mountain Square<br>Upland, California 91786</div></td></tr>
<tr><td rowspan="2"><a href="#" class="toggle">SO71850</a></td><td>Quitting Business Distributors</td><td>PO18241134627</td><td>Aug 28, 2007</td><td>$10,492.47</td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Shipping Address</div><div>University Plaza<br>Tampa, Florida 33602</div></td></tr>
<tr><td rowspan="2"><a href="#" class="toggle">SO71851</a></td><td>Rapid Bikes</td><td>PO18299133687</td><td>Jun 17, 2007</td><td>$51,104.88</td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Shipping Address</div><div>992 St Clair Ave East<br>Toronto, Ontario M4B 1V7</div></td></tr>
<tr><td rowspan="2"><a href="#" class="toggle">SO71852</a></td><td>Painters Bicycle Specialists</td><td>PO20213171866</td><td>Mar 24, 2008</td><td>$10,406.62</td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Shipping Address</div><div>9975 Union St.<br>Waterbury, Connecticut 06710</div></td></tr>
<tr><td rowspan="3"><a href="#" class="toggle">SO71853</a></td><td>Famous Bike Shop</td><td>PO18531164420</td><td>May 3, 2007</td><td>$4,578.20</td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Comment</div><div>Please send ATTN: Jim</div></td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Shipping Address</div><div>999 West Georgia St.<br>Vancouver, Ontario V5T 1Y9</div></td></tr>
<tr><td rowspan="2"><a href="#" class="toggle">SO71854</a></td><td>Helpful Sales and Repair Service </td><td>PO16385143469</td><td>Nov 11, 2007</td><td>$36,819.69</td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Shipping Address</div><div>Licensing Account<br>Seaford, Victoria 3198</div></td></tr>
<tr><td rowspan="2"><a href="#" class="toggle">SO71855</a></td><td>Self-Contained Cycle Parts Company</td><td>PO18589189353</td><td>Jun 23, 2007</td><td>$429.62</td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Shipping Address</div><div>12, rue des Grands Champs<br>Verrieres Le Buisson, Essonne 91370</div></td></tr>
<tr><td rowspan="2"><a href="#" class="toggle">SO71856</a></td><td>Transport Bikes</td><td>PO16530177647</td><td>Nov 18, 2007</td><td>$665.43</td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Shipping Address</div><div>25130 South State Street<br>Sandy, Utah 84070</div></td></tr>
<tr><td rowspan="3"><a href="#" class="toggle">SO71857</a></td><td>First Cycle Store</td><td>PO16269151631</td><td>Jan 4, 2008</td><td>$37,400.41</td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Comment</div><div>Please send ATTN: Mike</div></td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Shipping Address</div><div>25250 N 90th St<br>Scottsdale, Arizona 85257</div></td></tr>
<tr><td rowspan="2"><a href="#" class="toggle">SO71858</a></td><td>Thrilling Bike Tours</td><td>PO16153112278</td><td>Oct 6, 2007</td><td>$15,275.20</td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Shipping Address</div><div>4660 Rodeo Road<br>Santa Fe, New Mexico 87501</div></td></tr>
<tr><td rowspan="2"><a href="#" class="toggle">SO71859</a></td><td>Bike World</td><td>PO16182112142</td><td>Apr 11, 2007</td><td>$8,654.14</td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Shipping Address</div><div>60025 Bollinger Canyon Road<br>San Ramon, California 94583</div></td></tr>
<tr><td rowspan="2"><a href="#" class="toggle">SO71860</a></td><td>Vinyl and Plastic Goods Corporation</td><td>PO17835163979</td><td>Feb 20, 2008</td><td>$3,651.79</td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Shipping Address</div><div>No. 25800-130 King Street West<br>Toronto, Ontario M4B 1V5</div></td></tr>
<tr><td rowspan="3"><a href="#" class="toggle">SO71861</a></td><td>Two Bike Shops</td><td>PO14152156429</td><td>Nov 30, 2007</td><td>$2,430.32</td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Comment</div><div>Please send ATTN: Jim</div></td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Shipping Address</div><div>35525-9th Street Sw<br>Puyallup, Washington 98371</div></td></tr>
<tr><td rowspan="2"><a href="#" class="toggle">SO71862</a></td><td>Fad Outlet</td><td>PO14065190039</td><td>Feb 19, 2008</td><td>$1,622.62</td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Shipping Address</div><div>2550 Ne Sandy Blvd<br>Portland, Oregon 97205</div></td></tr>
<tr><td rowspan="2"><a href="#" class="toggle">SO71863</a></td><td>Sports Products Store</td><td>PO16124166561</td><td>Apr 30, 2007</td><td>$3,673.32</td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Shipping Address</div><div>Po Box 252525<br>Santa Ana, California 92701</div></td></tr>
<tr><td rowspan="2"><a href="#" class="toggle">SO71864</a></td><td>Good Bike Shop</td><td>PO14268188903</td><td>Oct 9, 2007</td><td>$37,623.76</td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Shipping Address</div><div>99433 S. Greenbay Rd.<br>Racine, Wisconsin 53182</div></td></tr>
<tr><td rowspan="3"><a href="#" class="toggle">SO71865</a></td><td>Neighborhood Bicycle Storehouse</td><td>PO15109136609</td><td>May 30, 2007</td><td>$290.23</td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Comment</div><div>Please send ATTN: Cecilia</div></td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Shipping Address</div><div>69, boulevard Tremblay<br>Roncq, Nord 59223</div></td></tr>
<tr><td rowspan="2"><a href="#" class="toggle">SO71866</a></td><td>Exchange Parts Inc.</td><td>PO14297151936</td><td>Jan 27, 2008</td><td>$43,277.65</td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Shipping Address</div><div>7700 Green Road<br>Raleigh, North Carolina 27603</div></td></tr>
<tr><td rowspan="2"><a href="#" class="toggle">SO71867</a></td><td>Vigorous Sports Store</td><td>PO13050111529</td><td>Jul 29, 2007</td><td>$1,170.54</td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Shipping Address</div><div>Banbury<br>Oxon, England OX16 8RS</div></td></tr>
<tr><td rowspan="2"><a href="#" class="toggle">SO71868</a></td><td>Cycle Merchants</td><td>PO14210134527</td><td>Aug 15, 2007</td><td>$1,932.67</td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Shipping Address</div><div>575 Rue St Amable<br>Quebec, Quebec G1R</div></td></tr>
<tr><td rowspan="3"><a href="#" class="toggle">SO71869</a></td><td>Certified Sports Supply</td><td>PO14877155420</td><td>Feb 21, 2008</td><td>$143.50</td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Comment</div><div>Please send ATTN: Gabriele</div></td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Shipping Address</div><div>250551 Shellbridge Way<br>Richmond, British Columbia V6B 3P7</div></td></tr>
<tr><td rowspan="2"><a href="#" class="toggle">SO71870</a></td><td>Accessories Network</td><td>PO13195134898</td><td>Feb 1, 2008</td><td>$1,903.38</td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Shipping Address</div><div>699bis, rue des Peupliers<br>Paris, Seine (Paris) 75008</div></td></tr>
<tr><td rowspan="2"><a href="#" class="toggle">SO71871</a></td><td>Remote Bicycle Specialists</td><td>PO14239120760</td><td>Aug 10, 2007</td><td>$2,168.53</td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Shipping Address</div><div>No. 2000-25080 Beaver Hall Hill<br>Quebec, Quebec G1R</div></td></tr>
<tr><td rowspan="2"><a href="#" class="toggle">SO71872</a></td><td>First Center</td><td>PO13137112099</td><td>Jan 2, 2008</td><td>$215.91</td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Shipping Address</div><div>22, rue Lafayette<br>Pantin, Seine Saint Denis 93500</div></td></tr>
<tr><td rowspan="3"><a href="#" class="toggle">SO71873</a></td><td>Incomparable Bicycle Store</td><td>PO12325121185</td><td>Jul 5, 2007</td><td>$5,941.29</td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Comment</div><div>Please send ATTN: Faith</div></td></tr>
<tr class="expand-child"><td colspan="4"><div class="bold">Shipping Address</div><div>99 Edgewater Drive<br>Norwood, Massachusetts 02062</div></td></tr>
</tbody>
</table>
<div id="pager" class="pager">
<form>
<input type="button" value="&lt;&lt;" class="first" />
<input type="button" value="&lt;" class="prev" />
<input type="text" class="pagedisplay"/>
<input type="button" value="&gt;" class="next" />
<input type="button" value="&gt;&gt;" class="last" />
<select class="pagesize">
<option selected="selected" value="10">10</option>
<option value="20">20</option>
<option value="30">30</option>
<option value="40">40</option>
</select>
</form>
</div></div>
<h1>Javascript</h1>
<div id="javascript">
<pre class="js"></pre>
</div>
<h1>HTML</h1>
<div>
<pre class="html">&lt;table class=&quot;tablesorter&quot;&gt;
&lt;colgroup&gt;
&lt;col width=&quot;85&quot; /&gt;
&lt;col width=&quot;250&quot; /&gt;
&lt;col width=&quot;100&quot; /&gt;
&lt;col width=&quot;90&quot; /&gt;
&lt;col width=&quot;70&quot; /&gt;
&lt;/colgroup&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Order #&lt;/th&gt;
&lt;th&gt;Customer&lt;/th&gt;
&lt;th&gt;PO&lt;/th&gt;
&lt;th&gt;Date&lt;/th&gt;
&lt;th&gt;Total&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td rowspan=&quot;2&quot;&gt; &lt;!-- rowspan=&quot;2&quot; makes the table look nicer --&gt;
&lt;a href=&quot;#&quot; class=&quot;toggle&quot;&gt;SO71774&lt;/a&gt; &lt;!-- link to toggle view of the child row --&gt;
&lt;/td&gt;
&lt;td&gt;Good Toys&lt;/td&gt;
&lt;td&gt;PO348186287&lt;/td&gt;
&lt;td&gt;Jul 20, 2007&lt;/td&gt;
&lt;td&gt;$972.78&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&quot;expand-child&quot;&gt;
&lt;td colspan=&quot;4&quot;&gt;
&lt;div class=&quot;bold&quot;&gt;Shipping Address&lt;/div&gt;
&lt;div&gt;99700 Bell Road&lt;br&gt;Auburn, California 95603&lt;/div&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td rowspan=&quot;2&quot;&gt; &lt;!-- rowspan=&quot;2&quot; makes the table look nicer --&gt;
&lt;a href=&quot;#&quot; class=&quot;toggle&quot;&gt;SO71775&lt;/a&gt; &lt;!-- link to toggle view of the child row --&gt;
&lt;/td&gt;
&lt;td&gt;Cycle Clearance&lt;/td&gt;
&lt;td&gt;PO58159451&lt;/td&gt;
&lt;td&gt;May 6, 2007&lt;/td&gt;
&lt;td&gt;$2,313.13&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&quot;expand-child&quot;&gt;
&lt;td colspan=&quot;4&quot;&gt;
&lt;div class=&quot;bold&quot;&gt;Shipping Address&lt;/div&gt;
&lt;div&gt;2255 254th Avenue Se&lt;br&gt;Albany, Oregon 97321&lt;/div&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;!-- View page source for complete HTML markup --&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;div id=&quot;pager&quot; class=&quot;pager&quot;&gt;
&lt;form&gt;
&lt;input type=&quot;button&quot; value=&quot;&amp;lt;&amp;lt;&quot; class=&quot;first&quot; /&gt;
&lt;input type=&quot;button&quot; value=&quot;&amp;lt;&quot; class=&quot;prev&quot; /&gt;
&lt;input type=&quot;text&quot; class=&quot;pagedisplay&quot;/&gt;
&lt;input type=&quot;button&quot; value=&quot;&amp;gt;&quot; class=&quot;next&quot; /&gt;
&lt;input type=&quot;button&quot; value=&quot;&amp;gt;&amp;gt;&quot; class=&quot;last&quot; /&gt;
&lt;select class=&quot;pagesize&quot;&gt;
&lt;option selected=&quot;selected&quot; value=&quot;10&quot;&gt;10&lt;/option&gt;
&lt;option value=&quot;20&quot;&gt;20&lt;/option&gt;
&lt;option value=&quot;30&quot;&gt;30&lt;/option&gt;
&lt;option value=&quot;40&quot;&gt;40&lt;/option&gt;
&lt;/select&gt;
&lt;/form&gt;
&lt;/div&gt;</pre>
</div>
<div class="next-up">
<hr />
Next up: <a href="example-option-sort-force.html">Basic: Force a default sorting order &rsaquo;&rsaquo;</a>
</div>
</div>
</body>
</html>

View File

@ -1,78 +1,95 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" <!DOCTYPE html>
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-us">
<head> <head>
<title>jQuery plugin: Tablesorter 2.0 - Initializing tablesorter on a empty table</title> <meta charset="utf-8">
<title>jQuery plugin: Tablesorter 2.0 - Initializing tablesorter on an empty table</title>
<!-- jQuery --> <!-- jQuery -->
<script type="text/javascript" src="js/jquery-latest.js"></script> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.min.js"></script>
<!-- Demo stuff --> <!-- Demo stuff -->
<link rel="stylesheet" href="css/jq.css" type="text/css" media="print, projection, screen" /> <link rel="stylesheet" href="css/jq.css">
<script type="text/javascript" src="js/chili/chili-1.8b.js"></script> <script src="js/chili/jquery.chili-2.2.js"></script>
<script type="text/javascript" src="js/docs.js"></script> <script src="js/chili/recipes.js"></script>
<script type="text/javascript" src="js/examples.js"></script> <script src="js/docs.js"></script>
<!-- Tablesorter: required --> <!-- Tablesorter: required -->
<link rel="stylesheet" href="../css/blue/style.css" type="text/css" media="print, projection, screen" /> <link rel="stylesheet" href="../css/blue/style.css">
<script type="text/javascript" src="../js/jquery.tablesorter.js"></script> <script src="../js/jquery.tablesorter.js"></script>
<script id="js">$(function() {
<script type="text/javascript" id="js">$(document).ready(function() {
$("table").tablesorter(); $("table").tablesorter();
$("#append").click(function() { $("#append").click(function() {
// add some html // 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>"; 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>"; "<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>" +
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>"; "<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>";
// append new html to table body // append new html to table body
$("table tbody").append(html); $("table tbody").append(html);
// let the plugin know that we made a update
$("table").trigger("update"); // resort on the third column
// set sorting column and direction, this will sort on the first and third column
var sorting = [[2,1],[0,0]]; var sorting = [[2,1],[0,0]];
// sort on the first column
$("table").trigger("sorton",[sorting]); // let the plugin know that we made a update, then
// set sorting column and direction, this will sort on the first and third column
$("table")
.trigger("update")
.trigger("sorton",[sorting]);
return false; return false;
}); });
});</script> });</script>
</head> </head>
<body> <body>
<div id="banner"> <div id="banner">
<h1>table<em>sorter</em></h1> <h1>table<em>sorter</em></h1>
<h2>Initializing tablesorter on a empty table</h2> <h2>Initializing tablesorter on an empty table</h2>
<h3>Flexible client-side table sorting</h3> <h3>Flexible client-side table sorting</h3>
<a href="index.html">Back to documentation</a> <a href="index.html">Back to documentation</a>
</div> </div>
<div id="main"> <div id="main">
<h1>Demo</h1> <h1>Demo</h1>
<div id="demo"> <div id="demo"><table class="tablesorter">
<table cellspacing="1" class="tablesorter"> <thead>
<thead> <tr>
<tr> <th>First Name</th>
<th>First Name</th> <th>Last Name</th>
<th>Last Name</th> <th>Age</th>
<th>Age</th> <th>Total</th>
<th>Total</th> <th>Discount</th>
<th>Discount</th> <th>Date</th>
<th>Date</th> </tr>
</tr> </thead>
</thead> <tbody>
<tbody> </tbody>
</tbody> </table>
</table>
<a href="#" id="append">Append new table data</a>
</div>
<a href="#" id="append">Append new table data</a>
<br/>
<br/>
</div>
<h1>Javascript</h1> <h1>Javascript</h1>
<div id="javascript"> <div id="javascript">
<pre class="javascript"></pre> <pre class="js"></pre>
</div> </div>
<h1>HTML</h1> <h1>HTML</h1>
<div id="html"> <div id="html">
<pre class="html"></pre> <pre class="html"></pre>
<div class="next-up">
<hr />
Next up: <a href="example-ajax.html">Advanced: Appending table data with ajax &rsaquo;&rsaquo;</a>
</div>
</div> </div>
</div> </div>
</body> </body>

View File

@ -1,27 +1,24 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" <!DOCTYPE html>
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-us">
<head> <head>
<meta charset="utf-8">
<title>jQuery plugin: Tablesorter 2.0 - Extending default options</title> <title>jQuery plugin: Tablesorter 2.0 - Extending default options</title>
<!-- jQuery --> <!-- jQuery -->
<script type="text/javascript" src="js/jquery-latest.js"></script> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.min.js"></script>
<!-- Demo stuff --> <!-- Demo stuff -->
<link rel="stylesheet" href="css/jq.css" type="text/css" media="print, projection, screen" /> <link rel="stylesheet" href="css/jq.css">
<script type="text/javascript" src="js/chili/chili-1.8b.js"></script> <script src="js/chili/jquery.chili-2.2.js"></script>
<script type="text/javascript" src="js/docs.js"></script> <script src="js/chili/recipes.js"></script>
<script type="text/javascript" src="js/examples.js"></script> <script src="js/docs.js"></script>
<!-- Tablesorter: required --> <!-- Tablesorter: required -->
<link rel="stylesheet" href="../css/blue/style.css" type="text/css" media="print, projection, screen" /> <link rel="stylesheet" href="../css/blue/style.css">
<script type="text/javascript" src="../js/jquery.tablesorter.js"></script> <script src="../js/jquery.tablesorter.js"></script>
<!-- Tablesorter: optional --> <script id="js">$(function() {
<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. // extend the default setting to always include the zebra widget.
$.tablesorter.defaults.widgets = ['zebra']; $.tablesorter.defaults.widgets = ['zebra'];
@ -30,82 +27,89 @@
// call the tablesorter plugin // call the tablesorter plugin
$("table").tablesorter(); $("table").tablesorter();
}); </script> }); </script>
</head> </head>
<body> <body>
<div id="banner"> <div id="banner">
<h1>table<em>sorter</em></h1> <h1>table<em>sorter</em></h1>
<h2>Extending default options</h2> <h2>Extending default options</h2>
<h3>Flexible client-side table sorting</h3> <h3>Flexible client-side table sorting</h3>
<a href="index.html">Back to documentation</a> <a href="index.html">Back to documentation</a>
</div> </div>
<div id="main"> <div id="main">
<h1>Demo</h1> <h1>Demo</h1>
<div id="demo"> <div id="demo"><table class="tablesorter">
<table cellspacing="1" class="tablesorter"> <thead>
<thead> <tr>
<tr> <th>First Name</th>
<th>First Name</th> <th>Last Name</th>
<th>Last Name</th> <th>Age</th>
<th>Age</th> <th>Total</th>
<th>Total</th> <th>Discount</th>
<th>Discount</th> <th>Date</th>
<th>Date</th> </tr>
</tr> </thead>
</thead> <tbody>
<tbody> <tr>
<tr> <td>Peter</td>
<td>Peter</td> <td>Parker</td>
<td>Parker</td> <td>28</td>
<td>28</td> <td>$9.99</td>
<td>$9.99</td> <td>20%</td>
<td>20%</td> <td>Jul 6, 2006 8:14 AM</td>
<td>Jul 6, 2006 8:14 AM</td> </tr>
</tr> <tr>
<tr> <td>John</td>
<td>John</td> <td>Hood</td>
<td>Hood</td> <td>33</td>
<td>33</td> <td>$19.99</td>
<td>$19.99</td> <td>25%</td>
<td>25%</td> <td>Dec 10, 2002 5:14 AM</td>
<td>Dec 10, 2002 5:14 AM</td> </tr>
</tr> <tr>
<tr> <td>Clark</td>
<td>Clark</td> <td>Kent</td>
<td>Kent</td> <td>18</td>
<td>18</td> <td>$15.89</td>
<td>$15.89</td> <td>44%</td>
<td>44%</td> <td>Jan 12, 2003 11:14 AM</td>
<td>Jan 12, 2003 11:14 AM</td> </tr>
</tr> <tr>
<tr> <td>Bruce</td>
<td>Bruce</td> <td>Almighty</td>
<td>Almighty</td> <td>45</td>
<td>45</td> <td>$153.19</td>
<td>$153.19</td> <td>44%</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>
<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> <h1>Javascript</h1>
<div id="javascript"> <div id="javascript">
<pre class="javascript"></pre> <pre class="js"></pre>
</div> </div>
<h1>HTML</h1> <h1>HTML</h1>
<div id="html"> <div id="html">
<pre class="html"></pre> <pre class="html"></pre>
</div> </div>
<div class="next-up">
<hr />
Next up: <a href="example-option-debug.html">Advanced: Enabling debug mode &rsaquo;&rsaquo;</a>
</div>
</div> </div>
</body> </body>

View File

@ -1,55 +1,58 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" <!DOCTYPE html>
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-us">
<head> <head>
<meta charset="utf-8">
<title>jQuery plugin: Tablesorter 2.0 - Disable headers using metadata</title> <title>jQuery plugin: Tablesorter 2.0 - Disable headers using metadata</title>
<!-- jQuery --> <!-- jQuery -->
<script type="text/javascript" src="js/jquery-latest.js"></script> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.min.js"></script>
<!-- Demo stuff --> <!-- Demo stuff -->
<link rel="stylesheet" href="css/jq.css" type="text/css" media="print, projection, screen" /> <link rel="stylesheet" href="css/jq.css">
<script type="text/javascript" src="js/chili/chili-1.8b.js"></script> <script src="js/chili/jquery.chili-2.2.js"></script>
<script type="text/javascript" src="js/docs.js"></script> <script src="js/chili/recipes.js"></script>
<script type="text/javascript" src="js/examples.js"></script> <script src="js/docs.js"></script>
<!-- Tablesorter: required --> <!-- Tablesorter: required -->
<link rel="stylesheet" href="../css/blue/style.css" type="text/css" media="print, projection, screen" /> <link rel="stylesheet" href="../css/blue/style.css">
<script type="text/javascript" src="../js/jquery.tablesorter.js"></script> <script src="../js/jquery.tablesorter.js"></script>
<!-- Tablesorter: optional --> <!-- Tablesorter: optional -->
<script type="text/javascript" src="../addons/pager/jquery.tablesorter.pager.js"></script> <script src="../addons/pager/jquery.tablesorter.pager.js"></script>
<script type="text/javascript" src="../js/jquery.metadata.js"></script> <script src="../js/jquery.metadata.js"></script>
<script type="text/javascript"> <script>
// not sure why this is here...
window.tableFile="table-metadata-disable.html"; window.tableFile="table-metadata-disable.html";
</script> </script>
<script type="text/javascript" id="js">$(function() {
<script id="js">$(function() {
// call the tablesorter plugin, the magic happens in the markup // call the tablesorter plugin, the magic happens in the markup
$("table").tablesorter(); $("table").tablesorter();
}); </script> });</script>
</head> </head>
<body> <body>
<div id="banner"> <div id="banner">
<h1>table<em>sorter</em></h1> <h1>table<em>sorter</em></h1>
<h2>Disable headers using metadata</h2> <h2>Disable headers using metadata</h2>
<h3>Flexible client-side table sorting</h3> <h3>Flexible client-side table sorting</h3>
<a href="index.html">Back to documentation</a> <a href="index.html">Back to documentation</a>
</div> </div>
<div id="main"> <div id="main">
<h1>Demo</h1> <h1>Demo</h1>
<div id="demo"> <div id="demo"><table class="tablesorter">
<table cellspacing="1" class="tablesorter"> <thead>
<thead> <tr>
<tr> <th class="{sorter: false}">First Name</th>
<th class="{sorter: false}">First Name</th> <th>Last Name</th>
<th>Last Name</th> <th>Age</th>
<th>Age</th> <th>Total</th>
<th>Total</th> <th class="{sorter: false}">Discount</th>
<th class="{sorter: false}">Discount</th> <th>Date</th>
<th>Date</th> </tr>
</tr> </thead>
</thead>
<tbody> <tbody>
<tr> <tr>
<td>Peter</td> <td>Peter</td>
@ -57,7 +60,6 @@
<td>28</td> <td>28</td>
<td>$9.99</td> <td>$9.99</td>
<td>20%</td> <td>20%</td>
<td>Jul 6, 2006 8:14 AM</td> <td>Jul 6, 2006 8:14 AM</td>
</tr> </tr>
<tr> <tr>
@ -66,7 +68,6 @@
<td>33</td> <td>33</td>
<td>$19.99</td> <td>$19.99</td>
<td>25%</td> <td>25%</td>
<td>Dec 10, 2002 5:14 AM</td> <td>Dec 10, 2002 5:14 AM</td>
</tr> </tr>
<tr> <tr>
@ -83,7 +84,6 @@
<td>45</td> <td>45</td>
<td>$153.19</td> <td>$153.19</td>
<td>44%</td> <td>44%</td>
<td>Jan 18, 2001 9:12 AM</td> <td>Jan 18, 2001 9:12 AM</td>
</tr> </tr>
<tr> <tr>
@ -95,16 +95,22 @@
<td>Jan 18, 2007 9:12 AM</td> <td>Jan 18, 2007 9:12 AM</td>
</tr> </tr>
</tbody> </tbody>
</table> </table></div>
</div>
<h1>Javascript</h1> <h1>Javascript</h1>
<div id="javascript"> <div id="javascript">
<pre class="javascript"></pre> <pre class="js"></pre>
</div> </div>
<h1>HTML</h1> <h1>HTML</h1>
<div id="html"> <div id="html">
<pre class="html"></pre> <pre class="html"></pre>
</div> </div>
<div class="next-up">
<hr />
Next up: <a href="example-meta-parsers.html">Metadata: Setting column parser using metadata &rsaquo;&rsaquo;</a>
</div>
</div> </div>
</body> </body>

View File

@ -1,41 +1,42 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" <!DOCTYPE html>
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-us">
<head> <head>
<meta charset="utf-8">
<title>jQuery plugin: Tablesorter 2.0 - Setting column parser using metadata</title> <title>jQuery plugin: Tablesorter 2.0 - Setting column parser using metadata</title>
<!-- jQuery --> <!-- jQuery -->
<script type="text/javascript" src="js/jquery-latest.js"></script> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.min.js"></script>
<!-- Demo stuff --> <!-- Demo stuff -->
<link rel="stylesheet" href="css/jq.css" type="text/css" media="print, projection, screen" /> <link rel="stylesheet" href="css/jq.css">
<script type="text/javascript" src="js/chili/chili-1.8b.js"></script> <script src="js/chili/jquery.chili-2.2.js"></script>
<script type="text/javascript" src="js/docs.js"></script> <script src="js/chili/recipes.js"></script>
<script type="text/javascript" src="js/examples.js"></script> <script src="js/docs.js"></script>
<!-- Tablesorter: required --> <!-- Tablesorter: required -->
<link rel="stylesheet" href="../css/blue/style.css" type="text/css" media="print, projection, screen" /> <link rel="stylesheet" href="../css/blue/style.css">
<script type="text/javascript" src="../js/jquery.tablesorter.js"></script> <script src="../js/jquery.tablesorter.js"></script>
<script type="text/javascript" src="../js/jquery.metadata.js"></script> <script src="../js/jquery.metadata.js"></script>
<script type="text/javascript" src="../addons/pager/jquery.tablesorter.pager.js"></script> <script src="../addons/pager/jquery.tablesorter.pager.js"></script>
<script type="text/javascript" id="js">$(document).ready(function() { <script id="js">$(function() {
// call the tablesorter plugin, the magic happens in the markup // call the tablesorter plugin, the magic happens in the markup
$("table").tablesorter(); $("table").tablesorter();
});</script> });</script>
</head> </head>
<body> <body>
<div id="banner"> <div id="banner">
<h1>table<em>sorter</em></h1> <h1>table<em>sorter</em></h1>
<h2>Setting column parser using metadata</h2> <h2>Setting column parser using metadata</h2>
<h3>Flexible client-side table sorting</h3> <h3>Flexible client-side table sorting</h3>
<a href="index.html">Back to documentation</a> <a href="index.html">Back to documentation</a>
</div> </div>
<div id="main"> <div id="main">
<h1>Demo</h1> <h1>Demo</h1>
<div id="demo"> <div id="demo"><table class="tablesorter">
<table cellspacing="1" class="tablesorter"> <thead>
<thead>
<tr> <tr>
<th class="{sorter: 'text'}">First Name</th> <th class="{sorter: 'text'}">First Name</th>
<th>Last Name</th> <th>Last Name</th>
@ -87,18 +88,23 @@
<td>Jan 18, 2007 9:12 AM</td> <td>Jan 18, 2007 9:12 AM</td>
</tr> </tr>
</tbody> </tbody>
</table> </table></div>
</div>
<h1>Javascript</h1> <h1>Javascript</h1>
<div id="javascript"> <div id="javascript">
<pre class="javascript"></pre> <pre class="js"></pre>
</div> </div>
<h1>HTML</h1> <h1>HTML</h1>
<div id="html"> <div id="html">
<pre class="html"></pre> <pre class="html"></pre>
</div> </div>
<div class="next-up">
<hr />
Next up: <a href="example-triggers.html">Advanced: Triggers sortEnd and sortStart &rsaquo;&rsaquo;</a>
</div>
</div> </div>
</body> </body>
</html> </html>

View File

@ -1,54 +1,54 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" <!DOCTYPE html>
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-us">
<head> <head>
<meta charset="utf-8">
<title>jQuery plugin: Tablesorter 2.0 - Setting initial sorting order with metadata</title> <title>jQuery plugin: Tablesorter 2.0 - Setting initial sorting order with metadata</title>
<!-- jQuery --> <!-- jQuery -->
<script type="text/javascript" src="js/jquery-latest.js"></script> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.min.js"></script>
<!-- Demo stuff --> <!-- Demo stuff -->
<link rel="stylesheet" href="css/jq.css" type="text/css" media="print, projection, screen" /> <link rel="stylesheet" href="css/jq.css">
<script type="text/javascript" src="js/chili/chili-1.8b.js"></script> <script src="js/chili/jquery.chili-2.2.js"></script>
<script type="text/javascript" src="js/docs.js"></script> <script src="js/chili/recipes.js"></script>
<script type="text/javascript" src="js/examples.js"></script> <script src="js/docs.js"></script>
<!-- Tablesorter: required --> <!-- Tablesorter: required -->
<link rel="stylesheet" href="../css/blue/style.css" type="text/css" media="print, projection, screen" /> <link rel="stylesheet" href="../css/blue/style.css">
<script type="text/javascript" src="../js/jquery.tablesorter.js"></script> <script src="../js/jquery.tablesorter.js"></script>
<!-- Tablesorter: optional --> <!-- Tablesorter: optional -->
<script type="text/javascript" src="../addons/pager/jquery.tablesorter.pager.js"></script> <script src="../addons/pager/jquery.tablesorter.pager.js"></script>
<script type="text/javascript" src="../js/jquery.metadata.js"></script> <script src="../js/jquery.metadata.js"></script>
<script type="text/javascript" id="js">$(function() { <script id="js">$(function() {
// call the tablesorter plugin, the magic happens in the markup // call the tablesorter plugin, the magic happens in the markup
$("table").tablesorter(); $("table").tablesorter();
});</script> });</script>
</head> </head>
<body> <body>
<div id="banner"> <div id="banner">
<h1>table<em>sorter</em></h1> <h1>table<em>sorter</em></h1>
<h2>Setting initial sorting order with metadata</h2> <h2>Setting initial sorting order with metadata</h2>
<h3>Flexible client-side table sorting</h3> <h3>Flexible client-side table sorting</h3>
<a href="index.html">Back to documentation</a> <a href="index.html">Back to documentation</a>
</div> </div>
<div id="main"> <div id="main">
<h1>Demo</h1> <h1>Demo</h1>
<div id="demo"> <div id="demo"><!-- sortlist is appended to the table using the class attribute and is picked up by metadata plugin -->
<!-- sortlist is appended to the table using the class attribute and is picked up by metadata plugin --> <table class="tablesorter {sortlist: [[0,0],[4,0]]}">
<table cellspacing="1" class="tablesorter {sortlist: [[0,0],[4,0]]}"> <thead>
<thead> <tr>
<tr> <th>First Name</th>
<th>First Name</th> <th>Last Name</th>
<th>Last Name</th> <th>Age</th>
<th>Age</th> <th>Total</th>
<th>Total</th> <th>Discount</th>
<th>Discount</th> <th>Date</th>
<th>Date</th> </tr>
</thead>
</tr>
</thead>
<tbody> <tbody>
<tr> <tr>
<td>Peter</td> <td>Peter</td>
@ -91,18 +91,23 @@
<td>Jan 18, 2007 9:12 AM</td> <td>Jan 18, 2007 9:12 AM</td>
</tr> </tr>
</tbody> </tbody>
</table> </table></div>
</div>
<h1>Javascript</h1> <h1>Javascript</h1>
<div id="javascript"> <div id="javascript">
<pre class="javascript"></pre> <pre class="js"></pre>
</div> </div>
<h1>HTML</h1> <h1>HTML</h1>
<div id="html"> <div id="html">
<pre class="html"></pre> <pre class="html"></pre>
</div> </div>
<div class="next-up">
<hr />
Next up: <a href="example-meta-headers.html">Metadata: Disable header using metadata &rsaquo;&rsaquo;</a>
</div>
</div> </div>
</body> </body>
</html> </html>

View File

@ -1,115 +1,116 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" <!DOCTYPE html>
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-us">
<head> <head>
<meta charset="utf-8">
<title>jQuery plugin: Tablesorter 2.0 - Enabling debug mode</title> <title>jQuery plugin: Tablesorter 2.0 - Enabling debug mode</title>
<!-- jQuery --> <!-- jQuery -->
<script type="text/javascript" src="js/jquery-latest.js"></script> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.min.js"></script>
<!-- Demo stuff --> <!-- Demo stuff -->
<link rel="stylesheet" href="css/jq.css" type="text/css" media="print, projection, screen" /> <link rel="stylesheet" href="css/jq.css">
<script type="text/javascript" src="js/chili/chili-1.8b.js"></script> <script src="js/chili/jquery.chili-2.2.js"></script>
<script type="text/javascript" src="js/docs.js"></script> <script src="js/chili/recipes.js"></script>
<script type="text/javascript" src="js/examples.js"></script> <script src="js/docs.js"></script>
<!-- Tablesorter: required --> <!-- Tablesorter: required -->
<link rel="stylesheet" href="../css/blue/style.css" type="text/css" media="print, projection, screen" /> <link rel="stylesheet" href="../css/blue/style.css">
<script type="text/javascript" src="../js/jquery.tablesorter.js"></script> <script src="../js/jquery.tablesorter.js"></script>
<!-- Tablesorter: optional --> <script id="js">$(function() {
<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 // call the tablesorter plugin
$("table").tablesorter({ $("table").tablesorter({
// enable debug mode // enable debug mode
debug: true debug: true
}); });
}); </script>
});</script>
</head> </head>
<body> <body>
<div id="banner"> <div id="banner">
<h1>table<em>sorter</em></h1> <h1>table<em>sorter</em></h1>
<h2>Enabling debug mode</h2> <h2>Enabling debug mode</h2>
<h3>Flexible client-side table sorting</h3> <h3>Flexible client-side table sorting</h3>
<a href="index.html">Back to documentation</a> <a href="index.html">Back to documentation</a>
</div> </div>
<div id="main">
<div id="main">
<p class="tip"> <p class="tip">
<em>NOTE!</em> If firebug is installed the debuging information will be displayed in the firebug console. <em>NOTE!</em> If firebug is installed the debuging information will be displayed in the firebug console.
</p> </p>
<h1>Demo</h1> <h1>Demo</h1>
<div id="demo"> <div id="demo"><table class="tablesorter">
<thead>
<table cellspacing="1" class="tablesorter"> <tr>
<thead> <th>First Name</th>
<tr> <th>Last Name</th>
<th>First Name</th> <th>Age</th>
<th>Last Name</th> <th>Total</th>
<th>Age</th> <th>Discount</th>
<th>Total</th> <th>Date</th>
<th>Discount</th> </tr>
<th>Date</th> </thead>
</tr> <tbody>
</thead> <tr>
<tbody> <td>Peter</td>
<tr> <td>Parker</td>
<td>Peter</td> <td>28</td>
<td>Parker</td> <td>$9.99</td>
<td>28</td> <td>20%</td>
<td>$9.99</td> <td>Jul 6, 2006 8:14 AM</td>
<td>20%</td> </tr>
<td>Jul 6, 2006 8:14 AM</td> <tr>
</tr> <td>John</td>
<tr> <td>Hood</td>
<td>John</td> <td>33</td>
<td>Hood</td> <td>$19.99</td>
<td>33</td> <td>25%</td>
<td>$19.99</td> <td>Dec 10, 2002 5:14 AM</td>
<td>25%</td> </tr>
<td>Dec 10, 2002 5:14 AM</td> <tr>
</tr> <td>Clark</td>
<tr> <td>Kent</td>
<td>Clark</td> <td>18</td>
<td>Kent</td> <td>$15.89</td>
<td>18</td> <td>44%</td>
<td>$15.89</td> <td>Jan 12, 2003 11:14 AM</td>
<td>44%</td> </tr>
<td>Jan 12, 2003 11:14 AM</td> <tr>
</tr> <td>Bruce</td>
<tr> <td>Almighty</td>
<td>Bruce</td> <td>45</td>
<td>Almighty</td> <td>$153.19</td>
<td>45</td> <td>44%</td>
<td>$153.19</td> <td>Jan 18, 2001 9:12 AM</td>
<td>44%</td> </tr>
<td>Jan 18, 2001 9:12 AM</td> <tr>
</tr> <td>Bruce</td>
<tr> <td>Evans</td>
<td>Bruce</td> <td>22</td>
<td>Evans</td> <td>$13.19</td>
<td>22</td> <td>11%</td>
<td>$13.19</td> <td>Jan 18, 2007 9:12 AM</td>
<td>11%</td> </tr>
<td>Jan 18, 2007 9:12 AM</td> </tbody>
</tr> </table></div>
</tbody>
</table>
</div>
<h1>Javascript</h1> <h1>Javascript</h1>
<div id="javascript"> <div id="javascript">
<pre class="javascript"></pre> <pre class="js"></pre>
</div> </div>
<h1>HTML</h1> <h1>HTML</h1>
<div id="html"> <div id="html">
<pre class="html"></pre> <pre class="html"></pre>
</div> </div>
<div class="next-up">
<hr />
Next up: <a href="example-parsers.html">Advanced: Parser, writing your own &rsaquo;&rsaquo;</a>
</div>
</div> </div>
</body> </body>

View File

@ -1,26 +1,23 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" <!DOCTYPE html>
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-us">
<head> <head>
<meta charset="utf-8">
<title>jQuery plugin: Tablesorter 2.0 - Enabling debug mode</title> <title>jQuery plugin: Tablesorter 2.0 - Enabling debug mode</title>
<!-- jQuery --> <!-- jQuery -->
<script type="text/javascript" src="js/jquery-latest.js"></script> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.min.js"></script>
<!-- Demo stuff --> <!-- Demo stuff -->
<link rel="stylesheet" href="css/jq.css" type="text/css" media="print, projection, screen" /> <link rel="stylesheet" href="css/jq.css">
<script type="text/javascript" src="js/chili/chili-1.8b.js"></script> <script src="js/chili/jquery.chili-2.2.js"></script>
<script type="text/javascript" src="js/docs.js"></script> <script src="js/chili/recipes.js"></script>
<script type="text/javascript" src="js/examples.js"></script> <script src="js/docs.js"></script>
<!-- Tablesorter: required --> <!-- Tablesorter: required -->
<link rel="stylesheet" href="../css/blue/style.css" type="text/css" media="print, projection, screen" /> <link rel="stylesheet" href="../css/blue/style.css">
<script type="text/javascript" src="../js/jquery.tablesorter.js"></script> <script src="../js/jquery.tablesorter.js"></script>
<!-- Tablesorter: optional --> <script id="js">$(function() {
<script type="text/javascript" src="../addons/pager/jquery.tablesorter.pager.js"></script>
<script type="text/javascript" id="js">$(function() {
// call the tablesorter plugin // call the tablesorter plugin
$("table").tablesorter(); $("table").tablesorter();
});</script> });</script>
@ -34,74 +31,86 @@
</div> </div>
<div id="main"> <div id="main">
<h1>Demo</h1> <p class="tip">
<div id="demo"> <em>NOTE!</em> Click on any column header to sort that column. Note the new alphanumeric sort working in the first column.
</p>
<table cellspacing="1" class="tablesorter"> <h1>Demo</h1>
<thead> <div id="demo"><table class="tablesorter">
<tr> <thead>
<th>First Name</th> <tr>
<th>Last Name</th> <th>Account #</th>
<th>Age</th> <th>First Name</th>
<th>Total</th> <th>Last Name</th>
<th>Discount</th> <th>Age</th>
<th>Diff</th> <th>Total</th>
</tr> <th>Discount</th>
</thead> <th>Diff</th>
<tbody> </tr>
<tr> </thead>
<td>Peter</td> <tbody>
<td>Parker</td> <tr>
<td>28</td> <td>A43</td>
<td>9.99</td> <td>Peter</td>
<td>20.3%</td> <td>Parker</td>
<td>+3</td> <td>28</td>
</tr> <td>9.99</td>
<tr> <td>20.3%</td>
<td>John</td> <td>+3</td>
<td>Hood</td> </tr>
<td>33</td> <tr>
<td>19.99</td> <td>A255</td>
<td>25.1%</td> <td>John</td>
<td>-7</td> <td>Hood</td>
</tr> <td>33</td>
<tr> <td>19.99</td>
<td>Clark</td> <td>25.1%</td>
<td>Kent</td> <td>-7</td>
<td>18</td> </tr>
<td>15.89</td> <tr>
<td>44.2%</td> <td>A33</td>
<td>-15</td> <td>Clark</td>
</tr> <td>Kent</td>
<tr> <td>18</td>
<td>Bruce</td> <td>15.89</td>
<td>Almighty</td> <td>44.2%</td>
<td>45</td> <td>-15</td>
<td>153.19</td> </tr>
<td>44%</td> <tr>
<td>+19</td> <td>A1</td>
</tr> <td>Bruce</td>
<tr> <td>Almighty</td>
<td>Bruce</td> <td>45</td>
<td>Evans</td> <td>153.19</td>
<td>56</td> <td>44%</td>
<td>153.19</td> <td>+19</td>
<td>23%</td> </tr>
<td>+9</td> <tr>
</tr> <td>A102</td>
</tbody> <td>Bruce</td>
</table> <td>Evans</td>
<td>56</td>
</div> <td>153.19</td>
<td>23%</td>
<td>+9</td>
</tr>
</tbody>
</table></div>
<h1>Javascript</h1> <h1>Javascript</h1>
<div id="javascript"> <div id="javascript">
<pre class="javascript"></pre> <pre class="js"></pre>
</div> </div>
<h1>HTML</h1> <h1>HTML</h1>
<div id="html"> <div id="html">
<pre class="html"></pre> <pre class="html"></pre>
</div> </div>
<div class="next-up">
<hr />
Next up: <a href="example-option-sort-order.html">Basic: Direction of initial sort &rsaquo;&rsaquo;</a>
</div>
</div> </div>
</body> </body>

View File

@ -0,0 +1,133 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>jQuery plugin: Tablesorter 2.0 - Render Header</title>
<!-- jQuery -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.min.js"></script>
<!-- Demo stuff -->
<link rel="stylesheet" href="css/jq.css">
<script src="js/chili/jquery.chili-2.2.js"></script>
<script src="js/chili/recipes.js"></script>
<script src="js/docs.js"></script>
<!-- Tablesorter: required -->
<link rel="stylesheet" href="../css/blue/style.css">
<script src="../js/jquery.tablesorter.js"></script>
<!-- Tablesorter: optional -->
<script src="../addons/pager/jquery.tablesorter.pager.js"></script>
<style id="css">.roundedCorners {
border: #000 1px solid;
padding: 2px 8px;
border-radius: 1em;
-moz-border-radius: 1em;
-webkit-border-radius: 1em;
}
.headerSortDown .roundedCorners {
border-color: #fff;
}
</style>
<script id="js">$(function() {
// call the tablesorter plugin
$("table").tablesorter({
onRenderHeader: function (){
// the TH content is wrapped with a span by default, so just add the class
$(this).find('span').addClass('roundedCorners');
}
});
});</script>
</head>
<body>
<div id="banner">
<h1>table<em>sorter</em></h1>
<h2>Render Headers</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 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="js"></pre>
</div>
<h1>CSS</h1>
<div id="css">
<pre class="css"></pre>
</div>
<h1>HTML</h1>
<div id="html">
<pre class="html"></pre>
</div>
<div class="next-up">
<hr />
Next up: <a href="example-extending-defaults.html">Advanced: Extending default options &rsaquo;&rsaquo;</a>
</div>
</div>
</body>
</html>

View File

@ -0,0 +1,120 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>jQuery plugin: Tablesorter 2.0 - Append a default sorting order</title>
<!-- jQuery -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.min.js"></script>
<!-- Demo stuff -->
<link rel="stylesheet" href="css/jq.css">
<script src="js/chili/jquery.chili-2.2.js"></script>
<script src="js/chili/recipes.js"></script>
<script src="js/docs.js"></script>
<!-- Tablesorter: required -->
<link rel="stylesheet" href="../css/blue/style.css">
<script src="../js/jquery.tablesorter.js"></script>
<!-- Tablesorter: optional -->
<script src="../addons/pager/jquery.tablesorter.pager.js"></script>
<script id="js">$(function() {
// call the tablesorter plugin
$("table").tablesorter({
// set forced sort on the fourth column and in decending order.
sortAppend: [[0,0]]
});
});</script>
</head>
<body>
<div id="banner">
<h1>table<em>sorter</em></h1>
<h2>Append to a sort order</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> Click to sort any column header to see the the first column sort is appended to the selected sort order.
</p>
<h1>Demo</h1>
<div id="demo"><table 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>Jan 18, 2001 9:12 AM</td>
</tr>
<tr>
<td>John</td>
<td>Evans</td>
<td>33</td>
<td>$9.99</td>
<td>25%</td>
<td>Dec 10, 2002 5:14 AM</td>
</tr>
<tr>
<td>Clark</td>
<td>Kent</td>
<td>22</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>$15.89</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>Jul 6, 2006 8:14 AM</td>
</tr>
</tbody>
</table></div>
<h1>Javascript</h1>
<div id="javascript">
<pre class="js"></pre>
</div>
<h1>HTML</h1>
<div id="html">
<pre class="html"></pre>
</div>
<div class="next-up">
<hr />
Next up: <a href="example-option-digits.html">Basic: Dealing with digits! &rsaquo;&rsaquo;</a>
</div>
</div>
</body>
</html>

View File

@ -1,110 +1,120 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" <!DOCTYPE html>
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-us">
<head> <head>
<meta charset="utf-8">
<title>jQuery plugin: Tablesorter 2.0 - Force a default sorting order</title> <title>jQuery plugin: Tablesorter 2.0 - Force a default sorting order</title>
<!-- jQuery --> <!-- jQuery -->
<script type="text/javascript" src="js/jquery-latest.js"></script> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.min.js"></script>
<!-- Demo stuff --> <!-- Demo stuff -->
<link rel="stylesheet" href="css/jq.css" type="text/css" media="print, projection, screen" /> <link rel="stylesheet" href="css/jq.css">
<script type="text/javascript" src="js/chili/chili-1.8b.js"></script> <script src="js/chili/jquery.chili-2.2.js"></script>
<script type="text/javascript" src="js/docs.js"></script> <script src="js/chili/recipes.js"></script>
<script type="text/javascript" src="js/examples.js"></script> <script src="js/docs.js"></script>
<!-- Tablesorter: required --> <!-- Tablesorter: required -->
<link rel="stylesheet" href="../css/blue/style.css" type="text/css" media="print, projection, screen" /> <link rel="stylesheet" href="../css/blue/style.css">
<script type="text/javascript" src="../js/jquery.tablesorter.js"></script> <script src="../js/jquery.tablesorter.js"></script>
<!-- Tablesorter: optional --> <!-- Tablesorter: optional -->
<script type="text/javascript" src="../addons/pager/jquery.tablesorter.pager.js"></script> <script src="../addons/pager/jquery.tablesorter.pager.js"></script>
<script id="js">$(function() {
<script type="text/javascript" id="js">$(function() {
// call the tablesorter plugin // call the tablesorter plugin
$("table").tablesorter({ $("table").tablesorter({
// set forced sort on the fourth column and i decending order. // set forced sort on the fourth column and in decending order.
sortForce: [[0,0]] sortForce: [[0,0]]
}); });
});</script> });</script>
</head> </head>
<body> <body>
<div id="banner"> <div id="banner">
<h1>table<em>sorter</em></h1> <h1>table<em>sorter</em></h1>
<h2>Force a default sorting order</h2> <h2>Force a default sorting order</h2>
<h3>Flexible client-side table sorting</h3> <h3>Flexible client-side table sorting</h3>
<a href="index.html">Back to documentation</a> <a href="index.html">Back to documentation</a>
</div> </div>
<div id="main"> <div id="main">
<p class="tip">
<em>NOTE!</em> Click to sort any column header to see the forcing of the first column sort.
</p>
<h1>Demo</h1> <h1>Demo</h1>
<div id="demo"> <div id="demo"><table class="tablesorter">
<table cellspacing="1" class="tablesorter"> <thead>
<thead> <tr>
<tr> <th>First Name</th>
<th>First Name</th> <th>Last Name</th>
<th>Last Name</th> <th>Age</th>
<th>Age</th> <th>Total</th>
<th>Total</th> <th>Discount</th>
<th>Discount</th> <th>Date</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>
</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> <h1>Javascript</h1>
<div id="javascript"> <div id="javascript">
<pre class="javascript"></pre> <pre class="js"></pre>
</div> </div>
<h1>HTML</h1> <h1>HTML</h1>
<div id="html"> <div id="html">
<pre class="html"></pre> <pre class="html"></pre>
</div> </div>
<div class="next-up">
<hr />
Next up: <a href="example-option-sort-append.html">Basic: Append a sort to the selected sorting order &rsaquo;&rsaquo;</a>
</div>
</div> </div>
</body> </body>

View File

@ -1,33 +1,31 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" <!DOCTYPE html>
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-us">
<head> <head>
<meta charset="utf-8">
<title>jQuery plugin: Tablesorter 2.0 - Change multi-column sorting key</title> <title>jQuery plugin: Tablesorter 2.0 - Change multi-column sorting key</title>
<!-- jQuery --> <!-- jQuery -->
<script type="text/javascript" src="js/jquery-latest.js"></script> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.min.js"></script>
<!-- Demo stuff --> <!-- Demo stuff -->
<link rel="stylesheet" href="css/jq.css" type="text/css" media="print, projection, screen" /> <link rel="stylesheet" href="css/jq.css">
<script type="text/javascript" src="js/chili/chili-1.8b.js"></script> <script src="js/chili/jquery.chili-2.2.js"></script>
<script type="text/javascript" src="js/docs.js"></script> <script src="js/chili/recipes.js"></script>
<script type="text/javascript" src="js/examples.js"></script> <script src="js/docs.js"></script>
<!-- Tablesorter: required --> <!-- Tablesorter: required -->
<link rel="stylesheet" href="../css/blue/style.css" type="text/css" media="print, projection, screen" /> <link rel="stylesheet" href="../css/blue/style.css">
<script type="text/javascript" src="../js/jquery.tablesorter.js"></script> <script src="../js/jquery.tablesorter.js"></script>
<!-- Tablesorter: optional --> <script id="js">$(function() {
<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 // call the tablesorter plugin
$("table").tablesorter({ $("table").tablesorter({
// change the multi sort key from the default shift to alt button // change the multi sort key from the default shift to alt button
sortMultiSortKey: 'altKey' sortMultiSortKey: 'altKey'
}); });
}); </script>
});</script>
</head> </head>
<body> <body>
<div id="banner"> <div id="banner">
@ -37,71 +35,81 @@
<a href="index.html">Back to documentation</a> <a href="index.html">Back to documentation</a>
</div> </div>
<div id="main"> <div id="main">
<p class="tip">
<em>NOTE!</em> Click to sort any column header, then hold down the alt key and select a second column. Continue selecting columns as desired.
</p>
<h1>Demo</h1> <h1>Demo</h1>
<div id="demo"> <div id="demo"><table class="tablesorter">
<table cellspacing="1" class="tablesorter"> <thead>
<thead> <tr>
<tr> <th>First Name</th>
<th>First Name</th> <th>Last Name</th>
<th>Last Name</th> <th>Age</th>
<th>Age</th> <th>Total</th>
<th>Total</th> <th>Discount</th>
<th>Discount</th> <th>Date</th>
<th>Date</th> </tr>
</tr> </thead>
</thead> <tbody>
<tbody> <tr>
<tr> <td>Peter</td>
<td>Peter</td> <td>Parker</td>
<td>Parker</td> <td>28</td>
<td>28</td> <td>$9.99</td>
<td>$9.99</td> <td>20%</td>
<td>20%</td> <td>Jul 6, 2006 8:14 AM</td>
<td>Jul 6, 2006 8:14 AM</td> </tr>
</tr> <tr>
<tr> <td>John</td>
<td>John</td> <td>Hood</td>
<td>Hood</td> <td>33</td>
<td>33</td> <td>$19.99</td>
<td>$19.99</td> <td>25%</td>
<td>25%</td> <td>Dec 10, 2002 5:14 AM</td>
<td>Dec 10, 2002 5:14 AM</td> </tr>
</tr> <tr>
<tr> <td>Clark</td>
<td>Clark</td> <td>Kent</td>
<td>Kent</td> <td>18</td>
<td>18</td> <td>$15.89</td>
<td>$15.89</td> <td>44%</td>
<td>44%</td> <td>Jan 12, 2003 11:14 AM</td>
<td>Jan 12, 2003 11:14 AM</td> </tr>
</tr> <tr>
<tr> <td>Bruce</td>
<td>Bruce</td> <td>Almighty</td>
<td>Almighty</td> <td>45</td>
<td>45</td> <td>$153.19</td>
<td>$153.19</td> <td>44%</td>
<td>44%</td> <td>Jan 18, 2001 9:12 AM</td>
<td>Jan 18, 2001 9:12 AM</td> </tr>
</tr> <tr>
<tr> <td>Bruce</td>
<td>Bruce</td> <td>Evans</td>
<td>Evans</td> <td>22</td>
<td>22</td> <td>$13.19</td>
<td>$13.19</td> <td>11%</td>
<td>11%</td> <td>Jan 18, 2007 9:12 AM</td>
<td>Jan 18, 2007 9:12 AM</td> </tr>
</tr> </tbody>
</tbody> </table></div>
</table>
</div>
<h1>Javascript</h1> <h1>Javascript</h1>
<div id="javascript"> <div id="javascript">
<pre class="javascript"></pre> <pre class="js"></pre>
</div> </div>
<h1>HTML</h1> <h1>HTML</h1>
<div id="html"> <div id="html">
<pre class="html"></pre> <pre class="html"></pre>
</div> </div>
<div class="next-up">
<hr />
Next up: <a href="example-meta-sort-list.html">Metadata: Set a initial sorting order using metadata &rsaquo;&rsaquo;</a>
</div>
</div> </div>
</body> </body>

View File

@ -1,112 +1,112 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" <!DOCTYPE html>
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-us">
<head> <head>
<title>jQuery plugin: Tablesorter 2.0 - Set a initial sorting order</title> <meta charset="utf-8">
<title>jQuery plugin: Tablesorter 2.0 - Set an initial sort order</title>
<!-- jQuery --> <!-- jQuery -->
<script type="text/javascript" src="js/jquery-latest.js"></script> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.min.js"></script>
<!-- Demo stuff --> <!-- Demo stuff -->
<link rel="stylesheet" href="css/jq.css" type="text/css" media="print, projection, screen" /> <link rel="stylesheet" href="css/jq.css">
<script type="text/javascript" src="js/chili/chili-1.8b.js"></script> <script src="js/chili/jquery.chili-2.2.js"></script>
<script type="text/javascript" src="js/docs.js"></script> <script src="js/chili/recipes.js"></script>
<script type="text/javascript" src="js/examples.js"></script> <script src="js/docs.js"></script>
<!-- Tablesorter: required --> <!-- Tablesorter: required -->
<link rel="stylesheet" href="../css/blue/style.css" type="text/css" media="print, projection, screen" /> <link rel="stylesheet" href="../css/blue/style.css">
<script type="text/javascript" src="../js/jquery.tablesorter.js"></script> <script src="../js/jquery.tablesorter.js"></script>
<!-- Tablesorter: optional --> <script id="js">$(function() {
<script type="text/javascript" src="../addons/pager/jquery.tablesorter.pager.js"></script>
<script type="text/javascript" id="js">$(function() {
// call the tablesorter plugin // call the tablesorter plugin
$("table").tablesorter({ $("table").tablesorter({
// sort on the first column and third column, order asc // sort on the first column and third column in ascending order
sortList: [[0,0],[2,0]] sortList: [[0,0],[2,0]]
}); });
}); </script>
});</script>
</head> </head>
<body> <body>
<div id="banner"> <div id="banner">
<h1>table<em>sorter</em></h1> <h1>table<em>sorter</em></h1>
<h2>Set a initial sorting order</h2> <h2>Set an initial sort order</h2>
<h3>Flexible client-side table sorting</h3> <h3>Flexible client-side table sorting</h3>
<a href="index.html">Back to documentation</a> <a href="index.html">Back to documentation</a>
</div> </div>
<div id="main"> <div id="main">
<h1>Demo</h1> <h1>Demo</h1>
<div id="demo"> <div id="demo"><table class="tablesorter">
<table cellspacing="1" class="tablesorter"> <thead>
<thead> <tr>
<tr> <th>First Name</th>
<th>First Name</th> <th>Last Name</th>
<th>Last Name</th> <th>Age</th>
<th>Age</th> <th>Total</th>
<th>Total</th> <th>Discount</th>
<th>Discount</th> <th>Date</th>
<th>Date</th> </tr>
</thead>
</tr> <tbody>
</thead> <tr>
<tbody> <td>Peter</td>
<tr> <td>Parker</td>
<td>Peter</td> <td>28</td>
<td>Parker</td> <td>$9.99</td>
<td>28</td> <td>20%</td>
<td>$9.99</td> <td>Jul 6, 2006 8:14 AM</td>
<td>20%</td> </tr>
<tr>
<td>Jul 6, 2006 8:14 AM</td> <td>John</td>
</tr> <td>Hood</td>
<tr> <td>33</td>
<td>John</td> <td>$19.99</td>
<td>Hood</td> <td>25%</td>
<td>33</td> <td>Dec 10, 2002 5:14 AM</td>
<td>$19.99</td> </tr>
<td>25%</td> <tr>
<td>Clark</td>
<td>Dec 10, 2002 5:14 AM</td> <td>Kent</td>
</tr> <td>18</td>
<tr> <td>$15.89</td>
<td>Clark</td> <td>44%</td>
<td>Kent</td> <td>Jan 12, 2003 11:14 AM</td>
<td>18</td> </tr>
<td>$15.89</td> <tr>
<td>44%</td> <td>Bruce</td>
<td>Jan 12, 2003 11:14 AM</td> <td>Almighty</td>
</tr> <td>45</td>
<tr> <td>$153.19</td>
<td>Bruce</td> <td>44%</td>
<td>Almighty</td> <td>Jan 18, 2001 9:12 AM</td>
<td>45</td> </tr>
<td>$153.19</td> <tr>
<td>44%</td> <td>Bruce</td>
<td>Evans</td>
<td>Jan 18, 2001 9:12 AM</td> <td>22</td>
</tr> <td>$13.19</td>
<tr> <td>11%</td>
<td>Bruce</td> <td>Jan 18, 2007 9:12 AM</td>
<td>Evans</td> </tr>
<td>22</td> </tbody>
<td>$13.19</td> </table></div>
<td>11%</td>
<td>Jan 18, 2007 9:12 AM</td>
</tr>
</tbody>
</table>
</div>
<h1>Javascript</h1> <h1>Javascript</h1>
<div id="javascript"> <div id="javascript">
<pre class="javascript"></pre> <pre class="js"></pre>
</div> </div>
<h1>HTML</h1> <h1>HTML</h1>
<div id="html"> <div id="html">
<pre class="html"></pre> <pre class="html"></pre>
</div> </div>
<div class="next-up">
<hr />
Next up: <a href="example-trigger-sort.html">Basic: Sort table using a link outside the table &rsaquo;&rsaquo;</a>
</div> </div>
</div>
</body> </body>
</html> </html>

View File

@ -1,107 +1,109 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" <!DOCTYPE html>
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-us">
<head> <head>
<title>jQuery plugin: Tablesorter 2.0 - Set a initial sort order</title> <meta charset="utf-8">
<title>jQuery plugin: Tablesorter 2.0 - Set an initial sort order direction</title>
<!-- jQuery --> <!-- jQuery -->
<script type="text/javascript" src="js/jquery-latest.js"></script> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.min.js"></script>
<!-- Demo stuff --> <!-- Demo stuff -->
<link rel="stylesheet" href="css/jq.css" type="text/css" media="print, projection, screen" /> <link rel="stylesheet" href="css/jq.css">
<script type="text/javascript" src="js/chili/chili-1.8b.js"></script> <script src="js/chili/jquery.chili-2.2.js"></script>
<script type="text/javascript" src="js/docs.js"></script> <script src="js/chili/recipes.js"></script>
<script type="text/javascript" src="js/examples.js"></script> <script src="js/docs.js"></script>
<!-- Tablesorter: required --> <!-- Tablesorter: required -->
<link rel="stylesheet" href="../css/blue/style.css" type="text/css" media="print, projection, screen" /> <link rel="stylesheet" href="../css/blue/style.css">
<script type="text/javascript" src="../js/jquery.tablesorter.js"></script> <script src="../js/jquery.tablesorter.js"></script>
<!-- Tablesorter: optional --> <script id="js">$(function() {
<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 // call the tablesorter plugin
$("table").tablesorter({ $("table").tablesorter({
// change the default sorting order from 'asc' to 'desc' // change the default sorting order from 'asc' to 'desc'
sortInitialOrder: "desc" sortInitialOrder: "desc"
}); });
}); </script> }); </script>
</head> </head>
<body> <body>
<div id="banner"> <div id="banner">
<h1>table<em>sorter</em></h1> <h1>table<em>sorter</em></h1>
<h2>Set a initial sorting order</h2> <h2>Set an initial sorting order direction</h2>
<h3>Flexible client-side table sorting</h3> <h3>Flexible client-side table sorting</h3>
<a href="index.html">Back to documentation</a> <a href="index.html">Back to documentation</a>
</div> </div>
<div id="main"> <div id="main">
<h1>Demo</h1> <h1>Demo</h1>
<div id="demo"> <div id="demo"><table class="tablesorter">
<table cellspacing="1" class="tablesorter"> <thead>
<thead> <tr>
<tr> <th>First Name</th>
<th>First Name</th> <th>Last Name</th>
<th>Last Name</th> <th>Age</th>
<th>Age</th> <th>Total</th>
<th>Total</th> <th>Discount</th>
<th>Discount</th> <th>Date</th>
<th>Date</th> </tr>
</tr> </thead>
</thead> <tbody>
<tbody> <tr>
<tr> <td>Peter</td>
<td>Peter</td> <td>Parker</td>
<td>Parker</td> <td>28</td>
<td>28</td> <td>$9.99</td>
<td>$9.99</td> <td>20%</td>
<td>20%</td> <td>Jul 6, 2006 8:14 AM</td>
<td>Jul 6, 2006 8:14 AM</td> </tr>
</tr> <tr>
<tr> <td>John</td>
<td>John</td> <td>Hood</td>
<td>Hood</td> <td>33</td>
<td>33</td> <td>$19.99</td>
<td>$19.99</td> <td>25%</td>
<td>25%</td> <td>Dec 10, 2002 5:14 AM</td>
<td>Dec 10, 2002 5:14 AM</td> </tr>
</tr> <tr>
<tr> <td>Clark</td>
<td>Clark</td> <td>Kent</td>
<td>Kent</td> <td>18</td>
<td>18</td> <td>$15.89</td>
<td>$15.89</td> <td>44%</td>
<td>44%</td> <td>Jan 12, 2003 11:14 AM</td>
<td>Jan 12, 2003 11:14 AM</td> </tr>
</tr> <tr>
<tr> <td>Bruce</td>
<td>Bruce</td> <td>Almighty</td>
<td>Almighty</td> <td>45</td>
<td>45</td> <td>$153.19</td>
<td>$153.19</td> <td>44%</td>
<td>44%</td> <td>Jan 18, 2001 9:12 AM</td>
<td>Jan 18, 2001 9:12 AM</td> </tr>
</tr> <tr>
<tr> <td>Bruce</td>
<td>Bruce</td> <td>Evans</td>
<td>Evans</td> <td>22</td>
<td>22</td> <td>$13.19</td>
<td>$13.19</td> <td>11%</td>
<td>11%</td> <td>Jan 18, 2007 9:12 AM</td>
<td>Jan 18, 2007 9:12 AM</td> </tr>
</tr> </tbody>
</tbody> </table></div>
</table>
</div>
<h1>Javascript</h1> <h1>Javascript</h1>
<div id="javascript"> <div id="javascript">
<pre class="javascript"></pre> <pre class="js"></pre>
</div> </div>
<h1>HTML</h1> <h1>HTML</h1>
<div id="html"> <div id="html">
<pre class="html"></pre> <pre class="html"></pre>
</div> </div>
<div class="next-up">
<hr />
Next up: <a href="example-apply-widget.html">Basic: Applying Widgets &rsaquo;&rsaquo;</a>
</div>
</div> </div>
</body> </body>

View File

@ -1,87 +1,117 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" <!DOCTYPE html>
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-us">
<head> <head>
<meta charset="utf-8">
<title>jQuery plugin: Tablesorter 2.0 - Dealing with markup inside cells</title> <title>jQuery plugin: Tablesorter 2.0 - Dealing with markup inside cells</title>
<!-- jQuery --> <!-- jQuery -->
<script type="text/javascript" src="js/jquery-latest.js"></script> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.min.js"></script>
<!-- Demo stuff --> <!-- Demo stuff -->
<link rel="stylesheet" href="css/jq.css" type="text/css" media="print, projection, screen" /> <link rel="stylesheet" href="css/jq.css">
<script type="text/javascript" src="js/chili/chili-1.8b.js"></script> <script src="js/chili/jquery.chili-2.2.js"></script>
<script type="text/javascript" src="js/docs.js"></script> <script src="js/chili/recipes.js"></script>
<script type="text/javascript" src="js/examples.js"></script> <script src="js/docs.js"></script>
<!-- Tablesorter: required --> <!-- Tablesorter: required -->
<link rel="stylesheet" href="../css/blue/style.css" type="text/css" media="print, projection, screen" /> <link rel="stylesheet" href="../css/blue/style.css">
<script type="text/javascript" src="../js/jquery.tablesorter.js"></script> <script src="../js/jquery.tablesorter.js"></script>
<!-- Tablesorter: optional --> <script id="js">$(function() {
<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 // call the tablesorter plugin
$("table").tablesorter({ $("table").tablesorter({
// define a custom text extraction function // define a custom text extraction function
textExtraction: function(node) { textExtraction: function(node) {
// extract data from markup and return it // extract data from markup and return it
return node.childNodes[0].childNodes[0].innerHTML; return $(node).text();
} }
}); });
}); </script>
});</script>
</head> </head>
<body> <body>
<div id="banner"> <div id="banner">
<h1>table<em>sorter</em></h1> <h1>table<em>sorter</em></h1>
<h2>Dealing with markup inside cells</h2> <h2>Dealing with markup inside cells</h2>
<h3>Flexible client-side table sorting</h3> <h3>Flexible client-side table sorting</h3>
<a href="index.html">Back to documentation</a> <a href="index.html">Back to documentation</a>
</div> </div>
<div id="main"> <div id="main">
<h1>Demo</h1> <h1>Demo</h1>
<div id="demo"> <div id="demo"><table class="tablesorter">
<table cellspacing="1" class="tablesorter"> <thead>
<thead> <tr>
<tr> <th>First Name</th>
<th>First Name</th> <th>Last Name</th>
<th>Last Name</th> <th>Age</th>
<th>Age</th> <th>Total</th>
<th>Total</th> <th>Discount</th>
<th>Discount</th> <th>Date</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>
<tr>
<td><strong><em>Clark</em></strong></td>
<td><strong><em>Kent</em></strong></td>
<td><strong><em>18</em></strong></td>
<td><strong><em>$15.89</em></strong></td>
<td><strong><em>44%</em></strong></td>
<td><strong><em>Jan 12, 2003 11:14 AM</em></strong></td>
</tr>
<tr>
<td><strong><em>Bruce</em></strong></td>
<td><strong><em>Almighty</em></strong></td>
<td><strong><em>45</em></strong></td>
<td><strong><em>$153.19</em></strong></td>
<td><strong><em>44%</em></strong></td>
<td><strong><em>Jan 18, 2001 9:12 AM</em></strong></td>
</tr>
<tr>
<td><strong><em>Bruce</em></strong></td>
<td><strong><em>Evans</em></strong></td>
<td><strong><em>22</em></strong></td>
<td><strong><em>$13.19</em></strong></td>
<td><strong><em>11%</em></strong></td>
<td><strong><em>Jan 18, 2007 9:12 AM</em></strong></td>
</tr>
</tbody>
</table></div>
</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> <h1>Javascript</h1>
<div id="javascript"> <div id="javascript">
<pre class="javascript"></pre> <pre class="js"></pre>
</div> </div>
<h1>HTML</h1> <h1>HTML</h1>
<div id="html"> <div id="html">
<pre class="html"></pre> <pre class="html"></pre>
</div> </div>
<div class="next-up">
<hr />
Next up: <a href="example-option-render-header.html">Advanced: Modify how the header is rendered to allow for custom styling &rsaquo;&rsaquo;</a>
</div>
</div> </div>
</body> </body>

View File

@ -1,27 +1,23 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" <!DOCTYPE html>
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-us">
<head> <head>
<meta charset="utf-8">
<title>jQuery plugin: Tablesorter 2.0 - Disable headers using options</title> <title>jQuery plugin: Tablesorter 2.0 - Disable headers using options</title>
<!-- jQuery --> <!-- jQuery -->
<script type="text/javascript" src="js/jquery-latest.js"></script> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.min.js"></script>
<!-- Demo stuff --> <!-- Demo stuff -->
<link rel="stylesheet" href="css/jq.css" type="text/css" media="print, projection, screen" /> <link rel="stylesheet" href="css/jq.css">
<script type="text/javascript" src="js/chili/chili-1.8b.js"></script> <script src="js/chili/jquery.chili-2.2.js"></script>
<script type="text/javascript" src="js/docs.js"></script> <script src="js/chili/recipes.js"></script>
<script type="text/javascript" src="js/examples.js"></script> <script src="js/docs.js"></script>
<!-- Tablesorter: required --> <!-- Tablesorter: required -->
<link rel="stylesheet" href="../css/blue/style.css" type="text/css" media="print, projection, screen" /> <link rel="stylesheet" href="../css/blue/style.css">
<script type="text/javascript" src="../js/jquery.tablesorter.js"></script> <script src="../js/jquery.tablesorter.js"></script>
<!-- Tablesorter: optional --> <script id="js">$(function(){
<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({ $("table").tablesorter({
// pass the headers argument and assing a object // pass the headers argument and assing a object
headers: { headers: {
@ -48,70 +44,75 @@
</div> </div>
<div id="main"> <div id="main">
<h1>Demo</h1> <h1>Demo</h1>
<div id="demo"> <div id="demo"><table class="tablesorter">
<table cellspacing="1" class="tablesorter"> <thead>
<thead> <tr>
<tr> <th>First Name</th>
<th>First Name</th> <th>Last Name</th>
<th>Last Name</th> <th>Age</th>
<th>Age</th> <th>Total</th>
<th>Total</th> <th>Discount</th>
<th>Discount</th> <th>Date</th>
<th>Date</th> </tr>
</tr> </thead>
</thead> <tbody>
<tbody> <tr>
<tr> <td>Peter</td>
<td>Peter</td> <td>Parker</td>
<td>Parker</td> <td>28</td>
<td>28</td> <td>$9.99</td>
<td>$9.99</td> <td>20%</td>
<td>20%</td> <td>Jul 6, 2006 8:14 AM</td>
<td>Jul 6, 2006 8:14 AM</td> </tr>
</tr> <tr>
<tr> <td>John</td>
<td>John</td> <td>Hood</td>
<td>Hood</td> <td>33</td>
<td>33</td> <td>$19.99</td>
<td>$19.99</td> <td>25%</td>
<td>25%</td> <td>Dec 10, 2002 5:14 AM</td>
<td>Dec 10, 2002 5:14 AM</td> </tr>
</tr> <tr>
<tr> <td>Clark</td>
<td>Clark</td> <td>Kent</td>
<td>Kent</td> <td>18</td>
<td>18</td> <td>$15.89</td>
<td>$15.89</td> <td>44%</td>
<td>44%</td> <td>Jan 12, 2003 11:14 AM</td>
<td>Jan 12, 2003 11:14 AM</td> </tr>
</tr> <tr>
<tr> <td>Bruce</td>
<td>Bruce</td> <td>Almighty</td>
<td>Almighty</td> <td>45</td>
<td>45</td> <td>$153.19</td>
<td>$153.19</td> <td>44%</td>
<td>44%</td> <td>Jan 18, 2001 9:12 AM</td>
<td>Jan 18, 2001 9:12 AM</td> </tr>
</tr> <tr>
<tr> <td>Bruce</td>
<td>Bruce</td> <td>Evans</td>
<td>Evans</td> <td>22</td>
<td>22</td> <td>$13.19</td>
<td>$13.19</td> <td>11%</td>
<td>11%</td> <td>Jan 18, 2007 9:12 AM</td>
<td>Jan 18, 2007 9:12 AM</td> </tr>
</tr> </tbody>
</tbody> </table></div>
</table>
</div>
<h1>Javascript</h1> <h1>Javascript</h1>
<div id="javascript"> <div id="javascript">
<pre class="javascript"></pre> <pre class="js"></pre>
</div> </div>
<h1>HTML</h1> <h1>HTML</h1>
<div id="html"> <div id="html">
<pre class="html"></pre> <pre class="html"></pre>
</div> </div>
<div class="next-up">
<hr />
Next up: <a href="example-option-sort-key.html">Basic: Change the default multi-sorting key &rsaquo;&rsaquo;</a>
</div>
</div> </div>
</body> </body>

File diff suppressed because one or more lines are too long

View File

@ -1,23 +1,24 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" <!DOCTYPE html>
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-us">
<head> <head>
<meta charset="utf-8">
<title>jQuery plugin: Tablesorter 2.0 - Writing custom parsers</title> <title>jQuery plugin: Tablesorter 2.0 - Writing custom parsers</title>
<!-- jQuery --> <!-- jQuery -->
<script type="text/javascript" src="js/jquery-latest.js"></script> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.min.js"></script>
<!-- Demo stuff --> <!-- Demo stuff -->
<link rel="stylesheet" href="css/jq.css" type="text/css" media="print, projection, screen" /> <link rel="stylesheet" href="css/jq.css">
<script type="text/javascript" src="js/chili/chili-1.8b.js"></script> <script src="js/chili/jquery.chili-2.2.js"></script>
<script type="text/javascript" src="js/docs.js"></script> <script src="js/chili/recipes.js"></script>
<script type="text/javascript" src="js/examples.js"></script> <script src="js/docs.js"></script>
<!-- Tablesorter: required --> <!-- Tablesorter: required -->
<link rel="stylesheet" href="../css/blue/style.css" type="text/css" media="print, projection, screen" /> <link rel="stylesheet" href="../css/blue/style.css">
<script type="text/javascript" src="../js/jquery.tablesorter.js"></script> <script src="../js/jquery.tablesorter.js"></script>
<script type="text/javascript" src="../addons/pager/jquery.tablesorter.pager.js"></script> <script src="../addons/pager/jquery.tablesorter.pager.js"></script>
<script type="text/javascript" id="js">// add parser through the tablesorter addParser method
<script id="js">// add parser through the tablesorter addParser method
$.tablesorter.addParser({ $.tablesorter.addParser({
// set a unique id // set a unique id
id: 'grades', id: 'grades',
@ -27,7 +28,10 @@ $.tablesorter.addParser({
}, },
format: function(s) { format: function(s) {
// format your data for normalization // format your data for normalization
return s.toLowerCase().replace(/good/,2).replace(/medium/,1).replace(/bad/,0); return s.toLowerCase()
.replace(/good/,2)
.replace(/medium/,1)
.replace(/bad/,0);
}, },
// set type, either numeric or text // set type, either numeric or text
type: 'numeric' type: 'numeric'
@ -37,74 +41,81 @@ $(function() {
$("table").tablesorter({ $("table").tablesorter({
headers: { headers: {
6: { 6: {
sorter:'grades' sorter: 'grades'
} }
} }
}); });
});</script> });</script>
</head> </head>
<body> <body>
<div id="banner"> <div id="banner">
<h1>table<em>sorter</em></h1> <h1>table<em>sorter</em></h1>
<h2>Writing custom parsers</h2> <h2>Writing custom parsers</h2>
<h3>Flexible client-side table sorting</h3> <h3>Flexible client-side table sorting</h3>
<a href="index.html">Back to documentation</a> <a href="index.html">Back to documentation</a>
</div> </div>
<div id="main"> <div id="main">
<h1>Demo</h1> <h1>Demo</h1>
<div id="demo"> <div id="demo"><table 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>
<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> <h1>Javascript</h1>
<div id="javascript"> <div id="javascript">
<pre class="javascript"></pre> <pre class="js"></pre>
</div> </div>
<h1>HTML</h1> <h1>HTML</h1>
<div id="html"> <div id="html">
<pre class="html"></pre> <pre class="html"></pre>
</div> </div>
<div class="next-up">
<hr />
Next up: <a href="example-widgets.html">Advanced: Widgets, writing your own &rsaquo;&rsaquo;</a>
</div>
</div> </div>
</body> </body>

View File

@ -1,33 +1,36 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" <!DOCTYPE html>
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-us">
<head> <head>
<meta charset="utf-8">
<title>jQuery plugin: Tablesorter 2.0 - Sort table using a link outside the table</title> <title>jQuery plugin: Tablesorter 2.0 - Sort table using a link outside the table</title>
<!-- jQuery --> <!-- jQuery -->
<script type="text/javascript" src="js/jquery-latest.js"></script> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.min.js"></script>
<!-- Demo stuff --> <!-- Demo stuff -->
<link rel="stylesheet" href="css/jq.css" type="text/css" media="print, projection, screen" /> <link rel="stylesheet" href="css/jq.css">
<script type="text/javascript" src="js/chili/chili-1.8b.js"></script> <script src="js/chili/jquery.chili-2.2.js"></script>
<script type="text/javascript" src="js/docs.js"></script> <script src="js/chili/recipes.js"></script>
<script type="text/javascript" src="js/examples.js"></script> <script src="js/docs.js"></script>
<!-- Tablesorter: required --> <!-- Tablesorter: required -->
<link rel="stylesheet" href="../css/blue/style.css" type="text/css" media="print, projection, screen" /> <link rel="stylesheet" href="../css/blue/style.css">
<script type="text/javascript" src="../js/jquery.tablesorter.js"></script> <script src="../js/jquery.tablesorter.js"></script>
<script type="text/javascript" src="../addons/pager/jquery.tablesorter.pager.js"></script> <script src="../addons/pager/jquery.tablesorter.pager.js"></script>
<script id="js">$(function() {
<script type="text/javascript" id="js">$(function() {
$("table").tablesorter(); $("table").tablesorter();
$("#trigger-link").click(function() { $("#trigger-link").click(function() {
// set sorting column and direction, this will sort on the first and third column the column index starts at zero // 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]]; var sorting = [[0,0],[2,0]];
// sort on the first column // sort on the first column and third columns
$("table").trigger("sorton",[sorting]); $("table").trigger("sorton",[sorting]);
// return false to stop default link action // return false to stop default link action
return false; return false;
}); });
});</script> });</script>
</head> </head>
<body> <body>
@ -39,72 +42,76 @@
</div> </div>
<div id="main"> <div id="main">
<h1>Demo</h1> <h1>Demo</h1>
<div id="demo"> <div id="demo"><table class="tablesorter">
<table cellspacing="1" class="tablesorter"> <thead>
<thead> <tr>
<tr> <th>First Name</th>
<th>First Name</th> <th>Last Name</th>
<th>Last Name</th> <th>Age</th>
<th>Age</th> <th>Total</th>
<th>Total</th> <th>Discount</th>
<th>Discount</th> <th>Date</th>
<th>Date</th> </tr>
</tr> </thead>
</thead> <tbody>
<tbody> <tr>
<tr> <td>Peter</td>
<td>Peter</td> <td>Parker</td>
<td>Parker</td> <td>28</td>
<td>28</td> <td>$9.99</td>
<td>$9.99</td> <td>20%</td>
<td>20%</td> <td>Jul 6, 2006 8:14 AM</td>
<td>Jul 6, 2006 8:14 AM</td> </tr>
</tr> <tr>
<tr> <td>John</td>
<td>John</td> <td>Hood</td>
<td>Hood</td> <td>33</td>
<td>33</td> <td>$19.99</td>
<td>$19.99</td> <td>25%</td>
<td>25%</td> <td>Dec 10, 2002 5:14 AM</td>
<td>Dec 10, 2002 5:14 AM</td> </tr>
</tr> <tr>
<tr> <td>Clark</td>
<td>Clark</td> <td>Kent</td>
<td>Kent</td> <td>18</td>
<td>18</td> <td>$15.89</td>
<td>$15.89</td> <td>44%</td>
<td>44%</td> <td>Jan 12, 2003 11:14 AM</td>
<td>Jan 12, 2003 11:14 AM</td> </tr>
</tr> <tr>
<tr> <td>Bruce</td>
<td>Bruce</td> <td>Almighty</td>
<td>Almighty</td> <td>45</td>
<td>45</td> <td>$153.19</td>
<td>$153.19</td> <td>44%</td>
<td>44%</td> <td>Jan 18, 2001 9:12 AM</td>
<td>Jan 18, 2001 9:12 AM</td> </tr>
</tr> <tr>
<tr> <td>Bruce</td>
<td>Bruce</td> <td>Evans</td>
<td>Evans</td> <td>22</td>
<td>22</td> <td>$13.19</td>
<td>$13.19</td> <td>11%</td>
<td>11%</td> <td>Jan 18, 2007 9:12 AM</td>
<td>Jan 18, 2007 9:12 AM</td> </tr>
</tr> </tbody>
</tbody></table> </table>
<a href="#" id="trigger-link">Sort first and third columns</a>
</div> <a href="#" id="trigger-link">Sort first and third columns</a></div>
<br/>
<br/>
<h1>Javascript</h1> <h1>Javascript</h1>
<div id="javascript"> <div id="javascript">
<pre class="javascript"></pre> <pre class="js"></pre>
</div> </div>
<h1>HTML</h1> <h1>HTML</h1>
<div id="html"> <div id="html">
<pre class="html"></pre> <pre class="html"></pre>
</div> </div>
<div class="next-up">
<hr />
Next up: <a href="example-child-rows.html">Basic: How to add rows that sort with their parent row &rsaquo;&rsaquo;</a>
</div>
</div> </div>
</body> </body>

View File

@ -1,61 +1,68 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" <!DOCTYPE html>
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-us">
<head> <head>
<meta charset="utf-8">
<title>jQuery plugin: Tablesorter 2.0 - Triggers sortStart and sortEnd</title> <title>jQuery plugin: Tablesorter 2.0 - Triggers sortStart and sortEnd</title>
<!-- jQuery --> <!-- jQuery -->
<script type="text/javascript" src="js/jquery-latest.js"></script> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.min.js"></script>
<!-- Demo stuff --> <!-- Demo stuff -->
<link rel="stylesheet" href="css/jq.css" type="text/css" media="print, projection, screen" /> <link rel="stylesheet" href="css/jq.css">
<script type="text/javascript" src="js/chili/chili-1.8b.js"></script> <script src="js/chili/jquery.chili-2.2.js"></script>
<script type="text/javascript" src="js/docs.js"></script> <script src="js/chili/recipes.js"></script>
<script type="text/javascript" src="js/examples.js"></script> <script src="js/docs.js"></script>
<!-- Tablesorter: required --> <!-- Tablesorter: required -->
<link rel="stylesheet" href="../css/blue/style.css" type="text/css" media="print, projection, screen" /> <link rel="stylesheet" href="../css/blue/style.css">
<script type="text/javascript" src="../js/jquery.tablesorter.js"></script> <script src="../js/jquery.tablesorter.js"></script>
<script id="js">$(function(){
<script type="text/javascript" id="js">$(function(){
var start; var start;
// call the tablesorter plugin, the magic happens in the markup // call the tablesorter plugin, the magic happens in the markup
$("table") $("table")
.tablesorter() .tablesorter()
//assign the sortStart event
.bind("sortStart",function(e){ // assign the sortStart event
.bind("sortStart",function(e, t){
start = e.timeStamp; start = e.timeStamp;
$("#events").append('<li>Sort Started</li>').find('li:first').remove(); $("#display").append('<li>Sort Started</li>').find('li:first').remove();
}) })
.bind("sortEnd",function(e){
$("#events").append('<li>Sort Ended after ' + ((e.timeStamp - start)/1000).toFixed(2) +' seconds</li>').find('li:first').remove(); .bind("sortEnd",function(e, t){
$("#display").append('<li>Sort Ended after ' + ( (e.timeStamp - start)/1000 ).toFixed(2) + ' seconds</li>').find('li:first').remove();
}); });
}); </script> }); </script>
</head> </head>
<body> <body>
<div id="banner"> <div id="banner">
<h1>table<em>sorter</em></h1> <h1>table<em>sorter</em></h1>
<h2>Triggers sortStart and sortEnd</h2> <h2>Triggers sortStart and sortEnd</h2>
<h3>Flexible client-side table sorting</h3> <h3>Flexible client-side table sorting</h3>
<a href="index.html">Back to documentation</a> <a href="index.html">Back to documentation</a>
</div> </div>
<div id="main"> <div id="main">
<h1>Demo</h1>
<div id="">
<ul id="events">
<li>...</li>
<li>...</li>
<li>...</li>
</ul>
<h1>Javascript</h1> <h1>Javascript</h1>
<div id="javascript"> <div id="javascript">
<pre class="javascript"></pre> <pre class="js"></pre>
</div> </div>
<h1>Sort Events</h1>
<ul id="display">
<li>Sort events will appear here.</li>
<li>&nbsp;</li>
<li>&nbsp;</li>
</ul>
<h1>Demo</h1>
<!-- sortlist is appended to the table using the class attribute and is picked up by metadata plugin --> <!-- sortlist is appended to the table using the class attribute and is picked up by metadata plugin -->
<table cellspacing="1" class="tablesorter"> <table class="tablesorter">
<thead> <thead>
<tr><th>Name</th><th>Major</th><th>Sex</th><th>English</th><th>Japanese</th><th>Calculus</th><th>Geometry</th></tr> <tr><th>Name</th><th>Major</th><th>Sex</th><th>English</th><th>Japanese</th><th>Calculus</th><th>Geometry</th></tr>
</thead> </thead>
@ -1088,6 +1095,10 @@
<tr><td>student1022</td><td>Languages</td><td>female</td><td>75</td><td>22</td><td>7</td><td>52</td></tr> <tr><td>student1022</td><td>Languages</td><td>female</td><td>75</td><td>22</td><td>7</td><td>52</td></tr>
</tbody> </tbody>
</table> </table>
<div class="next-up">
<hr />
Next up: <a href="example-empty-table.html">Advanced: Initializing tablesorter on a empty table &rsaquo;&rsaquo;</a>
</div> </div>
</div> </div>

View File

@ -1,118 +1,133 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" <!DOCTYPE html>
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-us">
<head> <head>
<title>jQuery plugin: Tablesorter 2.0 - Appending table data with ajax</title> <meta charset="utf-8">
<title>jQuery plugin: Tablesorter 2.0 - Updating a table cell</title>
<!-- jQuery --> <!-- jQuery -->
<script type="text/javascript" src="js/jquery-latest.js"></script> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.min.js"></script>
<!-- Demo stuff --> <!-- Demo stuff -->
<link rel="stylesheet" href="css/jq.css" type="text/css" media="print, projection, screen" /> <link rel="stylesheet" href="css/jq.css">
<script type="text/javascript" src="js/chili/chili-1.8b.js"></script> <script src="js/chili/jquery.chili-2.2.js"></script>
<script type="text/javascript" src="js/docs.js"></script> <script src="js/chili/recipes.js"></script>
<script type="text/javascript" src="js/examples.js"></script> <script src="js/docs.js"></script>
<!-- Tablesorter: required --> <!-- Tablesorter: required -->
<link rel="stylesheet" href="../css/blue/style.css" type="text/css" media="print, projection, screen" /> <link rel="stylesheet" href="../css/blue/style.css">
<script type="text/javascript" src="../js/jquery.tablesorter.js"></script> <script src="../js/jquery.tablesorter.js"></script>
<style>
.discount { cursor: pointer; }
</style>
<script id="js">$(function() {
<script type="text/javascript" id="js">
$(document).ready(function() {
$("table").tablesorter(); $("table").tablesorter();
$("table tbody td.discount").click(function() { $("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); // randomize a number
$(this).text(discount); var discount = '$' + Math.round(Math.random() * Math.random() * 100) + '.' + ('0' + Math.round(Math.random() * Math.random() * 100)).slice(-2);
$("table").trigger("updateCell",[this]); $(this).text(discount);
// set sorting column and direction, this will sort on the first and third column
var sorting = [[3,1]]; ("table").trigger("updateCell",[this]);
// sort on the first column
$("table").trigger("sorton",[sorting]); // set sorting column and direction, this will sort on the first and third column
return false; var sorting = [[3,1]];
// sort on the fourth column
$("table").trigger("sorton", [sorting]);
return false;
}); });
});
</script> });</script>
</head> </head>
<body> <body>
<div id="banner"> <div id="banner">
<h1>table<em>sorter</em></h1> <h1>table<em>sorter</em></h1>
<h2>Updating the table cache</h2> <h2>Updating a table cell</h2>
<h3>Flexible client-side table sorting</h3> <h3>Flexible client-side table sorting</h3>
<a href="index.html">Back to documentation</a> <a href="index.html">Back to documentation</a>
</div> </div>
<div id="main"> <div id="main">
<p class="tip">
<em>NOTE!</em> Click on any value in the Total column to change it to a random amount.
</p>
<h1>Demo</h1> <h1>Demo</h1>
<div id="demo"> <div id="demo"><table class="tablesorter">
<table cellspacing="1" class="tablesorter"> <thead>
<thead> <tr>
<tr> <th>First Name</th>
<th>First Name</th> <th>Last Name</th>
<th>Last Name</th> <th>Age</th>
<th>Age</th> <th>Total</th>
<th>Total</th> <th>Discount</th>
<th>Discount</th> <th>Date</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></div>
</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> <h1>Javascript</h1>
<div id="javascript"> <div id="javascript">
<pre class="javascript"></pre> <pre class="js"></pre>
</div> </div>
<h1>HTML</h1> <h1>HTML</h1>
<div id="html"> <div id="html">
<pre class="html"></pre> <pre class="html"></pre>
</div> </div>
<div class="next-up">
<hr />
Next up: <a href="example-option-text-extraction.html">Advanced: Dealing with markup inside cells (textExtraction function) &rsaquo;&rsaquo;</a>
</div>
</div> </div>
</body> </body>

View File

@ -1,114 +1,85 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" <!DOCTYPE html>
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-us">
<head> <head>
<meta charset="utf-8">
<title>jQuery plugin: Tablesorter 2.0 - Writing custom widgets</title> <title>jQuery plugin: Tablesorter 2.0 - Writing custom widgets</title>
<!-- jQuery --> <!-- jQuery -->
<script type="text/javascript" src="js/jquery-latest.js"></script> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.min.js"></script>
<!-- Demo stuff --> <!-- Demo stuff -->
<link rel="stylesheet" href="css/jq.css" type="text/css" media="print, projection, screen" /> <link rel="stylesheet" href="css/jq.css">
<script type="text/javascript" src="js/chili/chili-1.8b.js"></script> <script src="js/chili/jquery.chili-2.2.js"></script>
<script type="text/javascript" src="js/docs.js"></script> <script src="js/chili/recipes.js"></script>
<script src="js/docs.js"></script>
<!-- Tablesorter: required --> <!-- Tablesorter: required -->
<link rel="stylesheet" href="../css/blue/style.css" type="text/css" media="print, projection, screen" /> <link rel="stylesheet" href="../css/blue/style.css">
<script type="text/javascript" src="../js/jquery.tablesorter.js"></script> <script 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. <!-- Tablesorter: optional -->
$("tr.repated-header",table).remove(); <script src="../addons/pager/jquery.tablesorter.pager.js"></script>
// loop all tr elements and insert a copy of the "headers" <script id="js">$(function() {
for(var i=0; i < table.tBodies[0].rows.length; i++) {
// insert a copy of the table head every 10th row // add new widget called repeatHeaders
if((i%5) == 4) { $.tablesorter.addWidget({
$("tbody tr:eq(" + i + ")",table).before(
$("<tr></tr>").addClass("repated-header").html(this.headers.join("")) // give the widget an 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.repeated-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 X rows
// i mod 5 = 4, is true every 4th row, starting from the 4th.
// i mod 6 = 5, is true every 5th row, starting from the 5th, etc.
if ((i%5) === 4) {
$("tbody tr:eq(" + i + ")",table).before(
$("<tr></tr>").addClass("repeated-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>
// call the tablesorter plugin and assign widgets with id "zebra" (Default widget in the core) and the newly created "repeatHeaders"
$("table").tablesorter({
// apply both widgets
widgets: ['zebra', 'repeatHeaders']
});
});</script>
</head> </head>
<body> <body>
<div id="banner"> <div id="banner">
<h1>table<em>sorter</em></h1> <h1>table<em>sorter</em></h1>
<h2>Writing custom widgets</h2> <h2>Writing custom widgets</h2>
<h3>Flexible client-side table sorting</h3> <h3>Flexible client-side table sorting</h3>
<a href="index.html">Back to documentation</a> <a href="index.html">Back to documentation</a>
</div> </div>
<div id="main"> <div id="main">
<h1>Demo</h1>
<h1>Javascript</h1> <table class="tablesorter">
<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> <thead>
<tr> <tr>
<th>Name</th> <th>Name</th>
@ -341,6 +312,18 @@ $("table").tablesorter({
</tr> </tr>
</tbody> </tbody>
</table> </table>
<h1>Javascript</h1>
<div id="javascript">
<pre class="js"></pre>
</div>
<div class="next-up">
<hr />
Next up: <a href="example-pager.html">Companion Plugins: file:///C:/Temp/tablesorter/docs/example-pager.html &rsaquo;&rsaquo;</a>
</div>
</div> </div>
</body> </body>

133
docs/example-zebra.html Normal file
View File

@ -0,0 +1,133 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>jQuery plugin: Tablesorter 2.0 - Zebra Stripe Widget</title>
<!-- jQuery -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.min.js"></script>
<!-- Demo stuff -->
<link rel="stylesheet" href="css/jq.css">
<script src="js/chili/jquery.chili-2.2.js"></script>
<script src="js/chili/recipes.js"></script>
<script src="js/docs.js"></script>
<!-- Tablesorter: required -->
<link rel="stylesheet" href="../css/blue/style.css">
<script src="../js/jquery.tablesorter.js"></script>
<!-- Tablesorter: optional -->
<script src="../addons/pager/jquery.tablesorter.pager.js"></script>
<style id="css">/* Extra selectors needed to override the default styling */
table.tablesorter tbody tr.normal-row td {
background: #888;
color: #fff;
}
table.tablesorter tbody tr.alt-row td {
background: #555;
color: #fff;
}
</style>
<script id="js">$(function() {
// call the tablesorter plugin
$("table").tablesorter({
// initialize zebra striping of the table
widgets: ["zebra"],
// change the default striping class names
// default is { css : ["even", "odd"] }
widgetZebra: { css: [ "normal-row", "alt-row" ] }
});
});</script>
</head>
<body>
<div id="banner">
<h1>table<em>sorter</em></h1>
<h2>Zebra Stripe Widget</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 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="js"></pre>
</div>
<h1>CSS</h1>
<div id="css">
<pre class="css"></pre>
</div>
<h1>HTML</h1>
<div id="html">
<pre class="html"></pre>
</div>
<div class="next-up">
<hr />
Next up: <a href="example-options-headers.html">Basic: Disable header using options &rsaquo;&rsaquo;</a>
</div>
</div>
</body>
</html>

File diff suppressed because it is too large Load Diff

View File

@ -1,392 +0,0 @@
/*
===============================================================================
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: "&#160;" // use an empty string for not replacing
, replaceTab: "&#160;&#160;&#160;&#160;" // use an empty string for not replacing
, replaceNewLine: "&#160;<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, "&amp;" ).replace( /</g, "&lt;" );
} // 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 );

File diff suppressed because one or more lines are too long

View File

@ -1,18 +0,0 @@
/*
===============================================================================
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; }

View File

@ -2,21 +2,44 @@
=============================================================================== ===============================================================================
Chili is the jQuery code highlighter plugin Chili is the jQuery code highlighter plugin
............................................................................... ...............................................................................
Copyright 2007 / Andrea Ercolino
-------------------------------------------------------------------------------
LICENSE: http://www.opensource.org/licenses/mit-license.php LICENSE: http://www.opensource.org/licenses/mit-license.php
WEBSITE: http://noteslog.com/chili/ WEBSITE: http://noteslog.com/chili/
Copyright 2008 / Andrea Ercolino
=============================================================================== ===============================================================================
*/ */
{ {
steps: { _name: "cpp"
mlcom : { exp: /\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\// } , _case: true
, com : { exp: /\/\/.*/ } , _main: {
, preproc : { exp: /[\^\n]\s*#\w+/ } mlcom : {
, string : { exp: /(?:\'[^\'\\\n]*(?:\\.[^\'\\\n]*)*\')|(?:\"[^\"\\\n]*(?:\\.[^\"\\\n]*)*\")/ } _match: /\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\//
, number : { exp: /\b[+-]?(?:\d*\.?\d+|\d+\.?\d*)(?:[eE][+-]?\d+)?\b/ } , _style: "color: #4040c2;"
, 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/ } , com : {
_match: /\/\/.*/
, _style: "color: green;"
}
, preproc : {
_match: /(?=^|\n)\s*#\w+/
, _style: "color: red;"
}
, string : {
_match: /(?:\'[^\'\\\n]*(?:\\.[^\'\\\n]*)*\')|(?:\"[^\"\\\n]*(?:\\.[^\"\\\n]*)*\")/
, _style: "color: teal;"
}
, number : {
_match: /\b[+-]?(?:\d*\.?\d+|\d+\.?\d*)(?:[eE][+-]?\d+)?\b/
, _style: "color: red;"
}
, datatype: {
_match: /\b(?:wint_t|wctype_t|wctrans_t|wchar_t|va_list|uintptr_t|tm|time_t|terminate_function|size_t|signed|sig_atomic_t|short|ptrdiff_t|mbstate_t|long|ldiv_t|lconv|jmp_buf|intptr_t|int|fpos_t|float|double|div_t|clock_t|char|bool|_wfinddatai64_t|_wfinddata_t|_utimbuf|_timeb|_stati64|_stat|_purecall_handler|_onexit_t|_off_t|_finddatai64_t|_finddata_t|_exception|_diskfree_t|_dev_t|_complex|__wfinddata64_t|__wchar_t|__timeb64|__time64_t|__stat64|__int8|__int64|__int32|__int16|__finddata64_t|_PNH|_HFILE|_HEAPINFO|_FPIEEE_RECORD|_EXCEPTION_POINTERS|WPARAM|WORD|WCHAR|VOID|USN|USHORT|ULONG_PTR|ULONGLONG|ULONG64|ULONG32|ULONG|UINT_PTR|UINT64|UINT32|UINT|UHALF_PTR|UCHAR|TCHAR|TBYTE|SSIZE_T|SIZE_T|SHORT|SERVICE_STATUS_HANDLE|SC_LOCK|SC_HANDLE|PWSTR|PWORD|PWCHAR|PVOID|PUSHORT|PULONG_PTR|PULONGLONG|PULONG64|PULONG32|PULONG|PUINT_PTR|PUINT64|PUINT32|PUINT|PUHALF_PTR|PUCHAR|PTSTR|PTCHAR|PTBYTE|PSTR|PSSIZE_T|PSIZE_T|PSHORT|POINTER_64|POINTER_32|PLONG_PTR|PLONGLONG|PLONG64|PLONG32|PLONG|PLCID|PINT_PTR|PINT64|PINT32|PINT|PHKEY|PHANDLE|PHALF_PTR|PFLOAT|PDWORD_PTR|PDWORDLONG|PDWORD64|PDWORD32|PCWSTR|PCTSTR|PCSTR|PCHAR|PBYTE|PBOOLEAN|PBOOL|LRESULT|LPWSTR|LPWORD|LPVOID|LPTSTR|LPSTR|LPLONG|LPINT|LPHANDLE|LPDWORD|LPCWSTR|LPCVOID|LPCTSTR|LPCSTR|LPCOLORREF|LPBYTE|LPBOOL|LPARAM|LONG_PTR|LONGLONG|LONG64|LONG32|LONG|LGRPID|LCTYPE|LCID|LANGID|INT_PTR|INT64|INT32|INT|HWND|HWINSTA|HSZ|HRSRC|HRGN|HRESULT|HPEN|HPALETTE|HMONITOR|HMODULE|HMETAFILE|HMENU|HLOCAL|HKL|HKEY|HINSTANCE|HICON|HHOOK|HGLOBAL|HGDIOBJ|HFONT|HFILE|HENHMETAFILE|HDWP|HDROP|HDESK|HDDEDATA|HDC|HCURSOR|HCONVLIST|HCONV|HCOLORSPACE|HBRUSH|HBITMAP|HANDLE|HALF_PTR|HACCEL|FLOAT|FILE|DWORD_PTR|DWORDLONG|DWORD64|DWORD32|DWORD|COLORREF|CHAR|BYTE|BOOLEAN|BOOL|ATOM)\b/
, _style: "color: blue;"
}
, keyword : {
_match: /\b(?:while|whcar_t|volatile|void|virtual|uuid|using|union|typename|typeid|typedef|try|true|throw|thread|this|template|switch|struct|static_cast|static|sizeof|selectany|return|reinterpret_cast|register|public|protected|private|nothrow|noreturn|noinline|new|namespace|naked|mutable|inline|if|goto|friend|for|false|extern|explicit|enum|else|dynamic_cast|do|dllimport|dllexport|deprecated|delete|default|continue|const_cast|const|class|catch|case|break|__try|__finally|__exception|__declspec)\b/
, _style: "color: navy; font-weight: bold;"
}
} }
} }

View File

@ -1,17 +0,0 @@
/*
===============================================================================
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; }

View File

@ -2,20 +2,40 @@
=============================================================================== ===============================================================================
Chili is the jQuery code highlighter plugin Chili is the jQuery code highlighter plugin
............................................................................... ...............................................................................
Copyright 2007 / Andrea Ercolino
-------------------------------------------------------------------------------
LICENSE: http://www.opensource.org/licenses/mit-license.php LICENSE: http://www.opensource.org/licenses/mit-license.php
WEBSITE: http://noteslog.com/chili/ WEBSITE: http://noteslog.com/chili/
Copyright 2008 / Andrea Ercolino
=============================================================================== ===============================================================================
*/ */
{ {
steps: { _name: "cs"
mlcom : { exp: /\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\// } , _case: true
, com : { exp: /\/\/.*/ } , _main: {
, string : { exp: /(?:\'[^\'\\\n]*(?:\\.[^\'\\\n]*)*\')|(?:\"[^\"\\\n]*(?:\\.[^\"\\\n]*)*\")/ } mlcom : {
, preproc: { exp: /^\s*#.*/ } _match: /\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\//
, number : { exp: /\b[+-]?(?:\d*\.?\d+|\d+\.?\d*)(?:[eE][+-]?\d+)?\b/ } , _style: "color: #4040c2;"
, 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/ } }
, com : {
_match: /\/\/.*/
, _style: "color: green;"
}
, string : {
_match: /(?:\'[^\'\\\n]*(?:\\.[^\'\\\n]*)*\')|(?:\"[^\"\\\n]*(?:\\.[^\"\\\n]*)*\")/
, _style: "color: teal;"
}
, preproc: {
_match: /^\s*#.*/
, _style: "color: red;"
}
, number : {
_match: /\b[+-]?(?:\d*\.?\d+|\d+\.?\d*)(?:[eE][+-]?\d+)?\b/
, _style: "color: red;"
}
, keyword: {
_match: /\b(?:while|volatile|void|virtual|using|ushort|unsafe|unchecked|ulong|uint|typeof|try|true|throw|this|switch|struct|string|static|stackalloc|sizeof|short|sealed|sbyte|return|ref|readonly|public|protected|private|params|override|out|operator|object|null|new|namespace|long|lock|is|internal|interface|int|in|implicit|if|goto|foreach|for|float|fixed|finally|false|extern|explicit|event|enum|else|double|do|delegate|default|decimal|continue|const|class|checked|char|catch|case|byte|break|bool|base|as|abstract)\b/
, _style: "color: navy; font-weight: bold;"
}
} }
} }

View File

@ -1,17 +0,0 @@
/*
===============================================================================
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; }

View File

@ -2,20 +2,84 @@
=============================================================================== ===============================================================================
Chili is the jQuery code highlighter plugin Chili is the jQuery code highlighter plugin
............................................................................... ...............................................................................
Copyright 2007 / Andrea Ercolino
-------------------------------------------------------------------------------
LICENSE: http://www.opensource.org/licenses/mit-license.php LICENSE: http://www.opensource.org/licenses/mit-license.php
WEBSITE: http://noteslog.com/chili/ WEBSITE: http://noteslog.com/chili/
Copyright 2008 / Andrea Ercolino
=============================================================================== ===============================================================================
*/ */
{ {
steps: { _name: 'css'
mlcom : { exp: /\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\// } , _case: true
, string: { exp: /(?:\'[^\'\\\n]*(?:\\.[^\'\\\n]*)*\')|(?:\"[^\"\\\n]*(?:\\.[^\"\\\n]*)*\")/ } , _main: {
, number: { exp: /(?:\b[+-]?(?:\d*\.?\d+|\d+\.?\d*))(?:%|(?:(?:px|pt|em|)\b))/ } comment: {
, 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/ } _match: /\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\//
, 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/ } , _style: "color: olive;"
, color : { exp: /(?:\#[a-zA-Z0-9]{3,6})|(?:yellow|white|teal|silver|red|purple|olive|navy|maroon|lime|green|gray|fuchsia|blue|black|aqua)/ } }
, directive: {
_match: /@\w+/
, _style: "color: fuchsia;"
}
, url: {
_match: /\b(url\s*\()([^)]+)(\))/
, _replace: "<span class='url'>$1</span>$2<span class='url'>$3</span>"
, _style: "color: fuchsia;"
}
, block: {
_match: /\{([\w\W]*?)\}/
, _replace: function( all, pairs ) {
return '{' + this.x( pairs, '/definition' ) + '}';
}
}
, 'class': {
_match: /\.\w+/
, _style: "color: #CC0066; font-weight: bold;"
}
, id: {
_match: /#\w+/
, _style: "color: IndianRed; font-weight: bold;"
}
, pseudo: {
_match: /:\w+/
, _style: "color: #CC9900;"
}
, element: {
_match: /\w+/
, _style: "color: Purple; font-weight: bold;"
}
}
, definition: {
comment: {
_match: /\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\//
}
, property: {
_match: /\b(?:zoom|z-index|writing-mode|word-wrap|word-spacing|word-break|width|widows|white-space|volume|voice-family|visibility|vertical-align|unicode-bidi|top|text-underline-position|text-transform|text-shadow|text-overflow|text-kashida-space|text-justify|text-indent|text-decoration|text-autospace|text-align-last|text-align|table-layout|stress|speech-rate|speak-punctuation|speak-numeral|speak-header|speak|size|scrollbar-track-color|scrollbar-shadow-color|scrollbar-highlight-color|scrollbar-face-color|scrollbar-dark-shadow-color|scrollbar-base-color|scrollbar-arrow-color|scrollbar-3d-light-color|ruby-position|ruby-overhang|ruby-align|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-Y|overflow-X|overflow|outline-width|outline-style|outline-color|outline|orphans|min-width|min-height|max-width|max-height|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|line-break|letter-spacing|left|layout-grid-type|layout-grid-mode|layout-grid-line|layout-grid-char-spacing|layout-grid-char|layout-grid|layout-flow|layer-background-image|layer-background-color|include-source|ime-mode|height|font-weight|font-variant|font-style|font-stretch|font-size-adjust|font-size|font-family|font|float|filter|empty-cells|elevation|display|direction|cursor|cue-before|cue-after|cue|counter-reset|counter-increment|content|color|clip|clear|caption-side|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|behavior|background-repeat|background-position-y|background-position-x|background-position|background-image|background-color|background-attachment|background|azimuth|accelerator)\s*:/
, _style: "color: #330066;"
}
, special: {
_match: /\b(?:-use-link-source|-set-link-source|-replace|-moz-user-select|-moz-user-modify|-moz-user-input|-moz-user-focus|-moz-outline-width|-moz-outline-style|-moz-outline-color|-moz-outline|-moz-opacity|-moz-border-top-colors|-moz-border-right-colors|-moz-border-radius-topright|-moz-border-radius-topleft|-moz-border-radius-bottomright|-moz-border-radius-bottomleft|-moz-border-radius|-moz-border-left-colors|-moz-border-bottom-colors|-moz-binding)\s*:/
, _style: "color: #330066; text-decoration: underline;"
}
, url: {
_match: /\b(url\s*\()([^)]+)(\))/
, _replace: "<span class='url'>$1</span>$2<span class='url'>$3</span>"
}
, value: {
_match: /\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/
, _style: "color: #3366FF;"
}
, string: {
_match: /(?:\'[^\'\\\n]*(?:\\.[^\'\\\n]*)*\')|(?:\"[^\"\\\n]*(?:\\.[^\"\\\n]*)*\")/
, _style: "color: teal;"
}
, number: {
_match: /(?:\b[+-]?(?:\d*\.?\d+|\d+\.?\d*))(?:%|(?:(?:px|pt|em|)\b))/
, _style: "color: red;"
}
, color : {
_match: /(?:\#[a-fA-F0-9]{3,6})|\b(?:yellow|white|teal|silver|red|purple|olive|navy|maroon|lime|green|gray|fuchsia|blue|black|aqua|YellowGreen|Yellow|WhiteSmoke|White|Wheat|Violet|Turquoise|Tomato|Thistle|Teal|Tan|SteelBlue|SpringGreen|Snow|SlateGrey|SlateGray|SlateBlue|SkyBlue|Silver|Sienna|SeaShell|SeaGreen|SandyBrown|Salmon|SaddleBrown|RoyalBlue|RosyBrown|Red|Purple|PowderBlue|Plum|Pink|Peru|PeachPuff|PapayaWhip|PaleVioletRed|PaleTurquoise|PaleGreen|PaleGoldenRod|Orchid|OrangeRed|Orange|OliveDrab|Olive|OldLace|Navy|NavajoWhite|Moccasin|MistyRose|MintCream|MidnightBlue|MediumVioletRed|MediumTurquoise|MediumSpringGreen|MediumSlateBlue|MediumSeaGreen|MediumPurple|MediumOrchid|MediumBlue|MediumAquaMarine|Maroon|Magenta|Linen|LimeGreen|Lime|LightYellow|LightSteelBlue|LightSlateGrey|LightSlateGray|LightSkyBlue|LightSeaGreen|LightSalmon|LightPink|LightGrey|LightGreen|LightGray|LightGoldenRodYellow|LightCyan|LightCoral|LightBlue|LemonChiffon|LawnGreen|LavenderBlush|Lavender|Khaki|Ivory|Indigo|IndianRed|HotPink|HoneyDew|Grey|GreenYellow|Green|Gray|GoldenRod|Gold|GhostWhite|Gainsboro|Fuchsia|ForestGreen|FloralWhite|FireBrick|DodgerBlue|DimGrey|DimGray|DeepSkyBlue|DeepPink|Darkorange|DarkViolet|DarkTurquoise|DarkSlateGrey|DarkSlateGray|DarkSlateBlue|DarkSeaGreen|DarkSalmon|DarkRed|DarkOrchid|DarkOliveGreen|DarkMagenta|DarkKhaki|DarkGrey|DarkGreen|DarkGray|DarkGoldenRod|DarkCyan|DarkBlue|Cyan|Crimson|Cornsilk|CornflowerBlue|Coral|Chocolate|Chartreuse|CadetBlue|BurlyWood|Brown|BlueViolet|Blue|BlanchedAlmond|Black|Bisque|Beige|Azure|Aquamarine|Aqua|AntiqueWhite|AliceBlue)\b/
, _style: "color: green;"
}
} }
} }

View File

@ -1,17 +0,0 @@
/*
===============================================================================
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; }

View File

@ -2,20 +2,40 @@
=============================================================================== ===============================================================================
Chili is the jQuery code highlighter plugin Chili is the jQuery code highlighter plugin
............................................................................... ...............................................................................
Copyright 2007 / Andrea Ercolino
-------------------------------------------------------------------------------
LICENSE: http://www.opensource.org/licenses/mit-license.php LICENSE: http://www.opensource.org/licenses/mit-license.php
WEBSITE: http://noteslog.com/chili/ WEBSITE: http://noteslog.com/chili/
Copyright 2008 / Andrea Ercolino
=============================================================================== ===============================================================================
*/ */
{ {
steps: { _name: "pas"
mlcom : { exp: /(?:\(\*[\s\S]*?\*\))|(?:{(?!\$)[\s\S]*?})/ } , _case: true
, com : { exp: /\/\/.*/ } , _main: {
, string : { exp: /(?:\'[^\'\\\n]*(?:\\.[^\'\\\n]*)*\')/ } mlcom: {
, number : { exp: /(?:\b[+-]?(?:\d*\.?\d+|\d+\.?\d*)(?:[eE][+-]?\d+)?\b)|(?:\$[a-zA-Z0-9]+\b)/ } _match: /(?:\(\*[\w\W]*?\*\))|(?:{(?!\$)[\w\W]*?})/
, direct : { exp: /\{\$[a-zA-Z]+ .+\}/ } , _style: "color: #4040c2;"
, 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/ } }
, com: {
_match: /\/\/.*/
, _style: "color: green;"
}
, string: {
_match: /(?:\'[^\'\\\n]*(?:\\.[^\'\\\n]*)*\')/
, _style: "color: teal;"
}
, number: {
_match: /(?:\b[+-]?(?:\d*\.?\d+|\d+\.?\d*)(?:[eE][+-]?\d+)?\b)|(?:\$[a-zA-Z0-9]+\b)/
, _style: "color: red;"
}
, direct: {
_match: /\{\$[a-zA-Z]+ .+\}/
, _style: "color: red;"
}
, keyword: {
_match: /\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/
, _style: "color: navy; font-weight: bold;"
}
} }
} }

View File

@ -1,17 +0,0 @@
/*
===============================================================================
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; }

View File

@ -2,22 +2,79 @@
=============================================================================== ===============================================================================
Chili is the jQuery code highlighter plugin Chili is the jQuery code highlighter plugin
............................................................................... ...............................................................................
Copyright 2007 / Andrea Ercolino
-------------------------------------------------------------------------------
LICENSE: http://www.opensource.org/licenses/mit-license.php LICENSE: http://www.opensource.org/licenses/mit-license.php
WEBSITE: http://noteslog.com/chili/ WEBSITE: http://noteslog.com/chili/
Copyright 2008 / Andrea Ercolino
=============================================================================== ===============================================================================
*/ */
{ {
steps: { _name: 'html'
mlcom : { exp: /\<!--(?:.|\n)*?--\>/ } , _case: false
, tag : { exp: /(?:\<\!?[\w:]+)|(?:\>)|(?:\<\/[\w:]+\>)|(?:\/\>)/ } , _main: {
, php : { exp: /(?:\<\?php\s)|(?:\<\?)|(?:\?\>)/ } doctype: {
, aname : { exp: /\s+?[\w-]+:?\w+(?=\s*=)/ } _match: /<!DOCTYPE\b[\w\W]*?>/
, avalue: { , _style: "color: #CC6600;"
exp: /(=\s*)(([\"\'])(?:(?:[^\3\\]*?(?:\3\3|\\.))*?[^\3\\]*?)\3)/ }
, replacement: '$1<span class="$0">$2</span>' } , ie_style: {
, entity: { exp: /&[\w#]+?;/ } _match: /(<!--\[[^\]]*\]>)([\w\W]*?)(<!\[[^\]]*\]-->)/
} , _replace: function( all, open, content, close ) {
return "<span class='ie_style'>" + this.x( open ) + "</span>"
+ this.x( content, '//style' )
+ "<span class='ie_style'>" + this.x( close ) + "</span>";
}
, _style: "color: DarkSlateGray; font-weight: bold;"
}
, comment: {
_match: /<!--[\w\W]*?-->/
, _style: "color: #4040c2;"
}
, script: {
_match: /(<script\s+[^>]*>)([\w\W]*?)(<\/script\s*>)/
, _replace: function( all, open, content, close ) {
return this.x( open, '//tag_start' )
+ this.x( content, 'js' )
+ this.x( close, '//tag_end' );
}
}
, style: {
_match: /(<style\s+[^>]*>)([\w\W]*?)(<\/style\s*>)/
, _replace: function( all, open, content, close ) {
return this.x( open, '//tag_start' )
+ this.x( content, 'css' )
+ this.x( close, '//tag_end' );
}
}
// matches a starting tag of an element (with attrs)
// like "<div ... >" or "<img ... />"
, tag_start: {
_match: /(<\w+)((?:[?%]>|[\w\W])*?)(\/>|>)/
, _replace: function( all, open, content, close ) {
return "<span class='tag_start'>" + this.x( open ) + "</span>"
+ this.x( content, '/tag_attrs' )
+ "<span class='tag_start'>" + this.x( close ) + "</span>";
}
, _style: "color: navy; font-weight: bold;"
}
// matches an ending tag
// like "</div>"
, tag_end: {
_match: /<\/\w+\s*>|\/>/
, _style: "color: navy;"
}
, entity: {
_match: /&\w+?;/
, _style: "color: blue;"
}
}
, tag_attrs: {
// matches a name/value pair
attr: {
// before in $1, name in $2, between in $3, value in $4
_match: /(\W*?)([\w-]+)(\s*=\s*)((?:\'[^\']*(?:\\.[^\']*)*\')|(?:\"[^\"]*(?:\\.[^\"]*)*\"))/
, _replace: "$1<span class='attr_name'>$2</span>$3<span class='attr_value'>$4</span>"
, _style: { attr_name: "color: green;", attr_value: "color: maroon;" }
}
}
} }

View File

@ -1,17 +0,0 @@
/*
===============================================================================
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; }

View File

@ -2,20 +2,40 @@
=============================================================================== ===============================================================================
Chili is the jQuery code highlighter plugin Chili is the jQuery code highlighter plugin
............................................................................... ...............................................................................
Copyright 2007 / Andrea Ercolino
-------------------------------------------------------------------------------
LICENSE: http://www.opensource.org/licenses/mit-license.php LICENSE: http://www.opensource.org/licenses/mit-license.php
WEBSITE: http://noteslog.com/chili/ WEBSITE: http://noteslog.com/chili/
Copyright 2008 / Andrea Ercolino
=============================================================================== ===============================================================================
*/ */
{ {
steps: { _name: "java"
mlcom : { exp: /\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\// } , _case: true
, com : { exp: /\/\/.*/ } , _main: {
, string : { exp: /(?:\'[^\'\\\n]*(?:\\.[^\'\\\n]*)*\')|(?:\"[^\"\\\n]*(?:\\.[^\"\\\n]*)*\")/ } mlcom : {
, number : { exp: /(?:\b[+-]?(?:\d*\.?\d+|\d+\.?\d*)(?:[eE][+-]?\d+)?\b)|(?:0x[a-f0-9]+)\b/ } _match: /\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\//
, meta : { exp: /(?!\@interface\b)\@[\$\w]+\b/ } , _style: "color: #4040c2;"
, 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/ } }
, com : {
_match: /\/\/.*/
, _style: "color: green;"
}
, string : {
_match: /(?:\'[^\'\\\n]*(?:\\.[^\'\\\n]*)*\')|(?:\"[^\"\\\n]*(?:\\.[^\"\\\n]*)*\")/
, _style: "color: teal;"
}
, number : {
_match: /(?:\b[+-]?(?:\d*\.?\d+|\d+\.?\d*)(?:[eE][+-]?\d+)?\b)|(?:0x[a-f0-9]+)\b/
, _style: "color: red;"
}
, meta : {
_match: /(?!\@interface\b)\@[\$\w]+\b/
, _style: "color: red;"
}
, keyword: {
_match: /\b(?:while|volatile|void|try|true|transient|throws|throw|this|synchronized|switch|super|strictfp|static|short|return|public|protected|private|package|null|new|native|long|interface|int|instanceof|import|implements|if|goto|for|float|finally|final|false|extends|enum|else|double|do|default|continue|const|class|char|catch|case|byte|break|boolean|assert|abstract)\b/
, _style: "color: navy; font-weight: bold;"
}
} }
} }

View File

@ -1,18 +0,0 @@
/*
===============================================================================
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; }

View File

@ -1,22 +0,0 @@
/*
===============================================================================
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/ }
}
}

View File

@ -0,0 +1,704 @@
/*
===============================================================================
Chili is the jQuery code highlighter plugin
...............................................................................
LICENSE: http://www.opensource.org/licenses/mit-license.php
WEBSITE: http://noteslog.com/chili/
Copyright 2008 / Andrea Ercolino
===============================================================================
*/
( function($) {
ChiliBook = { //implied global
version: "2.2" // 2008-07-06
// options --------------------------------------------------------------------
, automatic: true
, automaticSelector: "code"
, lineNumbers: !true
, codeLanguage: function( el ) {
var recipeName = $( el ).attr( "class" );
return recipeName ? recipeName : '';
}
, recipeLoading: true
, recipeFolder: "" // used like: recipeFolder + recipeName + '.js'
// IE and FF convert &#160; to "&nbsp;", Safari and Opera do not
, replaceSpace: "&#160;"
, replaceTab: "&#160;&#160;&#160;&#160;"
, replaceNewLine: "&#160;<br/>"
, selectionStyle: [ "position:absolute; z-index:3000; overflow:scroll;"
, "width:16em;"
, "height:9em;"
, "border:1px solid gray;"
, "padding:15px;"
, "background-color:yellow;"
].join( ' ' )
// ------------------------------------------------------------- end of options
, defaultReplacement: '<span class="$0">$$</span>' // TODO: make this an option again
, recipes: {} //repository
, queue: {} //registry
, unique: function() {
return (new Date()).valueOf();
}
};
$.fn.chili = function( options ) {
var book = $.extend( {}, ChiliBook, options || {} );
function cook( ingredients, recipe, blockName ) {
function prepareBlock( recipe, blockName ) {
var steps = [];
for( var stepName in recipe[ blockName ] ) {
steps.push( prepareStep( recipe, blockName, stepName ) );
}
return steps;
} // prepareBlock
function prepareStep( recipe, blockName, stepName ) {
var step = recipe[ blockName ][ stepName ];
var exp = ( typeof step._match == "string" ) ? step._match : step._match.source;
return {
recipe: recipe
, blockName: blockName
, 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._replace ? step._replace : book.defaultReplacement
};
} // prepareStep
function knowHow( steps ) {
var prevLength = 1;
var exps = [];
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 prolog = '((?:\\s|\\S)*?)';
var epilog = '((?:\\s|\\S)+)';
var source = '(?:' + exps.join( "|" ) + ')';
source = prolog + source + '|' + epilog;
return new RegExp( source, recipe._case ? "g" : "gi" );
} // knowHow
function escapeHTML( str ) {
return str.replace( /&/g, "&amp;" ).replace( /</g, "&lt;" );
} // escapeHTML
function replaceSpaces( str ) {
return str.replace( / +/g, function( spaces ) {
return spaces.replace( / /g, replaceSpace );
} );
} // replaceSpaces
function filter( str ) {
str = escapeHTML( str );
if( replaceSpace ) {
str = replaceSpaces( str );
}
return str;
} // filter
function applyRecipe( subject, recipe ) {
return cook( subject, recipe );
} // applyRecipe
function applyBlock( subject, recipe, blockName ) {
return cook( subject, recipe, blockName );
} // applyBlock
function applyStep( subject, recipe, blockName, stepName ) {
var replaceSpace = book.replaceSpace;
var step = prepareStep( recipe, blockName, stepName );
var steps = [step];
var perfect = subject.replace( knowHow( steps ), function() {
return chef.apply( { steps: steps }, arguments );
} );
return perfect;
} // applyStep
function applyModule( subject, module, context ) {
if( ! module ) {
return filter( subject );
}
var sub = module.split( '/' );
var recipeName = '';
var blockName = '';
var stepName = '';
switch( sub.length ) {
case 1:
recipeName = sub[0];
break;
case 2:
recipeName = sub[0]; blockName = sub[1];
break;
case 3:
recipeName = sub[0]; blockName = sub[1]; stepName = sub[2];
break;
default:
return filter( subject );
}
function getRecipe( recipeName ) {
var path = getPath( recipeName );
var recipe = book.recipes[ path ];
if( ! recipe ) {
throw {msg:"recipe not available"};
}
return recipe;
}
try {
var recipe;
if ( '' == stepName ) {
if ( '' == blockName ) {
if ( '' == recipeName ) {
//nothing to do
}
else { // ( '' != recipeName )
recipe = getRecipe( recipeName );
return applyRecipe( subject, recipe );
}
}
else { // ( '' != blockName )
if( '' == recipeName ) {
recipe = context.recipe;
}
else {
recipe = getRecipe( recipeName );
}
if( ! (blockName in recipe) ) {
return filter( subject );
}
return applyBlock( subject, recipe, blockName );
}
}
else { // ( '' != stepName )
if( '' == recipeName ) {
recipe = context.recipe;
}
else {
recipe = getRecipe( recipeName );
}
if( '' == blockName ) {
blockName = context.blockName;
}
if( ! (blockName in recipe) ) {
return filter( subject );
}
if( ! (stepName in recipe[blockName]) ) {
return filter( subject );
}
return applyStep( subject, recipe, blockName, stepName );
}
}
catch( e ) {
if (e.msg && e.msg == "recipe not available") {
var cue = 'chili_' + book.unique();
if( book.recipeLoading ) {
var path = getPath( recipeName );
if( ! book.queue[ path ] ) {
/* this is a new recipe to download */
try {
book.queue[ path ] = [ {cue: cue, subject: subject, module: module, context: context} ];
$.getJSON( path, function( recipeLoaded ) {
book.recipes[ path ] = recipeLoaded;
var q = book.queue[ path ];
for( var i = 0, iTop = q.length; i < iTop; i++ ) {
var replacement = applyModule( q[ i ].subject, q[ i ].module, q[ i ].context );
if( book.replaceTab ) {
replacement = replacement.replace( /\t/g, book.replaceTab );
}
if( book.replaceNewLine ) {
replacement = replacement.replace( /\n/g, book.replaceNewLine );
}
$( '#' + q[ i ].cue ).replaceWith( replacement );
}
} );
}
catch( recipeNotAvailable ) {
alert( "the recipe for '" + recipeName + "' was not found in '" + path + "'" );
}
}
else {
/* not a new recipe, so just enqueue this element */
book.queue[ path ].push( {cue: cue, subject: subject, module: module, context: context} );
}
return '<span id="' + cue + '">' + filter( subject ) + '</span>';
}
return filter( subject );
}
else {
return filter( subject );
}
}
} // applyModule
function addPrefix( prefix, replacement ) {
var aux = replacement.replace( /(<span\s+class\s*=\s*(["']))((?:(?!__)\w)+\2\s*>)/ig, "$1" + prefix + "__$3" );
return aux;
} // addPrefix
function chef() {
if (! arguments[ 0 ]) {
return '';
}
var steps = this.steps;
var i = 0; // iterate steps
var j = 2; // iterate chef's arguments
var prolog = arguments[ 1 ];
var epilog = arguments[ arguments.length - 3 ];
if (! epilog) {
var step;
while( step = steps[ i++ ] ) {
var aux = arguments; // this unmasks chef's arguments inside the next function
if( aux[ j ] ) {
var replacement = '';
if( $.isFunction( step.replacement ) ) {
var matches = []; //Array.slice.call( aux, j, step.length );
for (var k = 0, kTop = step.length; k < kTop; k++) {
matches.push( aux[ j + k ] );
}
matches.push( aux[ aux.length - 2 ] );
matches.push( aux[ aux.length - 1 ] );
replacement = step.replacement
.apply( {
x: function() {
var subject = arguments[0];
var module = arguments[1];
var context = {
recipe: step.recipe
, blockName: step.blockName
};
return applyModule( subject, module, context );
}
}, matches );
}
else { //we expect step.replacement to be a string
replacement = step.replacement
.replace( /(\\\$)|(?:\$\$)|(?:\$(\d+))/g, function( m, escaped, K ) {
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 ) ] );
}
} );
}
replacement = addPrefix( step.recipe._name, replacement );
return filter( prolog ) + replacement;
}
else {
j+= step.length;
}
}
}
else {
return filter( epilog );
}
} // chef
if( ! blockName ) {
blockName = '_main';
checkSpices( recipe );
}
if( ! (blockName in recipe) ) {
return filter( ingredients );
}
var replaceSpace = book.replaceSpace;
var steps = prepareBlock( recipe, blockName );
var kh = knowHow( steps );
var perfect = ingredients.replace( kh, function() {
return chef.apply( { steps: steps }, arguments );
} );
return perfect;
} // cook
function loadStylesheetInline( sourceCode ) {
if( document.createElement ) {
var e = document.createElement( "style" );
e.type = "text/css";
if( e.styleSheet ) { // IE
e.styleSheet.cssText = sourceCode;
}
else {
var t = document.createTextNode( sourceCode );
e.appendChild( t );
}
document.getElementsByTagName( "head" )[0].appendChild( e );
}
} // loadStylesheetInline
function checkSpices( recipe ) {
var name = recipe._name;
if( ! book.queue[ name ] ) {
var content = ['/* Chili -- ' + name + ' */'];
for (var blockName in recipe) {
if( blockName.search( /^_(?!main\b)/ ) < 0 ) {
for (var stepName in recipe[ blockName ]) {
var step = recipe[ blockName ][ stepName ];
if( '_style' in step ) {
if( step[ '_style' ].constructor == String ) {
content.push( '.' + name + '__' + stepName + ' { ' + step[ '_style' ] + ' }' );
}
else {
for (var className in step[ '_style' ]) {
content.push( '.' + name + '__' + className + ' { ' + step[ '_style' ][ className ] + ' }' );
}
}
}
}
}
}
content = content.join('\n');
loadStylesheetInline( content );
book.queue[ name ] = true;
}
} // checkSpices
function askDish( el ) {
var recipeName = book.codeLanguage( el );
if( '' != recipeName ) {
var path = getPath( recipeName );
if( book.recipeLoading ) {
/* dynamic setups come here */
if( ! book.queue[ path ] ) {
/* this is a new recipe to download */
try {
book.queue[ path ] = [ el ];
$.getJSON( path, function( recipeLoaded ) {
book.recipes[ path ] = recipeLoaded;
var q = book.queue[ path ];
for( var i = 0, iTop = q.length; i < iTop; i++ ) {
makeDish( q[ i ], path );
}
} );
}
catch( recipeNotAvailable ) {
alert( "the recipe for '" + recipeName + "' was not found in '" + path + "'" );
}
}
else {
/* not a new recipe, so just enqueue this element */
book.queue[ path ].push( el );
}
/* a recipe could have been already downloaded */
makeDish( el, path );
}
else {
/* static setups come here */
makeDish( el, path );
}
}
} // askDish
function makeDish( el, recipePath ) {
var recipe = book.recipes[ recipePath ];
if( ! recipe ) {
return;
}
var $el = $( el );
var ingredients = $el.text();
if( ! ingredients ) {
return;
}
//fix for msie: \r (13) is used instead of \n (10)
//fix for opera: \r\n is used instead of \n
ingredients = ingredients.replace(/\r\n?/g, "\n");
//reverse fix for safari: msie, mozilla and opera render the initial \n
if( $el.parent().is('pre') ) {
if( ! $.browser.safari ) {
ingredients = ingredients.replace(/^\n/g, "");
}
}
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.innerHTML = dish; //much faster than $el.html( dish );
//tried also the function replaceHtml from http://blog.stevenlevithan.com/archives/faster-than-innerhtml
//but it was not faster nor without sideffects (it was not possible to count spans into el)
//opera and safari select PRE text correctly
if( $.browser.msie || $.browser.mozilla ) {
enableSelectionHelper( el );
}
var $that = $el.parent();
var classes = $that.attr( 'class' );
var ln = /ln-(\d+)-([\w][\w\-]*)|ln-(\d+)|ln-/.exec( classes );
if( ln ) {
addLineNumbers( el );
var start = 0;
if( ln[1] ) {
start = parseInt( ln[1], 10 );
var $pieces = $( '.ln-' + ln[1] + '-' + ln[2] );
var pos = $pieces.index( $that[0] );
$pieces.slice( 0, pos ).each( function() {
start += $( this ).find( 'li' ).length;
} );
}
else if( ln[3] ) {
start = parseInt( ln[3], 10 );
}
else {
start = 1;
}
$el.find( 'ol' )[0].start = start;
$('body').width( $('body').width() - 1 ).width( $('body').width() + 1 );
}
else if( book.lineNumbers ) {
addLineNumbers( el );
}
} // makeDish
function enableSelectionHelper( el ) {
var element = null;
$( el )
.parents()
.filter( "pre" )
.bind( "mousedown", function() {
element = this;
if( $.browser.msie ) {
document.selection.empty();
}
else {
window.getSelection().removeAllRanges();
}
} )
.bind( "mouseup", function( event ) {
if( element && (element == this) ) {
element = null;
var selected = '';
if( $.browser.msie ) {
selected = document.selection.createRange().htmlText;
if( '' == selected ) {
return;
}
selected = preserveNewLines( selected );
var container_tag = '<textarea style="STYLE">';
}
else {
selected = window.getSelection().toString(); //opera doesn't select new lines
if( '' == selected ) {
return;
}
selected = selected
.replace( /\r/g, '' )
.replace( /^# ?/g, '' )
.replace( /\n# ?/g, '\n' )
;
var container_tag = '<pre style="STYLE">';
}
var $container = $( container_tag.replace( /\bSTYLE\b/, ChiliBook.selectionStyle ) )
.appendTo( 'body' )
.text( selected )
.attr( 'id', 'chili_selection' )
.click( function() { $(this).remove(); } )
;
var top = event.pageY - Math.round( $container.height() / 2 ) + "px";
var left = event.pageX - Math.round( $container.width() / 2 ) + "px";
$container.css( { top: top, left: left } );
if( $.browser.msie ) {
// window.clipboardData.setData( 'Text', selected ); //I couldn't find anything similar for Mozilla
$container[0].focus();
$container[0].select();
}
else {
var s = window.getSelection();
s.removeAllRanges();
var r = document.createRange();
r.selectNodeContents( $container[0] );
s.addRange( r );
}
}
} )
;
} // enableSelectionHelper
function getPath( recipeName ) {
return book.recipeFolder + recipeName + ".js";
} // getPath
function getSelectedText() {
var text = '';
if( $.browser.msie ) {
text = document.selection.createRange().htmlText;
}
else {
text = window.getSelection().toString();
}
return text;
} // getSelectedText
function preserveNewLines( html ) {
do {
var newline_flag = ChiliBook.unique();
}
while( html.indexOf( newline_flag ) > -1 );
var text = '';
if (/<br/i.test(html) || /<li/i.test(html)) {
if (/<br/i.test(html)) {
html = html.replace( /\<br[^>]*?\>/ig, newline_flag );
}
else if (/<li/i.test(html)) {
html = html.replace( /<ol[^>]*?>|<\/ol>|<li[^>]*?>/ig, '' ).replace( /<\/li>/ig, newline_flag );
}
var el = $( '<pre>' ).appendTo( 'body' ).hide()[0];
el.innerHTML = html;
text = $( el ).text().replace( new RegExp( newline_flag, "g" ), '\r\n' );
$( el ).remove();
}
return text;
} // preserveNewLines
function addLineNumbers( el ) {
function makeListItem1( not_last_line, not_last, last, open ) {
var close = open ? '</span>' : '';
var aux = '';
if( not_last_line ) {
aux = '<li>' + open + not_last + close + '</li>';
}
else if( last ) {
aux = '<li>' + open + last + close + '</li>';
}
return aux;
} // makeListItem1
function makeListItem2( not_last_line, not_last, last, prev_li ) {
var aux = '';
if( prev_li ) {
aux = prev_li;
}
else {
aux = makeListItem1( not_last_line, not_last, last, '' )
}
return aux;
} // makeListItem2
var html = $( el ).html();
var br = /<br>/.test(html) ? '<br>' : '<BR>';
var empty_line = '<li>' + book.replaceSpace + '</li>';
var list_items = html
//extract newlines at the beginning of a span
.replace( /(<span [^>]+>)((?:(?:&nbsp;|\xA0)<br>)+)(.*?)(<\/span>)/ig, '$2$1$3$4' ) // I don't know why <span .*?> does not work here
//transform newlines inside of a span
.replace( /(.*?)(<span .*?>)(.*?)(?:<\/span>(?:&nbsp;|\xA0)<br>|<\/span>)/ig, // but here it does
function( all, before, open, content ) {
if (/<br>/i.test(content)) {
var pieces = before.split( br );
var lastPiece = pieces.pop();
before = pieces.join( br );
var aux = (before ? before + br : '') //+ replace1( lastPiece + content, open );
+ (lastPiece + content).replace( /((.*?)(?:&nbsp;|\xA0)<br>)|(.*)/ig,
function( tmp, not_last_line, not_last, last ) {
var aux2 = makeListItem1( not_last_line, not_last, last, open );
return aux2;
}
);
return aux;
}
else {
return all;
}
}
)
//transform newlines outside of a span
.replace( /(<li>.*?<\/li>)|((.*?)(?:&nbsp;|\xA0)<br>)|(.+)/ig,
function( tmp, prev_li, not_last_line, not_last, last ) {
var aux2 = makeListItem2( not_last_line, not_last, last, prev_li );
return aux2;
}
)
//fix empty lines for Opera
.replace( /<li><\/li>/ig, empty_line )
;
el.innerHTML = '<ol>' + list_items + '</ol>';
} // addLineNumbers
function revealChars( tmp ) {
return $
.map( tmp.split(''),
function(n, i) {
return ' ' + n + ' ' + n.charCodeAt( 0 ) + ' ';
} )
.join(' ');
} // revealChars
//-----------------------------------------------------------------------------
// the coloring starts here
this
.each( function() {
var $this = $( this );
$this.trigger( 'chili.before_coloring' );
askDish( this );
$this.trigger( 'chili.after_coloring' );
} );
return this;
//-----------------------------------------------------------------------------
};
//main
$( function() {
if( ChiliBook.automatic ) {
$( ChiliBook.automaticSelector ).chili();
}
} );
} ) ( jQuery );

View File

@ -1,30 +0,0 @@
/*
===============================================================================
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; }

View File

@ -1,68 +0,0 @@
/*
===============================================================================
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>'
}
}
}

75
docs/js/chili/js.js Normal file
View File

@ -0,0 +1,75 @@
/*
===============================================================================
Chili is the jQuery code highlighter plugin
...............................................................................
LICENSE: http://www.opensource.org/licenses/mit-license.php
WEBSITE: http://noteslog.com/chili/
Copyright 2008 / Andrea Ercolino
===============================================================================
*/
{
_name: 'js'
, _case: true
, _main: {
ml_comment: {
_match: /\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\//
, _style: 'color: gray;'
}
, sl_comment: {
_match: /\/\/.*/
, _style: 'color: green;'
}
, string: {
_match: /(?:\'[^\'\\\n]*(?:\\.[^\'\\\n]*)*\')|(?:\"[^\"\\\n]*(?:\\.[^\"\\\n]*)*\")/
, _style: 'color: teal;'
}
, num: {
_match: /\b[+-]?(?:\d*\.?\d+|\d+\.?\d*)(?:[eE][+-]?\d+)?\b/
, _style: 'color: red;'
}
, reg_not: { //this prevents "a / b / c" to be interpreted as a reg_exp
_match: /(?:\w+\s*)\/[^\/\\\n]*(?:\\.[^\/\\\n]*)*\/[gim]*(?:\s*\w+)/
, _replace: function( all ) {
return this.x( all, '//num' );
}
}
, reg_exp: {
_match: /\/[^\/\\\n]*(?:\\.[^\/\\\n]*)*\/[gim]*/
, _style: 'color: maroon;'
}
, brace: {
_match: /[\{\}]/
, _style: 'color: red; font-weight: bold;'
}
, statement: {
_match: /\b(with|while|var|try|throw|switch|return|if|for|finally|else|do|default|continue|const|catch|case|break)\b/
, _style: 'color: navy; font-weight: bold;'
}
, error: {
_match: /\b(URIError|TypeError|SyntaxError|ReferenceError|RangeError|EvalError|Error)\b/
, _style: 'color: Coral;'
}
, object: {
_match: /\b(String|RegExp|Object|Number|Math|Function|Date|Boolean|Array)\b/
, _style: 'color: DeepPink;'
}
, property: {
_match: /\b(undefined|arguments|NaN|Infinity)\b/
, _style: 'color: Purple; font-weight: bold;'
}
, 'function': {
_match: /\b(parseInt|parseFloat|isNaN|isFinite|eval|encodeURIComponent|encodeURI|decodeURIComponent|decodeURI)\b/
, _style: 'color: olive;'
}
, operator: {
_match: /\b(void|typeof|this|new|instanceof|in|function|delete)\b/
, _style: 'color: RoyalBlue; font-weight: bold;'
}
, liveconnect: {
_match: /\b(sun|netscape|java|Packages|JavaPackage|JavaObject|JavaClass|JavaArray|JSObject|JSException)\b/
, _style: 'text-decoration: overline;'
}
}
}

View File

@ -1,20 +0,0 @@
/*
===============================================================================
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; }

View File

@ -2,26 +2,53 @@
=============================================================================== ===============================================================================
Chili is the jQuery code highlighter plugin Chili is the jQuery code highlighter plugin
............................................................................... ...............................................................................
Copyright 2007 / Andrea Ercolino
-------------------------------------------------------------------------------
LICENSE: http://www.opensource.org/licenses/mit-license.php LICENSE: http://www.opensource.org/licenses/mit-license.php
WEBSITE: http://noteslog.com/chili/ WEBSITE: http://noteslog.com/chili/
Copyright 2008 / Andrea Ercolino
=============================================================================== ===============================================================================
*/ */
{ {
ignoreCase: true _name: "ls"
, steps: { , _case: false
mlcom : { exp : /((?:^|\n)%REM\b.*)((?:.|\n)*?)(\n%END\s*REM\b.*)/ , _main: {
,replacement: '<span class="directive">$1</span><span class="mlcom">$2</span><span class="directive">$3</span>' mlcom: {
_match: /((?:^|\n)%REM\b.*)([\w\W]*?)(\n%END\s*REM\b.*)/
, _replace: '<span class="directive">$1</span><span class="mlcom">$2</span><span class="directive">$3</span>'
, _style: "color: #4040c2;"
}
, com: {
_match: /(?:\'.*)|(?:\bREM\b.*)/
, _style: "color: green;"
}
, mlstr: {
_match: /(?:\{[^}]*\})|(?:\|[^|]*\|)/
, _style: "color: red;"
}
, str: {
_match: /(?:\"[^\"].*?\")|\"\"/
, _style: "color: teal;"
}
, keyd: {
_match: /\b(?:Ustring|Uchr|Ucase|Trim|Time|Strtoken|Strrightback|Strright|Strleftback|Strleft|String|Str|Space|Rtrim|Rightc|Rightbp|Rightb|Right|Oct|Midc|Midbp|Midb|Mid|Ltrim|Leftc|Leftbp|Leftb|Left|Lcase|Inputbp|Inputbox|Inputb|Input|Implode|Hex|Format|Error|Environ|Dir|Date|Curdrive|Curdir|Command|Chr|Bin)[$](?:\s)/
, _style: "color: fuchsia;"
}
, keyw: {
_match: /\b(?:Yield|Year|Xor|Write|With|Width|While|Wend|Weekday|Vartype|Variant|Val|Ustring|Uselsx|Use|Until|Unlock|Unicode|Uni|Uchr|Ucase|Ubound|Typename|Type|True|Trim|Today|To|Timevalue|Timeserial|Timer|Timenumber|Time|Then|Text|Tan|Tab|Sub|Strtoken|Strrightback|Strright|Strleftback|Strleft|String|Strconv|Strcompare|Strcomp|Str|Stop|Step|Static|Sqr|Split|Spc|Space|Sleep|Single|Sin|Shell|Shared|Sgn|Setfileattr|Setattr|Set|Sendkeys|Select|Seek|Second|Rtrim|Rset|Round|Rnd|Rmdir|Rightc|Rightbp|Rightb|Right|Return|Resume|Reset|Replace|Remove|Redim|Read|Randomize|Random|Put|Published|Public|Property|Private|Print|Preserve|Pitch|Pi|Output|Or|Option|Open|On|Oct|Null|Now|Nothing|Not|Nopitch|Nocase|Next|New|Name|Msgbox|Month|Mod|Mkdir|Minute|Midc|Midbp|Midb|Mid|Messagebox|Me|Ltrim|Lsserver|Lsi_info|Lset|Loop|Long|Log|Lof|Lock|Loc|Lmbcs|Listtag|List|Line|Like|Lib|Let|Lenc|Lenbp|Lenb|Len|Leftc|Leftbp|Leftb|Left|Lcase|Lbound|Kill|Join|Isunknown|Isscalar|Isobject|Isnumeric|Isnull|Islist|Isempty|Iselement|Isdate|Isarray|Isa|Is|Integer|Int|Instrc|Instrbp|Instrb|Instr|Inputbp|Inputbox|Inputb|Input|In|Implode|Imp|Imestatus|Imesetmode|If|Hour|Hex|Goto|Gosub|Getthreadinfo|Getfileattr|Getattr|Get|Function|Fulltrim|From|Freefile|Fraction|Format|Forall|For|Fix|Filelen|Filedatetime|Filecopy|Fileattr|False|Explicit|Exp|Exit|Execute|Event|Evaluate|Error|Err|Erl|Erase|Eqv|Eof|Environ|End|Elseif|Else|Double|Doevents|Do|Dir|Dim|Destroylock|Delete|Defvar|Defstr|Defsng|Deflng|Defint|Defdbl|Defcur|Defbyte|Defbool|Declare|Day|Datevalue|Dateserial|Datenumber|Date|Datatype|Cvdate|Cvar|Currency|Curdrive|Curdir|Cstr|Csng|Createlock|Cos|Const|Compare|Command|Codeunlock|Codelockcheck|Codelock|Close|Clng|Class|Cint|Chr|Chdrive|Chdir|Cdbl|Cdat|Ccur|Cbyte|Cbool|Case|Call|Byval|Byte|Boolean|Bind|Binary|Bin|Beep|Base|Atn2|Atn|Asin|Asc|As|Arrayunique|Arrayreplace|Arraygetindex|Arrayappend|Append|Appactivate|Any|And|Alias|Activateapp|Acos|Access|Abs)\b/
, _style: "color: maroon; font-weight: bold;"
}
, directive: {
_match: /((?:^|\n)(?:%if|%end|%elseif|%else)\b)|(?:(?:^|\n)%include\b.*)/
, _style: "color: #5f5f5f;"
}
, notes: {
_match: /\b(?:NotesXSLTransformer|NotesXMLProcessor|NotesViewNavigator|NotesViewEntryCollection|NotesViewEntry|NotesViewColumn|NotesView|NotesTimer|NotesStream|NotesSession|NotesSAXParser|NotesSAXException|NotesSAXAttributeList|NotesRichTextTable|NotesRichTextTab|NotesRichTextStyle|NotesRichTextSection|NotesRichTextRange|NotesRichTextParagraphStyle|NotesRichTextNavigator|NotesRichTextItem|NotesRichTextDocLink|NotesReplicationEntry|NotesReplication|NotesRegistration|NotesOutlineEntry|NotesOutline|NotesNoteCollection|NotesNewsLetter|NotesName|NotesMIMEHeader|NotesMIMEEntity|NotesLog|NotesItem|NotesInternational|NotesForm|NotesEmbeddedObject|NotesDocumentCollection|NotesDocument|NotesDbDirectory|NotesDateTime|NotesDateRange|NotesDatabase|NotesDXLImporter|NotesDXLExporter|NotesDOMXMLDeclNode|NotesDOMTextNode|NotesDOMProcessingInstructionNode|NotesDOMParser|NotesDOMNotationNode|NotesDOMNodeList|NotesDOMNode|NotesDOMNamedNodeMap|NotesDOMEntityReferenceNode|NotesDOMEntityNode|NotesDOMElementNode|NotesDOMDocumentTypeNode|NotesDOMDocumentNode|NotesDOMDocumentFragmentNode|NotesDOMCommentNode|NotesDOMCharacterDataNode|NotesDOMCDATASectionNode|NotesDOMAttributeNode|NotesColorObject|NotesAgent|NotesAdministrationProcess|NotesACLEntry|NotesACL)\b/
, _style: "color: navy;"
}
, notesui: {
_match: /\b(?:NotesUIWorkspace|NotesUIView|NotesUIScheduler|NotesUIDocument|NotesUIDatabase|Navigator|Field|Button)\b/
, _style: "color: purple;"
} }
, 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/ }
} }
} }

View File

@ -1,22 +0,0 @@
/*
===============================================================================
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; }

View File

@ -2,31 +2,62 @@
=============================================================================== ===============================================================================
Chili is the jQuery code highlighter plugin Chili is the jQuery code highlighter plugin
............................................................................... ...............................................................................
Copyright 2007 / Andrea Ercolino
-------------------------------------------------------------------------------
LICENSE: http://www.opensource.org/licenses/mit-license.php LICENSE: http://www.opensource.org/licenses/mit-license.php
WEBSITE: http://noteslog.com/chili/ WEBSITE: http://noteslog.com/chili/
Copyright 2008 / Andrea Ercolino
=============================================================================== ===============================================================================
*/ */
{ {
ignoreCase: true _name: "sql"
, steps: { , _case: false
mlcom : { exp: /\/\*[^*]*\*+([^\/][^*]*\*+)*\// } , _main: {
, com : { exp: /(?:--\s+.*)|(?:[^\\]\#.*)/ } mlcom: {
, string : { exp: /([\"\'])(?:(?:[^\1\\\r\n]*?(?:\1\1|\\.))*[^\1\\\r\n]*?)\1/ } _match: /\/\*[^*]*\*+([^\/][^*]*\*+)*\//
, quid : { exp: /(`)(?:(?:[^\1\\\r\n]*?(?:\1\1|\\.))*[^\1\\\r\n]*?)\1/ } , _style: "color: gray;"
, 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/ , com: {
_match: /(?:--\s+.*)|(?:[^\\]\#.*)/
, _style: "color: green;"
}
, string: {
_match: /([\"\'])(?:(?:[^\1\\\r\n]*?(?:\1\1|\\.))*[^\1\\\r\n]*?)\1/
, _style: "color: purple;"
}
, quid: {
_match: /(`)(?:(?:[^\1\\\r\n]*?(?:\1\1|\\.))*[^\1\\\r\n]*?)\1/
, _style: "color: fuchsia;"
}
, value: {
_match: /\b(?:NULL|TRUE|FALSE)\b/
, _style: "color: gray; font-weight: bold;"
}
, number: {
_match: /\b[+-]?(\d*\.?\d+|\d+\.?\d*)([eE][+-]?\d+)?\b/
, _style: "color: red;"
}
, hexnum: {
_match: /\b0[xX][\dA-Fa-f]+\b|\b[xX]([\'\"])[\dA-Fa-f]+\1/
, _style: "color: red; font-weight: bold;"
}
, variable: {
_match: /@([$.\w]+|([`\"\'])(?:(?:[^\2\\\r\n]*?(?:\2\2|\\.))*[^\2\\\r\n]*?)\2)/
, _replace: '<span class="keyword">@</span><span class="variable">$1</span>'
, _style: "color: #4040c2;"
}
, keyword: {
_match: /\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/
, _style: "color: navy; font-weight: bold;"
}
, 'function': {
_match: /\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|))(?=\()/
, _style: "color: #e17100;"
}
, id: {
_match: /[$\w]+/
, _style: "color: maroon;"
} }
, 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]+/ }
} }
} }

142
docs/js/chili/php-f.js Normal file

File diff suppressed because one or more lines are too long

View File

@ -1,24 +0,0 @@
/*
===============================================================================
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; }

File diff suppressed because one or more lines are too long

View File

@ -1,64 +0,0 @@
/*
===============================================================================
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; }

View File

@ -2,97 +2,363 @@
=============================================================================== ===============================================================================
Chili is the jQuery code highlighter plugin Chili is the jQuery code highlighter plugin
............................................................................... ...............................................................................
Copyright 2007 / Andrea Ercolino
-------------------------------------------------------------------------------
LICENSE: http://www.opensource.org/licenses/mit-license.php LICENSE: http://www.opensource.org/licenses/mit-license.php
WEBSITE: http://noteslog.com/chili/ WEBSITE: http://noteslog.com/chili/
===============================================================================
*/
/* Copyright 2008 / Andrea Ercolino
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.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" ] = ChiliBook.recipes[ "php.js" ] =
/* ----------------------------------------------------------------------------
* this recipe uses a little trick for highlighting php code
* 1: replace each php snippet with a placeholder
* 2: highlight html without php and php snippets apart
* 3: replace each placeholder with its highlighted php snippet
*
* the trick is not perfect only if the html without php is broken
* however, in such a case many highlighters get fooled but Chili does not
*
* ---
* this recipe has been adapted for working with Safari
* in fact, Safari cannot match more than 101236 characters with a lazy star
* --------------------------------------------------------------------------*/
{ {
steps: { _name: "php"
mlcom : { exp: /\/\*[^*]*\*+([^\/][^*]*\*+)*\// } , _case: true
, com : { exp: /(?:\/\/.*)|(?:[^\\]\#.*)/ } , _main: {
, string1 : { exp: /\'[^\'\\]*(?:\\.[^\'\\]*)*\'/ } all: {
, string2 : { exp: /\"[^\"\\]*(?:\\.[^\"\\]*)*\"/ } _match: /[\w\W]*/
, value : { exp: /\b(?:[Nn][Uu][Ll][Ll]|[Tt][Rr][Uu][Ee]|[Ff][Aa][Ll][Ss][Ee])\b/ } , _replace: function( all ) {
, number : { exp: /\b[+-]?(\d*\.?\d+|\d+\.?\d*)([eE][+-]?\d+)?\b/ } var placeholder = String.fromCharCode(0);
, 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/ } var blocks = [];
, 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/ } var that = this;
, global : { exp: /(?:\$GLOBALS|\$_COOKIE|\$_ENV|\$_FILES|\$_GET|\$_POST|\$_REQUEST|\$_SERVER|\$_SESSION|\$php_errormsg)\b/ } var no_php_1 = all.replace( /<\?[^?]*\?+(?:[^>][^?]*\?+)*>/g, function( block ) {
, 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/ } blocks.push( that.x( block, '/block/php_1' ) );
, variable: { exp: /\$(\w+)/ return placeholder;
, replacement: '<span class="keyword">$</span><span class="variable">$1</span>' } } );
, heredoc : { exp: /(\<\<\<\s*)(\w+)((?:(?!\2).*\n)+)(\2)\b/ var no_php_2 = no_php_1.replace( /^[^?]*\?+(?:[^>][^?]*\?+)*>|<\?[\w\W]*$/g, function( block ) {
, replacement: '<span class="keyword">$1</span><span class="string1">$2</span><span class="string2">$3</span><span class="string1">$4</span>' } blocks.push( that.x( block, '/block/php_2' ) );
return placeholder;
} );
if( blocks.length ) {
var html = this.x( no_php_2, 'html' );
var count = 0;
return html.replace( new RegExp( placeholder, "g" ), function() {
return blocks[ count++ ];
} );
}
else {
return this.x( all, '/php' );
}
}
}
}
, block: {
php_1: { // --- <? +++ ?> ---
_match: /(<\?(?:php\b)?)([^?]*\?+(?:[^>][^?]*\?+)*>)/
, _replace: function( all, open, content ) {
return "<span class='start'>" + this.x( open ) + "</span>"
+ this.x( content.replace( /\?>$/, '' ), '/php' )
+ "<span class='end'>" + this.x( '?>' ) + "</span>";
}
, _style: {
start: "color: red; font-weight: bold"
, end: "color: red;"
}
}
, php_2: { // +++ ?> --- <? +++
_match: /([^?]*\?+(?:[^>][^?]*\?+)*>)|(<\?(?:php\b)?)([\w\W]*)/
, _replace: function( all, content, open2, content2 ) {
if( open2 ) {
return "<span class='start'>" + this.x( open2 ) + "</span>"
+ this.x( content2, '/php' );
}
else {
return this.x( content.replace( /\?>$/, '' ), '/php' )
+ "<span class='end'>" + this.x( '?>' ) + "</span>";
}
}
, _style: {
start: "color: red; font-weight: bold"
, end: "color: red;"
}
}
}
, php: {
mlcom: {
_match: /\/\*[^*]*\*+([^\/][^*]*\*+)*\//
, _style: "color: gray;"
}
, com: {
_match: /(?:\/\/.*)|(?:[^\\]\#.*)/
, _style: "color: green;"
}
, string1: {
_match: /\'[^\'\\]*(?:\\.[^\'\\]*)*\'/
, _style: "color: purple;"
}
, string2: {
_match: /\"[^\"\\]*(?:\\.[^\"\\]*)*\"/
, _style: "color: fuchsia;"
}
, value: {
_match: /\b(?:[Nn][Uu][Ll][Ll]|[Tt][Rr][Uu][Ee]|[Ff][Aa][Ll][Ss][Ee])\b/
, _style: "color: gray; font-weight: bold;"
}
, number: {
_match: /\b[+-]?(\d*\.?\d+|\d+\.?\d*)([eE][+-]?\d+)?\b/
, _style: "color: red;"
}
, const1: {
_match: /\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/
, _style: "color: red;"
}
, const2: {
_match: /\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/
, _style: "color: red;"
}
, global: {
_match: /(?:\$GLOBALS|\$_COOKIE|\$_ENV|\$_FILES|\$_GET|\$_POST|\$_REQUEST|\$_SERVER|\$_SESSION|\$php_errormsg)\b/
, _style: "color: red;"
}
, keyword: {
_match: /\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/
, _style: "color: navy; font-weight: bold;"
}
, variable: {
_match: /\$(\w+)/
, _replace: '<span class="keyword">$</span><span class="variable">$1</span>'
, _style: "color: #4040c2;"
}
, heredoc: {
_match: /(\<\<\<\s*)(\w+)((?:(?!\2).*\n)+)(\2)\b/
, _replace: '<span class="keyword">$1</span><span class="string1">$2</span><span class="string2">$3</span><span class="string1">$4</span>'
}
}
}
ChiliBook.recipes[ "html.js" ] =
{
_name: 'html'
, _case: false
, _main: {
doctype: {
_match: /<!DOCTYPE\b[\w\W]*?>/
, _style: "color: #CC6600;"
}
, ie_style: {
_match: /(<!--\[[^\]]*\]>)([\w\W]*?)(<!\[[^\]]*\]-->)/
, _replace: function( all, open, content, close ) {
return "<span class='ie_style'>" + this.x( open ) + "</span>"
+ this.x( content, '//style' )
+ "<span class='ie_style'>" + this.x( close ) + "</span>";
}
, _style: "color: DarkSlateGray; font-weight: bold;"
}
, comment: {
_match: /<!--[\w\W]*?-->/
, _style: "color: #4040c2;"
}
, script: {
_match: /(<script\s+[^>]*>)([\w\W]*?)(<\/script\s*>)/
, _replace: function( all, open, content, close ) {
return this.x( open, '//tag_start' )
+ this.x( content, 'js' )
+ this.x( close, '//tag_end' );
}
}
, style: {
_match: /(<style\s+[^>]*>)([\w\W]*?)(<\/style\s*>)/
, _replace: function( all, open, content, close ) {
return this.x( open, '//tag_start' )
+ this.x( content, 'css' )
+ this.x( close, '//tag_end' );
}
}
// matches a starting tag of an element (with attrs)
// like "<div ... >" or "<img ... />"
, tag_start: {
_match: /(<\w+)((?:[?%]>|[\w\W])*?)(\/>|>)/
, _replace: function( all, open, content, close ) {
return "<span class='tag_start'>" + this.x( open ) + "</span>"
+ this.x( content, '/tag_attrs' )
+ "<span class='tag_start'>" + this.x( close ) + "</span>";
}
, _style: "color: navy; font-weight: bold;"
}
// matches an ending tag
// like "</div>"
, tag_end: {
_match: /<\/\w+\s*>|\/>/
, _style: "color: navy;"
}
, entity: {
_match: /&\w+?;/
, _style: "color: blue;"
}
}
, tag_attrs: {
// matches a name/value pair
attr: {
// before in $1, name in $2, between in $3, value in $4
_match: /(\W*?)([\w-]+)(\s*=\s*)((?:\'[^\']*(?:\\.[^\']*)*\')|(?:\"[^\"]*(?:\\.[^\"]*)*\"))/
, _replace: "$1<span class='attr_name'>$2</span>$3<span class='attr_value'>$4</span>"
, _style: { attr_name: "color: green;", attr_value: "color: maroon;" }
}
} }
}; };
ChiliBook.recipes[ "js.js" ] =
{
_name: 'js'
, _case: true
, _main: {
ml_comment: {
_match: /\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\//
, _style: 'color: gray;'
}
, sl_comment: {
_match: /\/\/.*/
, _style: 'color: green;'
}
, string: {
_match: /(?:\'[^\'\\\n]*(?:\\.[^\'\\\n]*)*\')|(?:\"[^\"\\\n]*(?:\\.[^\"\\\n]*)*\")/
, _style: 'color: teal;'
}
, num: {
_match: /\b[+-]?(?:\d*\.?\d+|\d+\.?\d*)(?:[eE][+-]?\d+)?\b/
, _style: 'color: red;'
}
, reg_not: { //this prevents "a / b / c" to be interpreted as a reg_exp
_match: /(?:\w+\s*)\/[^\/\\\n]*(?:\\.[^\/\\\n]*)*\/[gim]*(?:\s*\w+)/
, _replace: function( all ) {
return this.x( all, '//num' );
}
}
, reg_exp: {
_match: /\/[^\/\\\n]*(?:\\.[^\/\\\n]*)*\/[gim]*/
, _style: 'color: maroon;'
}
, brace: {
_match: /[\{\}]/
, _style: 'color: red; font-weight: bold;'
}
, statement: {
_match: /\b(with|while|var|try|throw|switch|return|if|for|finally|else|do|default|continue|const|catch|case|break)\b/
, _style: 'color: navy; font-weight: bold;'
}
, error: {
_match: /\b(URIError|TypeError|SyntaxError|ReferenceError|RangeError|EvalError|Error)\b/
, _style: 'color: Coral;'
}
, object: {
_match: /\b(String|RegExp|Object|Number|Math|Function|Date|Boolean|Array)\b/
, _style: 'color: DeepPink;'
}
, property: {
_match: /\b(undefined|arguments|NaN|Infinity)\b/
, _style: 'color: Purple; font-weight: bold;'
}
, 'function': {
_match: /\b(parseInt|parseFloat|isNaN|isFinite|eval|encodeURIComponent|encodeURI|decodeURIComponent|decodeURI)\b/
, _style: 'color: olive;'
}
, operator: {
_match: /\b(void|typeof|this|new|instanceof|in|function|delete)\b/
, _style: 'color: RoyalBlue; font-weight: bold;'
}
, liveconnect: {
_match: /\b(sun|netscape|java|Packages|JavaPackage|JavaObject|JavaClass|JavaArray|JSObject|JSException)\b/
, _style: 'text-decoration: overline;'
}
}
};
ChiliBook.recipes[ "css.js" ] = ChiliBook.recipes[ "css.js" ] =
{ {
steps: { _name: 'css'
mlcom : { exp: /\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\// } , _case: true
, string: { exp: /(?:\'[^\'\\\n]*(?:\\.[^\'\\\n]*)*\')|(?:\"[^\"\\\n]*(?:\\.[^\"\\\n]*)*\")/ } , _main: {
, number: { exp: /(?:\b[+-]?(?:\d*\.?\d+|\d+\.?\d*))(?:%|(?:(?:px|pt|em|)\b))/ } comment: {
, 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/ } _match: /\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\//
, 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/ } , _style: "color: olive;"
, color : { exp: /(?:\#[a-zA-Z0-9]{3,6})|(?:yellow|white|teal|silver|red|purple|olive|navy|maroon|lime|green|gray|fuchsia|blue|black|aqua)/ } }
, directive: {
_match: /@\w+/
, _style: "color: fuchsia;"
}
, url: {
_match: /\b(url\s*\()([^)]+)(\))/
, _replace: "<span class='url'>$1</span>$2<span class='url'>$3</span>"
, _style: "color: fuchsia;"
}
, block: {
_match: /\{([\w\W]*?)\}/
, _replace: function( all, pairs ) {
return '{' + this.x( pairs, '/definition' ) + '}';
}
}
, 'class': {
_match: /\.\w+/
, _style: "color: #CC0066; font-weight: bold;"
}
, id: {
_match: /#\w+/
, _style: "color: IndianRed; font-weight: bold;"
}
, pseudo: {
_match: /:\w+/
, _style: "color: #CC9900;"
}
, element: {
_match: /\w+/
, _style: "color: Purple; font-weight: bold;"
}
} }
} , definition: {
comment: {
_match: /\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\//
}
, property: {
_match: /\b(?:zoom|z-index|writing-mode|word-wrap|word-spacing|word-break|width|widows|white-space|volume|voice-family|visibility|vertical-align|unicode-bidi|top|text-underline-position|text-transform|text-shadow|text-overflow|text-kashida-space|text-justify|text-indent|text-decoration|text-autospace|text-align-last|text-align|table-layout|stress|speech-rate|speak-punctuation|speak-numeral|speak-header|speak|size|scrollbar-track-color|scrollbar-shadow-color|scrollbar-highlight-color|scrollbar-face-color|scrollbar-dark-shadow-color|scrollbar-base-color|scrollbar-arrow-color|scrollbar-3d-light-color|ruby-position|ruby-overhang|ruby-align|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-Y|overflow-X|overflow|outline-width|outline-style|outline-color|outline|orphans|min-width|min-height|max-width|max-height|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|line-break|letter-spacing|left|layout-grid-type|layout-grid-mode|layout-grid-line|layout-grid-char-spacing|layout-grid-char|layout-grid|layout-flow|layer-background-image|layer-background-color|include-source|ime-mode|height|font-weight|font-variant|font-style|font-stretch|font-size-adjust|font-size|font-family|font|float|filter|empty-cells|elevation|display|direction|cursor|cue-before|cue-after|cue|counter-reset|counter-increment|content|color|clip|clear|caption-side|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|behavior|background-repeat|background-position-y|background-position-x|background-position|background-image|background-color|background-attachment|background|azimuth|accelerator)\s*:/
, _style: "color: #330066;"
}
, special: {
_match: /\b(?:-use-link-source|-set-link-source|-replace|-moz-user-select|-moz-user-modify|-moz-user-input|-moz-user-focus|-moz-outline-width|-moz-outline-style|-moz-outline-color|-moz-outline|-moz-opacity|-moz-border-top-colors|-moz-border-right-colors|-moz-border-radius-topright|-moz-border-radius-topleft|-moz-border-radius-bottomright|-moz-border-radius-bottomleft|-moz-border-radius|-moz-border-left-colors|-moz-border-bottom-colors|-moz-binding)\s*:/
, _style: "color: #330066; text-decoration: underline;"
}
, url: {
_match: /\b(url\s*\()([^)]+)(\))/
, _replace: "<span class='url'>$1</span>$2<span class='url'>$3</span>"
}
, value: {
_match: /\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/
, _style: "color: #3366FF;"
}
, string: {
_match: /(?:\'[^\'\\\n]*(?:\\.[^\'\\\n]*)*\')|(?:\"[^\"\\\n]*(?:\\.[^\"\\\n]*)*\")/
, _style: "color: teal;"
}
, number: {
_match: /(?:\b[+-]?(?:\d*\.?\d+|\d+\.?\d*))(?:%|(?:(?:px|pt|em|)\b))/
, _style: "color: red;"
}
, color : {
_match: /(?:\#[a-fA-F0-9]{3,6})|\b(?:yellow|white|teal|silver|red|purple|olive|navy|maroon|lime|green|gray|fuchsia|blue|black|aqua|YellowGreen|Yellow|WhiteSmoke|White|Wheat|Violet|Turquoise|Tomato|Thistle|Teal|Tan|SteelBlue|SpringGreen|Snow|SlateGrey|SlateGray|SlateBlue|SkyBlue|Silver|Sienna|SeaShell|SeaGreen|SandyBrown|Salmon|SaddleBrown|RoyalBlue|RosyBrown|Red|Purple|PowderBlue|Plum|Pink|Peru|PeachPuff|PapayaWhip|PaleVioletRed|PaleTurquoise|PaleGreen|PaleGoldenRod|Orchid|OrangeRed|Orange|OliveDrab|Olive|OldLace|Navy|NavajoWhite|Moccasin|MistyRose|MintCream|MidnightBlue|MediumVioletRed|MediumTurquoise|MediumSpringGreen|MediumSlateBlue|MediumSeaGreen|MediumPurple|MediumOrchid|MediumBlue|MediumAquaMarine|Maroon|Magenta|Linen|LimeGreen|Lime|LightYellow|LightSteelBlue|LightSlateGrey|LightSlateGray|LightSkyBlue|LightSeaGreen|LightSalmon|LightPink|LightGrey|LightGreen|LightGray|LightGoldenRodYellow|LightCyan|LightCoral|LightBlue|LemonChiffon|LawnGreen|LavenderBlush|Lavender|Khaki|Ivory|Indigo|IndianRed|HotPink|HoneyDew|Grey|GreenYellow|Green|Gray|GoldenRod|Gold|GhostWhite|Gainsboro|Fuchsia|ForestGreen|FloralWhite|FireBrick|DodgerBlue|DimGrey|DimGray|DeepSkyBlue|DeepPink|Darkorange|DarkViolet|DarkTurquoise|DarkSlateGrey|DarkSlateGray|DarkSlateBlue|DarkSeaGreen|DarkSalmon|DarkRed|DarkOrchid|DarkOliveGreen|DarkMagenta|DarkKhaki|DarkGrey|DarkGreen|DarkGray|DarkGoldenRod|DarkCyan|DarkBlue|Cyan|Crimson|Cornsilk|CornflowerBlue|Coral|Chocolate|Chartreuse|CadetBlue|BurlyWood|Brown|BlueViolet|Blue|BlanchedAlmond|Black|Bisque|Beige|Azure|Aquamarine|Aqua|AntiqueWhite|AliceBlue)\b/
, _style: "color: green;"
}
}
};

View File

@ -1,7 +1,5 @@
/* Stop IE flicker */ /* Stop IE flicker */
if ($.browser.msie == true) document.execCommand('BackgroundImageCache', false, true); if ($.browser.msie == true) document.execCommand('BackgroundImageCache', false, true);
ChiliBook.recipeFolder = "js/chili/";
ChiliBook.stylesheetFolder = "js/chili/"
jQuery.fn.antispam = function() { jQuery.fn.antispam = function() {
return this.each(function(){ return this.each(function(){
@ -13,10 +11,50 @@ jQuery.fn.antispam = function() {
}); });
}; };
$(function() { $(function(){
$("pre.javascript").chili();
$("pre.html").chili();
$("pre.css").chili();
$("a.external").each(function() {this.target = '_new'}); $("a.external").each(function() {this.target = '_new'});
$("span.email").antispam(); $("span.email").antispam();
// get javascript source
if ($("#js").length) {
$("#javascript pre").text( $("#js").html().replace(/\t/g, " ") );
}
if ($("#css").length) {
$("pre.css").text( $("#css").html().replace(/\t/g, " ") );
}
if ($("#demo").length) {
$("#html pre").text(
$("#demo").html()
.replace(/\t/g, " ")
// .replace(/[<>]/g, function(m){ return {'<':'&lt;','>':'&gt;'}[m]; })
);
}
// hide child rows
$('#root .expand-child').hide();
// toggle child row content, not hiding the row since we are using rowspan
$('#root .toggle').click(function(){
$(this).closest('tr').nextUntil('tr:not(.expand-child)').toggle();
return false;
});
$('.collapsible').hide();
$('.toggle2').click(function(){
$(this).closest('tr').find('.collapsible').slideToggle();
return false;
});
$('.toggleAll, .showAll, .hideAll').click(function(){
var t = $.trim($(this).text());
$(this).parent().next('table').find('.collapsible')[t]();
return false;
});
});
$(window).load(function(){
$(".js").chili();
$(".html").chili();
$(".css").chili();
}); });

View File

@ -1,29 +0,0 @@
$(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

File diff suppressed because it is too large Load Diff

View File

@ -22,8 +22,11 @@
</head> </head>
<body> <body>
<div class="demo"> <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> <h1><a href="https://github.com/Mottie/tablesorter">TableSorter v2.0.7</a></h1>
<p>By Christian Bach; github updates by Rob G<br>
<a href="docs/index.html">Complete docs included</a> (updated with missing docs from <a href="http://wowmotty.blogspot.com/2011/06/jquery-tablesorter-missing-docs.html">this blog post</a>)
</p>
<table class="tablesorter"> <table class="tablesorter">
<thead> <thead>

View File

@ -1,6 +1,6 @@
/* /*
* TableSorter 2.0 - Client-side table sorting with ease! * TableSorter 2.0 - Client-side table sorting with ease!
* Version 2.0.6 * Version 2.0.7
* @requires jQuery v1.2.3 * @requires jQuery v1.2.3
* *
* Copyright (c) 2007 Christian Bach * Copyright (c) 2007 Christian Bach
@ -9,7 +9,7 @@
* http://www.opensource.org/licenses/mit-license.php * http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html * http://www.gnu.org/licenses/gpl.html
* *
* @description Create a sortable table with multi-column sorting capabilitys * @description Create a sortable table with multi-column sorting capabilities
* *
* @example $('table').tablesorter(); * @example $('table').tablesorter();
* @desc Create a simple tablesorter interface. * @desc Create a simple tablesorter interface.
@ -308,7 +308,7 @@
applyWidget(table); applyWidget(table);
// trigger sortend // trigger sortend
setTimeout(function () { setTimeout(function () {
$(table).trigger("sortEnd"); $(table).trigger("sortEnd", table);
}, 0); }, 0);
} }
@ -474,7 +474,7 @@
} }
/* sorting methods - reverted sorting method back to version 2.0.3 */ /* sorting methods - reverted sorting method back to version 2.0.3 */
function multisort(table,sortList,cache){ function multisort(table,sortList,cache) {
var dynamicExp = "var sortWrapper = function(a,b) {", var dynamicExp = "var sortWrapper = function(a,b) {",
l = sortList.length, sortTime, i, c, s, e, order, orgOrderCol; l = sortList.length, sortTime, i, c, s, e, order, orgOrderCol;
if (table.config.debug) { sortTime = new Date(); } if (table.config.debug) { sortTime = new Date(); }
@ -502,7 +502,7 @@
} }
// http://www.webdeveloper.com/forum/showthread.php?t=107909 // http://www.webdeveloper.com/forum/showthread.php?t=107909
function sortText(a, b){ function sortText(a, b) {
if ($.data(tbl[0], "tablesorter").sortLocaleCompare) { return a.localeCompare(b); } if ($.data(tbl[0], "tablesorter").sortLocaleCompare) { return a.localeCompare(b); }
if (a === b) { return 0; } if (a === b) { return 0; }
try { try {
@ -576,7 +576,7 @@
totalRows = ($this[0].tBodies[0] && $this[0].tBodies[0].rows.length) || 0; totalRows = ($this[0].tBodies[0] && $this[0].tBodies[0].rows.length) || 0;
if (!this.sortDisabled && totalRows > 0) { if (!this.sortDisabled && totalRows > 0) {
// Only call sortStart if sorting is enabled. // Only call sortStart if sorting is enabled.
$this.trigger("sortStart"); $this.trigger("sortStart", tbl[0]);
// store exp, for speed // store exp, for speed
$cell = $(this); $cell = $(this);
// get current column index // get current column index
@ -621,6 +621,14 @@
config.sortList.push([i, this.order]); config.sortList.push([i, this.order]);
} }
} }
if (config.sortAppend !== null) {
a = config.sortAppend;
for (j = 0; j < a.length; j++) {
if (a[j][0] !== i) {
config.sortList.push(a[j]);
}
}
}
setTimeout(function () { setTimeout(function () {
// set css for headers // set css for headers
setHeadersCss($this[0], $headers, config.sortList, sortCSS); setHeadersCss($this[0], $headers, config.sortList, sortCSS);
@ -663,7 +671,7 @@
getElementText(config, cell), cell); getElementText(config, cell), cell);
}) })
.bind("sorton", function(e, list) { .bind("sorton", function(e, list) {
$(this).trigger("sortStart"); $(this).trigger("sortStart", tbl[0]);
config.sortList = list; config.sortList = list;
// update and store the sortlist // update and store the sortlist
var sortList = config.sortList; var sortList = config.sortList;
@ -695,7 +703,7 @@
applyWidget(this); applyWidget(this);
}); });
}; };
this.addParser = function(parser) { this.addParser = function(parser) {
var i, l = parsers.length, a = true; var i, l = parsers.length, a = true;
for (i = 0; i < l; i++) { for (i = 0; i < l; i++) {
if (parsers[i].id.toLowerCase() === parser.id.toLowerCase()) { if (parsers[i].id.toLowerCase() === parser.id.toLowerCase()) {
@ -706,22 +714,22 @@
parsers.push(parser); parsers.push(parser);
} }
}; };
this.addWidget = function (widget) { this.addWidget = function (widget) {
widgets.push(widget); widgets.push(widget);
}; };
this.formatFloat = function (s) { this.formatFloat = function (s) {
var i = parseFloat(s); var i = parseFloat(s);
return (isNaN(i)) ? 0 : i; return (isNaN(i)) ? 0 : i;
}; };
this.formatInt = function (s) { this.formatInt = function (s) {
var i = parseInt(s, 10); var i = parseInt(s, 10);
return (isNaN(i)) ? 0 : i; return (isNaN(i)) ? 0 : i;
}; };
this.isDigit = function (s, config) { this.isDigit = function (s, config) {
// replace all an wanted chars and match. // replace all an wanted chars and match.
return (/^[\-+]?\d*$/).test($.trim(s.replace(/[,.']/g, ''))); return (/^[\-+]?\d*$/).test($.trim(s.replace(/[,.']/g, '')));
}; };
this.clearTableBody = function (table) { this.clearTableBody = function (table) {
if ($.browser.msie) { if ($.browser.msie) {
var empty = function() { var empty = function() {
while (this.firstChild) { while (this.firstChild) {
@ -733,7 +741,7 @@
table.tBodies[0].innerHTML = ""; table.tBodies[0].innerHTML = "";
} }
}; };
} }
})(); })();
// extend plugin scope // extend plugin scope

File diff suppressed because one or more lines are too long

View File

@ -1,184 +0,0 @@
(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);