replaced chili with prettify (syntax highlighting)

This commit is contained in:
Mottie 2013-01-26 09:21:13 -06:00
parent 678baf14b6
commit 610ee0442c
63 changed files with 456 additions and 1411 deletions

View File

@ -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; }

55
docs/css/prettify.css Normal file
View File

@ -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 {
/* */
}

View File

@ -9,8 +9,8 @@
<!-- 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>
<link href="css/prettify.css" rel="stylesheet">
<script src="js/prettify.js"></script>
<script src="js/docs.js"></script>
<!-- Tablesorter: required -->
@ -125,11 +125,11 @@
<h1>Javascript</h1>
<div id="javascript">
<pre class="js"></pre>
<pre class="prettyprint lang-javascript"></pre>
</div>
<h1>HTML</h1>
<div id="html">
<pre class="html"></pre>
<pre class="prettyprint lang-html"></pre>
</div>
<div class="next-up">

View File

@ -5,12 +5,12 @@
<title>jQuery plugin: Tablesorter 2.0 - Appending table data with ajax</title>
<!-- jQuery -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/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>
<link href="css/prettify.css" rel="stylesheet">
<script src="js/prettify.js"></script>
<script src="js/docs.js"></script>
<!-- Tablesorter: required -->
@ -115,16 +115,16 @@
<a href="#" id="ajax-append">Append new table data</a></div>
<p class="tip">
<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 (Firefox).
<em>NOTE!</em> With the latest version of jQuery, this demo will only work when the ajax page is hosted online.
</p>
<h1>Javascript</h1>
<div id="javascript">
<pre class="js"></pre>
<pre class="prettyprint lang-javascript"></pre>
</div>
<h1>HTML</h1>
<div id="html">
<pre class="html"></pre>
<pre class="prettyprint lang-html"></pre>
</div>
<div class="next-up">

View File

@ -9,8 +9,8 @@
<!-- 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>
<link href="css/prettify.css" rel="stylesheet">
<script src="js/prettify.js"></script>
<script src="js/docs.js"></script>
<!-- Tablesorter: required -->
@ -110,11 +110,11 @@
<h1>Javascript</h1>
<div id="javascript">
<pre class="js"></pre>
<pre class="prettyprint lang-javascript"></pre>
</div>
<h1>HTML</h1>
<div id="html">
<pre class="html"></pre>
<pre class="prettyprint lang-html"></pre>
</div>
<div class="next-up">

View File

@ -9,8 +9,8 @@
<!-- 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>
<link href="css/prettify.css" rel="stylesheet">
<script src="js/prettify.js"></script>
<script src="js/docs.js"></script>
<!-- Tablesorter: required -->
@ -354,11 +354,11 @@
<h1>Javascript</h1>
<div id="javascript">
<pre class="js"></pre>
<pre class="prettyprint lang-javascript"></pre>
</div>
<h1>HTML</h1>
<div>
<pre class="html">&lt;table class=&quot;tablesorter&quot;&gt;
<pre class="prettyprint lang-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;

View File

@ -9,8 +9,8 @@
<!-- 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>
<link href="css/prettify.css" rel="stylesheet">
<script src="js/prettify.js"></script>
<script src="js/docs.js"></script>
<!-- Tablesorter: required -->
@ -349,11 +349,11 @@
<h1>Javascript</h1>
<div id="javascript">
<pre class="js"></pre>
<pre class="prettyprint lang-javascript"></pre>
</div>
<h1>HTML</h1>
<div>
<pre class="html">&lt;table class=&quot;tablesorter&quot;&gt;
<pre class="prettyprint lang-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;

View File

@ -9,8 +9,8 @@
<!-- 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>
<link href="css/prettify.css" rel="stylesheet">
<script src="js/prettify.js"></script>
<script src="js/docs.js"></script>
<!-- Tablesorter: required -->
@ -78,11 +78,11 @@
<h1>Javascript</h1>
<div id="javascript">
<pre class="js"></pre>
<pre class="prettyprint lang-javascript"></pre>
</div>
<h1>HTML</h1>
<div id="html">
<pre class="html"></pre>
<pre class="prettyprint lang-html"></pre>
<div class="next-up">
<hr />

View File

@ -9,8 +9,8 @@
<!-- 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>
<link href="css/prettify.css" rel="stylesheet">
<script src="js/prettify.js"></script>
<script src="js/docs.js"></script>
<!-- Tablesorter: required -->
@ -98,11 +98,11 @@
<h1>Javascript</h1>
<div id="javascript">
<pre class="js"></pre>
<pre class="prettyprint lang-javascript"></pre>
</div>
<h1>HTML</h1>
<div id="html">
<pre class="html"></pre>
<pre class="prettyprint lang-html"></pre>
</div>
<div class="next-up">

View File

@ -9,8 +9,8 @@
<!-- 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>
<link href="css/prettify.css" rel="stylesheet">
<script src="js/prettify.js"></script>
<script src="js/docs.js"></script>
<!-- Tablesorter: required -->
@ -81,11 +81,11 @@
<h1>Javascript</h1>
<div id="javascript">
<pre class="js"></pre>
<pre class="prettyprint lang-javascript"></pre>
</div>
<h1>HTML</h1>
<div id="html">
<pre class="html"></pre>
<pre class="prettyprint lang-html"></pre>
</div>
<div class="next-up">

View File

@ -9,8 +9,8 @@
<!-- 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>
<link href="css/prettify.css" rel="stylesheet">
<script src="js/prettify.js"></script>
<script src="js/docs.js"></script>
<!-- Tablesorter: required -->
@ -150,11 +150,11 @@
<h1>Javascript</h1>
<div id="javascript">
<pre class="js"></pre>
<pre class="prettyprint lang-javascript"></pre>
</div>
<h1>HTML</h1>
<div id="html">
<pre class="html"></pre>
<pre class="prettyprint lang-html"></pre>
</div>
<div class="next-up">

View File

@ -9,8 +9,8 @@
<!-- 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>
<link href="css/prettify.css" rel="stylesheet">
<script src="js/prettify.js"></script>
<script src="js/docs.js"></script>
<!-- Tablesorter: required -->
@ -99,11 +99,11 @@
<h1>Javascript</h1>
<div id="javascript">
<pre class="js"></pre>
<pre class="prettyprint lang-javascript"></pre>
</div>
<h1>HTML</h1>
<div id="html">
<pre class="html"></pre>
<pre class="prettyprint lang-html"></pre>
</div>
<div class="next-up">

View File

@ -9,8 +9,8 @@
<!-- 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>
<link href="css/prettify.css" rel="stylesheet">
<script src="js/prettify.js"></script>
<script src="js/docs.js"></script>
<!-- Tablesorter: required -->
@ -92,11 +92,11 @@
<h1>Javascript</h1>
<div id="javascript">
<pre class="js"></pre>
<pre class="prettyprint lang-javascript"></pre>
</div>
<h1>HTML</h1>
<div id="html">
<pre class="html"></pre>
<pre class="prettyprint lang-html"></pre>
</div>
<div class="next-up">

View File

@ -9,8 +9,8 @@
<!-- 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>
<link href="css/prettify.css" rel="stylesheet">
<script src="js/prettify.js"></script>
<script src="js/docs.js"></script>
<!-- Tablesorter: required -->
@ -94,11 +94,11 @@
<h1>Javascript</h1>
<div id="javascript">
<pre class="js"></pre>
<pre class="prettyprint lang-javascript"></pre>
</div>
<h1>HTML</h1>
<div id="html">
<pre class="html"></pre>
<pre class="prettyprint lang-html"></pre>
</div>
<div class="next-up">

View File

@ -9,8 +9,8 @@
<!-- 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>
<link href="css/prettify.css" rel="stylesheet">
<script src="js/prettify.js"></script>
<script src="js/docs.js"></script>
<!-- Tablesorter: required -->
@ -140,7 +140,7 @@
<h1>Javascript</h1>
<div id="javascript">
<pre class="js"></pre>
<pre class="prettyprint lang-javascript"></pre>
</div>
<div class="next-up">

View File

@ -9,8 +9,8 @@
<!-- 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>
<link href="css/prettify.css" rel="stylesheet">
<script src="js/prettify.js"></script>
<script src="js/docs.js"></script>
<!-- Tablesorter: required -->
@ -90,11 +90,11 @@
<h1>Javascript</h1>
<div id="javascript">
<pre class="js"></pre>
<pre class="prettyprint lang-javascript"></pre>
</div>
<h1>HTML</h1>
<div id="html">
<pre class="html"></pre>
<pre class="prettyprint lang-html"></pre>
</div>
<div class="next-up">

View File

@ -9,8 +9,8 @@
<!-- 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>
<link href="css/prettify.css" rel="stylesheet">
<script src="js/prettify.js"></script>
<script src="js/docs.js"></script>
<!-- Tablesorter: required -->
@ -138,11 +138,11 @@
<h1>Javascript</h1>
<div id="javascript">
<pre class="js"></pre>
<pre class="prettyprint lang-javascript"></pre>
</div>
<h1>HTML</h1>
<div id="html">
<pre class="html"></pre>
<pre class="prettyprint lang-html"></pre>
</div>
<div class="next-up">

View File

@ -9,8 +9,8 @@
<!-- 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>
<link href="css/prettify.css" rel="stylesheet">
<script src="js/prettify.js"></script>
<script src="js/docs.js"></script>
<!-- Tablesorter: required -->
@ -157,11 +157,11 @@
<h1>Javascript</h1>
<div id="javascript">
<pre class="js"></pre>
<pre class="prettyprint lang-javascript"></pre>
</div>
<h1>HTML</h1>
<div id="html">
<pre class="html"></pre>
<pre class="prettyprint lang-html"></pre>
</div>
<div class="next-up">

View File

@ -9,8 +9,8 @@
<!-- 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>
<link href="css/prettify.css" rel="stylesheet">
<script src="js/prettify.js"></script>
<script src="js/docs.js"></script>
<!-- Tablesorter: required -->
@ -100,11 +100,11 @@
<h1>Javascript</h1>
<div id="javascript">
<pre class="js"></pre>
<pre class="prettyprint lang-javascript"></pre>
</div>
<h1>HTML</h1>
<div id="html">
<pre class="html"></pre>
<pre class="prettyprint lang-html"></pre>
</div>
<div class="next-up">

View File

@ -9,8 +9,8 @@
<!-- 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>
<link href="css/prettify.css" rel="stylesheet">
<script src="js/prettify.js"></script>
<script src="js/docs.js"></script>
<!-- Tablesorter: required -->
@ -132,11 +132,11 @@
<h1>Javascript</h1>
<div id="javascript">
<pre class="js"></pre>
<pre class="prettyprint lang-javascript"></pre>
</div>
<h1>HTML</h1>
<div id="html">
<pre class="html"></pre>
<pre class="prettyprint lang-html"></pre>
</div>
<div class="next-up">

View File

@ -9,8 +9,8 @@
<!-- 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>
<link href="css/prettify.css" rel="stylesheet">
<script src="js/prettify.js"></script>
<script src="js/docs.js"></script>
<!-- Tablesorter: required -->
@ -114,16 +114,16 @@
<h1>Javascript</h1>
<div id="javascript">
<pre class="js"></pre>
<pre class="prettyprint lang-javascript"></pre>
</div>
<h1>CSS</h1>
<div id="css">
<pre class="css"></pre>
<pre class="prettyprint lang-css"></pre>
</div>
<h1>HTML</h1>
Before
<div>
<pre class="html">&lt;thead&gt;
<pre class="prettyprint lang-html">&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;First Name&lt;/th&gt;
&lt;th&gt;Last Name&lt;/th&gt;
@ -136,7 +136,7 @@
</div>
After
<div>
<pre class="html">&lt;thead&gt;
<pre class="prettyprint lang-html">&lt;thead&gt;
&lt;tr class=&quot;tablesorter-headerRow&quot;&gt;
&lt;th class=&quot;tablesorter-header&quot;&gt;&lt;div class=&quot;tablesorter-header-inner roundedCorners header0&quot;&gt;First Name &lt;i class=&quot;tablesorter-icon&quot;&gt;&lt;/i&gt;&lt;/div&gt;&lt;/th&gt;
&lt;th class=&quot;tablesorter-header&quot;&gt;&lt;div class=&quot;tablesorter-header-inner roundedCorners header1&quot;&gt;Last Name &lt;i class=&quot;tablesorter-icon&quot;&gt;&lt;/i&gt;&lt;/div&gt;&lt;/th&gt;

View File

@ -9,8 +9,8 @@
<!-- 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>
<link href="css/prettify.css" rel="stylesheet">
<script src="js/prettify.js"></script>
<script src="js/docs.js"></script>
<!-- Tablesorter: required -->
@ -106,12 +106,12 @@
<h1>Javascript</h1>
<div id="javascript">
<pre class="js"></pre>
<pre class="prettyprint lang-javascript"></pre>
</div>
<h1>HTML</h1>
Before
<div>
<pre class="html">&lt;thead&gt;
<pre class="prettyprint lang-html">&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;First Name&lt;/th&gt;
&lt;th&gt;Last Name&lt;/th&gt;
@ -124,7 +124,7 @@
</div>
After
<div>
<pre class="html">&lt;thead&gt;
<pre class="prettyprint lang-html">&lt;thead&gt;
&lt;tr class=&quot;tablesorter-headerRow&quot;&gt;
&lt;th class=&quot;tablesorter-header&quot;&gt;&lt;div class=&quot;tablesorter-header-inner&quot;&gt;&lt;em&gt;1:&lt;/em&gt; &lt;i class=&quot;tablesorter-icon&quot;&gt;&lt;/i&gt;First Name&lt;/div&gt;&lt;/th&gt;
&lt;th class=&quot;tablesorter-header&quot;&gt;&lt;div class=&quot;tablesorter-header-inner&quot;&gt;&lt;em&gt;2:&lt;/em&gt; &lt;i class=&quot;tablesorter-icon&quot;&gt;&lt;/i&gt;Last Name&lt;/div&gt;&lt;/th&gt;

View File

@ -9,8 +9,8 @@
<!-- 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>
<link href="css/prettify.css" rel="stylesheet">
<script src="js/prettify.js"></script>
<script src="js/docs.js"></script>
<style>
@ -132,11 +132,11 @@
<h1>Javascript</h1>
<div id="javascript">
<pre class="js"></pre>
<pre class="prettyprint lang-javascript"></pre>
</div>
<h1>HTML</h1>
<div id="html">
<pre class="html"></pre>
<pre class="prettyprint lang-html"></pre>
</div>
<div class="next-up">

View File

@ -9,8 +9,8 @@
<!-- 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>
<link href="css/prettify.css" rel="stylesheet">
<script src="js/prettify.js"></script>
<script src="js/docs.js"></script>
<style>
@ -64,7 +64,7 @@
<h1>Javascript</h1>
<div id="javascript">
<pre class="js"></pre>
<pre class="prettyprint lang-javascript"></pre>
</div>
<h1>Filter Events</h1>

View File

@ -9,8 +9,8 @@
<!-- 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>
<link href="css/prettify.css" rel="stylesheet">
<script src="js/prettify.js"></script>
<script src="js/docs.js"></script>
<!-- Tablesorter: required -->
@ -107,11 +107,11 @@
<h1>Javascript</h1>
<div id="javascript">
<pre class="js"></pre>
<pre class="prettyprint lang-javascript"></pre>
</div>
<h1>HTML</h1>
<div id="html">
<pre class="html"></pre>
<pre class="prettyprint lang-html"></pre>
</div>
<div class="next-up">

View File

@ -9,8 +9,8 @@
<!-- 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>
<link href="css/prettify.css" rel="stylesheet">
<script src="js/prettify.js"></script>
<script src="js/docs.js"></script>
<!-- Tablesorter: required -->
@ -166,11 +166,11 @@ Set <code>emptyTo</code> option: <select>
<h1>Javascript</h1>
<div id="javascript">
<pre class="js"></pre>
<pre class="prettyprint lang-javascript"></pre>
</div>
<h1>HTML</h1>
<div id="html">
<pre class="html"></pre>
<pre class="prettyprint lang-html"></pre>
</div>
<div class="next-up">

View File

@ -9,8 +9,8 @@
<!-- 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>
<link href="css/prettify.css" rel="stylesheet">
<script src="js/prettify.js"></script>
<script src="js/docs.js"></script>
<!-- Tablesorter: required -->
@ -49,7 +49,6 @@
<li>Click to sort any column header to see the forcing of the first column sort.</li>
<li>This option is part of the original plugin</li>
</ul>
</p>
<h1>Demo</h1>
@ -110,11 +109,11 @@
<h1>Javascript</h1>
<div id="javascript">
<pre class="js"></pre>
<pre class="prettyprint lang-javascript"></pre>
</div>
<h1>HTML</h1>
<div id="html">
<pre class="html"></pre>
<pre class="prettyprint lang-html"></pre>
</div>
<div class="next-up">

View File

@ -9,8 +9,8 @@
<!-- 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>
<link href="css/prettify.css" rel="stylesheet">
<script src="js/prettify.js"></script>
<script src="js/docs.js"></script>
<!-- Tablesorter: required -->
@ -100,11 +100,11 @@
<h1>Javascript</h1>
<div id="javascript">
<pre class="js"></pre>
<pre class="prettyprint lang-javascript"></pre>
</div>
<h1>HTML</h1>
<div id="html">
<pre class="html"></pre>
<pre class="prettyprint lang-html"></pre>
</div>
<div class="next-up">

View File

@ -9,8 +9,8 @@
<!-- 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>
<link href="css/prettify.css" rel="stylesheet">
<script src="js/prettify.js"></script>
<script src="js/docs.js"></script>
<!-- Tablesorter: required -->
@ -94,11 +94,11 @@
</table></div>
<h1>Javascript</h1>
<div id="javascript">
<pre class="js"></pre>
<pre class="prettyprint lang-javascript"></pre>
</div>
<h1>HTML</h1>
<div id="html">
<pre class="html"></pre>
<pre class="prettyprint lang-html"></pre>
</div>
<div class="next-up">

View File

@ -9,8 +9,8 @@
<!-- 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>
<link href="css/prettify.css" rel="stylesheet">
<script src="js/prettify.js"></script>
<script src="js/docs.js"></script>
<!-- Tablesorter: required -->
@ -94,11 +94,11 @@
</table></div>
<h1>Javascript</h1>
<div id="javascript">
<pre class="js"></pre>
<pre class="prettyprint lang-javascript"></pre>
</div>
<h1>HTML</h1>
<div id="html">
<pre class="html"></pre>
<pre class="prettyprint lang-html"></pre>
</div>
<div class="next-up">

View File

@ -9,8 +9,8 @@
<!-- 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>
<link href="css/prettify.css" rel="stylesheet">
<script src="js/prettify.js"></script>
<script src="js/docs.js"></script>
<!-- Tablesorter: required -->
@ -117,11 +117,11 @@
</table></div>
<h1>Javascript</h1>
<div id="javascript">
<pre class="js"></pre>
<pre class="prettyprint lang-javascript"></pre>
</div>
<h1>HTML</h1>
<div id="html">
<pre class="html"></pre>
<pre class="prettyprint lang-html"></pre>
</div>
<div class="next-up">

View File

@ -9,8 +9,8 @@
<!-- 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>
<link href="css/prettify.css" rel="stylesheet">
<script src="js/prettify.js"></script>
<script src="js/docs.js"></script>
<!-- Tablesorter: required -->
@ -122,11 +122,11 @@
<h1>Javascript</h1>
<div id="javascript">
<pre class="js"></pre>
<pre class="prettyprint lang-javascript"></pre>
</div>
<h1>HTML</h1>
<div id="html">
<pre class="html"></pre>
<pre class="prettyprint lang-html"></pre>
</div>
<div class="next-up">

View File

@ -9,8 +9,8 @@
<!-- 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>
<link href="css/prettify.css" rel="stylesheet">
<script src="js/prettify.js"></script>
<script src="js/docs.js"></script>
<!-- Tablesorter: required -->
@ -206,11 +206,11 @@
<h1>Javascript</h1>
<div id="javascript">
<pre class="js"></pre>
<pre class="prettyprint lang-javascript"></pre>
</div>
<h1>HTML</h1>
<div id="html">
<pre class="html"></pre>
<pre class="prettyprint lang-html"></pre>
</div>
<div class="next-up">

View File

@ -9,8 +9,8 @@
<!-- 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>
<link href="css/prettify.css" rel="stylesheet">
<script src="js/prettify.js"></script>
<script src="js/docs.js"></script>
<!-- Tablesorter: required -->
@ -113,11 +113,11 @@
<h1>Javascript</h1>
<div id="javascript">
<pre class="js"></pre>
<pre class="prettyprint lang-javascript"></pre>
</div>
<h1>HTML</h1>
<div id="html">
<pre class="html"></pre>
<pre class="prettyprint lang-html"></pre>
</div>
<div class="next-up">

View File

@ -9,8 +9,8 @@
<!-- 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>
<link href="css/prettify.css" rel="stylesheet">
<script src="js/prettify.js"></script>
<script src="js/docs.js"></script>
<!-- Tablesorter: required -->
@ -116,11 +116,11 @@
<h1>Javascript</h1>
<div id="javascript">
<pre class="js"></pre>
<pre class="prettyprint lang-javascript"></pre>
</div>
<h1>HTML</h1>
<div id="html">
<pre class="html"></pre>
<pre class="prettyprint lang-html"></pre>
</div>
<div class="next-up">

View File

@ -9,8 +9,8 @@
<!-- 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>
<link href="css/prettify.css" rel="stylesheet">
<script src="js/prettify.js"></script>
<script src="js/docs.js"></script>
<!-- Tablesorter: required -->
@ -118,11 +118,11 @@
<h1>Javascript</h1>
<div id="javascript">
<pre class="js"></pre>
<pre class="prettyprint lang-javascript"></pre>
</div>
<h1>HTML</h1>
<div id="html">
<pre class="html"></pre>
<pre class="prettyprint lang-html"></pre>
</div>
<div class="next-up">

View File

@ -8,9 +8,9 @@
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8/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>
<link href="css/jq.css" rel="stylesheet">
<link href="css/prettify.css" rel="stylesheet">
<script src="js/prettify.js"></script>
<script src="js/docs.js"></script>
<!-- Tablesorter: required -->
@ -157,7 +157,7 @@
<li>The <code>ajaxUrl</code> and <code>ajaxProcessing</code> function are both required options for this interaction to work properly.</li>
<li>The <code>ajaxUrl</code> contains a replaceable string to sent the requested page (<code>{page}</code>), block size (<code>{size}</code>) or sort order (<code>{sortList:name}</code>).</li>
<li>The <code>ajaxProcessing</code> function must* return the data in the following format <code>[ total, rows, headers ]</code> - <span class="tip"><em>Modified</em></span> in 2.1.3:
<pre class="js"><code>[
<pre class="prettyprint lang-javascript"><code>[
// total # rows contained in the database
100,
// row data: array of arrays; each internal array has the table cell data for that row
@ -232,12 +232,12 @@
<h1>Javascript</h1>
<div id="javascript">
<pre class="js"></pre>
<pre class="prettyprint lang-javascript"></pre>
</div>
<h1>CSS</h1>
<div>
<pre class="css">/* pager wrapper, div */
<pre class="prettyprint lang-css">/* pager wrapper, div */
.pager {
padding: 5px;
}
@ -280,7 +280,7 @@ td.pager {
<h1>HTML</h1>
<div id="html">
<pre class="html">&lt;table class=&quot;tablesorter&quot;&gt;
<pre class="prettyprint lang-html">&lt;table class=&quot;tablesorter&quot;&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;td class=&quot;pager&quot; colspan=&quot;5&quot;&gt;

View File

@ -9,8 +9,8 @@
<!-- 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>
<link href="css/prettify.css" rel="stylesheet">
<script src="js/prettify.js"></script>
<script src="js/docs.js"></script>
<!-- Tablesorter: required -->
@ -58,11 +58,22 @@
// the "update" method doesn't work here because not all rows are
// present in the table when the pager is applied ("removeRows" is false)
// ***********************************************************************
var r, $row, num = 50,
row = '<tr><td>Student{i}</td><td>{m}</td><td>{g}</td><td>{r}</td><td>{r}</td><td>{r}</td><td>{r}</td><td><button class="remove" title="Remove this row">X</button></td></tr>' +
'<tr><td>Student{j}</td><td>{m}</td><td>{g}</td><td>{r}</td><td>{r}</td><td>{r}</td><td>{r}</td><td><button class="remove" title="Remove this row">X</button></td></tr>';
$('button:contains(Add)').click(function(){
// add two rows
var row = '<tr><td>StudentXX</td><td>Mathematics</td><td>male</td><td>33</td><td>39</td><td>54</td><td>73</td><td><button class="remove" title="Remove this row">X</button></td></tr>' +
'<tr><td>StudentYY</td><td>Mathematics</td><td>female</td><td>83</td><td>89</td><td>84</td><td>83</td><td><button class="remove" title="Remove this row">X</button></td></tr>',
$row = $(row);
// add two rows of random data!
r = row.replace(/\{[gijmr]\}/g, function(m){
return {
'{i}' : num + 1,
'{j}' : num + 2,
'{r}' : Math.round(Math.random() * 100),
'{g}' : Math.random() > 0.5 ? 'male' : 'female',
'{m}' : Math.random() > 0.5 ? 'Mathematics' : 'Languages'
}[m];
});
num = num + 2;
$row = $(r);
$('table')
.find('tbody').append($row)
.trigger('addRows', [$row]);
@ -439,7 +450,7 @@
<h1>Javascript</h1>
<div id="javascript">
<pre class="js"></pre>
<pre class="prettyprint lang-javascript"></pre>
</div>
<div class="next-up">

View File

@ -9,8 +9,8 @@
<!-- 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>
<link href="css/prettify.css" rel="stylesheet">
<script src="js/prettify.js"></script>
<script src="js/docs.js"></script>
<!-- Tablesorter: required -->
@ -92,10 +92,10 @@
// bind to pager events
// *********************
.bind('pagerChange pagerComplete pagerInitialized pageMoved', function(e, c){
var msg = '" event triggered, ' + (e.type === 'pagerChange' ? 'going to' : 'now on') +
' page ' + (c.page + 1) + '/' + c.totalPages;
var msg = '"</span> event triggered, ' + (e.type === 'pagerChange' ? 'going to' : 'now on') +
' page <span class="typ">' + (c.page + 1) + '/' + c.totalPages + '</span>';
$('#display')
.append('<li>"' + e.type + msg + '</li>')
.append('<li><span class="str">"' + e.type + msg + '</li>')
.find('li:first').remove();
})
@ -107,11 +107,22 @@
// the "update" method doesn't work here because not all rows are
// present in the table when the pager is applied ("removeRows" is false)
// ***********************************************************************
var r, $row, num = 50,
row = '<tr><td>Student{i}</td><td>{m}</td><td>{g}</td><td>{r}</td><td>{r}</td><td>{r}</td><td>{r}</td><td><button class="remove" title="Remove this row">X</button></td></tr>' +
'<tr><td>Student{j}</td><td>{m}</td><td>{g}</td><td>{r}</td><td>{r}</td><td>{r}</td><td>{r}</td><td><button class="remove" title="Remove this row">X</button></td></tr>';
$('button:contains(Add)').click(function(){
// add two rows
var row = '<tr><td>StudentXX</td><td>Mathematics</td><td>male</td><td>33</td><td>39</td><td>54</td><td>73</td><td><button class="remove" title="Remove this row">X</button></td></tr>' +
'<tr><td>StudentYY</td><td>Mathematics</td><td>female</td><td>83</td><td>89</td><td>84</td><td>83</td><td><button class="remove" title="Remove this row">X</button></td></tr>',
$row = $(row);
// add two rows of random data!
r = row.replace(/\{[gijmr]\}/g, function(m){
return {
'{i}' : num + 1,
'{j}' : num + 2,
'{r}' : Math.round(Math.random() * 100),
'{g}' : Math.random() > 0.5 ? 'male' : 'female',
'{m}' : Math.random() > 0.5 ? 'Mathematics' : 'Languages'
}[m];
});
num = num + 2;
$row = $(r);
$('table')
.find('tbody').append($row)
.trigger('addRows', [$row]);
@ -119,7 +130,6 @@
// Delete a row
// *************
$('table').delegate('button.remove', 'click' ,function(){
var t = $('table');
// disabling the pager will restore all table rows
@ -173,7 +183,7 @@
<em>NOTE!</em> The following are not part of the original plugin:
<ul>
<li>This pager plugin can be applied to the original tablesorter, but there is one exception - setting the <code>removeRows</code> option to false will break the sort.</li>
<li>There have been lots of changes made in version 2.1, please check out the <a href="#change-log">change log</a> below.</li>
<li>There have been lots of changes made in version 2.1, please check out the <a href="https://github.com/Mottie/tablesorter/wiki/Change2">change log</a>.</li>
</ul>
</p>
@ -497,12 +507,12 @@
<h1>Javascript</h1>
<div id="javascript">
<pre class="js"></pre>
<pre class="prettyprint lang-javascript"></pre>
</div>
<h1>CSS</h1>
<div>
<pre class="css">/* pager wrapper, div */
<pre class="prettyprint lang-css">/* pager wrapper, div */
.tablesorter-pager {
padding: 5px;
}
@ -547,7 +557,7 @@ td.tablesorter-pager {
<h1>HTML</h1>
<div id="html">
<pre class="html">&lt;table class=&quot;tablesorter&quot;&gt;
<pre class="prettyprint lang-html">&lt;table class=&quot;tablesorter&quot;&gt;
&lt;!-- view page source to see the entire table --&gt;
&lt;/table&gt;

View File

@ -9,8 +9,8 @@
<!-- 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>
<link href="css/prettify.css" rel="stylesheet">
<script src="js/prettify.js"></script>
<script src="js/docs.js"></script>
<!-- Tablesorter: required -->
@ -126,11 +126,11 @@ $(function(){
<h1>Javascript</h1>
<div id="javascript">
<pre class="js"></pre>
<pre class="prettyprint lang-javascript"></pre>
</div>
<h1>HTML</h1>
<div id="html">
<pre class="html"></pre>
<pre class="prettyprint lang-html"></pre>
</div>
<div class="next-up">

View File

@ -9,8 +9,8 @@
<!-- 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>
<link href="css/prettify.css" rel="stylesheet">
<script src="js/prettify.js"></script>
<script src="js/docs.js"></script>
<!-- Tablesorter: required -->
@ -112,11 +112,11 @@
<h1>Javascript</h1>
<div id="javascript">
<pre class="js"></pre>
<pre class="prettyprint lang-javascript"></pre>
</div>
<h1>HTML</h1>
<div id="html">
<pre class="html"></pre>
<pre class="prettyprint lang-html"></pre>
</div>
<div class="next-up">

View File

@ -9,8 +9,8 @@
<!-- 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>
<link href="css/prettify.css" rel="stylesheet">
<script src="js/prettify.js"></script>
<script src="js/docs.js"></script>
<!-- Tablesorter: required -->
@ -100,11 +100,11 @@
<h1>Javascript</h1>
<div id="javascript">
<pre class="js"></pre>
<pre class="prettyprint lang-javascript"></pre>
</div>
<h1>HTML</h1>
<div id="html">
<pre class="html"></pre>
<pre class="prettyprint lang-html"></pre>
</div>
<div class="next-up">

View File

@ -9,8 +9,8 @@
<!-- 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>
<link href="css/prettify.css" rel="stylesheet">
<script src="js/prettify.js"></script>
<script src="js/docs.js"></script>
<!-- Tablesorter: required -->
@ -22,10 +22,10 @@
$.tablesorter.addParser({
// set a unique id
id: 'grades',
is: function(s) {
// is: function(s) {
// return false so this parser is not auto detected
return false;
},
// return false;
// },
format: function(s, table, cell, cellIndex) {
// format your data for normalization
return s.toLowerCase()
@ -135,11 +135,11 @@ $(function() {
<h1>Javascript</h1>
<div id="javascript">
<pre class="js"></pre>
<pre class="prettyprint lang-javascript"></pre>
</div>
<h1>HTML</h1>
<div id="html">
<pre class="html"></pre>
<pre class="prettyprint lang-html"></pre>
</div>
<div class="next-up">

View File

@ -9,8 +9,8 @@
<!-- 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>
<link href="css/prettify.css" rel="stylesheet">
<script src="js/prettify.js"></script>
<script src="js/docs.js"></script>
<!-- Tablesorter: required -->
@ -100,11 +100,11 @@
<a href="#" id="trigger-link">Sort first and third columns</a></div>
<h1>Javascript</h1>
<div id="javascript">
<pre class="js"></pre>
<pre class="prettyprint lang-javascript"></pre>
</div>
<h1>HTML</h1>
<div id="html">
<pre class="html"></pre>
<pre class="prettyprint lang-html"></pre>
</div>
<div class="next-up">

View File

@ -9,8 +9,8 @@
<!-- 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>
<link href="css/prettify.css" rel="stylesheet">
<script src="js/prettify.js"></script>
<script src="js/docs.js"></script>
<!-- Tablesorter: required -->
@ -53,7 +53,7 @@
<h1>Javascript</h1>
<div id="javascript">
<pre class="js"></pre>
<pre class="prettyprint lang-javascript"></pre>
</div>
<h1>Sort Events</h1>

View File

@ -9,8 +9,8 @@
<!-- 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>
<link href="css/prettify.css" rel="stylesheet">
<script src="js/prettify.js"></script>
<script src="js/docs.js"></script>
<!-- Tablesorter: required -->
@ -119,11 +119,11 @@
<h1>Javascript</h1>
<div id="javascript">
<pre class="js"></pre>
<pre class="prettyprint lang-javascript"></pre>
</div>
<h1>HTML</h1>
<div id="html">
<pre class="html"></pre>
<pre class="prettyprint lang-html"></pre>
</div>
<div class="next-up">

View File

@ -10,8 +10,8 @@
<!-- Demo stuff -->
<link rel="stylesheet" href="css/jq.css">
<link rel="stylesheet" href="css/bootstrap.min.css">
<script src="js/chili/jquery.chili-2.2.js"></script>
<script src="js/chili/recipes.js"></script>
<link href="css/prettify.css" rel="stylesheet">
<script src="js/prettify.js"></script>
<script src="js/docs.js"></script>
<!-- Tablesorter: required for bootstrap -->
@ -265,7 +265,7 @@
<h2>Page Header</h2>
<div>
<pre class="html">&lt;!-- Bootstrap stylesheet --&gt;
<pre class="prettyprint lang-html">&lt;!-- Bootstrap stylesheet --&gt;
&lt;link rel=&quot;stylesheet&quot; href=&quot;/css/bootstrap.min.css&quot;&gt;
&lt;!-- bootstrap widget theme --&gt;
@ -278,7 +278,7 @@
<h2>Javascript</h2>
<div id="javascript">
<pre class="js"></pre>
<pre class="prettyprint lang-javascript"></pre>
</div>
<div class="next-up">

View File

@ -9,8 +9,8 @@
<!-- 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>
<link href="css/prettify.css" rel="stylesheet">
<script src="js/prettify.js"></script>
<script src="js/docs.js"></script>
<!-- Tablesorter: required -->
@ -34,13 +34,16 @@
sortList : [[1,0],[2,0],[3,0]],
// initialize zebra striping and column styling of the table
widgets: ["zebra", "columns"],
// header layout template; {icon} needed for some themes
headerTemplate : '{content}{icon}',
widgetOptions: {
// initialize zebra striping and column styling of the table
widgets : ["zebra", "columns"],
widgetOptions : {
// change the default column class names
// primary is the first column sorted, secondary is the second, etc
columns: [ "primary", "secondary", "tertiary" ],
columns : [ "primary", "secondary", "tertiary" ],
// include thead when adding class names
columns_thead : true,
// include tfoot when adding class names
@ -158,7 +161,7 @@ $(function() {
<h1>Page Header</h1>
<div>
<pre class="html">&lt;!-- blue theme stylesheet with additional css styles added in v2.0.17 --&gt;
<pre class="prettyprint lang-html">&lt;!-- blue theme stylesheet with additional css styles added in v2.0.17 --&gt;
&lt;link rel=&quot;stylesheet&quot; href=&quot;../css/theme.blue.css&quot;&gt;
&lt;!-- tablesorter plugin --&gt;
&lt;script src=&quot;../js/jquery.tablesorter.js&quot;&gt;&lt;/script&gt;
@ -169,12 +172,12 @@ $(function() {
<h1>Javascript</h1>
<div id="javascript">
<pre class="js"></pre>
<pre class="prettyprint lang-javascript"></pre>
</div>
<h1>CSS</h1>
<div>
<pre class="css">/*
<pre class="prettyprint lang-css">/*
This css is part of the blue/style.css theme, shown as an example
To work with the zebra widget, include the .odd and .even color definitions as well
as definitions for the "primary", "secondary" and "tertiary" sorts.
@ -207,7 +210,7 @@ table.tablesorter-blue tr.even td.tertiary {
<h1>HTML</h1>
<div id="html">
<pre class="html"></pre>
<pre class="prettyprint lang-html"></pre>
</div>
<div class="next-up">

View File

@ -4,7 +4,6 @@
<meta charset="utf-8">
<title>jQuery plugin: Tablesorter 2.0 - Custom Filter Widget</title>
<!-- jQuery -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
@ -12,8 +11,8 @@
<link class="ui-theme" rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/cupertino/jquery-ui.css">
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7/jquery-ui.min.js"></script>
<link rel="stylesheet" href="css/jq.css">
<script src="js/chili/jquery.chili-2.2.js"></script>
<script src="js/chili/recipes.js"></script>
<link href="css/prettify.css" rel="stylesheet">
<script src="js/prettify.js"></script>
<script src="js/docs.js"></script>
<!-- Tablesorter: required -->
@ -49,9 +48,6 @@
});
});
</script>
@ -396,12 +392,12 @@
<h1>Javascript</h1>
<div id="javascript">
<pre class="js"></pre>
<pre class="prettyprint lang-javascript"></pre>
</div>
<h1>HTML</h1>
<div id="html">
<pre class="html"></pre>
<pre class="prettyprint lang-html"></pre>
</div>
<div class="next-up">

View File

@ -12,8 +12,8 @@
<link class="ui-theme" rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/cupertino/jquery-ui.css">
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7/jquery-ui.min.js"></script>
<link rel="stylesheet" href="css/jq.css">
<script src="js/chili/jquery.chili-2.2.js"></script>
<script src="js/chili/recipes.js"></script>
<link href="css/prettify.css" rel="stylesheet">
<script src="js/prettify.js"></script>
<script src="js/docs.js"></script>
<!-- Tablesorter: required -->
@ -176,6 +176,7 @@ $(function(){
<li><code>filter_searchDelay : 300</code> - typing delay in milliseconds before starting a search.</li>
<li><code>filter_startsWith : false</code> - if true, filter start from the beginning of the cell contents.</li>
<li><code>filter_useParsedData : false</code> - filter all data using parsed content.</li>
<li><code>filter_serversideFiltering : false</code> - if true, server-side filtering should be performed because client-side filtering will be disabled, but the ui and events will still be used.</li>
</ul>
</div>
@ -191,118 +192,10 @@ $(function(){
<h3><a href="#">Changes</a></h3>
<div class="inner">
<div class="accordion">
<h3><a href="#">v2.4</a></h3>
<div>
<ul>
<li>Added the ability to enter operators into the filter. Added <code>< <= >= > ! =</code>
<ul>
<li>Click any of the following buttons to perform a search in the table below. Click and scroll down!</li>
<li>To find values greater than 10, enter <code>&gt;10</code>.</li>
<li>To find letters less than M, enter <button class="search" data-filter-column="1" data-filter-text="<m">&lt;m</button>, but to find letters greater than M, enter <button class="search" data-filter-column="1" data-filter-text=">=n">&gt;=n</button>, because <button class="search" data-filter-column="1" data-filter-text=">m">&gt;m</button> will include <code>ma</code> because <code>ma &gt; m</code>.</li>
<li>To find people that don't have "son" in their name, enter <button class="search" data-filter-column="2" data-filter-text="!son">!son</button> or to only look for males, enter <code>!female</code>.</li>
<li>Exact matches can be done using quotes, as before, or by using an equal sign <code>=</code>, e.g. find the exact number 10 by using <button class="search" data-filter-column="0" data-filter-text="10=">10=</button>.</li>
<li><strong>Note #1</strong> In currency, percent or other numerical columns with numbers, the operators will ignore these extra symbols when parsing the value. So to find values greater than 30%, ignore the percent sign and use <button class="search" data-filter-column="5" data-filter-text=">30">&gt; 30</button>.</li>
<li><strong>Note #2</strong> when using any of the above operators, the child row content is ignored even if <code>filter_childRows</code> is set to <code>true</code>.</li>
</ul>
</li>
<li>Added "filterStart" and "filterEnd" triggered events on the table. This is used by the updated pager plugin to allow it to work with the filter widget.</li>
<li>Added <code>filter_columnFilters</code> option which when <code>true</code> will add a filter to each column. If <code>false</code>, no filter row is added.</li>
<li>Added <code>filter_reset</code> option which will contain a jQuery selector pointing to a reset element (button or link).</li>
<li>Added <code>filter_useParsedData</code> option
<ul>
<li>When <code>true</code>, ALL filter searches will only use parsed data.</li>
<li>To only use parsed data in specific columns, set this option to <code>false</code> and use any of the following (they all do the same thing), set in order of priority:
<ul>
<li>jQuery data <code>data-filter="parsed"</code>.</li>
<li>metadata <code>class="{ filter: 'parsed'}"</code>. This requires the metadata plugin.</li>
<li>headers option <code>headers : { 0 : { filter : 'parsed' } }</code>.</li>
<li>header class name <code>class="filter-parsed"</code>.</li>
</ul>
</li>
<li>Remember that parsed data most likely doesn't match the actual table cell text, <code>20%</code> becomes <code>20</code> and <code>Jan 1, 2013 12:01 AM</code> becomes <code>1357020060000</code>.</li>
</ul>
</li>
<li>Added a method to apply a filter to the table when <code>filter_columnFilters</code> is <code>false</code> by triggering a search on the table.
<h3>Search by columns</h3>
<pre class="js"><code>// *** applies to both basic & advanced filter widgets ***
// search using an array - the index of the array matches the column index
// [ column0, column1, column2, ..., columnN ]
var columns = []; // undefined array elements are treated as an empty search ''
columns[4] = '2?%'; // is equivalent to defining the array this way [ '', '', '', '2?%' ]
$('table').trigger('search', [columns]);
</code></pre>
</li>
</ul>
</div>
<h3><a href="#">v2.3.6</a></h3>
<div>
<ul>
<li>Include filter input boxes placeholder text by adding <code>data-placeholder</code> to the column header cell; e.g. <code>data-placeholder="First Name"</code>. See the examples in the HTML code block below.</li>
<li>Exact match added. Add a quote (single or double) to the end of the string to find an exact match. In the first column enter <code>Clark"</code> to only find Clark and not Brandon Clark.</li>
<li>Wild cards added:
<ul>
<li><code>?</code> (question mark) finds any single non-space character.<br>In the discount column, adding <code>2?%</code> in the filter will find all percentages between "10%" and "19%". In the last column, <code>J?n</code> will find "Jun" and "Jan".</li>
<li><code>*</code> (asterisk) finds multiple non-space characters.<br>In the first column below Enter <code>B*</code> will find multiple names starting with "B". Now add a space at the end, and "Bruce" will not be included in the results.</li>
</ul>
</li>
<li>Regex method added.
<ul>
<li>Use standard regex within the filter to filter the columns.</li>
<li>For example enter <code>/20[1-9]\d/</code> or <code>/20[^0]\d/</code> in the last column to find all dates greater than 2009.</li>
<li>Another example would be to switch the <code>filter_ignoreCase</code> value to <code>false</code> and then enter <code>/JAN/i</code> to find "Jan" with a case-insenstive regex flag.</li>
</ul>
</li>
<li>Added <code>filter_functions</code> option which allows you to add a custom filter function for a column or to a dropdown list. Please see the <a href="example-widget-filter-custom.html">jQuery filter widget, advanced</a> demo for more details.</li>
</ul>
</div>
<h3><a href="#">v2.3.4</a></h3>
<div>
<ul>
<li>Added <code>widgetOptions.filter_ignoreCase</code> option which makes the search case-insensitive, when <code>true</code>.</li>
<li>Added <code>widgetOptions.filter_searchDelay</code> option which delays the search giving the user time to type in the search string.</li>
</ul>
</div>
<h3><a href="#">v2.3</a></h3>
<div>
The filter widget can be disabled using any of the following methods (they all do the same thing), in order of priority:
<ul>
<li>jQuery data <code>data-filter="false"</code>.</li>
<li>metadata <code>class="{ filter: false }"</code>. This requires the metadata plugin.</li>
<li>headers option <code>headers : { 0 : { filter: false } }</code>.</li>
<li>header class name <code>class="filter-false"</code>.</li>
<li><strike>As of this version, this widget <strong>can no longer be applied to the original plugin</strong>.</strike>. Fixed in v2.3.3.</li>
</ul>
</div>
<h3><a href="#">v2.1</a></h3>
<div>
<ul>
<li>Replaced <code>widgetFilterChildRows</code> option with <code>widgetOptions.filter_childRows</code>.</li>
<li>Added <code>widgetOptions.filter_startsWith</code> option which when <code>true</code>, allows you to search the table from the starting of the table cell text. Use the toggle button to see the difference, and that it can be dynamically changed!.</li>
<li>Added <code>widgetOptions.filter_cssFilter</code> option which allows you to defined the css class applied to the filter row and each search input.</li>
<li>Additional filter widget specific options are included in the javascript below, with explanations.</li>
<li>Please note that using the pager plugin with this filter widget will have <em>unexpected results</em> - I haven't found a fix for this problem.</li>
</ul>
</div>
<h3><a href="#">v2.0.19.1</a></h3>
<div>
<ul>
<li>A filter header option and header class name check was added to allow disabling the filter in a specific column.</li>
</ul>
</div>
</div>
<p>Moved to the wiki pages - <a href="https://github.com/Mottie/tablesorter/wiki/Change3">filter change log</a>.
</div>
</div>
<h1>Demo</h1>
<button class="toggle fsw">Toggle</button> filter_startsWith : <span id="start">false</span> (if true, search from beginning of cell content only)<br>
<button class="toggle fic">Toggle</button> filter_ignoreCase : <span id="case">true</span> (if false, the search will be case sensitive)
@ -447,7 +340,7 @@ $('table').trigger('search', [columns]);
<h1>Page Header</h1>
<div>
<pre class="html">&lt;!-- blue theme stylesheet --&gt;
<pre class="prettyprint lang-html">&lt;!-- blue theme stylesheet --&gt;
&lt;link rel=&quot;stylesheet&quot; href=&quot;../css/theme.blue.css&quot;&gt;
&lt;!-- tablesorter plugin --&gt;
&lt;script src=&quot;../js/jquery.tablesorter.js&quot;&gt;&lt;/script&gt;
@ -458,12 +351,12 @@ $('table').trigger('search', [columns]);
<h1>Javascript</h1>
<div id="javascript">
<pre class="js"></pre>
<pre class="prettyprint lang-javascript"></pre>
</div>
<h1>CSS</h1>
<div>
<pre class="css">/* filter row */
<pre class="prettyprint lang-css">/* filter row */
.tablesorter-filter-row td {
background: #eee;
line-height: normal;
@ -523,7 +416,7 @@ $('table').trigger('search', [columns]);
<h1>HTML</h1>
<div id="html">
<pre class="html"></pre>
<pre class="prettyprint lang-html"></pre>
</div>
<div class="next-up">

View File

@ -9,8 +9,8 @@
<!-- 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>
<link href="css/prettify.css" rel="stylesheet">
<script src="js/prettify.js"></script>
<script src="js/docs.js"></script>
<!-- Tablesorter: required -->
@ -113,7 +113,7 @@
<h1>Page Header</h1>
<div>
<pre class="html">&lt;!-- blue theme stylesheet with additional css styles added in v2.0.17 --&gt;
<pre class="prettyprint lang-html">&lt;!-- blue theme stylesheet with additional css styles added in v2.0.17 --&gt;
&lt;link rel=&quot;stylesheet&quot; href=&quot;../css/theme.blue.css&quot;&gt;
&lt;!-- tablesorter plugin --&gt;
&lt;script src=&quot;../js/jquery.tablesorter.js&quot;&gt;&lt;/script&gt;
@ -124,12 +124,12 @@
<h1>Javascript</h1>
<div id="javascript">
<pre class="js"></pre>
<pre class="prettyprint lang-javascript"></pre>
</div>
<h1>HTML</h1>
<div id="html">
<pre class="html"></pre>
<pre class="prettyprint lang-html"></pre>
</div>
<div class="next-up">

View File

@ -9,8 +9,8 @@
<!-- 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>
<link href="css/prettify.css" rel="stylesheet">
<script src="js/prettify.js"></script>
<script src="js/docs.js"></script>
<!-- Tablesorter: required -->
@ -158,7 +158,7 @@
<h1>Page Header</h1>
<div>
<pre class="html">
<pre class="prettyprint lang-html">
&lt;link rel="stylesheet" href="css/blue/style.css"&gt;
&lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js"&gt;&lt;/script&gt;
&lt;script src="js/jquery.tablesorter.min.js"&gt;&lt;/script&gt;
@ -166,11 +166,11 @@
</div>
<h1>Javascript</h1>
<div id="javascript">
<pre class="js"></pre>
<pre class="prettyprint lang-javascript"></pre>
</div>
<h1>HTML</h1>
<div id="html">
<pre class="html"></pre>
<pre class="prettyprint lang-html"></pre>
</div>
<div class="next-up">

View File

@ -9,8 +9,8 @@
<!-- 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>
<link href="css/prettify.css" rel="stylesheet">
<script src="js/prettify.js"></script>
<script src="js/docs.js"></script>
<!-- Tablesorter: theme -->
@ -116,7 +116,7 @@ $(function() {
<h1>Javascript</h1>
<div id="javascript">
<pre class="js"></pre>
<pre class="prettyprint lang-javascript"></pre>
</div>
<h1>Demo</h1>

View File

@ -9,8 +9,8 @@
<!-- 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>
<link href="css/prettify.css" rel="stylesheet">
<script src="js/prettify.js"></script>
<script src="js/docs.js"></script>
<!-- Tablesorter: required; also include any of the jQuery UI themes -->
@ -167,7 +167,7 @@
<h1>Page Header</h1>
<div>
<pre class="html">&lt;!-- ui theme stylesheet - contents shown below --&gt;
<pre class="prettyprint lang-html">&lt;!-- ui theme stylesheet - contents shown below --&gt;
&lt;link rel=&quot;stylesheet&quot; href=&quot;../css/theme.jui.css&quot;&gt;
&lt;!-- jQuery UI theme (cupertino example here) --&gt;
&lt;link rel=&quot;stylesheet&quot; href=&quot;http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/cupertino/jquery-ui.css&quot;&gt;
@ -180,12 +180,12 @@
<h1>Javascript</h1>
<div id="javascript">
<pre class="js"></pre>
<pre class="prettyprint lang-javascript"></pre>
</div>
<h1>HTML</h1>
<div id="html">
<pre class="html"></pre>
<pre class="prettyprint lang-html"></pre>
</div>
<div class="next-up">

View File

@ -9,8 +9,8 @@
<!-- 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>
<link href="css/prettify.css" rel="stylesheet">
<script src="js/prettify.js"></script>
<script src="js/docs.js"></script>
<!-- Tablesorter: required -->
@ -28,8 +28,7 @@ table.tablesorter tbody tr.normal-row td {
table.tablesorter tbody tr.alt-row td {
background: #555;
color: #fff;
}
</style>
}</style>
<script id="js">$(function() {
@ -124,15 +123,15 @@ table.tablesorter tbody tr.alt-row td {
<h1>Javascript</h1>
<div id="javascript">
<pre class="js"></pre>
<pre class="prettyprint lang-javascript"></pre>
</div>
<h1>CSS</h1>
<div id="css">
<pre class="css"></pre>
<pre class="prettyprint lang-css"></pre>
</div>
<h1>HTML</h1>
<div id="html">
<pre class="html"></pre>
<pre class="prettyprint lang-html"></pre>
</div>
<div class="next-up">

View File

@ -9,8 +9,8 @@
<!-- 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>
<link href="css/prettify.css" rel="stylesheet">
<script src="js/prettify.js"></script>
<script src="js/docs.js"></script>
<!-- Tablesorter: required -->
@ -36,9 +36,7 @@
if (!this.headers) {
h = this.headers = [];
$("thead th",table).each(function() {
h.push(
"<th>" + $(this).text() + "</th>"
);
h.push( "<th>" + $(this).text() + "</th>" );
});
}
@ -335,7 +333,7 @@
<h1>Javascript</h1>
<h3>Add Widget Template</h3>
<div>
<pre class="js">// addWidget Template
<pre class="prettyprint lang-javascript">// addWidget Template
// *******************
$.tablesorter.addWidget({
id: 'myWidget',
@ -359,7 +357,7 @@ $.tablesorter.addWidget({
<h3>Repeat Headers Widget Code</h3>
<div id="javascript">
<pre class="js"></pre>
<pre class="prettyprint lang-javascript"></pre>
</div>
<div class="next-up">

View File

@ -5,12 +5,12 @@
<title>jQuery plugin: Tablesorter 2.0</title>
<!-- jQuery -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.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>
<link href="css/prettify.css" rel="stylesheet">
<script src="js/prettify.js"></script>
<script src="js/docs.js"></script>
<!-- Tablesorter: required -->
@ -171,7 +171,7 @@
of your HTML document:
</p>
<pre class="html">&lt;!-- choose a theme file --&gt;
<pre class="prettyprint lang-html">&lt;!-- choose a theme file --&gt;
&lt;link rel=&quot;stylesheet&quot; href=&quot;/path/to/theme.default.css&quot;&gt;
&lt;!-- load jQuery and tablesorter scripts --&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;/path/to/jquery-latest.js&quot;&gt;&lt;/script&gt;
@ -183,7 +183,7 @@
<p>tablesorter works on standard HTML tables. You must include THEAD and TBODY tags:</p>
<pre class="html">&lt;table id="myTable" class="tablesorter"&gt;
<pre class="prettyprint lang-html">&lt;table id="myTable" class="tablesorter"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Last Name&lt;/th&gt;
@ -227,7 +227,7 @@
<p>Start by telling tablesorter to sort your table when the document is loaded:</p>
<pre class="js">$(function(){
<pre class="prettyprint lang-javascript">$(function(){
$("#myTable").tablesorter();
});</pre>
@ -237,7 +237,7 @@
tablesorter to sort on the first and second column in ascending order.
</p>
<pre class="js">$(function(){
<pre class="prettyprint lang-javascript">$(function(){
$("#myTable").tablesorter({ sortList: [[0,0], [1,0]] });
});</pre>
@ -339,9 +339,10 @@
<h4>Playgrounds & Other demos</h4>
<ul>
<li><a href="http://jsfiddle.net/Mottie/vCTHw/10/">tablesorter basic demo</a> (includes widgets)</li>
<li><a href="http://jsfiddle.net/Mottie/vCTHw/11/">tablesorter basic demo using jQuery UI theme</a></li>
<li><a href="http://jsfiddle.net/Mottie/aEL9t/7/">tablesorter basic demo with pager plugin</a></li>
<li><a href="http://jsfiddle.net/Mottie/4mVfu/">tablesorter basic demo</a> (includes widgets)</li>
<li><a href="http://jsfiddle.net/Mottie/abkNM/325/">tablesorter basic demo using jQuery UI theme</a></li>
<li><a href="http://jsfiddle.net/Mottie/4mVfu/1/">tablesorter basic demo with pager plugin</a></li>
<li><a href="http://codepen.io/Mottie/pen/eqBbn">tableSorter LESS theme; modify the colors dynamically in this LESS theme demo!</a></li>
<li><a href="https://github.com/Mottie/tablesorter/wiki">More demos - added to wiki pages</a></li>
</ul>
@ -400,7 +401,7 @@
<td>The CSS style used to style the header when sorting ascending. Default value <span class="tip"><em>Changed!</em></span> v2.5.
<div class="collapsible">
Example from the blue theme:
<pre class="css">.tablesorter-blue .tablesorter-headerAsc {
<pre class="prettyprint lang-css">.tablesorter-blue .tablesorter-headerAsc {
background-color: #9fbfdf;
background-image: url(black-asc.gif);
}</pre></div>
@ -421,7 +422,7 @@
<td></td>
<td>This is an entirely new row, but attached to the row above while sorting<br>
cssChildRow Example HTML:
<pre class="html">
<pre class="prettyprint lang-html">
&lt;table width=&quot;100%&quot; border=&quot;1&quot;&gt;
&lt;thead&gt;
&lt;tr&gt;
@ -470,7 +471,7 @@
<td>The CSS style used to style the header when sorting descending. Default value <span class="tip"><em>Changed!</em></span> v2.5.
<div class="collapsible">
Example from the blue theme:
<pre class="css">.tablesorter-blue .tablesorter-headerDesc {
<pre class="prettyprint lang-css">.tablesorter-blue .tablesorter-headerDesc {
background-color: #8cb3d9;
background-image: url(black-desc.gif);
}</pre></div>
@ -485,7 +486,7 @@
<td>The CSS style used to style the header in its unsorted state.
<div class="collapsible">
Example from the blue theme:
<pre class="css">.tablesorter-blue .tablesorter-header {
<pre class="prettyprint lang-css">.tablesorter-blue .tablesorter-header {
background-color: #99bfe6;
background-repeat: no-repeat;
background-position: center right;
@ -539,7 +540,7 @@
<div class="collapsible">
<br>
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.
<pre class="html">&lt;tbody class=&quot;tablesorter-infoOnly&quot;&gt;
<pre class="prettyprint lang-html">&lt;tbody class=&quot;tablesorter-infoOnly&quot;&gt;
&lt;tr&gt;
&lt;th&gt;The contents of this tbody&lt;/th&gt;
&lt;/tr&gt;
@ -572,7 +573,7 @@
<br>
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 <a href="example-option-date-format.html">the demo page</a> to see it working.
<pre class="js">$(function(){
<pre class="prettyprint lang-javascript">$(function(){
$("table").tablesorter({
dateFormat : "mmddyyyy", // default date format
@ -666,7 +667,7 @@
<br>
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 <a href="#parsers">default parsers</a> here or <a href="example-parsers.html">write your own</a>.
<pre class="js">$(function(){
<pre class="prettyprint lang-javascript">$(function(){
$("table").tablesorter({
headers: {
@ -757,14 +758,14 @@
<div class="collapsible">
<br>
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 (<a href="http://www.pengoworks.com/workshop/jquery/tablesorter/tablesorter.htm">source</a>).
<pre class="js">$(function(){
<pre class="prettyprint lang-javascript">$(function(){
$("table").tablesorter({
headerTemplate: '{content}',
onRenderHeader: function (){
$(this).find('div').addClass('roundedCorners');
}
});
});</pre>and you'll end up with this HTML (only the thead is shown)<pre class="html">&lt;thead&gt;
});</pre>and you'll end up with this HTML (only the thead is shown)<pre class="prettyprint lang-html">&lt;thead&gt;
&lt;tr&gt;
&lt;th class=&quot;tablesorter-header&quot;&gt;&lt;div class=&quot;tablesorter-header-inner roundedCorners&quot;&gt;Column 1&lt;/div&gt;&lt;/th&gt;
&lt;th class=&quot;tablesorter-header&quot;&gt;&lt;div class=&quot;tablesorter-header-inner roundedCorners&quot;&gt;Column 2&lt;/div&gt;&lt;/th&gt;
@ -785,7 +786,7 @@
<div class="collapsible">
<br>
The <code>onRenderTemplate</code> function receives a column index and template string parameters. The template string, from the <a href="#headertemplate"><code>headerTemplate</code> option</a>, will already have the <code>{icon}</code> and <code>{content}</code> tags replaced; it's just a string of formatted HTML. When done manipulating this string, return it. Here is an example:
<pre class="js">$(function(){
<pre class="prettyprint lang-javascript">$(function(){
$("table").tablesorter({
headerTemplate: '{icon}{content}',
onRenderTemplate: function (index, template){
@ -794,7 +795,7 @@
});
});</pre>The <code>template</code> parameter can be manipulated as a string, or if you prefer, turn it into a jQuery object (<code>var $t = $(template)</code>) to find and replace content as desired. Just make sure you return a string (<code>return $t.html()</code>)<br>
<br>
From the example function above, you'll end up with something similar to this HTML (only the thead is shown)<pre class="html">&lt;thead&gt;
From the example function above, you'll end up with something similar to this HTML (only the thead is shown)<pre class="prettyprint lang-html">&lt;thead&gt;
&lt;tr&gt;
&lt;th class=&quot;tablesorter-header&quot;&gt;&lt;div class=&quot;tablesorter-header-inner&quot;&gt;&lt;em&gt;1:&lt;/em&gt; &lt;i class=&quot;tablesorter-icon&quot;&gt;&lt;/i&gt;First Name&lt;/div&gt;&lt;/th&gt;
&lt;th class=&quot;tablesorter-header&quot;&gt;&lt;div class=&quot;tablesorter-header-inner&quot;&gt;&lt;em&gt;2:&lt;/em&gt; &lt;i class=&quot;tablesorter-icon&quot;&gt;&lt;/i&gt;Last Name&lt;/div&gt;&lt;/th&gt;
@ -820,9 +821,9 @@ From the example function above, you'll end up with something similar to this HT
<tr><th><code>sorter: "currency"</code></th><td>Sort by currency value (supports "&#163;$&#8364;&#x00a4;&#x00a5;&#x00a2;").</td></tr>
<tr><th><code>sorter: "ipAddress"</code></th><td>Sort by IP Address.</td></tr>
<tr><th><code>sorter: "url"</code></th><td>Sort by url.</td></tr>
<tr><th><code>sorter: "isoDate"</code></th><td>Sort by ISO date (YYYY-MM-DD or YYYY/MM/DD).</td></tr>
<tr><th><code>sorter: "isoDate"</code></th><td>Sort by ISO date (YYYY-MM-DD or YYYY/MM/DD; these formats can be followed by a time).</td></tr>
<tr><th><code>sorter: "percent"</code></th><td>Sort by percent.</td></tr>
<tr><th><code>sorter: "usLongDate"</code></th><td>Sort by date (U.S. Standard, e.g. Jan 18, 2001 9:12 AM).</td></tr>
<tr><th><code>sorter: "usLongDate"</code></th><td>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)).</td></tr>
<tr><th><code>sorter: "shortDate"</code></th><td>Sort by a shorten date (see <a href="#dateformat"><code>dateFormat</code></a>).</td></tr>
<tr><th><code>sorter: "time"</code></th><td>Sort by time (23:59 or 12:59 pm).</td></tr>
<tr><th><code>sorter: "metadata"</code></th><td>Sort by the sorter value in the metadata - requires the metadata plugin.</td></tr>
@ -903,7 +904,7 @@ From the example function above, you'll end up with something similar to this HT
<li><a href="#sortappend"><code>SortAppend</code></a> is the default sort that is added to the end of the users sort selection (null by default).</li>
</ol>
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: <code>[[columnIndex, sortDirection], ... ]</code> where <code>columnIndex</code> is a zero-based index for your columns left-to-right and <code>sortDirection</code> is 0 for Ascending and 1 for Descending. A valid argument that sorts ascending first by column 1 and then column 2 looks like: <code>[[0,0],[1,0]]</code>.
<pre class="js">$(function(){
<pre class="prettyprint lang-javascript">$(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 HT
</li>
<li>Please see the example page for instrcutions on how to modify the above equivalency table.</li>
<li>If you would like to continuing using the <code>String.localeCompare</code> method, then set the <code>sortLocaleCompare</code> option to <code>false</code> and use the new <a href="#textsorter"><code>textSorter</code></a> option as follows:
<pre class="js">$('table').tablesorter({
<pre class="prettyprint lang-javascript">$('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
<div class="collapsible">
<br>
You can customize the text extraction by writing your own text extraction function "myTextExtraction" which you define like:
<pre class="js">var myTextExtraction = function(node, table, cellIndex){
<pre class="prettyprint lang-javascript">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).
<p>Now if the text you are finding in the script above is say a number, then just include the <a href="#headers"><code>headers</code></a> 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.</p>
<p>Added <code>table</code> and <code>cellIndex</code> variables to the <code>textExtraction</code> function in version 2.1.2.</p>
<pre class="js">$(function(){
<pre class="prettyprint lang-javascript">$(function(){
$("table").tablesorter({
textExtraction: {
1: function(node, table, cellIndex) {
@ -1154,13 +1155,13 @@ $(function(){
<div class="collapsible">
<br>
Include a script like <a href="https://github.com/overset/javascript-natural-sort">naturalSort.js</a> as follows:
<pre class="js">$(function(){
<pre class="prettyprint lang-javascript">$(function(){
$("table").tablesorter({
textSorter : naturalSort
});
});</pre>
or use the localeCompare sort
<pre class="js">$(function(){
<pre class="prettyprint lang-javascript">$(function(){
$("table").tablesorter({
textSorter: function(a,b) {
return a.localeCompare(b);
@ -1232,7 +1233,7 @@ $(function(){
Previously documented widget options <a href="#widgetzebra"><code>widgetZebra</code></a>, <a href="#widgetcolumns"><code>widgetColumns</code></a> and <a href="#widgetuitheme"><code>widgetUitheme</code></a> will be retained for backwards compatibility.<br>
<br>
Use the <a href="#widgetoptions"><code>widgetOptions</code></a> option as follows, please note that each option is followed by a comma (except the last one):
<pre class="js">$(function(){
<pre class="prettyprint lang-javascript">$(function(){
$("table").tablesorter({
// initialize a bunch of widgets
@ -1319,7 +1320,7 @@ $(function(){
<br>
When the column styling widget is initialized, it automatically applied the default class names of <code>"primary"</code> for the primary sort, <code>"secondary"</code> for the next sort, <code>"tertiary"</code> for the next sort, and so on (add more as needed)... (v2.0.17).
Use the <a href="#widgetcolumns"><code>widgetColumns</code></a> option to change the css class name as follows:
<pre class="js">$(function(){
<pre class="prettyprint lang-javascript">$(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: <a class="external" href="http://jqueryui.com/themeroller/">http://jqueryui.com/themeroller/</a><br>
<br>
Use the <a href="#widgetuitheme"><code>widgetUitheme</code></a> option to change the css class name as follows:
<pre class="js">$(function(){
<pre class="prettyprint lang-javascript">$(function(){
$("table").tablesorter({
widgets: ["uitheme"], // initialize ui theme styling widget of the table
widgetUitheme: {
@ -1369,7 +1370,7 @@ $(function(){
<br>
When the zebra striping widget is initialized, it automatically applied the default class names of <code>"even"</code> and <code>"odd"</code>.
Use the <a href="#widgetzebra"><code>widgetZebra</code></a> option to change the css class name as follows:
<pre class="js">$(function(){
<pre class="prettyprint lang-javascript">$(function(){
$("table").tablesorter({
widgets: ["zebra"], // initialize zebra striping of the table
widgetZebra: { css: [ "normal-row", "alt-row" ] }
@ -1445,7 +1446,7 @@ $(function(){
<div class="collapsible">
<br>
Use the <a href="#widget-columns"><code>"columns"</code></a> option to change the css class name as follows:
<pre class="js">$(function(){
<pre class="prettyprint lang-javascript">$(function(){
$("table").tablesorter({
widgets: ["columns"], // initialize column styling of the table
widgetOptions : {
@ -1466,7 +1467,7 @@ $(function(){
<div class="collapsible">
<br>
Use the <a href="#widget-columns-thead"><code>"columns_thead"</code></a> option to add the column class names to the thead as follows:
<pre class="js">$(function(){
<pre class="prettyprint lang-javascript">$(function(){
$("table").tablesorter({
widgets: ["columns"], // initialize column styling of the table
widgetOptions : {
@ -1487,7 +1488,7 @@ $(function(){
<div class="collapsible">
<br>
Use the <a href="#widget-columns-tfoot"><code>"columns_tfoot"</code></a> option to add the column class names to the tfoot as follows:
<pre class="js">$(function(){
<pre class="prettyprint lang-javascript">$(function(){
$("table").tablesorter({
widgets: ["columns"], // initialize column styling of the table
widgetOptions : {
@ -1509,7 +1510,7 @@ $(function(){
<div class="collapsible">
<br>
Use the <a href="#widget-filter-childrows"><code>filter_childRows</code></a> option include child row text as follows:
<pre class="js">$(function(){
<pre class="prettyprint lang-javascript">$(function(){
$("table").tablesorter({
widgets: ["filter"],
widgetOptions : {
@ -1530,7 +1531,7 @@ $(function(){
<div class="collapsible">
<br>
Use the <a href="#widget-filter-columnFilters"><code>filter_columnFilters</code></a> option as follows:
<pre class="js">$(function(){
<pre class="prettyprint lang-javascript">$(function(){
$("table").tablesorter({
widgets: ["filter"],
widgetOptions : {
@ -1551,7 +1552,7 @@ $(function(){
<div class="collapsible">
<br>
Use the <a href="#widget-filter-cssfilter"><code>"tablesorter-filter"</code></a> option to change the css class name as follows:
<pre class="js">$(function(){
<pre class="prettyprint lang-javascript">$(function(){
$("table").tablesorter({
widgets: ["filter"],
widgetOptions : {
@ -1576,7 +1577,7 @@ $(function(){
<ul>
<li>
Make a sorted select dropdown list of all column contents. Repeated content will be combined.
<pre class="js">$(function(){
<pre class="prettyprint lang-javascript">$(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.
<h4>Regex example</h4>
<pre class="js">$(function(){
<pre class="prettyprint lang-javascript">$(function(){
$("table").tablesorter({
widgets: ["filter"],
widgetOptions: {
@ -1619,7 +1620,7 @@ $(function(){
});
});</pre>
<h4>Comparison example</h4>
<pre class="js">$(function(){
<pre class="prettyprint lang-javascript">$(function(){
$("table").tablesorter({
widgets: ["filter"],
widgetOptions: {
@ -1645,7 +1646,7 @@ $(function(){
</li>
<li>
Make a custom filter for the column.
<pre class="js">$(function(){
<pre class="prettyprint lang-javascript">$(function(){
$("table").tablesorter({
widgets: ["filter"],
widgetOptions: {
@ -1680,7 +1681,7 @@ $(function(){
<div class="collapsible">
<br>
Use the <a href="#widget-filter-hidefilters"><code>filter_hideFilters</code></a> option as follows:
<pre class="js">$(function(){
<pre class="prettyprint lang-javascript">$(function(){
$("table").tablesorter({
widgets: ["filter"],
widgetOptions : {
@ -1701,7 +1702,7 @@ $(function(){
<div class="collapsible">
<br>
Use the <a href="#widget-filter-ignorecase"><code>filter_ignorecase</code></a> option as follows:
<pre class="js">$(function(){
<pre class="prettyprint lang-javascript">$(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 (<code>&lt;input type="search"&gt;</code>) 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:
<br>
Use the <a href="#widget-filter-quickSearch"><code>filter_quickSearch</code></a> option as follows:
<pre class="js">$(function(){
<pre class="prettyprint lang-javascript">$(function(){
$("table").tablesorter({
widgets: ["filter"],
widgetOptions : {
@ -1745,7 +1746,7 @@ $(function(){
</li>
</ul>
Performing a quick search externally by triggering a search on the table as follows:
<pre class="js">$('table').trigger('search', [' AND h']);</pre>
<pre class="prettyprint lang-javascript">$('table').trigger('search', [' AND h']);</pre>
<ul>
</div>
@ -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 (<code>&lt;button class="reset"&gt;Reset&lt;/button&gt;</code>) 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):
</p>
Use the <a href="#widget-filter-reset"><code>filter_reset</code></a> option as follows:
<pre class="js">$(function(){
<pre class="prettyprint lang-javascript">$(function(){
$("table").tablesorter({
widgets: ["filter"],
widgetOptions : {
@ -1786,7 +1787,7 @@ $(function(){
<div class="collapsible">
<br>
Use the <a href="#widget-filter-searchdelay"><code>filter_searchDelay</code></a> option as follows:
<pre class="js">$(function(){
<pre class="prettyprint lang-javascript">$(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".
<pre class="js">// target the first filter input
<pre class="prettyprint lang-javascript">// 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);</pre>
In tablesorter v2.4+, the trigger can be applied directly to the table:
<pre class="js">// refresh the widget filter; no delay
<pre class="prettyprint lang-javascript">// refresh the widget filter; no delay
$('table').trigger('search', false);</pre></div>
</td>
<td></td>
@ -1820,7 +1821,7 @@ $('table').trigger('search', false);</pre></div>
<div class="collapsible">
<br>
Use the <a href="#widget-filter-serversidefiltering"><code>filter_serversideFiltering</code></a> option as follows:
<pre class="js">$(function(){
<pre class="prettyprint lang-javascript">$(function(){
$("table").tablesorter({
widgets: ["filter"],
widgetOptions : {
@ -1841,7 +1842,7 @@ $('table').trigger('search', false);</pre></div>
<div class="collapsible">
<br>
Use the <a href="#widget-filter-startswith"><code>filter_startsWith</code></a> option as follows:
<pre class="js">$(function(){
<pre class="prettyprint lang-javascript">$(function(){
$("table").tablesorter({
widgets: ["filter"],
widgetOptions : {
@ -1862,7 +1863,7 @@ $('table').trigger('search', false);</pre></div>
<div class="collapsible">
<br>
Use the <a href="#widget-filter-useParsedData"><code>filter_useParsedData</code></a> option as follows:
<pre class="js">$(function(){
<pre class="prettyprint lang-javascript">$(function(){
$("table").tablesorter({
widgets: ["filter"],
widgetOptions : {
@ -1895,7 +1896,7 @@ $('table').trigger('search', false);</pre></div>
<div class="collapsible">
<br>
Use the <a href="#widget-sticky-headers"><code>"stickyHeaders"</code></a> option to change the css class name as follows:
<pre class="js">$(function(){
<pre class="prettyprint lang-javascript">$(function(){
$("table").tablesorter({
widgets: ["stickyHeaders"],
widgetOptions : {
@ -1917,7 +1918,7 @@ $('table').trigger('search', false);</pre></div>
<div class="collapsible">
<br>
Use the <a href="#widget-resizable"><code>"resizable"</code></a> option to change the css class name as follows:
<pre class="js">$(function(){
<pre class="prettyprint lang-javascript">$(function(){
$("table").tablesorter({
widgets: ["resizable"],
widgetOptions : {
@ -1939,7 +1940,7 @@ $('table').trigger('search', false);</pre></div>
<div class="collapsible">
<br>
Use the <a href="#widget-savesort"><code>"saveSort"</code></a> option to change the css class name as follows:
<pre class="js">$(function(){
<pre class="prettyprint lang-javascript">$(function(){
$("table").tablesorter({
widgets: ["saveSort"],
widgetOptions : {
@ -1962,7 +1963,7 @@ $('table').trigger('search', false);</pre></div>
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
<div class="collapsible">
<p></p>
<pre class="js">// Extend the themes to change any of the default class names ** NEW **
<pre class="prettyprint lang-javascript">// 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 <code>"ui-icon-arrowthick-2-n-s"</code> for the unsorted column, <code>"ui-icon-arrowthick-1-s"</code> for the descending sort and <code>"ui-icon-arrowthick-1-n"</code> 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: <a class="external" href="http://jqueryui.com/themeroller/">http://jqueryui.com/themeroller/</a><br>
<br>
Use the <a href="#widget-uitheme"><code>"uitheme"</code></a> option to change the css class name as follows:
<pre class="js">$(function(){
<pre class="prettyprint lang-javascript">$(function(){
$("table").tablesorter({
widgets: ["uitheme"], // initialize ui theme styling widget of the table
widgetOptions: {
@ -1998,7 +1999,7 @@ $.extend($.tablesorter.themes.jui, {
});</pre>
To add a new theme, define it as follows; replace "custom" with the name of your theme:
<pre class="js">$.tablesorter.themes.custom = {
<pre class="prettyprint lang-javascript">$.tablesorter.themes.custom = {
table : 'table', // table classes
header : 'header', // header classes
icons : 'icon', // icon class added to the &lt;i&gt; in the header
@ -2024,7 +2025,7 @@ $.extend($.tablesorter.themes.jui, {
<div class="collapsible">
<br>
Use the <a href="#widget-zebra"><code>"zebra"</code></a> option to change the theme as follows:
<pre class="js">$(function(){
<pre class="prettyprint lang-javascript">$(function(){
$("table").tablesorter({
widgets: ["zebra"], // initialize zebra striping of the table
widgetOptions: {
@ -2065,7 +2066,7 @@ $.extend($.tablesorter.themes.jui, {
<div class="collapsible">
It does not work the same as "update" in that it only adds rows, it does not remove them.<br>
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.
<pre class="js">// Add multiple rows to the table
<pre class="prettyprint lang-javascript">// Add multiple rows to the table
var row = '&lt;tr&gt;&lt;td&gt;Inigo&lt;/td&gt;&lt;td&gt;Montoya&lt;/td&gt;&lt;td&gt;34&lt;/td&gt;' +
'&lt;td&gt;$19.99&lt;/td&gt;&lt;td&gt;15%&lt;/td&gt;&lt;td&gt;Sep 25, 1987 12:00PM&lt;/td&gt;&lt;/tr&gt;',
$row = $(row),
@ -2087,7 +2088,7 @@ $.extend($.tablesorter.themes.jui, {
<td><a href="#" class="toggle2">sorton</a></td>
<td>Use this method to sort an initialized table in the desired order.
<div class="collapsible">
<pre class="js">// Choose a new sort order
<pre class="prettyprint lang-javascript">// 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]);</pre></div>
<td>Use this method to reset the table to it's initial unsorted state. <span class="tip"><em>New</em></span> v2.4.7.
<div class="collapsible">
Don't confuse this method with the <a href="#sortreset"><code>sortReset</code> option</a>. This method immediately resets the entire table sort, while the option only resets the column sort after a third click.
<pre class="js">// Reset the table (make it unsorted)
<pre class="prettyprint lang-javascript">// Reset the table (make it unsorted)
$("table").trigger("sortReset");</pre></div>
</td>
<td><a href="example-method-sortreset.html">Example</a></td>
@ -2114,7 +2115,7 @@ $("table").trigger("sortReset");</pre></div>
<td><a href="#" class="toggle2">update</a></td>
<td>Update the stored tablesorter data and the table.
<div class="collapsible">
<pre class="js">// Add new content
<pre class="prettyprint lang-javascript">// Add new content
$("table tbody").append(html);
// let the plugin know that we made a update
@ -2144,7 +2145,7 @@ $("table").trigger("sorton", [sorting]);</pre></div>
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".<br>
<br>
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.
<pre class="js">// Table data was just dynamically changed (more than one cell)
<pre class="prettyprint lang-javascript">// Table data was just dynamically changed (more than one cell)
$("table")
.trigger("update")
.trigger("appendCache");</pre></div>
@ -2156,7 +2157,7 @@ $("table")
<td><a href="#" class="toggle2">updateCell</a></td>
<td>Update a table cell in the tablesorter data.
<div class="collapsible">
<pre class="js">$(function() {
<pre class="prettyprint lang-javascript">$(function() {
$("table").tablesorter();
$("td.discount").click(function(){
@ -2192,7 +2193,7 @@ $("table")
<td><a href="#" class="toggle2">applyWidgetId</a></td>
<td>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.
<div class="collapsible">
<pre class="js">$(function(){
<pre class="prettyprint lang-javascript">$(function(){
// initialize tablesorter without the widget
$("table").tablesorter();
@ -2210,7 +2211,7 @@ $("table")
<td><a href="#" class="toggle2">applyWidgets</a></td>
<td>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.
<div class="collapsible">
<pre class="js">// Update the list of widgets to apply to the table (add or remove)
<pre class="prettyprint lang-javascript">// 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');
<td><a href="#" class="toggle2">destroy</a></td>
<td>Use this method to remove tablesorter from the table.
<div class="collapsible">
<pre class="js">// Remove tablesorter and all classes
<pre class="prettyprint lang-javascript">// 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];</pre></div>
<td>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. <span class="tip"><em>New</em></span> v2.4.
<div class="collapsible"><br>
Trigger this method using either of the following methods (they are equivalent):
<pre class="js">// trigger a refresh widget event
<pre class="prettyprint lang-javascript">// trigger a refresh widget event
$('table').trigger('refreshWidgets', [doAll, dontapply]);
// Use the API directly
@ -2265,13 +2266,13 @@ $.tablesorter.refreshWidgets(table, doAll, dontapply)</pre>
<td><a href="#" class="toggle2">search</a></td>
<td>Trigger the filter widget to update the search from current inputs and/or selections. <span class="tip"><em>Updated!</em></span> v2.4.
<div class="collapsible">
This first method sends an array with the search strings to the filter widget.<pre class="js">$(function(){
This first method sends an array with the search strings to the filter widget.<pre class="prettyprint lang-javascript">$(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]);
});</pre>
or, directly add the search string to the filter input as follows:<pre class="js">$(function(){
or, directly add the search string to the filter input as follows:<pre class="prettyprint lang-javascript">$(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:<pre class="js
<td><a href="#" class="toggle2">initialized</a></td>
<td>This event fires when tablesorter has completed initialization. (v2.2).
<div class="collapsible">
<pre class="js">$(function(){
<pre class="prettyprint lang-javascript">$(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:<pre class="js
<td><a href="#" class="toggle2">sortBegin</a></td>
<td>This event fires immediately before tablesorter begins resorting the table.
<div class="collapsible">
<pre class="js">$(function(){
<pre class="prettyprint lang-javascript">$(function(){
// initialize the tablesorter plugin
$("table").tablesorter();
@ -2350,7 +2351,7 @@ or, directly add the search string to the filter input as follows:<pre class="js
<td><a href="#" class="toggle2">sortStart</a></td>
<td>This event fires immediately after the tablesorter header has been clicked, initializing a resort.
<div class="collapsible">
<pre class="js">$(function(){
<pre class="prettyprint lang-javascript">$(function(){
// initialize the tablesorter plugin
$("table").tablesorter();
@ -2372,7 +2373,7 @@ or, directly add the search string to the filter input as follows:<pre class="js
<td><a href="#" class="toggle2">sortEnd</a></td>
<td>This event fires when tablesorter has completed resorting the table.
<div class="collapsible">
<pre class="js">$(function(){
<pre class="prettyprint lang-javascript">$(function(){
// initialize the tablesorter plugin
$("table").tablesorter();
@ -2395,7 +2396,7 @@ or, directly add the search string to the filter input as follows:<pre class="js
<td>This event fires after tablesorter has completed updating. (v.2.3.9)
<div class="collapsible">
This occurs after an "update", "updateCell" or "addRows" method was called, but before any callback functions are executed.
<pre class="js">$(function(){
<pre class="prettyprint lang-javascript">$(function(){
// initialize the tablesorter plugin
$("table").tablesorter();
@ -2423,7 +2424,7 @@ or, directly add the search string to the filter input as follows:<pre class="js
<td><a href="#" class="toggle2">pagerChange</a></td>
<td>This event fires when the pager plugin begins to render the table on the currently selected page. (v2.0.7).
<div class="collapsible">
<pre class="js">$(function(){
<pre class="prettyprint lang-javascript">$(function(){
// initialize the sorter
$("table")
@ -2449,7 +2450,7 @@ or, directly add the search string to the filter input as follows:<pre class="js
<td><a href="#" class="toggle2">pagerComplete</a></td>
<td>This event fires when the pager plugin has completed its render of the table on the currently selected page. (v2.0.7).
<div class="collapsible">
<pre class="js">$(function(){
<pre class="prettyprint lang-javascript">$(function(){
// initialize the sorter
$("table")
@ -2475,7 +2476,7 @@ or, directly add the search string to the filter input as follows:<pre class="js
<td><a href="#" class="toggle2">pagerBeforeInitialized</a></td>
<td>This event fires after all pager controls have been bound and set up but before the pager formats the table or loads any ajax data. <span class="tip"><em>New</em></span> v2.4.4.
<div class="collapsible">
<pre class="js">$(function(){
<pre class="prettyprint lang-javascript">$(function(){
$("table")
@ -2501,7 +2502,7 @@ or, directly add the search string to the filter input as follows:<pre class="js
<td><a href="#" class="toggle2">pagerInitialized</a></td>
<td>This event fires when the pager plugin has completed initialization. <span class="tip"><em>New</em></span> v2.4.4.
<div class="collapsible">
<pre class="js">$(function(){
<pre class="prettyprint lang-javascript">$(function(){
$("table")
@ -2530,7 +2531,7 @@ or, directly add the search string to the filter input as follows:<pre class="js
<div class="collapsible">
This event may fire before the <code>pagerComplete</code> event when ajax processing is involved, or after the <code>pagerComplete</code> on normal use.
See <a href="https://github.com/Mottie/tablesorter/pull/153">issue #153</a>.
<pre class="js">$(function(){
<pre class="prettyprint lang-javascript">$(function(){
// initialize the sorter
$("table")
@ -2568,7 +2569,7 @@ or, directly add the search string to the filter input as follows:<pre class="js
<td><a href="#" class="toggle2">filterInit</a></td>
<td>Event triggered when the filter widget has finished initializing. <span class="tip"><em>New</em></span> v2.4.
<div class="collapsible">
You can use this event to modify the filter elements (row, inputs and/or selects) as desired. Use it as follows:<pre class="js">$(function(){
You can use this event to modify the filter elements (row, inputs and/or selects) as desired. Use it as follows:<pre class="prettyprint lang-javascript">$(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:<pre class="js
<td><a href="#" class="toggle2">filterStart</a></td>
<td>Event triggered when the filter widget has started processing the search. <span class="tip"><em>New</em></span> v2.4.
<div class="collapsible">
You can use this event to do something like add a class to the filter row. Use it as follows:<pre class="js">$(function(){
You can use this event to do something like add a class to the filter row. Use it as follows:<pre class="prettyprint lang-javascript">$(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:<pre class="js
<td><a href="#" class="toggle2">filterEnd</a></td>
<td>Event triggered when the filter widget has finished processing the search. <span class="tip"><em>New</em></span> v2.4.
<div class="collapsible">
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:<pre class="js">$(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:<pre class="prettyprint lang-javascript">$(function(){
$('table').bind('filterEnd', function(){
$(this).find('tr.tablesorter-filter-row').removeClass('filtering');
});

View File

@ -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 &#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,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: /<!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: gray;"
}
, 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;"
}
// 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: royalBlue;", attr_value: "color: maroon;" }
}
}
};
ChiliBook.recipes[ "js.js" ] =
{
_name: 'js'
, _case: true
, _main: {
ml_comment: {
_match: /\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\//
, _style: 'color: gray;'
}
, sl_comment: {
_match: /\/\/.*/
, _style: 'color: gray;'
}
, string: {
_match: /(?:\'[^\'\\\n]*(?:\\.[^\'\\\n]*)*\')|(?:\"[^\"\\\n]*(?:\\.[^\"\\\n]*)*\")/
, _style: 'color: teal;'
}
, num: {
_match: /\b[+-]?(?:\d*\.?\d+|\d+\.?\d*)(?:[eE][+-]?\d+)?\b/
, _style: 'color: #a00;'
}
, boolean: {
_match: /\b(true|false|null)\b/
, _style: 'color: #c00;'
}
, 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: #c00; 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" ] =
{
_name: 'css'
, _case: true
, _main: {
comment: {
_match: /\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\//
, _style: "color: gray;"
}
, directive: {
_match: /@\w+/
, _style: "color: fuchsia;"
}
, url: {
_match: /\b(url\s*\()([^)]+)(\))/
, _replace: "<span class='url'>$1</span><span class='number'>$2</span><span class='url'>$3</span>"
, _style: "color: #490093;"
}
, block: {
_match: /\{([\w\W]*?)\}/
, _replace: function( all, pairs ) {
return '{' + this.x( pairs, '/definition' ) + '}';
}
}
, 'class': {
_match: /\.\S+/
, _style: "color: #0069d2; font-weight: bold;"
}
, id: {
_match: /#\S+/
, _style: "color: #75029B; font-weight: bold;"
}
, pseudo: {
_match: /:\w+/
, _style: "color: #CC9900;"
}
, element: {
_match: /\w+/
, _style: "color: #004080; 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|opacity)\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|-webkit-transition|-moz-transition|-o-transition|transition|-webkit-box-sizing|-moz-box-sizing|box-sizing)\s*:/
, _style: "color: #330066;"
}
, url: {
_match: /\b(url\s*\()([^)]+)(\))/
, _replace: "<span class='url'>$1</span><span class='number'>$2</span><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|not-allowed|inherit)\b/
, _style: "color: #3366FF;"
}
, string: {
_match: /(?:\'[^\'\\\n]*(?:\\.[^\'\\\n]*)*\')|(?:\"[^\"\\\n]*(?:\\.[^\"\\\n]*)*\")/
, _style: "color: teal;"
}
, number: {
_match: /(?:\b[+-]?(?:\d*\.?\d+|\d+\.?\d*))(?:%|(?:(?:px|pt}rem|em|s|)\b))/
, _style: "color: maroon;"
}
, 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,32 +1,20 @@
/* Stop IE flicker */
if ($.browser.msie) { document.execCommand('BackgroundImageCache', false, true); }
jQuery.fn.antispam = function() {
return this.each(function(){
var email = $(this).text().toLowerCase().replace(/\sdot/g,'.').replace(/\sat/g,'@').replace(/\s+/g,''),
URI = "mailto:" + email;
$(this).hide().before(
$("<a></a>").attr("href",URI).addClass("external").text(email)
);
});
};
$(function(){
$("a.external").each(function(){this.target = '_new';});
$("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, " ") );
$("pre.lang-css").text( $("#css").html().replace(/\t/g, " ") );
}
if ($("#demo").length) {
$("#html pre").text( $("#demo").html().replace(/\t/g, " ") );
}
if (typeof prettyPrint !== 'undefined') { prettyPrint(); }
// hide child rows
$('#root .tablesorter-childRow').hide();
// toggle child row content, not hiding the row since we are using rowspan
@ -85,9 +73,6 @@ function showProperty(){
}
$(window).load(function(){
$(".js").chili();
$(".html").chili();
$(".css").chili();
$(window).bind('hashchange', function(){
showProperty();

28
docs/js/prettify.js Normal file
View File

@ -0,0 +1,28 @@
var q=null;window.PR_SHOULD_USE_CONTINUATION=!0;
(function(){function L(a){function m(a){var f=a.charCodeAt(0);if(f!==92)return f;var b=a.charAt(1);return(f=r[b])?f:"0"<=b&&b<="7"?parseInt(a.substring(1),8):b==="u"||b==="x"?parseInt(a.substring(2),16):a.charCodeAt(1)}function e(a){if(a<32)return(a<16?"\\x0":"\\x")+a.toString(16);a=String.fromCharCode(a);if(a==="\\"||a==="-"||a==="["||a==="]")a="\\"+a;return a}function h(a){for(var f=a.substring(1,a.length-1).match(/\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\[0-3][0-7]{0,2}|\\[0-7]{1,2}|\\[\S\s]|[^\\]/g),a=
[],b=[],o=f[0]==="^",c=o?1:0,i=f.length;c<i;++c){var j=f[c];if(/\\[bdsw]/i.test(j))a.push(j);else{var j=m(j),d;c+2<i&&"-"===f[c+1]?(d=m(f[c+2]),c+=2):d=j;b.push([j,d]);d<65||j>122||(d<65||j>90||b.push([Math.max(65,j)|32,Math.min(d,90)|32]),d<97||j>122||b.push([Math.max(97,j)&-33,Math.min(d,122)&-33]))}}b.sort(function(a,f){return a[0]-f[0]||f[1]-a[1]});f=[];j=[NaN,NaN];for(c=0;c<b.length;++c)i=b[c],i[0]<=j[1]+1?j[1]=Math.max(j[1],i[1]):f.push(j=i);b=["["];o&&b.push("^");b.push.apply(b,a);for(c=0;c<
f.length;++c)i=f[c],b.push(e(i[0])),i[1]>i[0]&&(i[1]+1>i[0]&&b.push("-"),b.push(e(i[1])));b.push("]");return b.join("")}function y(a){for(var f=a.source.match(/\[(?:[^\\\]]|\\[\S\s])*]|\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\\d+|\\[^\dux]|\(\?[!:=]|[()^]|[^()[\\^]+/g),b=f.length,d=[],c=0,i=0;c<b;++c){var j=f[c];j==="("?++i:"\\"===j.charAt(0)&&(j=+j.substring(1))&&j<=i&&(d[j]=-1)}for(c=1;c<d.length;++c)-1===d[c]&&(d[c]=++t);for(i=c=0;c<b;++c)j=f[c],j==="("?(++i,d[i]===void 0&&(f[c]="(?:")):"\\"===j.charAt(0)&&
(j=+j.substring(1))&&j<=i&&(f[c]="\\"+d[i]);for(i=c=0;c<b;++c)"^"===f[c]&&"^"!==f[c+1]&&(f[c]="");if(a.ignoreCase&&s)for(c=0;c<b;++c)j=f[c],a=j.charAt(0),j.length>=2&&a==="["?f[c]=h(j):a!=="\\"&&(f[c]=j.replace(/[A-Za-z]/g,function(a){a=a.charCodeAt(0);return"["+String.fromCharCode(a&-33,a|32)+"]"}));return f.join("")}for(var t=0,s=!1,l=!1,p=0,d=a.length;p<d;++p){var g=a[p];if(g.ignoreCase)l=!0;else if(/[a-z]/i.test(g.source.replace(/\\u[\da-f]{4}|\\x[\da-f]{2}|\\[^UXux]/gi,""))){s=!0;l=!1;break}}for(var r=
{b:8,t:9,n:10,v:11,f:12,r:13},n=[],p=0,d=a.length;p<d;++p){g=a[p];if(g.global||g.multiline)throw Error(""+g);n.push("(?:"+y(g)+")")}return RegExp(n.join("|"),l?"gi":"g")}function M(a){function m(a){switch(a.nodeType){case 1:if(e.test(a.className))break;for(var g=a.firstChild;g;g=g.nextSibling)m(g);g=a.nodeName;if("BR"===g||"LI"===g)h[s]="\n",t[s<<1]=y++,t[s++<<1|1]=a;break;case 3:case 4:g=a.nodeValue,g.length&&(g=p?g.replace(/\r\n?/g,"\n"):g.replace(/[\t\n\r ]+/g," "),h[s]=g,t[s<<1]=y,y+=g.length,
t[s++<<1|1]=a)}}var e=/(?:^|\s)nocode(?:\s|$)/,h=[],y=0,t=[],s=0,l;a.currentStyle?l=a.currentStyle.whiteSpace:window.getComputedStyle&&(l=document.defaultView.getComputedStyle(a,q).getPropertyValue("white-space"));var p=l&&"pre"===l.substring(0,3);m(a);return{a:h.join("").replace(/\n$/,""),c:t}}function B(a,m,e,h){m&&(a={a:m,d:a},e(a),h.push.apply(h,a.e))}function x(a,m){function e(a){for(var l=a.d,p=[l,"pln"],d=0,g=a.a.match(y)||[],r={},n=0,z=g.length;n<z;++n){var f=g[n],b=r[f],o=void 0,c;if(typeof b===
"string")c=!1;else{var i=h[f.charAt(0)];if(i)o=f.match(i[1]),b=i[0];else{for(c=0;c<t;++c)if(i=m[c],o=f.match(i[1])){b=i[0];break}o||(b="pln")}if((c=b.length>=5&&"lang-"===b.substring(0,5))&&!(o&&typeof o[1]==="string"))c=!1,b="src";c||(r[f]=b)}i=d;d+=f.length;if(c){c=o[1];var j=f.indexOf(c),k=j+c.length;o[2]&&(k=f.length-o[2].length,j=k-c.length);b=b.substring(5);B(l+i,f.substring(0,j),e,p);B(l+i+j,c,C(b,c),p);B(l+i+k,f.substring(k),e,p)}else p.push(l+i,b)}a.e=p}var h={},y;(function(){for(var e=a.concat(m),
l=[],p={},d=0,g=e.length;d<g;++d){var r=e[d],n=r[3];if(n)for(var k=n.length;--k>=0;)h[n.charAt(k)]=r;r=r[1];n=""+r;p.hasOwnProperty(n)||(l.push(r),p[n]=q)}l.push(/[\S\s]/);y=L(l)})();var t=m.length;return e}function u(a){var m=[],e=[];a.tripleQuotedStrings?m.push(["str",/^(?:'''(?:[^'\\]|\\[\S\s]|''?(?=[^']))*(?:'''|$)|"""(?:[^"\\]|\\[\S\s]|""?(?=[^"]))*(?:"""|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$))/,q,"'\""]):a.multiLineStrings?m.push(["str",/^(?:'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$)|`(?:[^\\`]|\\[\S\s])*(?:`|$))/,
q,"'\"`"]):m.push(["str",/^(?:'(?:[^\n\r'\\]|\\.)*(?:'|$)|"(?:[^\n\r"\\]|\\.)*(?:"|$))/,q,"\"'"]);a.verbatimStrings&&e.push(["str",/^@"(?:[^"]|"")*(?:"|$)/,q]);var h=a.hashComments;h&&(a.cStyleComments?(h>1?m.push(["com",/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,q,"#"]):m.push(["com",/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\n\r]*)/,q,"#"]),e.push(["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,q])):m.push(["com",/^#[^\n\r]*/,
q,"#"]));a.cStyleComments&&(e.push(["com",/^\/\/[^\n\r]*/,q]),e.push(["com",/^\/\*[\S\s]*?(?:\*\/|$)/,q]));a.regexLiterals&&e.push(["lang-regex",/^(?:^^\.?|[!+-]|!=|!==|#|%|%=|&|&&|&&=|&=|\(|\*|\*=|\+=|,|-=|->|\/|\/=|:|::|;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|[?@[^]|\^=|\^\^|\^\^=|{|\||\|=|\|\||\|\|=|~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\s*(\/(?=[^*/])(?:[^/[\\]|\\[\S\s]|\[(?:[^\\\]]|\\[\S\s])*(?:]|$))+\/)/]);(h=a.types)&&e.push(["typ",h]);a=(""+a.keywords).replace(/^ | $/g,
"");a.length&&e.push(["kwd",RegExp("^(?:"+a.replace(/[\s,]+/g,"|")+")\\b"),q]);m.push(["pln",/^\s+/,q," \r\n\t\xa0"]);e.push(["lit",/^@[$_a-z][\w$@]*/i,q],["typ",/^(?:[@_]?[A-Z]+[a-z][\w$@]*|\w+_t\b)/,q],["pln",/^[$_a-z][\w$@]*/i,q],["lit",/^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i,q,"0123456789"],["pln",/^\\[\S\s]?/,q],["pun",/^.[^\s\w"-$'./@\\`]*/,q]);return x(m,e)}function D(a,m){function e(a){switch(a.nodeType){case 1:if(k.test(a.className))break;if("BR"===a.nodeName)h(a),
a.parentNode&&a.parentNode.removeChild(a);else for(a=a.firstChild;a;a=a.nextSibling)e(a);break;case 3:case 4:if(p){var b=a.nodeValue,d=b.match(t);if(d){var c=b.substring(0,d.index);a.nodeValue=c;(b=b.substring(d.index+d[0].length))&&a.parentNode.insertBefore(s.createTextNode(b),a.nextSibling);h(a);c||a.parentNode.removeChild(a)}}}}function h(a){function b(a,d){var e=d?a.cloneNode(!1):a,f=a.parentNode;if(f){var f=b(f,1),g=a.nextSibling;f.appendChild(e);for(var h=g;h;h=g)g=h.nextSibling,f.appendChild(h)}return e}
for(;!a.nextSibling;)if(a=a.parentNode,!a)return;for(var a=b(a.nextSibling,0),e;(e=a.parentNode)&&e.nodeType===1;)a=e;d.push(a)}var k=/(?:^|\s)nocode(?:\s|$)/,t=/\r\n?|\n/,s=a.ownerDocument,l;a.currentStyle?l=a.currentStyle.whiteSpace:window.getComputedStyle&&(l=s.defaultView.getComputedStyle(a,q).getPropertyValue("white-space"));var p=l&&"pre"===l.substring(0,3);for(l=s.createElement("LI");a.firstChild;)l.appendChild(a.firstChild);for(var d=[l],g=0;g<d.length;++g)e(d[g]);m===(m|0)&&d[0].setAttribute("value",
m);var r=s.createElement("OL");r.className="linenums";for(var n=Math.max(0,m-1|0)||0,g=0,z=d.length;g<z;++g)l=d[g],l.className="L"+(g+n)%10,l.firstChild||l.appendChild(s.createTextNode("\xa0")),r.appendChild(l);a.appendChild(r)}function k(a,m){for(var e=m.length;--e>=0;){var h=m[e];A.hasOwnProperty(h)?window.console&&console.warn("cannot override language handler %s",h):A[h]=a}}function C(a,m){if(!a||!A.hasOwnProperty(a))a=/^\s*</.test(m)?"default-markup":"default-code";return A[a]}function E(a){var m=
a.g;try{var e=M(a.h),h=e.a;a.a=h;a.c=e.c;a.d=0;C(m,h)(a);var k=/\bMSIE\b/.test(navigator.userAgent),m=/\n/g,t=a.a,s=t.length,e=0,l=a.c,p=l.length,h=0,d=a.e,g=d.length,a=0;d[g]=s;var r,n;for(n=r=0;n<g;)d[n]!==d[n+2]?(d[r++]=d[n++],d[r++]=d[n++]):n+=2;g=r;for(n=r=0;n<g;){for(var z=d[n],f=d[n+1],b=n+2;b+2<=g&&d[b+1]===f;)b+=2;d[r++]=z;d[r++]=f;n=b}for(d.length=r;h<p;){var o=l[h+2]||s,c=d[a+2]||s,b=Math.min(o,c),i=l[h+1],j;if(i.nodeType!==1&&(j=t.substring(e,b))){k&&(j=j.replace(m,"\r"));i.nodeValue=
j;var u=i.ownerDocument,v=u.createElement("SPAN");v.className=d[a+1];var x=i.parentNode;x.replaceChild(v,i);v.appendChild(i);e<o&&(l[h+1]=i=u.createTextNode(t.substring(b,o)),x.insertBefore(i,v.nextSibling))}e=b;e>=o&&(h+=2);e>=c&&(a+=2)}}catch(w){"console"in window&&console.log(w&&w.stack?w.stack:w)}}var v=["break,continue,do,else,for,if,return,while"],w=[[v,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],
"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],F=[w,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],G=[w,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"],
H=[G,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"],w=[w,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"],I=[v,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],
J=[v,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],v=[v,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],K=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/,N=/\S/,O=u({keywords:[F,H,w,"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END"+
I,J,v],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0}),A={};k(O,["default-code"]);k(x([],[["pln",/^[^<?]+/],["dec",/^<!\w[^>]*(?:>|$)/],["com",/^<\!--[\S\s]*?(?:--\>|$)/],["lang-",/^<\?([\S\s]+?)(?:\?>|$)/],["lang-",/^<%([\S\s]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["lang-",/^<xmp\b[^>]*>([\S\s]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\S\s]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\S\s]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),
["default-markup","htm","html","mxml","xhtml","xml","xsl"]);k(x([["pln",/^\s+/,q," \t\r\n"],["atv",/^(?:"[^"]*"?|'[^']*'?)/,q,"\"'"]],[["tag",/^^<\/?[a-z](?:[\w-.:]*\w)?|\/?>$/i],["atn",/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^\s"'>]*(?:[^\s"'/>]|\/(?=\s)))/],["pun",/^[/<->]+/],["lang-js",/^on\w+\s*=\s*"([^"]+)"/i],["lang-js",/^on\w+\s*=\s*'([^']+)'/i],["lang-js",/^on\w+\s*=\s*([^\s"'>]+)/i],["lang-css",/^style\s*=\s*"([^"]+)"/i],["lang-css",/^style\s*=\s*'([^']+)'/i],["lang-css",
/^style\s*=\s*([^\s"'>]+)/i]]),["in.tag"]);k(x([],[["atv",/^[\S\s]+/]]),["uq.val"]);k(u({keywords:F,hashComments:!0,cStyleComments:!0,types:K}),["c","cc","cpp","cxx","cyc","m"]);k(u({keywords:"null,true,false"}),["json"]);k(u({keywords:H,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:K}),["cs"]);k(u({keywords:G,cStyleComments:!0}),["java"]);k(u({keywords:v,hashComments:!0,multiLineStrings:!0}),["bsh","csh","sh"]);k(u({keywords:I,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),
["cv","py"]);k(u({keywords:"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["perl","pl","pm"]);k(u({keywords:J,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb"]);k(u({keywords:w,cStyleComments:!0,regexLiterals:!0}),["js"]);k(u({keywords:"all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes",
hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]);k(x([],[["str",/^[\S\s]+/]]),["regex"]);window.prettyPrintOne=function(a,m,e){var h=document.createElement("PRE");h.innerHTML=a;e&&D(h,e);E({g:m,i:e,h:h});return h.innerHTML};window.prettyPrint=function(a){function m(){for(var e=window.PR_SHOULD_USE_CONTINUATION?l.now()+250:Infinity;p<h.length&&l.now()<e;p++){var n=h[p],k=n.className;if(k.indexOf("prettyprint")>=0){var k=k.match(g),f,b;if(b=
!k){b=n;for(var o=void 0,c=b.firstChild;c;c=c.nextSibling)var i=c.nodeType,o=i===1?o?b:c:i===3?N.test(c.nodeValue)?b:o:o;b=(f=o===b?void 0:o)&&"CODE"===f.tagName}b&&(k=f.className.match(g));k&&(k=k[1]);b=!1;for(o=n.parentNode;o;o=o.parentNode)if((o.tagName==="pre"||o.tagName==="code"||o.tagName==="xmp")&&o.className&&o.className.indexOf("prettyprint")>=0){b=!0;break}b||((b=(b=n.className.match(/\blinenums\b(?::(\d+))?/))?b[1]&&b[1].length?+b[1]:!0:!1)&&D(n,b),d={g:k,h:n,i:b},E(d))}}p<h.length?setTimeout(m,
250):a&&a()}for(var e=[document.getElementsByTagName("pre"),document.getElementsByTagName("code"),document.getElementsByTagName("xmp")],h=[],k=0;k<e.length;++k)for(var t=0,s=e[k].length;t<s;++t)h.push(e[k][t]);var e=q,l=Date;l.now||(l={now:function(){return+new Date}});var p=0,d,g=/\blang(?:uage)?-([\w.]+)(?!\S)/;m()};window.PR={createSimpleLexer:x,registerLangHandler:k,sourceDecorator:u,PR_ATTRIB_NAME:"atn",PR_ATTRIB_VALUE:"atv",PR_COMMENT:"com",PR_DECLARATION:"dec",PR_KEYWORD:"kwd",PR_LITERAL:"lit",
PR_NOCODE:"nocode",PR_PLAIN:"pln",PR_PUNCTUATION:"pun",PR_SOURCE:"src",PR_STRING:"str",PR_TAG:"tag",PR_TYPE:"typ"}})();

View File

@ -14,12 +14,11 @@
</style>
<!-- jQuery -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8/jquery.min.js"></script>
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/cupertino/jquery-ui.css">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<!-- Tablesorter themes -->
<!-- jquery ui -->
<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/cupertino/jquery-ui.css" rel="stylesheet">
<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1/themes/cupertino/jquery-ui.css" rel="stylesheet">
<link href="../css/theme.jui.css" rel="stylesheet">
<!-- bootstrap -->

View File

@ -8,7 +8,7 @@
<link href="docs/css/jq.css" rel="stylesheet">
<!-- jQuery: required (tablesorter works with jQuery 1.2.3+) -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<!-- Pick a theme, load the plugin & initialize plugin -->
<link href="css/theme.default.css" rel="stylesheet">