diff --git a/docs/css/jq.css b/docs/css/jq.css index 61bba44a..acc4f384 100644 --- a/docs/css/jq.css +++ b/docs/css/jq.css @@ -18,7 +18,8 @@ table.options .examples{width:60px;} table.compatibility { width: 50%; float: right; font-size: .8em; margin-left: 20px; } table.compatibility th,table.compatibility td { text-align: center; padding: 2px; } pre,#display{overflow-x:auto;padding:15px;border:1px solid #ddd;border-left-width:5px;} -pre,#display,code{background-color:#eee;color:#333;font-size:small;list-style:none;} +pre,#display,code{background-color:#eee;font-size:small;list-style:none;} +pre.prettyprint {padding:5px;} code{padding: 1px 5px;} a code {text-decoration:underline;} pre.normal{background-color:transparent;border:none;border-left-width:0;overflow-x:auto;} @@ -59,8 +60,8 @@ a.deprecated { color: #a00; } span.deprecated { background: #a00; color: #fff; padding: 1px 3px; } .hidden { display: none; } .clear { clear: both; } -.download { color: #050505; text-decoration: none; padding: 3px 10px; border: 1px solid #ddd; background: -moz-linear-gradient( top, #ddd 0%, #bbb 50%, #aaa 50%, #bbb); background: -webkit-gradient( linear, left top, left bottom, from(#ddd), color-stop(0.50, #bbb), color-stop(0.50, #aaa), to(#bbb)); border-radius: 8px; -moz-border-radius: 8px; -webkit-border-radius: 8px; } -.download:hover { background: -moz-linear-gradient( top, #dddddd 0%, #dddddd 50%, #cccccc 50%, #dddddd); background: -webkit-gradient( linear, left top, left bottom, from(#dddddd), color-stop(0.50, #dddddd), color-stop(0.50, #cccccc), to(#dddddd)); } +.download { color: #fff; text-decoration: none; padding: 3px 10px; border: 1px solid #0c7396; background-color: #11aadd; background-image: -webkit-gradient(linear, left top, left bottom, from(#11aadd), to(#0d86ae )); background-image: -webkit-linear-gradient(top, #11aadd, #0d86ae ); background-image: -moz-linear-gradient(top, #11aadd, #0d86ae ); background-image: -o-linear-gradient(top, #11aadd, #0d86ae ); background-image: linear-gradient(to bottom, #11aadd, #0d86ae ); border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; text-shadow: 0 -1px 0 rgba(black, 0.4); box-shadow: 0 1px 5px rgba(black, 0.4); } +.download:hover { background: #0d86ae; } .bootstrap_buttons button { margin: 5px 0 0 0; } #main .ui-accordion-header a { font-size: 14px; margin-left: 24px; } #main .ui-accordion-content { font-size: 14px; } \ No newline at end of file diff --git a/docs/css/prettify.css b/docs/css/prettify.css new file mode 100644 index 00000000..eb11a34a --- /dev/null +++ b/docs/css/prettify.css @@ -0,0 +1,55 @@ +/* Hemisu Light */ +/* Original theme - http://noahfrederick.com/vim-color-scheme-hemisu/ */ +/* Pretty printing styles. Used with prettify.js. */ +/* SPAN elements with the classes below are added by prettyprint. */ +/* plain text */ +.pln { color: #111111; } + +@media screen { + .str { color: #739200; } /* string content */ + .kwd { color: #739200; } /* a keyword */ + .com { color: #888888; } /* a comment */ + .typ { color: #ff0055; } /* a type name */ + .lit { color: #538192; } /* a literal value */ + .pun { color: #111111; } /* punctuation */ + .opn { color: #111111; } /* lisp open bracket */ + .clo { color: #111111; } /* lisp close bracket */ + .tag { color: #111111; } /* a markup tag name */ + .atn { color: #739200; } /* a markup attribute name */ + .atv { color: #ff0055; } /* a markup attribute value */ + .dec { color: #111111; } /* a declaration */ + .var { color: #111111; } /* a variable name */ + .fun { color: #538192; } /* a function name */ +} +/* Use higher contrast and text-weight for printable form. */ +@media print, projection { + .str { color: #060; } + .kwd { color: #006; font-weight: bold; } + .com { color: #600; font-style: italic; } + .typ { color: #404; font-weight: bold; } + .lit { color: #044; } + .pun, .opn, .clo { color: #440; } + .tag { color: #006; font-weight: bold; } + .atn { color: #404; } + .atv { color: #060; } +} +/* Style */ +pre.prettyprint { + font-family: Menlo, Monaco, Consolas, monospace; + font-size: 12px; + line-height: 1.5; + padding: 10px; +} + +/* Specify class=linenums on a pre to get line numbering */ +ol.linenums { margin-top: 0; margin-bottom: 0; } + +/* IE indents via margin-left */ +li.L0, li.L1, li.L2, li.L3, li.L4, li.L5, li.L6, li.L7, li.L8, li.L9 { + /* */ +} + +/* Alternate shading for lines */ +li.L1, li.L3, li.L5, li.L7, li.L9 { + /* */ +} diff --git a/docs/example-add-rows.html b/docs/example-add-rows.html index e88e5801..3eaab6d5 100644 --- a/docs/example-add-rows.html +++ b/docs/example-add-rows.html @@ -9,8 +9,8 @@ - - + + @@ -125,11 +125,11 @@
- NOTE! 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 (Firefox). + NOTE! With the latest version of jQuery, this demo will only work when the ajax page is hosted online.
<table class="tablesorter"> +<table class="tablesorter"> <colgroup> <col width="85" /> <col width="250" /> diff --git a/docs/example-child-rows.html b/docs/example-child-rows.html index 39627b4a..448f374b 100644 --- a/docs/example-child-rows.html +++ b/docs/example-child-rows.html @@ -9,8 +9,8 @@ - - + + @@ -349,11 +349,11 @@Javascript
- +HTML
-<table class="tablesorter"> +<table class="tablesorter"> <colgroup> <col width="85" /> <col width="250" /> diff --git a/docs/example-empty-table.html b/docs/example-empty-table.html index deaaa7f4..39aff5c3 100644 --- a/docs/example-empty-table.html +++ b/docs/example-empty-table.html @@ -9,8 +9,8 @@ - - + + @@ -78,11 +78,11 @@Javascript
- +HTML
- +
diff --git a/docs/example-extending-defaults.html b/docs/example-extending-defaults.html index c3dcbf91..3e39cba7 100644 --- a/docs/example-extending-defaults.html +++ b/docs/example-extending-defaults.html @@ -9,8 +9,8 @@ - - + + @@ -98,11 +98,11 @@Javascript
- +HTML
- +diff --git a/docs/example-header-column-span.html b/docs/example-header-column-span.html index a3692cfb..613ef10e 100644 --- a/docs/example-header-column-span.html +++ b/docs/example-header-column-span.html @@ -9,8 +9,8 @@ - - + + @@ -81,11 +81,11 @@Javascript
- +HTML
- +diff --git a/docs/example-locale-sort.html b/docs/example-locale-sort.html index 864075f9..5da76766 100644 --- a/docs/example-locale-sort.html +++ b/docs/example-locale-sort.html @@ -9,8 +9,8 @@ - - + + @@ -150,11 +150,11 @@Javascript
- +HTML
- +diff --git a/docs/example-meta-headers.html b/docs/example-meta-headers.html index 8c32fc13..31214594 100644 --- a/docs/example-meta-headers.html +++ b/docs/example-meta-headers.html @@ -9,8 +9,8 @@ - - + + @@ -99,11 +99,11 @@Javascript
- +HTML
- +diff --git a/docs/example-meta-parsers.html b/docs/example-meta-parsers.html index eb4e30ab..d4c5baa6 100644 --- a/docs/example-meta-parsers.html +++ b/docs/example-meta-parsers.html @@ -9,8 +9,8 @@ - - + + @@ -92,11 +92,11 @@Javascript
- +HTML
- +diff --git a/docs/example-meta-sort-list.html b/docs/example-meta-sort-list.html index d75035ed..f3ab43e5 100644 --- a/docs/example-meta-sort-list.html +++ b/docs/example-meta-sort-list.html @@ -9,8 +9,8 @@ - - + + @@ -94,11 +94,11 @@Javascript
- +HTML
- +diff --git a/docs/example-method-sortreset.html b/docs/example-method-sortreset.html index 3f9414fa..98c7d17a 100644 --- a/docs/example-method-sortreset.html +++ b/docs/example-method-sortreset.html @@ -9,8 +9,8 @@ - - + + @@ -140,7 +140,7 @@Javascript
- +diff --git a/docs/example-multiple-tbodies.html b/docs/example-multiple-tbodies.html index bc02031a..a855135c 100644 --- a/docs/example-multiple-tbodies.html +++ b/docs/example-multiple-tbodies.html @@ -9,8 +9,8 @@ - - + + @@ -90,11 +90,11 @@Javascript
- +HTML
- +diff --git a/docs/example-option-custom-sort.html b/docs/example-option-custom-sort.html index dfc16530..c46ff179 100644 --- a/docs/example-option-custom-sort.html +++ b/docs/example-option-custom-sort.html @@ -9,8 +9,8 @@ - - + + @@ -138,11 +138,11 @@Javascript
- +HTML
- +diff --git a/docs/example-option-date-format.html b/docs/example-option-date-format.html index ebd914fb..79c013c1 100644 --- a/docs/example-option-date-format.html +++ b/docs/example-option-date-format.html @@ -9,8 +9,8 @@ - - + + @@ -157,11 +157,11 @@Javascript
- +HTML
- +diff --git a/docs/example-option-debug.html b/docs/example-option-debug.html index 62dbcee6..208e1bc4 100644 --- a/docs/example-option-debug.html +++ b/docs/example-option-debug.html @@ -9,8 +9,8 @@ - - + + @@ -100,11 +100,11 @@Javascript
- +HTML
- +diff --git a/docs/example-option-digits.html b/docs/example-option-digits.html index 3b645025..321d52e9 100644 --- a/docs/example-option-digits.html +++ b/docs/example-option-digits.html @@ -9,8 +9,8 @@ - - + + @@ -132,11 +132,11 @@Javascript
- +HTML
- +diff --git a/docs/example-option-render-header.html b/docs/example-option-render-header.html index ef994ae5..e6cd1fb9 100644 --- a/docs/example-option-render-header.html +++ b/docs/example-option-render-header.html @@ -9,8 +9,8 @@ - - + + @@ -114,16 +114,16 @@Javascript
- +CSS
- +HTML
Before-After<thead> +<thead> <tr> <th>First Name</th> <th>Last Name</th> @@ -136,7 +136,7 @@-<thead> +<thead> <tr class="tablesorter-headerRow"> <th class="tablesorter-header"><div class="tablesorter-header-inner roundedCorners header0">First Name <i class="tablesorter-icon"></i></div></th> <th class="tablesorter-header"><div class="tablesorter-header-inner roundedCorners header1">Last Name <i class="tablesorter-icon"></i></div></th> diff --git a/docs/example-option-render-template.html b/docs/example-option-render-template.html index 5b0aeb97..28d451be 100644 --- a/docs/example-option-render-template.html +++ b/docs/example-option-render-template.html @@ -9,8 +9,8 @@ - - + + @@ -106,12 +106,12 @@Javascript
- +HTML
Before-After<thead> +<thead> <tr> <th>First Name</th> <th>Last Name</th> @@ -124,7 +124,7 @@-<thead> +<thead> <tr class="tablesorter-headerRow"> <th class="tablesorter-header"><div class="tablesorter-header-inner"><em>1:</em> <i class="tablesorter-icon"></i>First Name</div></th> <th class="tablesorter-header"><div class="tablesorter-header-inner"><em>2:</em> <i class="tablesorter-icon"></i>Last Name</div></th> diff --git a/docs/example-option-selectorsort.html b/docs/example-option-selectorsort.html index 87430275..b37b7abb 100644 --- a/docs/example-option-selectorsort.html +++ b/docs/example-option-selectorsort.html @@ -9,8 +9,8 @@ - - + + +} - + + @@ -36,9 +36,7 @@ if (!this.headers) { h = this.headers = []; $("thead th",table).each(function() { - h.push( - "" + $(this).text() + " " - ); + h.push( "" + $(this).text() + " " ); }); } @@ -335,7 +333,7 @@Javascript
Add Widget Template
-// addWidget Template +// addWidget Template // ******************* $.tablesorter.addWidget({ id: 'myWidget', @@ -359,7 +357,7 @@ $.tablesorter.addWidget({Repeat Headers Widget Code
- +diff --git a/docs/index.html b/docs/index.html index cbc20527..22963319 100644 --- a/docs/index.html +++ b/docs/index.html @@ -5,12 +5,12 @@jQuery plugin: Tablesorter 2.0 - + - - + + @@ -171,7 +171,7 @@ of your HTML document: -<!-- choose a theme file --> +<!-- choose a theme file --> <link rel="stylesheet" href="/path/to/theme.default.css"> <!-- load jQuery and tablesorter scripts --> <script type="text/javascript" src="/path/to/jquery-latest.js"></script> @@ -183,7 +183,7 @@tablesorter works on standard HTML tables. You must include THEAD and TBODY tags:
-<table id="myTable" class="tablesorter"> +<table id="myTable" class="tablesorter"> <thead> <tr> <th>Last Name</th> @@ -227,7 +227,7 @@Start by telling tablesorter to sort your table when the document is loaded:
-$(function(){ +$(function(){ $("#myTable").tablesorter(); });@@ -237,7 +237,7 @@ tablesorter to sort on the first and second column in ascending order. -$(function(){ +$(function(){ $("#myTable").tablesorter({ sortList: [[0,0], [1,0]] }); });@@ -339,9 +339,10 @@Playgrounds & Other demos
-
@@ -400,7 +401,7 @@- tablesorter basic demo (includes widgets)
-- tablesorter basic demo using jQuery UI theme
-- tablesorter basic demo with pager plugin
+- tablesorter basic demo (includes widgets)
+- tablesorter basic demo using jQuery UI theme
+- tablesorter basic demo with pager plugin
+- tableSorter LESS theme; modify the colors dynamically in this LESS theme demo!
- More demos - added to wiki pages
The CSS style used to style the header when sorting ascending. Default value Changed! v2.5. Example from the blue theme: -@@ -421,7 +422,7 @@.tablesorter-blue .tablesorter-headerAsc { +.tablesorter-blue .tablesorter-headerAsc { background-color: #9fbfdf; background-image: url(black-asc.gif); }This is an entirely new row, but attached to the row above while sorting
cssChildRow Example HTML: -+<table width="100%" border="1"> <thead> <tr> @@ -470,7 +471,7 @@The CSS style used to style the header when sorting descending. Default value Changed! v2.5. Example from the blue theme: -@@ -485,7 +486,7 @@.tablesorter-blue .tablesorter-headerDesc { +.tablesorter-blue .tablesorter-headerDesc { background-color: #8cb3d9; background-image: url(black-desc.gif); }The CSS style used to style the header in its unsorted state. Example from the blue theme: -.tablesorter-blue .tablesorter-header { +.tablesorter-blue .tablesorter-header { background-color: #99bfe6; background-repeat: no-repeat; background-position: center right; @@ -539,7 +540,7 @@
With the addition of multiple tbody sorting in v2.2, you can now insert a non-sorting tbody within the table by adding this class to the tbody. -<tbody class="tablesorter-infoOnly"> +<tbody class="tablesorter-infoOnly"> <tr> <th>The contents of this tbody</th> </tr> @@ -572,7 +573,7 @@
The sorter should be set to "shortDate" and the date format can be set in the "dateFormat" option or set for a specific columns within the "headers" option. See the demo page to see it working. -$(function(){ +$(function(){ $("table").tablesorter({ dateFormat : "mmddyyyy", // default date format @@ -666,7 +667,7 @@
The plugin attempts to detect the type of data that is contained in a column, but if it can't figure it out then it defaults to alphanumeric. You can easily override this by setting the header argument (or column parser). See the full list of default parsers here or write your own. -$(function(){ +$(function(){ $("table").tablesorter({ headers: { @@ -757,14 +758,14 @@
In versions 2.0.6+, all TH text is wrapped in a div with a class name of "tablesorter-inner" by default. In the example below, the header cell (TH) div is given a class name (source). -$(function(){ +$(function(){ $("table").tablesorter({ headerTemplate: '{content}', onRenderHeader: function (){ $(this).find('div').addClass('roundedCorners'); } }); -});and you'll end up with this HTML (only the thead is shown)<thead> +});and you'll end up with this HTML (only the thead is shown)<thead> <tr> <th class="tablesorter-header"><div class="tablesorter-header-inner roundedCorners">Column 1</div></th> <th class="tablesorter-header"><div class="tablesorter-header-inner roundedCorners">Column 2</div></th> @@ -785,7 +786,7 @@
TheonRenderTemplate
function receives a column index and template string parameters. The template string, from theheaderTemplate
option, will already have the{icon}
and{content}
tags replaced; it's just a string of formatted HTML. When done manipulating this string, return it. Here is an example: -$(function(){ +$(function(){ $("table").tablesorter({ headerTemplate: '{icon}{content}', onRenderTemplate: function (index, template){ @@ -794,7 +795,7 @@ }); });Thetemplate
parameter can be manipulated as a string, or if you prefer, turn it into a jQuery object (var $t = $(template)
) to find and replace content as desired. Just make sure you return a string (return $t.html()
)
-From the example function above, you'll end up with something similar to this HTML (only the thead is shown)<thead> +From the example function above, you'll end up with something similar to this HTML (only the thead is shown)<thead> <tr> <th class="tablesorter-header"><div class="tablesorter-header-inner"><em>1:</em> <i class="tablesorter-icon"></i>First Name</div></th> <th class="tablesorter-header"><div class="tablesorter-header-inner"><em>2:</em> <i class="tablesorter-icon"></i>Last Name</div></th> @@ -820,9 +821,9 @@ From the example function above, you'll end up with something similar to this HTsorter: "currency"
Sort by currency value (supports "£$€¤¥¢"). sorter: "ipAddress"
Sort by IP Address. - sorter: "url"
Sort by url. + sorter: "isoDate"
Sort by ISO date (YYYY-MM-DD or YYYY/MM/DD). sorter: "isoDate"
Sort by ISO date (YYYY-MM-DD or YYYY/MM/DD; these formats can be followed by a time). - sorter: "percent"
Sort by percent. + sorter: "usLongDate"
Sort by date (U.S. Standard, e.g. Jan 18, 2001 9:12 AM). sorter: "usLongDate"
Sort by date (U.S. Standard, e.g. Jan 18, 2001 9:12 AM or 18 Jan 2001 9:12 AM (new in v2.7.4)). sorter: "shortDate"
Sort by a shorten date (see dateFormat
).sorter: "time"
Sort by time (23:59 or 12:59 pm). @@ -903,7 +904,7 @@ From the example function above, you'll end up with something similar to this HT sorter: "metadata"
Sort by the sorter value in the metadata - requires the metadata plugin. The value of these sort options is an array of arrays and can include one or more columns. The format is an array of instructions for per-column sorting and direction in the format: SortAppend
is the default sort that is added to the end of the users sort selection (null by default).[[columnIndex, sortDirection], ... ]
wherecolumnIndex
is a zero-based index for your columns left-to-right andsortDirection
is 0 for Ascending and 1 for Descending. A valid argument that sorts ascending first by column 1 and then column 2 looks like:[[0,0],[1,0]]
. -$(function(){ +$(function(){ $("table").tablesorter({ sortForce : [[0,0]], // Always sort first column first sortList : [[1,0], [2,0]], // initial sort columns (2nd and 3rd) @@ -1000,7 +1001,7 @@ From the example function above, you'll end up with something similar to this HTPlease see the example page for instrcutions on how to modify the above equivalency table. If you would like to continuing using the String.localeCompare
method, then set thesortLocaleCompare
option tofalse
and use the newtextSorter
option as follows: -$('table').tablesorter({ +$('table').tablesorter({ textSorter: function(a,b) { return a.localeCompare(b); } @@ -1118,7 +1119,7 @@ From the example function above, you'll end up with something similar to this HT
You can customize the text extraction by writing your own text extraction function "myTextExtraction" which you define like: -var myTextExtraction = function(node, table, cellIndex){ +var myTextExtraction = function(node, table, cellIndex){ // extract data from markup and return it // originally: return node.childNodes[0].childNodes[0].innerHTML; return $(node).find('selector').text(); @@ -1129,7 +1130,7 @@ $(function(){ tablesorter will pass the current table cell object for you to parse and return. Thanks to Josh Nathanson for the examples. Updated to a jQuery example by Rob G (Mottie).Now if the text you are finding in the script above is say a number, then just include the
headers
sorter option to specify how to sort it. Also in this example, we will specify that the special textExtraction code is only needed for the second column ("1" because we are using a zero-based index). All other columns will ignore this textExtraction function.Added
-table
andcellIndex
variables to thetextExtraction
function in version 2.1.2.$(function(){ +$(function(){ $("table").tablesorter({ textExtraction: { 1: function(node, table, cellIndex) { @@ -1154,13 +1155,13 @@ $(function(){
Include a script like naturalSort.js as follows: -$(function(){ +$(function(){ $("table").tablesorter({ textSorter : naturalSort }); });or use the localeCompare sort -$(function(){ +$(function(){ $("table").tablesorter({ textSorter: function(a,b) { return a.localeCompare(b); @@ -1232,7 +1233,7 @@ $(function(){ Previously documented widget optionswidgetZebra
,widgetColumns
andwidgetUitheme
will be retained for backwards compatibility.
Use thewidgetOptions
option as follows, please note that each option is followed by a comma (except the last one): -$(function(){ +$(function(){ $("table").tablesorter({ // initialize a bunch of widgets @@ -1319,7 +1320,7 @@ $(function(){
When the column styling widget is initialized, it automatically applied the default class names of"primary"
for the primary sort,"secondary"
for the next sort,"tertiary"
for the next sort, and so on (add more as needed)... (v2.0.17). Use thewidgetColumns
option to change the css class name as follows: -$(function(){ +$(function(){ $("table").tablesorter({ widgets: ["columns"], // initialize column styling of the table widgetColumns: { css: ["primary", "secondary", "tertiary" ] } @@ -1342,7 +1343,7 @@ $(function(){ Find more jQuery UI class names by hovering over the Framework icons on this page: http://jqueryui.com/themeroller/
Use thewidgetUitheme
option to change the css class name as follows: -$(function(){ +$(function(){ $("table").tablesorter({ widgets: ["uitheme"], // initialize ui theme styling widget of the table widgetUitheme: { @@ -1369,7 +1370,7 @@ $(function(){
When the zebra striping widget is initialized, it automatically applied the default class names of"even"
and"odd"
. Use thewidgetZebra
option to change the css class name as follows: -$(function(){ +$(function(){ $("table").tablesorter({ widgets: ["zebra"], // initialize zebra striping of the table widgetZebra: { css: [ "normal-row", "alt-row" ] } @@ -1445,7 +1446,7 @@ $(function(){
Use the"columns"
option to change the css class name as follows: -$(function(){ +$(function(){ $("table").tablesorter({ widgets: ["columns"], // initialize column styling of the table widgetOptions : { @@ -1466,7 +1467,7 @@ $(function(){
Use the"columns_thead"
option to add the column class names to the thead as follows: -$(function(){ +$(function(){ $("table").tablesorter({ widgets: ["columns"], // initialize column styling of the table widgetOptions : { @@ -1487,7 +1488,7 @@ $(function(){
Use the"columns_tfoot"
option to add the column class names to the tfoot as follows: -$(function(){ +$(function(){ $("table").tablesorter({ widgets: ["columns"], // initialize column styling of the table widgetOptions : { @@ -1509,7 +1510,7 @@ $(function(){
Use thefilter_childRows
option include child row text as follows: -$(function(){ +$(function(){ $("table").tablesorter({ widgets: ["filter"], widgetOptions : { @@ -1530,7 +1531,7 @@ $(function(){
Use thefilter_columnFilters
option as follows: -$(function(){ +$(function(){ $("table").tablesorter({ widgets: ["filter"], widgetOptions : { @@ -1551,7 +1552,7 @@ $(function(){
Use the"tablesorter-filter"
option to change the css class name as follows: -$(function(){ +$(function(){ $("table").tablesorter({ widgets: ["filter"], widgetOptions : { @@ -1576,7 +1577,7 @@ $(function(){
- Make a sorted select dropdown list of all column contents. Repeated content will be combined. -
$(function(){ +$(function(){ $("table").tablesorter({ widgets: ["filter"], widgetOptions: { @@ -1594,7 +1595,7 @@ $(function(){ Make a select dropdown list with custom option settings. Each option must have a corresponding function which returns a boolean value; return true if there is a match, or false with no match.Regex example
-$(function(){ +$(function(){ $("table").tablesorter({ widgets: ["filter"], widgetOptions: { @@ -1619,7 +1620,7 @@ $(function(){ }); });Comparison example
-$(function(){ +$(function(){ $("table").tablesorter({ widgets: ["filter"], widgetOptions: { @@ -1645,7 +1646,7 @@ $(function(){- Make a custom filter for the column. -
$(function(){ +$(function(){ $("table").tablesorter({ widgets: ["filter"], widgetOptions: { @@ -1680,7 +1681,7 @@ $(function(){
Use thefilter_hideFilters
option as follows: -$(function(){ +$(function(){ $("table").tablesorter({ widgets: ["filter"], widgetOptions : { @@ -1701,7 +1702,7 @@ $(function(){@@ -1765,7 +1766,7 @@ $(function(){ To use this option, point to a reset button or link using a jQuery selector. For example, add this button (
Use thefilter_ignorecase
option as follows: -$(function(){ +$(function(){ $("table").tablesorter({ widgets: ["filter"], widgetOptions : { @@ -1724,7 +1725,7 @@ $(function(){ To use it, point to the quick search input by adding the selector string to this option. For example, add this input (<input type="search">
) to the table header, or anywhere else on the page. That input will be used as a quick search filter for all table data when the input is targetted as follows:
Use thefilter_quickSearch
option as follows: -$(function(){ +$(function(){ $("table").tablesorter({ widgets: ["filter"], widgetOptions : { @@ -1745,7 +1746,7 @@ $(function(){ Performing a quick search externally by triggering a search on the table as follows: -$('table').trigger('search', [' AND h']);+$('table').trigger('search', [' AND h']);
<button class="reset">Reset</button>
) to the table header, or anywhere else on the page. That element will be used as a reset for all column and quick search filters (clears all fields): Use thefilter_reset
option as follows: -$(function(){ +$(function(){ $("table").tablesorter({ widgets: ["filter"], widgetOptions : { @@ -1786,7 +1787,7 @@ $(function(){
Use thefilter_searchDelay
option as follows: -$(function(){ +$(function(){ $("table").tablesorter({ widgets: ["filter"], widgetOptions : { @@ -1797,7 +1798,7 @@ $(function(){ If you want to want to initialize the filter without user input, target any one of the filters and trigger a "search". -// target the first filter input +// target the first filter input // this method will begin the search after the searchDelay time $('input.tablesorter-filter:eq(0)').trigger('search'); @@ -1805,7 +1806,7 @@ $('input.tablesorter-filter:eq(0)').trigger('search'); $('input.tablesorter-filter:eq(0)').trigger('search', false);In tablesorter v2.4+, the trigger can be applied directly to the table: -// refresh the widget filter; no delay +// refresh the widget filter; no delay $('table').trigger('search', false);@@ -1820,7 +1821,7 @@ $('table').trigger('search', false);
Use thefilter_serversideFiltering
option as follows: -$(function(){ +$(function(){ $("table").tablesorter({ widgets: ["filter"], widgetOptions : { @@ -1841,7 +1842,7 @@ $('table').trigger('search', false);
Use thefilter_startsWith
option as follows: -$(function(){ +$(function(){ $("table").tablesorter({ widgets: ["filter"], widgetOptions : { @@ -1862,7 +1863,7 @@ $('table').trigger('search', false);
Use thefilter_useParsedData
option as follows: -$(function(){ +$(function(){ $("table").tablesorter({ widgets: ["filter"], widgetOptions : { @@ -1895,7 +1896,7 @@ $('table').trigger('search', false);
Use the"stickyHeaders"
option to change the css class name as follows: -$(function(){ +$(function(){ $("table").tablesorter({ widgets: ["stickyHeaders"], widgetOptions : { @@ -1917,7 +1918,7 @@ $('table').trigger('search', false);
Use the"resizable"
option to change the css class name as follows: -$(function(){ +$(function(){ $("table").tablesorter({ widgets: ["resizable"], widgetOptions : { @@ -1939,7 +1940,7 @@ $('table').trigger('search', false);Instead of the array of icon class names, this option now contains the name of the theme. Currently jQuery UI ("jui") and Bootstrap ("bootstrap") themes are supported. To modify the class names used, extend from the theme
Use the"saveSort"
option to change the css class name as follows: -$(function(){ +$(function(){ $("table").tablesorter({ widgets: ["saveSort"], widgetOptions : { @@ -1962,7 +1963,7 @@ $('table').trigger('search', false);-// Extend the themes to change any of the default class names ** NEW ** +// Extend the themes to change any of the default class names ** NEW ** $.extend($.tablesorter.themes.jui, { // change default jQuery uitheme icons - find the full list of icons // here: http://jqueryui.com/themeroller/ (hover over them for their name) @@ -1988,7 +1989,7 @@ $.extend($.tablesorter.themes.jui, { As before the jQuery UI theme applies the default class names of"ui-icon-arrowthick-2-n-s"
for the unsorted column,"ui-icon-arrowthick-1-s"
for the descending sort and"ui-icon-arrowthick-1-n"
for the ascending sort. (Modified v2.1; Updated in v2.4). Find more jQuery UI class names by hovering over the Framework icons on this page: http://jqueryui.com/themeroller/
Use the"uitheme"
option to change the css class name as follows: -$(function(){ +$(function(){ $("table").tablesorter({ widgets: ["uitheme"], // initialize ui theme styling widget of the table widgetOptions: { @@ -1998,7 +1999,7 @@ $.extend($.tablesorter.themes.jui, { });To add a new theme, define it as follows; replace "custom" with the name of your theme: -$.tablesorter.themes.custom = { +$.tablesorter.themes.custom = { table : 'table', // table classes header : 'header', // header classes icons : 'icon', // icon class added to the <i> in the header @@ -2024,7 +2025,7 @@ $.extend($.tablesorter.themes.jui, {
Use the"zebra"
option to change the theme as follows: -$(function(){ +$(function(){ $("table").tablesorter({ widgets: ["zebra"], // initialize zebra striping of the table widgetOptions: { @@ -2065,7 +2066,7 @@ $.extend($.tablesorter.themes.jui, {It does not work the same as "update" in that it only adds rows, it does not remove them.
Also, use this method to add table rows while using the pager plugin. If the "update" method is used, only the visible table rows continue to exist. -// Add multiple rows to the table +// Add multiple rows to the table var row = '<tr><td>Inigo</td><td>Montoya</td><td>34</td>' + '<td>$19.99</td><td>15%</td><td>Sep 25, 1987 12:00PM</td></tr>', $row = $(row), @@ -2087,7 +2088,7 @@ $.extend($.tablesorter.themes.jui, {sorton Use this method to sort an initialized table in the desired order. -// Choose a new sort order +// Choose a new sort order var sort = [[0,0],[2,0]], callback = function(table){ alert('new sort applied to ' + table.id); @@ -2104,7 +2105,7 @@ $("table").trigger("sorton", [sort, callback]);Use this method to reset the table to it's initial unsorted state. New v2.4.7. Don't confuse this method with thesortReset
option. This method immediately resets the entire table sort, while the option only resets the column sort after a third click. -// Reset the table (make it unsorted) +// Reset the table (make it unsorted) $("table").trigger("sortReset");Example @@ -2114,7 +2115,7 @@ $("table").trigger("sortReset");update Update the stored tablesorter data and the table. -Use this method when more than just one cell like in the "updateCell" method, but you may possibly have to trigger two events: both "update" and "appendCache".// Add new content +// Add new content $("table tbody").append(html); // let the plugin know that we made a update @@ -2144,7 +2145,7 @@ $("table").trigger("sorton", [sorting]);
Note: This is the only method the pager widget uses - the entire table is stored in the cache, but only the visible portion is actually exists in the table. -// Table data was just dynamically changed (more than one cell) +// Table data was just dynamically changed (more than one cell) $("table") .trigger("update") .trigger("appendCache");@@ -2156,7 +2157,7 @@ $("table")updateCell Update a table cell in the tablesorter data. -$(function() { +$(function() { $("table").tablesorter(); $("td.discount").click(function(){ @@ -2192,7 +2193,7 @@ $("table")applyWidgetId Apply the selected widget to the table, but the widget will not continue to be applied after each sort. See the example, it's easier than describing it. -$(function(){ +$(function(){ // initialize tablesorter without the widget $("table").tablesorter(); @@ -2210,7 +2211,7 @@ $("table")applyWidgets Apply the set widgets to the table. This method can be used after a table has been initialized, but it won't work unless you update the configuration settings. See the example, it's easier than describing it. -// Update the list of widgets to apply to the table (add or remove) +// Update the list of widgets to apply to the table (add or remove) // $("table").data("tablesorter").widgets = ["zebra"]; // works the same as $("table")[0].config.widgets = ["zebra"]; @@ -2225,7 +2226,7 @@ $('table').trigger('applyWidgets');destroy Use this method to remove tablesorter from the table. -// Remove tablesorter and all classes +// Remove tablesorter and all classes $("table").trigger("destroy"); // Remove tablesorter and all classes but the "tablesorter" class on the table @@ -2239,7 +2240,7 @@ $("table").trigger("destroy", [false];Refresh the currently applied widgets. Depending on the options, it will completely remove all widgets, then re-initialize the current widgets or just remove all non-current widgets. New v2.4.
Trigger this method using either of the following methods (they are equivalent): -// trigger a refresh widget event +// trigger a refresh widget event $('table').trigger('refreshWidgets', [doAll, dontapply]); // Use the API directly @@ -2265,13 +2266,13 @@ $.tablesorter.refreshWidgets(table, doAll, dontapply)search Trigger the filter widget to update the search from current inputs and/or selections. Updated! v2.4. - This first method sends an array with the search strings to the filter widget.$(function(){ + This first method sends an array with the search strings to the filter widget.$(function(){ // apply "2?%" filter to the fifth column (zero-based index) var columns = []; columns[4] = '2?%'; // or define the array this way [ '', '', '', '', '2?%' ] $('table').trigger('search', [columns]); });-or, directly add the search string to the filter input as follows:$(function(){ +or, directly add the search string to the filter input as follows:$(function(){ // apply "2?%" filter to the fifth column (zero-based index) $('table').find('input.tablesorter-filter').eq(4).val('2?%'); $('table').trigger('search', false); // add a false flag to skip the search delay @@ -2307,7 +2308,7 @@ or, directly add the search string to the filter input as follows:initializedThis event fires when tablesorter has completed initialization. (v2.2). -$(function(){ +$(function(){ // bind to initialized event BEFORE initializing tablesorter $("table") @@ -2332,7 +2333,7 @@ or, directly add the search string to the filter input as follows:sortBeginThis event fires immediately before tablesorter begins resorting the table. -$(function(){ +$(function(){ // initialize the tablesorter plugin $("table").tablesorter(); @@ -2350,7 +2351,7 @@ or, directly add the search string to the filter input as follows:sortStartThis event fires immediately after the tablesorter header has been clicked, initializing a resort. -$(function(){ +$(function(){ // initialize the tablesorter plugin $("table").tablesorter(); @@ -2372,7 +2373,7 @@ or, directly add the search string to the filter input as follows:sortEndThis event fires when tablesorter has completed resorting the table. -$(function(){ +$(function(){ // initialize the tablesorter plugin $("table").tablesorter(); @@ -2395,7 +2396,7 @@ or, directly add the search string to the filter input as follows:This occurs after an "update", "updateCell" or "addRows" method was called, but before any callback functions are executed. -$(function(){ +$(function(){ // initialize the tablesorter plugin $("table").tablesorter(); @@ -2423,7 +2424,7 @@ or, directly add the search string to the filter input as follows:pagerChangeThis event fires when the pager plugin begins to render the table on the currently selected page. (v2.0.7). -$(function(){ +$(function(){ // initialize the sorter $("table") @@ -2449,7 +2450,7 @@ or, directly add the search string to the filter input as follows:pagerCompleteThis event fires when the pager plugin has completed its render of the table on the currently selected page. (v2.0.7). -$(function(){ +$(function(){ // initialize the sorter $("table") @@ -2475,7 +2476,7 @@ or, directly add the search string to the filter input as follows:pagerBeforeInitializedThis event fires after all pager controls have been bound and set up but before the pager formats the table or loads any ajax data. New v2.4.4. -$(function(){ +$(function(){ $("table") @@ -2501,7 +2502,7 @@ or, directly add the search string to the filter input as follows:pagerInitializedThis event fires when the pager plugin has completed initialization. New v2.4.4. -$(function(){ +$(function(){ $("table") @@ -2530,7 +2531,7 @@ or, directly add the search string to the filter input as follows:This event may fire before thepagerComplete
event when ajax processing is involved, or after thepagerComplete
on normal use. See issue #153. -$(function(){ +$(function(){ // initialize the sorter $("table") @@ -2568,7 +2569,7 @@ or, directly add the search string to the filter input as follows:filterInitEvent triggered when the filter widget has finished initializing. New v2.4. - You can use this event to modify the filter elements (row, inputs and/or selects) as desired. Use it as follows:$(function(){ + You can use this event to modify the filter elements (row, inputs and/or selects) as desired. Use it as follows:$(function(){ $('table').bind('filterInit', function(){ $(this).find('tr.tablesorter-filter-row').addClass('fred'); }); @@ -2581,7 +2582,7 @@ or, directly add the search string to the filter input as follows:filterStartEvent triggered when the filter widget has started processing the search. New v2.4. - You can use this event to do something like add a class to the filter row. Use it as follows:$(function(){ + You can use this event to do something like add a class to the filter row. Use it as follows:$(function(){ $('table').bind('filterStart', function(){ $(this).find('tr.tablesorter-filter-row').addClass('filtering'); }); @@ -2594,7 +2595,7 @@ or, directly add the search string to the filter input as follows:filterEndEvent triggered when the filter widget has finished processing the search. New v2.4. - You can use this event to do something like remove the class added to the filter row when the filtering started. Use it as follows:$(function(){ + You can use this event to do something like remove the class added to the filter row when the filtering started. Use it as follows:$(function(){ $('table').bind('filterEnd', function(){ $(this).find('tr.tablesorter-filter-row').removeClass('filtering'); }); diff --git a/docs/js/chili/jquery.chili-2.2.js b/docs/js/chili/jquery.chili-2.2.js deleted file mode 100644 index 0a971bf4..00000000 --- a/docs/js/chili/jquery.chili-2.2.js +++ /dev/null @@ -1,704 +0,0 @@ -/* -=============================================================================== -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 to " ", Safari and Opera do not - , replaceSpace: " " - , replaceTab: " " - , replaceNewLine: "
" - - , 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: '$$' // 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, "&" ).replace( /' + filter( subject ) + ''; - } - return filter( subject ); - } - else { - return filter( subject ); - } - } - } // applyModule - - function addPrefix( prefix, replacement ) { - var aux = replacement.replace( /()/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 = '' : ''; - var aux = ''; - if( not_last_line ) { - aux = '' + open + not_last + close + ' '; - } - else if( last ) { - aux = '' + open + last + close + ' '; - } - 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 = /
/.test(html) ? '
' : '
'; - var empty_line = '' + book.replaceSpace + ' '; - var list_items = html - //extract newlines at the beginning of a span - .replace( /(]+>)((?:(?: |\xA0)
)+)(.*?)(<\/span>)/ig, '$2$1$3$4' ) // I don't know why does not work here - //transform newlines inside of a span - .replace( /(.*?)()(.*?)(?:<\/span>(?: |\xA0)
|<\/span>)/ig, // but here it does - function( all, before, open, content ) { - if (/
/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( /((.*?)(?: |\xA0)
)|(.*)/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>)|((.*?)(?: |\xA0)
)|(.+)/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>/ig, empty_line ) - ; - - el.innerHTML = ' ' + list_items + '
'; - } // 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 ); diff --git a/docs/js/chili/recipes.js b/docs/js/chili/recipes.js deleted file mode 100644 index ce86d433..00000000 --- a/docs/js/chili/recipes.js +++ /dev/null @@ -1,229 +0,0 @@ -/* -=============================================================================== -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 -=============================================================================== -*/ - -ChiliBook.recipeLoading = false; - -ChiliBook.recipes[ "html.js" ] = -{ - _name: 'html' - , _case: false - , _main: { - doctype: { - _match: // - , _style: "color: #CC6600;" - } - , ie_style: { - _match: /()/ - , _replace: function( all, open, content, close ) { - return "" + this.x( open ) + "" - + this.x( content, '//style' ) - + "" + this.x( close ) + ""; - } - , _style: "color: DarkSlateGray; font-weight: bold;" - } - , comment: { - _match: // - , _style: "color: gray;" - } - , script: { - _match: /( - + - + diff --git a/index.html b/index.html index 0775b9c1..dbdf0700 100644 --- a/index.html +++ b/index.html @@ -8,7 +8,7 @@ - +