Change the directory of Tablesorter from '_assets' to static 'assets'.
This commit is contained in:
230
assets/vendor/tablesorter/beta-testing/example-external-filters-using-select2.html
vendored
Normal file
230
assets/vendor/tablesorter/beta-testing/example-external-filters-using-select2.html
vendored
Normal file
@@ -0,0 +1,230 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>jQuery plugin: Tablesorter 2.0 - External Filters + select2</title>
|
||||
|
||||
<!-- jQuery -->
|
||||
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.js"></script>
|
||||
|
||||
<!-- Demo stuff -->
|
||||
<link class="ui-theme" rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/cupertino/jquery-ui.css">
|
||||
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
|
||||
<link rel="stylesheet" href="../docs/css/jq.css">
|
||||
<link href="../docs/css/prettify.css" rel="stylesheet">
|
||||
<script src="../docs/js/prettify.js"></script>
|
||||
<script src="../docs/js/docs.js"></script>
|
||||
|
||||
<link rel="stylesheet" href="select2.css">
|
||||
<script src="http://cdnjs.cloudflare.com/ajax/libs/select2/3.4.0/select2.min.js"></script>
|
||||
<style>
|
||||
.tablesorter-filter-row td button {
|
||||
background-color: red;
|
||||
color: white;
|
||||
border: #555 1px solid;
|
||||
}
|
||||
#external_controls input {
|
||||
width: 150px;
|
||||
margin-left: 5px;
|
||||
}
|
||||
.selector {
|
||||
width: 200px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<!-- Tablesorter: required -->
|
||||
<link rel="stylesheet" href="../css/theme.jui.css">
|
||||
<script src="../js/jquery.tablesorter.js"></script>
|
||||
<script src="../js/jquery.tablesorter.widgets.js"></script>
|
||||
|
||||
<script id="js">$(function(){
|
||||
|
||||
var $t = $('table')
|
||||
.on('filterInit', function () {
|
||||
|
||||
var filters,
|
||||
select2Column = 0,
|
||||
select2TagColumn = 1,
|
||||
$t = $(this),
|
||||
$filterCells = $t.find('.tablesorter-filter-row').children(),
|
||||
$ext = $('#external_controls'),
|
||||
$extCells = $ext.find('td'),
|
||||
startSearch = function(){
|
||||
filters = [];
|
||||
$extCells.each(function(i){
|
||||
var v,
|
||||
$this = $(this),
|
||||
$item = $this.find('select, input');
|
||||
// specific method for select2
|
||||
if (i === select2Column) {
|
||||
v = '/(' + ($this.find('.selector').select2('val') || []).join('$|') + '$)/';
|
||||
} else if(i === select2TagColumn){
|
||||
v = '/(' + ($this.find('.selectorTag').select2('val') || []).join('|') + ')/';
|
||||
}
|
||||
if (i !== select2Column) {
|
||||
// search for numbers > value
|
||||
// v = '>=' + $item.val();
|
||||
}
|
||||
filters[i] = v || $item.val() || '';
|
||||
});
|
||||
// start search
|
||||
$.tablesorter.setFilters($t, filters, true);
|
||||
};
|
||||
|
||||
// hide filter row completely
|
||||
$t.find('.tablesorter-filter-row').hide();
|
||||
|
||||
// clone original select and turn it into a select2
|
||||
// doing it this way because we can let the filter widget do most of the work
|
||||
$filterCells.eq(select2Column)
|
||||
.find('select')
|
||||
.attr('multiple', 'multiple')
|
||||
.addClass('selector')
|
||||
.appendTo( $ext.find('.select2') );
|
||||
// replace select with an input
|
||||
$filterCells.eq(select2Column).html('<input type="search" class="tablesorter-filter">');
|
||||
|
||||
// removed first option (it's just a placeholder)
|
||||
$ext.find('.selector').find('option:first').remove();
|
||||
// set up select2 input
|
||||
$ext.find('.selector').select2({
|
||||
placeholder : 'AlphaNumeric'
|
||||
});
|
||||
|
||||
|
||||
// /******* Select2 Tag Cloud ********/
|
||||
// as with above AlphaNumeric filter get the option values from original select
|
||||
var optionValues = [];
|
||||
$filterCells.eq(select2TagColumn).find('select option').each(function() {
|
||||
optionValues.push($(this).text());
|
||||
});
|
||||
|
||||
// removed first option (it's just a placeholder)
|
||||
optionValues = optionValues.slice(1);
|
||||
|
||||
//Create a new hidden input for select2 tag cloud and append it to its external filter cell
|
||||
var $selectInput = $('<input type="hidden" class="selectorTag" style="width:200px"/>')
|
||||
.appendTo( $ext.find('.select2tag') );
|
||||
|
||||
//Replace the original select filter with a search input
|
||||
$filterCells.eq(select2TagColumn).html('<input type="search" class="tablesorter-filter">');
|
||||
|
||||
// set up select2 tag cloud input
|
||||
$selectInput.select2({
|
||||
tags : optionValues,
|
||||
tokenSeparators : [","],
|
||||
placeholder : 'AlphaNumeric Tag'
|
||||
});
|
||||
|
||||
// turn off built-in filter-select
|
||||
$t.find('.filter-select').removeClass('filter-select') // turn off filter select
|
||||
this.config.widgetOptions.filter_functions[select2Column] = null;
|
||||
this.config.widgetOptions.filter_functions[select2TagColumn] = null;
|
||||
|
||||
// input changes trigger a new search
|
||||
$ext.find('select, input').on('change', function () {
|
||||
startSearch();
|
||||
});
|
||||
|
||||
})
|
||||
.tablesorter({
|
||||
theme: 'jui',
|
||||
headerTemplate: '{content}{icon}',
|
||||
widgets: ['zebra', 'uitheme', 'filter']
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="banner">
|
||||
<h1>table<em>sorter</em></h1>
|
||||
<h2>External Filters + select2</h2>
|
||||
<h3>Flexible client-side table sorting</h3>
|
||||
<a href="index.html">Back to documentation</a>
|
||||
</div>
|
||||
<div id="main">
|
||||
|
||||
<p class="tip">
|
||||
<em>NOTE!</em>
|
||||
<ul>
|
||||
<li>External filter using <a href="http://ivaynberg.github.io/select2/">Select2</a> plugin.</li>
|
||||
</ul>
|
||||
</p>
|
||||
|
||||
<h1>Demo</h1>
|
||||
<br>
|
||||
|
||||
<table id="external_controls">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="select2">filters: </td>
|
||||
<td class="select2tag"></td>
|
||||
<td>
|
||||
<input type="search" placeholder="num" />
|
||||
</td>
|
||||
<td>
|
||||
<input type="search" placeholder="anim" />
|
||||
</td>
|
||||
<td>
|
||||
<input type="search" placeholder="sites" />
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<table class="tablesorter">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="filter-select">AlphaNumeric</th>
|
||||
<th class="filter-select">AlphaNumeric Tag</th>
|
||||
<th>Numeric</th>
|
||||
<th>Animals</th>
|
||||
<th>Sites</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr><td>abc 123</td><td>abc 123</td><td>10</td><td>Koala</td><td>http://www.google.com</td></tr>
|
||||
<tr><td>abc 1</td><td>abc 1</td><td>34</td><td>Ox</td><td>http://www.yahoo.com</td></tr>
|
||||
<tr><td>abc 9</td><td>abc 9</td><td>10</td><td>Girafee</td><td>http://www.facebook.com</td></tr>
|
||||
<tr><td>zyx 24</td><td>zyx 24</td><td>67</td><td>Bison</td><td>http://www.whitehouse.gov/</td></tr>
|
||||
<tr><td>abc 11</td><td>abc 11</td><td>3</td><td>Chimp</td><td>http://www.ucla.edu/</td></tr>
|
||||
<tr><td>abc 2</td><td>abc 2</td><td>56</td><td>Elephant</td><td>http://www.wikipedia.org/</td></tr>
|
||||
<tr><td>abc 9</td><td>abc 9</td><td>75</td><td>Lion</td><td>http://www.nytimes.com/</td></tr>
|
||||
<tr><td>abc 10</td><td>abc 10</td><td>87</td><td>Zebra</td><td>http://www.google.com</td></tr>
|
||||
<tr><td>zyx 1</td><td>zyx 1</td><td>99</td><td>Koala</td><td>http://www.mit.edu/</td></tr>
|
||||
<tr><td>zyx 12</td><td>zyx 12</td><td>0</td><td>Llama</td><td>http://www.nasa.gov/</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<h1>HTML</h1>
|
||||
<div>
|
||||
<pre class="prettyprint lang-html"><table id="external_controls">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="select2">filters: </td>
|
||||
<td class="select2tag"></td>
|
||||
<td>
|
||||
<input type="search" placeholder="num" />
|
||||
</td>
|
||||
<td>
|
||||
<input type="search" placeholder="anim" />
|
||||
</td>
|
||||
<td>
|
||||
<input type="search" placeholder="sites" />
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table></pre>
|
||||
</div>
|
||||
|
||||
<h1>Javascript</h1>
|
||||
<div id="javascript">
|
||||
<pre class="prettyprint lang-javascript"></pre>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
1199
assets/vendor/tablesorter/beta-testing/example-pager-custom-controls.html
vendored
Normal file
1199
assets/vendor/tablesorter/beta-testing/example-pager-custom-controls.html
vendored
Normal file
File diff suppressed because it is too large
Load Diff
192
assets/vendor/tablesorter/beta-testing/example-widget-column-reorder.html
vendored
Normal file
192
assets/vendor/tablesorter/beta-testing/example-widget-column-reorder.html
vendored
Normal file
@@ -0,0 +1,192 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>jQuery plugin: Tablesorter 2.0 - Column reorder Widget</title>
|
||||
|
||||
<!-- jQuery -->
|
||||
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.js"></script>
|
||||
|
||||
<!-- Demo stuff -->
|
||||
<link rel="stylesheet" href="../docs/css/jq.css">
|
||||
<link href="../docs/css/prettify.css" rel="stylesheet">
|
||||
<script src="../docs/js/prettify.js"></script>
|
||||
<script src="../docs/js/docs.js"></script>
|
||||
|
||||
<!-- Tablesorter: theme -->
|
||||
<link class="theme" rel="stylesheet" href="../css/theme.blue.css">
|
||||
|
||||
<style id="css">.tablesorter-header.tablesorter-reorder-helper {
|
||||
cursor: move;
|
||||
}
|
||||
.tablesorter-reorder-helper-bar {
|
||||
width: 1px;
|
||||
background: #000;
|
||||
}</style>
|
||||
|
||||
<!-- Tablesorter script: required -->
|
||||
<script src="../js/jquery.tablesorter.js"></script>
|
||||
<script src="../js/jquery.tablesorter.widgets.js"></script>
|
||||
|
||||
<script src="widget-reorder.js"></script>
|
||||
|
||||
<script id="js">$(function(){
|
||||
|
||||
$("table").tablesorter({
|
||||
theme : 'blue',
|
||||
widthFixed : true,
|
||||
widgets: [ 'reorder', 'zebra', 'stickyHeaders', 'filter' ],
|
||||
widgetOptions: {
|
||||
reorder_axis : 'x', // 'x' or 'xy'
|
||||
reorder_delay : 300,
|
||||
reorder_helperClass : 'tablesorter-reorder-helper',
|
||||
reorder_helperBar : 'tablesorter-reorder-helper-bar',
|
||||
reorder_noReorder : 'reorder-false',
|
||||
reorder_blocked : 'reorder-block-left reorder-block-end',
|
||||
reorder_complete : null // callback
|
||||
}
|
||||
});
|
||||
|
||||
}); </script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="banner">
|
||||
<h1>table<em>sorter</em></h1>
|
||||
<h2>Sticky Header Widget</h2>
|
||||
<h3>Flexible client-side table sorting</h3>
|
||||
<a href="index.html">Back to documentation</a>
|
||||
</div>
|
||||
|
||||
<div id="main">
|
||||
|
||||
<p class="tip">
|
||||
<em>NOTE!</em>
|
||||
<ul>
|
||||
<li>Column reorder - beta testing.</li>
|
||||
<li>Does not yet work properly with sticky headers - reorder second table while top table sticky header is active, then scroll...</li>
|
||||
</ul>
|
||||
</p>
|
||||
|
||||
<h1>Javascript</h1>
|
||||
<div id="javascript">
|
||||
<pre class="prettyprint lang-javascript"></pre>
|
||||
</div>
|
||||
|
||||
<h1>CSS</h1>
|
||||
<div id="css">
|
||||
<pre class="prettyprint lang-css"></pre>
|
||||
</div>
|
||||
|
||||
<h1>Demo</h1>
|
||||
|
||||
<table class="tablesorter">
|
||||
<caption>Student Grades</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="reorder-false reorder-block-left">Name (0)</th>
|
||||
<th>Major (1)</th>
|
||||
<th>Sex (2)</th>
|
||||
<th>English (3)</th>
|
||||
<th>Japanese (4)</th>
|
||||
<th>Calculus (5)</th>
|
||||
<th class="reorder-block-end">Geometry (6)</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tfoot>
|
||||
<tr><th>Name</th><th>Major</th><th>Sex</th><th>English</th><th>Japanese</th><th>Calculus</th><th>Geometry</th></tr>
|
||||
</tfoot>
|
||||
<tbody>
|
||||
<tr><td>Student01 (0)</td><td>Languages (1)</td><td>male (2)</td><td>80 (3)</td><td>70 (4)</td><td>75 (5)</td><td>80 (6)</td></tr>
|
||||
<tr><td>Student02</td><td>Mathematics</td><td>male</td><td>90</td><td>88</td><td>100</td><td>90</td></tr>
|
||||
<tr><td>Student03</td><td>Languages</td><td>female</td><td>85</td><td>95</td><td>80</td><td>85</td></tr>
|
||||
<tr><td>Student04</td><td>Languages</td><td>male</td><td>60</td><td>55</td><td>100</td><td>100</td></tr>
|
||||
<tr><td>Student05</td><td>Languages</td><td>female</td><td>68</td><td>80</td><td>95</td><td>80</td></tr>
|
||||
<tr><td>Student06</td><td>Mathematics</td><td>male</td><td>100</td><td>99</td><td>100</td><td>90</td></tr>
|
||||
<tr><td>Student07</td><td>Mathematics</td><td>male</td><td>85</td><td>68</td><td>90</td><td>90</td></tr>
|
||||
<tr><td>Student08</td><td>Languages</td><td>male</td><td>100</td><td>90</td><td>90</td><td>85</td></tr>
|
||||
<tr><td>Student09</td><td>Mathematics</td><td>male</td><td>80</td><td>50</td><td>65</td><td>75</td></tr>
|
||||
<tr><td>Student10</td><td>Languages</td><td>male</td><td>85</td><td>100</td><td>100</td><td>90</td></tr>
|
||||
<tr><td>Student11</td><td>Languages</td><td>male</td><td>86</td><td>85</td><td>100</td><td>100</td></tr>
|
||||
<tr><td>Student12</td><td>Mathematics</td><td>female</td><td>100</td><td>75</td><td>70</td><td>85</td></tr>
|
||||
<tr><td>Student13</td><td>Languages</td><td>female</td><td>100</td><td>80</td><td>100</td><td>90</td></tr>
|
||||
<tr><td>Student14</td><td>Languages</td><td>female</td><td>50</td><td>45</td><td>55</td><td>90</td></tr>
|
||||
<tr><td>Student15</td><td>Languages</td><td>male</td><td>95</td><td>35</td><td>100</td><td>90</td></tr>
|
||||
<tr><td>Student16</td><td>Languages</td><td>female</td><td>100</td><td>50</td><td>30</td><td>70</td></tr>
|
||||
<tr><td>Student17</td><td>Languages</td><td>female</td><td>80</td><td>100</td><td>55</td><td>65</td></tr>
|
||||
<tr><td>Student18</td><td>Mathematics</td><td>male</td><td>30</td><td>49</td><td>55</td><td>75</td></tr>
|
||||
<tr><td>Student19</td><td>Languages</td><td>male</td><td>68</td><td>90</td><td>88</td><td>70</td></tr>
|
||||
<tr><td>Student20</td><td>Mathematics</td><td>male</td><td>40</td><td>45</td><td>40</td><td>80</td></tr>
|
||||
<tr><td>Student21</td><td>Languages</td><td>male</td><td>50</td><td>45</td><td>100</td><td>100</td></tr>
|
||||
<tr><td>Student22</td><td>Mathematics</td><td>male</td><td>100</td><td>99</td><td>100</td><td>90</td></tr>
|
||||
<tr><td>Student23</td><td>Languages</td><td>female</td><td>85</td><td>80</td><td>80</td><td>80</td></tr>
|
||||
<!--
|
||||
<tr><td>student23</td><td>Mathematics</td><td>male</td><td>82</td><td>77</td><td>0</td><td>79</td></tr>
|
||||
<tr><td>student24</td><td>Languages</td><td>female</td><td>100</td><td>91</td><td>13</td><td>82</td></tr>
|
||||
<tr><td>student25</td><td>Mathematics</td><td>male</td><td>22</td><td>96</td><td>82</td><td>53</td></tr>
|
||||
<tr><td>student26</td><td>Languages</td><td>female</td><td>37</td><td>29</td><td>56</td><td>59</td></tr>
|
||||
<tr><td>student27</td><td>Mathematics</td><td>male</td><td>86</td><td>82</td><td>69</td><td>23</td></tr>
|
||||
<tr><td>student28</td><td>Languages</td><td>female</td><td>44</td><td>25</td><td>43</td><td>1</td></tr>
|
||||
<tr><td>student29</td><td>Mathematics</td><td>male</td><td>77</td><td>47</td><td>22</td><td>38</td></tr>
|
||||
<tr><td>student30</td><td>Languages</td><td>female</td><td>19</td><td>35</td><td>23</td><td>10</td></tr>
|
||||
<tr><td>student31</td><td>Mathematics</td><td>male</td><td>90</td><td>27</td><td>17</td><td>50</td></tr>
|
||||
<tr><td>student32</td><td>Languages</td><td>female</td><td>60</td><td>75</td><td>33</td><td>38</td></tr>
|
||||
<tr><td>student33</td><td>Mathematics</td><td>male</td><td>4</td><td>31</td><td>37</td><td>15</td></tr>
|
||||
<tr><td>student34</td><td>Languages</td><td>female</td><td>77</td><td>97</td><td>81</td><td>44</td></tr>
|
||||
<tr><td>student35</td><td>Mathematics</td><td>male</td><td>5</td><td>81</td><td>51</td><td>95</td></tr>
|
||||
<tr><td>student36</td><td>Languages</td><td>female</td><td>70</td><td>61</td><td>70</td><td>94</td></tr>
|
||||
<tr><td>student37</td><td>Mathematics</td><td>male</td><td>60</td><td>3</td><td>61</td><td>84</td></tr>
|
||||
<tr><td>student38</td><td>Languages</td><td>female</td><td>63</td><td>39</td><td>0</td><td>11</td></tr>
|
||||
<tr><td>student39</td><td>Mathematics</td><td>male</td><td>50</td><td>46</td><td>32</td><td>38</td></tr>
|
||||
<tr><td>student40</td><td>Languages</td><td>female</td><td>51</td><td>75</td><td>25</td><td>3</td></tr>
|
||||
<tr><td>student41</td><td>Mathematics</td><td>male</td><td>43</td><td>34</td><td>28</td><td>78</td></tr>
|
||||
<tr><td>student42</td><td>Languages</td><td>female</td><td>11</td><td>89</td><td>60</td><td>95</td></tr>
|
||||
<tr><td>student43</td><td>Mathematics</td><td>male</td><td>48</td><td>92</td><td>18</td><td>88</td></tr>
|
||||
<tr><td>student44</td><td>Languages</td><td>female</td><td>82</td><td>2</td><td>59</td><td>73</td></tr>
|
||||
<tr><td>student45</td><td>Mathematics</td><td>male</td><td>91</td><td>73</td><td>37</td><td>39</td></tr>
|
||||
<tr><td>student46</td><td>Languages</td><td>female</td><td>4</td><td>8</td><td>12</td><td>10</td></tr>
|
||||
<tr><td>student47</td><td>Mathematics</td><td>male</td><td>89</td><td>10</td><td>6</td><td>11</td></tr>
|
||||
<tr><td>student48</td><td>Languages</td><td>female</td><td>90</td><td>32</td><td>21</td><td>18</td></tr>
|
||||
<tr><td>student49</td><td>Mathematics</td><td>male</td><td>42</td><td>49</td><td>49</td><td>72</td></tr>
|
||||
<tr><td>student50</td><td>Languages</td><td>female</td><td>56</td><td>37</td><td>67</td><td>54</td></tr>
|
||||
-->
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div class="narrow-block">
|
||||
<table class="tablesorter">
|
||||
<thead>
|
||||
<tr><th>Account #</th><th>First Name</th><th>Last Name</th><th>Age</th><th>Total</th><th>Discount</th><th>Diff</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr><td>A43</td><td>Peter</td><td>Parker</td><td>28</td><td>9.99</td><td>20.3%</td><td>+3</td></tr>
|
||||
<tr><td>A255</td><td>John</td><td>Hood</td><td>33</td><td>19.99</td><td>25.1%</td><td>-7</td></tr>
|
||||
<tr><td>A33</td><td>Clark</td><td>Kent</td><td>18</td><td>15.49</td><td>44.2%</td><td>-13</td></tr>
|
||||
<tr><td>A11</td><td>Bruce</td><td>Almighty</td><td>45</td><td>153.19</td><td>44%</td><td>+19</td></tr>
|
||||
<tr><td>A102</td><td>Bruce</td><td>Evans</td><td>56</td><td>153.19</td><td>23%</td><td>+9</td></tr>
|
||||
<tr><td>A23</td><td>Mike</td><td>Peters</td><td>22</td><td>5.69</td><td>20.3%</td><td>+2</td></tr>
|
||||
<tr><td>A55</td><td>Leslie</td><td>Kent</td><td>33</td><td>15.99</td><td>25.1%</td><td>-3</td></tr>
|
||||
<tr><td>A3</td><td>Frank</td><td>Mint</td><td>44</td><td>12.59</td><td>44.2%</td><td>-12</td></tr>
|
||||
<tr><td>A21</td><td>Joe</td><td>Thomas</td><td>45</td><td>15.25</td><td>44%</td><td>+12</td></tr>
|
||||
<tr><td>A12</td><td>Tess</td><td>Evans</td><td>66</td><td>13.59</td><td>23%</td><td>+4</td></tr>
|
||||
<tr><td>A21</td><td>Peter</td><td>Dunn</td><td>12</td><td>2.99</td><td>21.1%</td><td>+2</td></tr>
|
||||
<tr><td>A33</td><td>Harry</td><td>Jones</td><td>13</td><td>19.49</td><td>22.2%</td><td>-6</td></tr>
|
||||
<tr><td>A13</td><td>John</td><td>James</td><td>16</td><td>13.89</td><td>42.1%</td><td>-13</td></tr>
|
||||
<tr><td>A71</td><td>Nick</td><td>Parker</td><td>45</td><td>13.89</td><td>44%</td><td>+29</td></tr>
|
||||
<tr><td>A21</td><td>Charles</td><td>Dunn</td><td>19</td><td>15.49</td><td>22%</td><td>+3</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="spacer"></div>
|
||||
<div class="next-up">
|
||||
<hr />
|
||||
Next up: <a href="example-widget-zebra.html">Zebra stripe widget ››</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
247
assets/vendor/tablesorter/beta-testing/example-widget-sum-columns.html
vendored
Normal file
247
assets/vendor/tablesorter/beta-testing/example-widget-sum-columns.html
vendored
Normal file
@@ -0,0 +1,247 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>jQuery plugin: Tablesorter 2.0 - Column Math Widget</title>
|
||||
|
||||
<!-- jQuery -->
|
||||
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8/jquery.min.js"></script>
|
||||
|
||||
<!-- Demo stuff -->
|
||||
<link rel="stylesheet" href="../docs/css/jq.css">
|
||||
<link href="../docs/css/prettify.css" rel="stylesheet">
|
||||
<script src="../docs/js/prettify.js"></script>
|
||||
<script src="../docs/js/docs.js"></script>
|
||||
|
||||
<!-- Tablesorter: required -->
|
||||
<link rel="stylesheet" href="../css/theme.blue.css">
|
||||
<script src="../js/jquery.tablesorter.js"></script>
|
||||
|
||||
<script src="widget-column-math.js"></script>
|
||||
|
||||
<style>
|
||||
.align-decimal { width: 85px; text-align: right; }
|
||||
</style>
|
||||
|
||||
<script id="js">$(function() {
|
||||
|
||||
// call the tablesorter plugin and assign widgets with id "zebra" (Default widget in the core) and the newly created "repeatHeaders"
|
||||
$("table").tablesorter({
|
||||
theme: 'blue',
|
||||
widgets: ['zebra', 'column-math'],
|
||||
widgetOptions: {
|
||||
columnMath_data : 'math', // data-math attribute
|
||||
columnMath_format : {
|
||||
// would prefer to just use a formatting mask instead of all these options, something like: "$ #,###.00"
|
||||
output_prefix : '$ ',
|
||||
output_suffix : '',
|
||||
thousands_separator : ',',
|
||||
thousands_grouping : 3,
|
||||
decimal_separator : '.',
|
||||
decimal_places : 2,
|
||||
format_complete : null // function(number, $cell){ return number; }
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
});</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="banner">
|
||||
<h1>table<em>sorter</em></h1>
|
||||
<h2>Column Math Widget</h2>
|
||||
<h3>Flexible client-side table sorting</h3>
|
||||
<a href="index.html">Back to documentation</a>
|
||||
</div>
|
||||
|
||||
<div id="main">
|
||||
|
||||
<p class="tip">
|
||||
<em>NOTE!</em>
|
||||
<ul>
|
||||
<li>This is an attempt to generalize <a href="http://jsfiddle.net/Mottie/vCTHw/729/">this demo</a>.</li>
|
||||
<li>It still needs a LOT of work (incomplete functionality).</li>
|
||||
</ul>
|
||||
</p>
|
||||
|
||||
<h1>Demo</h1>
|
||||
|
||||
<div id="demo"><table class="sortable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="sorter-false">Region</th>
|
||||
<th>Salesman</th>
|
||||
<th>FastCar</th>
|
||||
<th>RapidZoo</th>
|
||||
<th>SuperGlue</th>
|
||||
<th>Grand Total</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="2">Column Totals</td>
|
||||
<td data-math="sumcol"></td>
|
||||
<td data-math="sumcol"></td>
|
||||
<td data-math="sumcol"></td>
|
||||
<td data-math="sumcol" data-math-target="[data-math]"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="5">Grand Total</td>
|
||||
<td data-math="sumall"></td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="block">Middle</td>
|
||||
<td>Joseph</td>
|
||||
<td>$ 3,623</td>
|
||||
<td>$ 4,782</td>
|
||||
<td>$ 7,055</td>
|
||||
<td data-math="sumrow"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="block">Middle</td>
|
||||
<td>Lawrence</td>
|
||||
<td>$ 5,908</td>
|
||||
<td>$ 4,642</td>
|
||||
<td>$ 4,593</td>
|
||||
<td data-math="sumrow"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="block">Middle</td>
|
||||
<td>Maria</td>
|
||||
<td>$ 6,502</td>
|
||||
<td>$ 3,969</td>
|
||||
<td>$ 5,408</td>
|
||||
<td data-math="sumrow"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="block">Middle</td>
|
||||
<td>Matt</td>
|
||||
<td>$ 4,170</td>
|
||||
<td>$ 6,093</td>
|
||||
<td>$ 5,039</td>
|
||||
<td data-math="sumrow"></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
<tbody class="tablesorter-infoOnly">
|
||||
<tr>
|
||||
<td colspan="2">Middle Total</td>
|
||||
<td data-math="sumabove"></td>
|
||||
<td data-math="sumabove"></td>
|
||||
<td data-math="sumabove"></td>
|
||||
<td data-math="sumabove" data-math-target="[data-math]"></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="block">North</td>
|
||||
<td>Joseph</td>
|
||||
<td>$ 3,643</td>
|
||||
<td>$ 5,846</td>
|
||||
<td>$ 6,574</td>
|
||||
<td data-math="sumrow"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="block">North</td>
|
||||
<td>Lawrence</td>
|
||||
<td>$ 4,456</td>
|
||||
<td>$ 6,658</td>
|
||||
<td>$ 7,685</td>
|
||||
<td data-math="sumrow"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="block">North</td>
|
||||
<td>Maria</td>
|
||||
<td>$ 6,235</td>
|
||||
<td>$ 4,616.99</td>
|
||||
<td>$ 3,612.33</td>
|
||||
<td data-math="sumrow"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="block">North</td>
|
||||
<td>Matt</td>
|
||||
<td>$ 3,868</td>
|
||||
<td>$ 3,926</td>
|
||||
<td>$ 3,254</td>
|
||||
<td data-math="sumrow"></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
<tbody class="tablesorter-infoOnly">
|
||||
<tr>
|
||||
<td colspan="2">North Total</td>
|
||||
<td data-math="sumabove"></td>
|
||||
<td data-math="sumabove"></td>
|
||||
<td data-math="sumabove"></td>
|
||||
<td data-math="sumabove" data-math-target="[data-math]"></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="block">West</td>
|
||||
<td>Joseph</td>
|
||||
<td>$ 5,507</td>
|
||||
<td>$ 5,186</td>
|
||||
<td>$ 4,882</td>
|
||||
<td data-math="sumrow"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="block">West</td>
|
||||
<td>Lawrence</td>
|
||||
<td>$ 4,082</td>
|
||||
<td>$ 5,272</td>
|
||||
<td>$ 6,124</td>
|
||||
<td data-math="sumrow"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="block">West</td>
|
||||
<td>Maria</td>
|
||||
<td>$ 5,520</td>
|
||||
<td>$ 5,461</td>
|
||||
<td>$ 4,872</td>
|
||||
<td data-math="sumrow"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="block">West</td>
|
||||
<td>Matt</td>
|
||||
<td>$ 6,737</td>
|
||||
<td>$ 4,598</td>
|
||||
<td>$ 4,233</td>
|
||||
<td data-math="sumrow"></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
<tbody class="tablesorter-infoOnly">
|
||||
<tr>
|
||||
<td colspan="2">West Total</td>
|
||||
<td data-math="sumabove"></td>
|
||||
<td data-math="sumabove"></td>
|
||||
<td data-math="sumabove"></td>
|
||||
<td data-math="sumabove" data-math-target="[data-math]"></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
</table></div>
|
||||
|
||||
<h1>Javascript</h1>
|
||||
|
||||
<div id="javascript">
|
||||
<pre class="prettyprint lang-javascript"></pre>
|
||||
</div>
|
||||
|
||||
<h1>HTML</h1>
|
||||
<div id="html">
|
||||
<pre class="prettyprint lang-html"></pre>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
98
assets/vendor/tablesorter/beta-testing/pager-custom-controls.js
vendored
Normal file
98
assets/vendor/tablesorter/beta-testing/pager-custom-controls.js
vendored
Normal file
@@ -0,0 +1,98 @@
|
||||
/*!
|
||||
* custom pager controls - beta testing
|
||||
initialize custom pager script BEFORE initializing tablesorter/tablesorter pager
|
||||
custom pager looks like this:
|
||||
1 | 2 … 5 | 6 | 7 … 99 | 100
|
||||
_ _ _ _ adjacentSpacer
|
||||
_ _ distanceSpacer
|
||||
_____ ________ ends (2 default)
|
||||
_________ aroundCurrent (1 default)
|
||||
|
||||
*/
|
||||
/*jshint browser:true, jquery:true, unused:false, loopfunc:true */
|
||||
/*global jQuery: false */
|
||||
|
||||
;(function($){
|
||||
"use strict";
|
||||
|
||||
$.tablesorter = $.tablesorter || {};
|
||||
|
||||
$.tablesorter.customPagerControls = function(settings) {
|
||||
var defaults = {
|
||||
table : 'table',
|
||||
pager : '.pager',
|
||||
pageSize : '.left a',
|
||||
currentPage : '.right a',
|
||||
ends : 2, // number of pages to show of either end
|
||||
aroundCurrent : 1, // number of pages surrounding the current page
|
||||
link : '<a href="#">{page}</a>', // page element; use {page} to include the page number
|
||||
currentClass : 'current', // current page class name
|
||||
adjacentSpacer : ' | ', // spacer for page numbers next to each other
|
||||
distanceSpacer : ' … ', // spacer for page numbers away from each other (ellipsis)
|
||||
addKeyboard : true // add left/right keyboard arrows to change current page
|
||||
},
|
||||
options = $.extend({}, defaults, settings),
|
||||
$table = $(options.table);
|
||||
|
||||
$table
|
||||
.on('pagerInitialized pagerComplete', function (e, c) {
|
||||
var indx, pages = $('<div/>'), pageArray = [],
|
||||
cur = c.page + 1,
|
||||
start = cur > 1 ? (c.totalPages - cur < options.aroundCurrent ? -(options.aroundCurrent + 1) + (c.totalPages - cur) : -options.aroundCurrent) : 0,
|
||||
end = cur < options.aroundCurrent + 1 ? options.aroundCurrent + 3 - cur : options.aroundCurrent + 1;
|
||||
for (indx = start; indx < end; indx++) {
|
||||
if (cur + indx >= 1 && cur + indx < c.totalPages) { pageArray.push( cur + indx ); }
|
||||
}
|
||||
if (pageArray.length) {
|
||||
// include first and last pages (ends) in the pagination
|
||||
for (indx = 0; indx < options.ends; indx++){
|
||||
if ($.inArray(indx + 1, pageArray) === -1) { pageArray.push(indx + 1); }
|
||||
if ($.inArray(c.totalPages - indx, pageArray) === -1) { pageArray.push(c.totalPages - indx); }
|
||||
}
|
||||
// sort the list
|
||||
pageArray = pageArray.sort(function(a, b){ return a - b; });
|
||||
// make links and spacers
|
||||
$.each(pageArray, function(indx, value){
|
||||
pages
|
||||
.append( $(options.link.replace(/\{page\}/g, value)).toggleClass(options.currentClass, value === cur).attr('data-page', value) )
|
||||
.append( '<span>' + (indx < pageArray.length - 1 && ( pageArray[ indx + 1 ] - 1 !== value ) ? options.distanceSpacer :
|
||||
( indx >= pageArray.length - 1 ? '' : options.adjacentSpacer )) + '</span>' );
|
||||
});
|
||||
}
|
||||
$('.pagecount').html(pages.html());
|
||||
});
|
||||
|
||||
// set up pager controls
|
||||
$(options.pager).find(options.pageSize).on('click', function () {
|
||||
$(this)
|
||||
.addClass(options.currentClass)
|
||||
.siblings()
|
||||
.removeClass(options.currentClass);
|
||||
$table.trigger('pageSize', $(this).html());
|
||||
return false;
|
||||
}).end()
|
||||
.on('click', options.currentPage, function(){
|
||||
$(this)
|
||||
.addClass(options.currentClass)
|
||||
.siblings()
|
||||
.removeClass(options.currentClass);
|
||||
$table.trigger('pageSet', $(this).attr('data-page'));
|
||||
return false;
|
||||
});
|
||||
|
||||
// make right/left arrow keys work
|
||||
if (options.addKeyboard) {
|
||||
$(document).on('keydown', function(events){
|
||||
// ignore arrows inside form elements
|
||||
if (/input|select|textarea/i.test(events.target.tagName)) { return; }
|
||||
if (events.which === 37) {
|
||||
// left
|
||||
$(options.pager).find(options.currentPage).filter('.' + options.currentClass).prevAll(':not(span):first').click();
|
||||
} else if (events.which === 39) {
|
||||
// right
|
||||
$(options.pager).find(options.currentPage).filter('.' + options.currentClass).nextAll(':not(span):first').click();
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
})(jQuery);
|
BIN
assets/vendor/tablesorter/beta-testing/select2-spinner.gif
vendored
Normal file
BIN
assets/vendor/tablesorter/beta-testing/select2-spinner.gif
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.8 KiB |
652
assets/vendor/tablesorter/beta-testing/select2.css
vendored
Normal file
652
assets/vendor/tablesorter/beta-testing/select2.css
vendored
Normal file
@@ -0,0 +1,652 @@
|
||||
/*
|
||||
Version: @@ver@@ Timestamp: @@timestamp@@
|
||||
*/
|
||||
.select2-container {
|
||||
margin: 0;
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
/* inline-block for ie7 */
|
||||
zoom: 1;
|
||||
*display: inline;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.select2-container,
|
||||
.select2-drop,
|
||||
.select2-search,
|
||||
.select2-search input{
|
||||
/*
|
||||
Force border-box so that % widths fit the parent
|
||||
container without overlap because of margin/padding.
|
||||
|
||||
More Info : http://www.quirksmode.org/css/box.html
|
||||
*/
|
||||
-webkit-box-sizing: border-box; /* webkit */
|
||||
-khtml-box-sizing: border-box; /* konqueror */
|
||||
-moz-box-sizing: border-box; /* firefox */
|
||||
-ms-box-sizing: border-box; /* ie */
|
||||
box-sizing: border-box; /* css3 */
|
||||
}
|
||||
|
||||
.select2-container .select2-choice {
|
||||
display: block;
|
||||
height: 26px;
|
||||
padding: 0 0 0 8px;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
|
||||
border: 1px solid #aaa;
|
||||
white-space: nowrap;
|
||||
line-height: 26px;
|
||||
color: #444;
|
||||
text-decoration: none;
|
||||
|
||||
-webkit-border-radius: 4px;
|
||||
-moz-border-radius: 4px;
|
||||
border-radius: 4px;
|
||||
|
||||
-webkit-background-clip: padding-box;
|
||||
-moz-background-clip: padding;
|
||||
background-clip: padding-box;
|
||||
|
||||
-webkit-touch-callout: none;
|
||||
-webkit-user-select: none;
|
||||
-khtml-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
|
||||
background-color: #fff;
|
||||
background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #eeeeee), color-stop(0.5, white));
|
||||
background-image: -webkit-linear-gradient(center bottom, #eeeeee 0%, white 50%);
|
||||
background-image: -moz-linear-gradient(center bottom, #eeeeee 0%, white 50%);
|
||||
background-image: -o-linear-gradient(bottom, #eeeeee 0%, #ffffff 50%);
|
||||
background-image: -ms-linear-gradient(top, #ffffff 0%, #eeeeee 50%);
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr = '#ffffff', endColorstr = '#eeeeee', GradientType = 0);
|
||||
background-image: linear-gradient(top, #ffffff 0%, #eeeeee 50%);
|
||||
}
|
||||
|
||||
.select2-container.select2-drop-above .select2-choice {
|
||||
border-bottom-color: #aaa;
|
||||
|
||||
-webkit-border-radius:0 0 4px 4px;
|
||||
-moz-border-radius:0 0 4px 4px;
|
||||
border-radius:0 0 4px 4px;
|
||||
|
||||
background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #eeeeee), color-stop(0.9, white));
|
||||
background-image: -webkit-linear-gradient(center bottom, #eeeeee 0%, white 90%);
|
||||
background-image: -moz-linear-gradient(center bottom, #eeeeee 0%, white 90%);
|
||||
background-image: -o-linear-gradient(bottom, #eeeeee 0%, white 90%);
|
||||
background-image: -ms-linear-gradient(top, #eeeeee 0%,#ffffff 90%);
|
||||
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#eeeeee',GradientType=0 );
|
||||
background-image: linear-gradient(top, #eeeeee 0%,#ffffff 90%);
|
||||
}
|
||||
|
||||
.select2-container.select2-allowclear .select2-choice span {
|
||||
margin-right: 42px;
|
||||
}
|
||||
|
||||
.select2-container .select2-choice span {
|
||||
margin-right: 26px;
|
||||
display: block;
|
||||
overflow: hidden;
|
||||
|
||||
white-space: nowrap;
|
||||
|
||||
-ms-text-overflow: ellipsis;
|
||||
-o-text-overflow: ellipsis;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.select2-container .select2-choice abbr {
|
||||
display: none;
|
||||
width: 12px;
|
||||
height: 12px;
|
||||
position: absolute;
|
||||
right: 24px;
|
||||
top: 8px;
|
||||
|
||||
font-size: 1px;
|
||||
text-decoration: none;
|
||||
|
||||
border: 0;
|
||||
background: url('select2.png') right top no-repeat;
|
||||
cursor: pointer;
|
||||
outline: 0;
|
||||
}
|
||||
|
||||
.select2-container.select2-allowclear .select2-choice abbr {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.select2-container .select2-choice abbr:hover {
|
||||
background-position: right -11px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.select2-drop-mask {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
z-index: 9998;
|
||||
}
|
||||
|
||||
.select2-drop {
|
||||
width: 100%;
|
||||
margin-top:-1px;
|
||||
position: absolute;
|
||||
z-index: 9999;
|
||||
top: 100%;
|
||||
|
||||
background: #fff;
|
||||
color: #000;
|
||||
border: 1px solid #aaa;
|
||||
border-top: 0;
|
||||
|
||||
-webkit-border-radius: 0 0 4px 4px;
|
||||
-moz-border-radius: 0 0 4px 4px;
|
||||
border-radius: 0 0 4px 4px;
|
||||
|
||||
-webkit-box-shadow: 0 4px 5px rgba(0, 0, 0, .15);
|
||||
-moz-box-shadow: 0 4px 5px rgba(0, 0, 0, .15);
|
||||
box-shadow: 0 4px 5px rgba(0, 0, 0, .15);
|
||||
}
|
||||
|
||||
.select2-drop-auto-width {
|
||||
border-top: 1px solid #aaa;
|
||||
width: auto;
|
||||
}
|
||||
|
||||
.select2-drop-auto-width .select2-search {
|
||||
padding-top: 4px;
|
||||
}
|
||||
|
||||
.select2-drop.select2-drop-above {
|
||||
margin-top: 1px;
|
||||
border-top: 1px solid #aaa;
|
||||
border-bottom: 0;
|
||||
|
||||
-webkit-border-radius: 4px 4px 0 0;
|
||||
-moz-border-radius: 4px 4px 0 0;
|
||||
border-radius: 4px 4px 0 0;
|
||||
|
||||
-webkit-box-shadow: 0 -4px 5px rgba(0, 0, 0, .15);
|
||||
-moz-box-shadow: 0 -4px 5px rgba(0, 0, 0, .15);
|
||||
box-shadow: 0 -4px 5px rgba(0, 0, 0, .15);
|
||||
}
|
||||
|
||||
.select2-container .select2-choice div {
|
||||
display: inline-block;
|
||||
width: 18px;
|
||||
height: 100%;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 0;
|
||||
|
||||
border-left: 1px solid #aaa;
|
||||
-webkit-border-radius: 0 4px 4px 0;
|
||||
-moz-border-radius: 0 4px 4px 0;
|
||||
border-radius: 0 4px 4px 0;
|
||||
|
||||
-webkit-background-clip: padding-box;
|
||||
-moz-background-clip: padding;
|
||||
background-clip: padding-box;
|
||||
|
||||
background: #ccc;
|
||||
background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #ccc), color-stop(0.6, #eee));
|
||||
background-image: -webkit-linear-gradient(center bottom, #ccc 0%, #eee 60%);
|
||||
background-image: -moz-linear-gradient(center bottom, #ccc 0%, #eee 60%);
|
||||
background-image: -o-linear-gradient(bottom, #ccc 0%, #eee 60%);
|
||||
background-image: -ms-linear-gradient(top, #cccccc 0%, #eeeeee 60%);
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr = '#eeeeee', endColorstr = '#cccccc', GradientType = 0);
|
||||
background-image: linear-gradient(top, #cccccc 0%, #eeeeee 60%);
|
||||
}
|
||||
|
||||
.select2-container .select2-choice div b {
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: url('select2.png') no-repeat 0 1px;
|
||||
}
|
||||
|
||||
.select2-search {
|
||||
display: inline-block;
|
||||
width: 100%;
|
||||
min-height: 26px;
|
||||
margin: 0;
|
||||
padding-left: 4px;
|
||||
padding-right: 4px;
|
||||
|
||||
position: relative;
|
||||
z-index: 10000;
|
||||
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.select2-search input {
|
||||
width: 100%;
|
||||
height: auto !important;
|
||||
min-height: 26px;
|
||||
padding: 4px 20px 4px 5px;
|
||||
margin: 0;
|
||||
|
||||
outline: 0;
|
||||
font-family: sans-serif;
|
||||
font-size: 1em;
|
||||
|
||||
border: 1px solid #aaa;
|
||||
-webkit-border-radius: 0;
|
||||
-moz-border-radius: 0;
|
||||
border-radius: 0;
|
||||
|
||||
-webkit-box-shadow: none;
|
||||
-moz-box-shadow: none;
|
||||
box-shadow: none;
|
||||
|
||||
background: #fff url('select2.png') no-repeat 100% -22px;
|
||||
background: url('select2.png') no-repeat 100% -22px, -webkit-gradient(linear, left bottom, left top, color-stop(0.85, white), color-stop(0.99, #eeeeee));
|
||||
background: url('select2.png') no-repeat 100% -22px, -webkit-linear-gradient(center bottom, white 85%, #eeeeee 99%);
|
||||
background: url('select2.png') no-repeat 100% -22px, -moz-linear-gradient(center bottom, white 85%, #eeeeee 99%);
|
||||
background: url('select2.png') no-repeat 100% -22px, -o-linear-gradient(bottom, white 85%, #eeeeee 99%);
|
||||
background: url('select2.png') no-repeat 100% -22px, -ms-linear-gradient(top, #ffffff 85%, #eeeeee 99%);
|
||||
background: url('select2.png') no-repeat 100% -22px, linear-gradient(top, #ffffff 85%, #eeeeee 99%);
|
||||
}
|
||||
|
||||
.select2-drop.select2-drop-above .select2-search input {
|
||||
margin-top: 4px;
|
||||
}
|
||||
|
||||
.select2-search input.select2-active {
|
||||
background: #fff url('select2-spinner.gif') no-repeat 100%;
|
||||
background: url('select2-spinner.gif') no-repeat 100%, -webkit-gradient(linear, left bottom, left top, color-stop(0.85, white), color-stop(0.99, #eeeeee));
|
||||
background: url('select2-spinner.gif') no-repeat 100%, -webkit-linear-gradient(center bottom, white 85%, #eeeeee 99%);
|
||||
background: url('select2-spinner.gif') no-repeat 100%, -moz-linear-gradient(center bottom, white 85%, #eeeeee 99%);
|
||||
background: url('select2-spinner.gif') no-repeat 100%, -o-linear-gradient(bottom, white 85%, #eeeeee 99%);
|
||||
background: url('select2-spinner.gif') no-repeat 100%, -ms-linear-gradient(top, #ffffff 85%, #eeeeee 99%);
|
||||
background: url('select2-spinner.gif') no-repeat 100%, linear-gradient(top, #ffffff 85%, #eeeeee 99%);
|
||||
}
|
||||
|
||||
.select2-container-active .select2-choice,
|
||||
.select2-container-active .select2-choices {
|
||||
border: 1px solid #5897fb;
|
||||
outline: none;
|
||||
|
||||
-webkit-box-shadow: 0 0 5px rgba(0,0,0,.3);
|
||||
-moz-box-shadow: 0 0 5px rgba(0,0,0,.3);
|
||||
box-shadow: 0 0 5px rgba(0,0,0,.3);
|
||||
}
|
||||
|
||||
.select2-dropdown-open .select2-choice {
|
||||
border-bottom-color: transparent;
|
||||
-webkit-box-shadow: 0 1px 0 #fff inset;
|
||||
-moz-box-shadow: 0 1px 0 #fff inset;
|
||||
box-shadow: 0 1px 0 #fff inset;
|
||||
|
||||
-webkit-border-bottom-left-radius: 0;
|
||||
-moz-border-radius-bottomleft: 0;
|
||||
border-bottom-left-radius: 0;
|
||||
|
||||
-webkit-border-bottom-right-radius: 0;
|
||||
-moz-border-radius-bottomright: 0;
|
||||
border-bottom-right-radius: 0;
|
||||
|
||||
background-color: #eee;
|
||||
background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, white), color-stop(0.5, #eeeeee));
|
||||
background-image: -webkit-linear-gradient(center bottom, white 0%, #eeeeee 50%);
|
||||
background-image: -moz-linear-gradient(center bottom, white 0%, #eeeeee 50%);
|
||||
background-image: -o-linear-gradient(bottom, white 0%, #eeeeee 50%);
|
||||
background-image: -ms-linear-gradient(top, #ffffff 0%,#eeeeee 50%);
|
||||
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#eeeeee', endColorstr='#ffffff',GradientType=0 );
|
||||
background-image: linear-gradient(top, #ffffff 0%,#eeeeee 50%);
|
||||
}
|
||||
|
||||
.select2-dropdown-open.select2-drop-above .select2-choice,
|
||||
.select2-dropdown-open.select2-drop-above .select2-choices {
|
||||
border: 1px solid #5897fb;
|
||||
border-top-color: transparent;
|
||||
|
||||
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, white), color-stop(0.5, #eeeeee));
|
||||
background-image: -webkit-linear-gradient(center top, white 0%, #eeeeee 50%);
|
||||
background-image: -moz-linear-gradient(center top, white 0%, #eeeeee 50%);
|
||||
background-image: -o-linear-gradient(top, white 0%, #eeeeee 50%);
|
||||
background-image: -ms-linear-gradient(bottom, #ffffff 0%,#eeeeee 50%);
|
||||
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#eeeeee', endColorstr='#ffffff',GradientType=0 );
|
||||
background-image: linear-gradient(bottom, #ffffff 0%,#eeeeee 50%);
|
||||
}
|
||||
|
||||
.select2-dropdown-open .select2-choice div {
|
||||
background: transparent;
|
||||
border-left: none;
|
||||
filter: none;
|
||||
}
|
||||
.select2-dropdown-open .select2-choice div b {
|
||||
background-position: -18px 1px;
|
||||
}
|
||||
|
||||
/* results */
|
||||
.select2-results {
|
||||
max-height: 200px;
|
||||
padding: 0 0 0 4px;
|
||||
margin: 4px 4px 4px 0;
|
||||
position: relative;
|
||||
overflow-x: hidden;
|
||||
overflow-y: auto;
|
||||
-webkit-tap-highlight-color: rgba(0,0,0,0);
|
||||
}
|
||||
|
||||
.select2-results ul.select2-result-sub {
|
||||
margin: 0;
|
||||
padding-left: 0;
|
||||
}
|
||||
|
||||
.select2-results ul.select2-result-sub > li .select2-result-label { padding-left: 20px }
|
||||
.select2-results ul.select2-result-sub ul.select2-result-sub > li .select2-result-label { padding-left: 40px }
|
||||
.select2-results ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub > li .select2-result-label { padding-left: 60px }
|
||||
.select2-results ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub > li .select2-result-label { padding-left: 80px }
|
||||
.select2-results ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub > li .select2-result-label { padding-left: 100px }
|
||||
.select2-results ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub > li .select2-result-label { padding-left: 110px }
|
||||
.select2-results ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub > li .select2-result-label { padding-left: 120px }
|
||||
|
||||
.select2-results li {
|
||||
list-style: none;
|
||||
display: list-item;
|
||||
background-image: none;
|
||||
}
|
||||
|
||||
.select2-results li.select2-result-with-children > .select2-result-label {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.select2-results .select2-result-label {
|
||||
padding: 3px 7px 4px;
|
||||
margin: 0;
|
||||
cursor: pointer;
|
||||
|
||||
min-height: 1em;
|
||||
|
||||
-webkit-touch-callout: none;
|
||||
-webkit-user-select: none;
|
||||
-khtml-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.select2-results .select2-highlighted {
|
||||
background: #3875d7;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.select2-results li em {
|
||||
background: #feffde;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
.select2-results .select2-highlighted em {
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.select2-results .select2-highlighted ul {
|
||||
background: white;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
|
||||
.select2-results .select2-no-results,
|
||||
.select2-results .select2-searching,
|
||||
.select2-results .select2-selection-limit {
|
||||
background: #f4f4f4;
|
||||
display: list-item;
|
||||
}
|
||||
|
||||
/*
|
||||
disabled look for disabled choices in the results dropdown
|
||||
*/
|
||||
.select2-results .select2-disabled.select2-highlighted {
|
||||
color: #666;
|
||||
background: #f4f4f4;
|
||||
display: list-item;
|
||||
cursor: default;
|
||||
}
|
||||
.select2-results .select2-disabled {
|
||||
background: #f4f4f4;
|
||||
display: list-item;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.select2-results .select2-selected {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.select2-more-results.select2-active {
|
||||
background: #f4f4f4 url('select2-spinner.gif') no-repeat 100%;
|
||||
}
|
||||
|
||||
.select2-more-results {
|
||||
background: #f4f4f4;
|
||||
display: list-item;
|
||||
}
|
||||
|
||||
/* disabled styles */
|
||||
|
||||
.select2-container.select2-container-disabled .select2-choice {
|
||||
background-color: #f4f4f4;
|
||||
background-image: none;
|
||||
border: 1px solid #ddd;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.select2-container.select2-container-disabled .select2-choice div {
|
||||
background-color: #f4f4f4;
|
||||
background-image: none;
|
||||
border-left: 0;
|
||||
}
|
||||
|
||||
.select2-container.select2-container-disabled .select2-choice abbr {
|
||||
display: none;
|
||||
}
|
||||
|
||||
|
||||
/* multiselect */
|
||||
|
||||
.select2-container-multi .select2-choices {
|
||||
height: auto !important;
|
||||
height: 1%;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
position: relative;
|
||||
|
||||
border: 1px solid #aaa;
|
||||
cursor: text;
|
||||
overflow: hidden;
|
||||
|
||||
background-color: #fff;
|
||||
background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(1%, #eeeeee), color-stop(15%, #ffffff));
|
||||
background-image: -webkit-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
|
||||
background-image: -moz-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
|
||||
background-image: -o-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
|
||||
background-image: -ms-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
|
||||
background-image: linear-gradient(top, #eeeeee 1%, #ffffff 15%);
|
||||
}
|
||||
|
||||
.select2-locked {
|
||||
padding: 3px 5px 3px 5px !important;
|
||||
}
|
||||
|
||||
.select2-container-multi .select2-choices {
|
||||
min-height: 26px;
|
||||
}
|
||||
|
||||
.select2-container-multi.select2-container-active .select2-choices {
|
||||
border: 1px solid #5897fb;
|
||||
outline: none;
|
||||
|
||||
-webkit-box-shadow: 0 0 5px rgba(0,0,0,.3);
|
||||
-moz-box-shadow: 0 0 5px rgba(0,0,0,.3);
|
||||
box-shadow: 0 0 5px rgba(0,0,0,.3);
|
||||
}
|
||||
.select2-container-multi .select2-choices li {
|
||||
float: left;
|
||||
list-style: none;
|
||||
}
|
||||
.select2-container-multi .select2-choices .select2-search-field {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.select2-container-multi .select2-choices .select2-search-field input {
|
||||
padding: 5px;
|
||||
margin: 1px 0;
|
||||
|
||||
font-family: sans-serif;
|
||||
font-size: 100%;
|
||||
color: #666;
|
||||
outline: 0;
|
||||
border: 0;
|
||||
-webkit-box-shadow: none;
|
||||
-moz-box-shadow: none;
|
||||
box-shadow: none;
|
||||
background: transparent !important;
|
||||
}
|
||||
|
||||
.select2-container-multi .select2-choices .select2-search-field input.select2-active {
|
||||
background: #fff url('select2-spinner.gif') no-repeat 100% !important;
|
||||
}
|
||||
|
||||
.select2-default {
|
||||
color: #999 !important;
|
||||
}
|
||||
|
||||
.select2-container-multi .select2-choices .select2-search-choice {
|
||||
padding: 3px 5px 3px 18px;
|
||||
margin: 3px 0 3px 5px;
|
||||
position: relative;
|
||||
|
||||
line-height: 13px;
|
||||
color: #333;
|
||||
cursor: default;
|
||||
border: 1px solid #aaaaaa;
|
||||
|
||||
-webkit-border-radius: 3px;
|
||||
-moz-border-radius: 3px;
|
||||
border-radius: 3px;
|
||||
|
||||
-webkit-box-shadow: 0 0 2px #ffffff inset, 0 1px 0 rgba(0,0,0,0.05);
|
||||
-moz-box-shadow: 0 0 2px #ffffff inset, 0 1px 0 rgba(0,0,0,0.05);
|
||||
box-shadow: 0 0 2px #ffffff inset, 0 1px 0 rgba(0,0,0,0.05);
|
||||
|
||||
-webkit-background-clip: padding-box;
|
||||
-moz-background-clip: padding;
|
||||
background-clip: padding-box;
|
||||
|
||||
-webkit-touch-callout: none;
|
||||
-webkit-user-select: none;
|
||||
-khtml-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
|
||||
background-color: #e4e4e4;
|
||||
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#eeeeee', endColorstr='#f4f4f4', GradientType=0 );
|
||||
background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(20%, #f4f4f4), color-stop(50%, #f0f0f0), color-stop(52%, #e8e8e8), color-stop(100%, #eeeeee));
|
||||
background-image: -webkit-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
|
||||
background-image: -moz-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
|
||||
background-image: -o-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
|
||||
background-image: -ms-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
|
||||
background-image: linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
|
||||
}
|
||||
.select2-container-multi .select2-choices .select2-search-choice span {
|
||||
cursor: default;
|
||||
}
|
||||
.select2-container-multi .select2-choices .select2-search-choice-focus {
|
||||
background: #d4d4d4;
|
||||
}
|
||||
|
||||
.select2-search-choice-close {
|
||||
display: block;
|
||||
width: 12px;
|
||||
height: 13px;
|
||||
position: absolute;
|
||||
right: 3px;
|
||||
top: 4px;
|
||||
|
||||
font-size: 1px;
|
||||
outline: none;
|
||||
background: url('select2.png') right top no-repeat;
|
||||
}
|
||||
|
||||
.select2-container-multi .select2-search-choice-close {
|
||||
left: 3px;
|
||||
}
|
||||
|
||||
.select2-container-multi .select2-choices .select2-search-choice .select2-search-choice-close:hover {
|
||||
background-position: right -11px;
|
||||
}
|
||||
.select2-container-multi .select2-choices .select2-search-choice-focus .select2-search-choice-close {
|
||||
background-position: right -11px;
|
||||
}
|
||||
|
||||
/* disabled styles */
|
||||
.select2-container-multi.select2-container-disabled .select2-choices{
|
||||
background-color: #f4f4f4;
|
||||
background-image: none;
|
||||
border: 1px solid #ddd;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.select2-container-multi.select2-container-disabled .select2-choices .select2-search-choice {
|
||||
padding: 3px 5px 3px 5px;
|
||||
border: 1px solid #ddd;
|
||||
background-image: none;
|
||||
background-color: #f4f4f4;
|
||||
}
|
||||
|
||||
.select2-container-multi.select2-container-disabled .select2-choices .select2-search-choice .select2-search-choice-close { display: none;
|
||||
background:none;
|
||||
}
|
||||
/* end multiselect */
|
||||
|
||||
|
||||
.select2-result-selectable .select2-match,
|
||||
.select2-result-unselectable .select2-match {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.select2-offscreen, .select2-offscreen:focus {
|
||||
clip: rect(0 0 0 0);
|
||||
width: 1px;
|
||||
height: 1px;
|
||||
border: 0;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
overflow: hidden;
|
||||
position: absolute;
|
||||
outline: 0;
|
||||
left: 0px;
|
||||
}
|
||||
|
||||
.select2-display-none {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.select2-measure-scrollbar {
|
||||
position: absolute;
|
||||
top: -10000px;
|
||||
left: -10000px;
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
overflow: scroll;
|
||||
}
|
||||
/* Retina-ize icons */
|
||||
|
||||
@media only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (min-resolution: 144dpi) {
|
||||
.select2-search input, .select2-search-choice-close, .select2-container .select2-choice abbr, .select2-container .select2-choice div b {
|
||||
background-image: url('select2x2.png') !important;
|
||||
background-repeat: no-repeat !important;
|
||||
background-size: 60px 40px !important;
|
||||
}
|
||||
.select2-search input {
|
||||
background-position: 100% -21px !important;
|
||||
}
|
||||
}
|
BIN
assets/vendor/tablesorter/beta-testing/select2.png
vendored
Normal file
BIN
assets/vendor/tablesorter/beta-testing/select2.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 613 B |
139
assets/vendor/tablesorter/beta-testing/widget-column-math.js
vendored
Normal file
139
assets/vendor/tablesorter/beta-testing/widget-column-math.js
vendored
Normal file
@@ -0,0 +1,139 @@
|
||||
/*! tablesorter column reorder - beta testing
|
||||
* Requires tablesorter v2.8+ and jQuery 1.7+
|
||||
* by Rob Garrison
|
||||
*/
|
||||
/*jshint browser:true, jquery:true, unused:false */
|
||||
/*global jQuery: false */
|
||||
;(function($){
|
||||
"use strict";
|
||||
|
||||
var ts = $.tablesorter = $.tablesorter || {};
|
||||
|
||||
ts.columnMath = {
|
||||
|
||||
equations : {
|
||||
// sum all the cells in the row
|
||||
sumrow : function(table, $el, c, wo, direct){
|
||||
var total = 0, row = ts.columnMath.getRow(table, $el, direct);
|
||||
$.each( row, function(i){
|
||||
total += row[i];
|
||||
});
|
||||
return total;
|
||||
},
|
||||
// sum all the cells in the column
|
||||
sumcol : function(table, $el, c, wo, direct){},
|
||||
// sum all of the cells
|
||||
sumall : function(table, $el, c, wo, direct){},
|
||||
// sum all of the cells in the column above the current one, until the next sumabove is reached
|
||||
sumabove : function(table, $el, c, wo, direct){},
|
||||
// target cells in a specific column c1, c2, c3, etc
|
||||
col : function(table, $el, c, wo, direct){},
|
||||
// target cells in a specific row r1, r2, r3, etc.
|
||||
row : function(table, $el, c, wo, direct){}
|
||||
// target
|
||||
},
|
||||
|
||||
// get all of the row numerical values in an array
|
||||
// el is the table cell where the data is added; direct means get the
|
||||
// numbers directly from the table, otherwise it gets it from the cache.
|
||||
getRow : function(table, $el, direct){
|
||||
var i, txt, arry = [],
|
||||
c = table.config,
|
||||
$tb = c.$table.find('tbody'),
|
||||
cIndex = $el[0].cellIndex,
|
||||
$row = $el.closest('tr'),
|
||||
bIndex = $tb.index( $row.closest('tbody') ),
|
||||
rIndex = $tb.eq(bIndex).find('tr').index( $row ),
|
||||
row = c.cache[bIndex].normalized[rIndex] || [];
|
||||
if (direct) {
|
||||
arry = $row.children().map(function(){
|
||||
txt = (c.supportsTextContent) ? this.textContent : $(this).text();
|
||||
txt = ts.formatFloat(txt.replace(/[^\w,. \-()]/g, ""), table);
|
||||
return isNaN(txt) ? 0 : txt;
|
||||
}).get();
|
||||
} else {
|
||||
for (i = 0; i < row.length - 1; i++) {
|
||||
arry.push( (i === cIndex || isNaN(row[i]) ) ? 0 : row[i] );
|
||||
}
|
||||
}
|
||||
return arry;
|
||||
},
|
||||
|
||||
output : function($el, wo, value) {
|
||||
value = wo.columnMath_format.output_prefix + ts.columnMath.addCommas(value, wo) + wo.columnMath_format.output_suffix;
|
||||
if ($.isFunction(wo.columnMath_format.format_complete)) {
|
||||
value = wo.columnMath_format.format_complete(value, $el);
|
||||
}
|
||||
$el.html('<div class="align-decimal">' + value + '</div>');
|
||||
},
|
||||
|
||||
addCommas : function(num, wo) {
|
||||
var parts = ( num.toFixed( wo.columnMath_format.decimal_places ) + '' ).split('.');
|
||||
parts[0] = parts[0].replace( wo.columnMath_regex, "$1" + wo.columnMath_format.thousands_separator );
|
||||
return parts.join( wo.columnMath_format.decimal_separator );
|
||||
},
|
||||
|
||||
recalculate : function(table, c, wo){
|
||||
if (c) {
|
||||
wo.columnMath_regex = new RegExp('(\\d)(?=(\\d{' + (wo.columnMath_format.thousands_grouping || 3) + '})+(?!\\d))', 'g' );
|
||||
var n, t, $t,
|
||||
priority = [ 'sumrow', 'sumabove', 'sumcol', 'sumall' ],
|
||||
eq = ts.columnMath.equations,
|
||||
dat = 'data-' + (wo.columnMath_data || 'math'),
|
||||
$mathCells = c.$tbodies.find('[' + dat + ']');
|
||||
// cells with a target are calculated last
|
||||
$mathCells.not('[' + dat + '-target]').each(function(){
|
||||
$t = $(this);
|
||||
n = $t.attr(dat);
|
||||
// check for built in math
|
||||
// eq = n.match(/(\w+)[\s+]?\(/g);
|
||||
if (eq[n]) {
|
||||
t = eq[n](table, $t, c, wo);
|
||||
if (t) {
|
||||
ts.columnMath.output( $t, wo, t );
|
||||
}
|
||||
}
|
||||
});
|
||||
// console.log($mathCells);
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
// add new widget called repeatHeaders
|
||||
// ************************************
|
||||
$.tablesorter.addWidget({
|
||||
id: "column-math",
|
||||
options: {
|
||||
columnMath_data : 'math',
|
||||
// columnMath_ignore : 'zero, text, empty',
|
||||
columnMath_format : {
|
||||
output_prefix : '$ ',
|
||||
output_suffix : '',
|
||||
thousands_separator : ',',
|
||||
thousands_grouping : 3,
|
||||
decimal_separator : '.',
|
||||
decimal_places : 2,
|
||||
format_complete : null // function(number, $cell){ return number; }
|
||||
}
|
||||
},
|
||||
init : function(table, thisWidget, c, wo){
|
||||
var $t = $(table).bind('update.tsmath updateRow.tsmath', function(){
|
||||
$.tablesorter.columnMath.recalculate(table, c, wo);
|
||||
});
|
||||
$.tablesorter.columnMath.recalculate(table, c, wo);
|
||||
},
|
||||
// format is called when the on init and when a sorting has finished
|
||||
format: function(table) {
|
||||
// do nothing
|
||||
},
|
||||
// this remove function is called when using the refreshWidgets method or when destroying the tablesorter plugin
|
||||
// this function only applies to tablesorter v2.4+
|
||||
remove: function(table, c, wo){
|
||||
$(table)
|
||||
.unbind('update.tsmath updateRows.tsmath')
|
||||
.find('[data-' + wo.columnMath_data + ']').empty();
|
||||
}
|
||||
});
|
||||
|
||||
})(jQuery);
|
182
assets/vendor/tablesorter/beta-testing/widget-reorder.js
vendored
Normal file
182
assets/vendor/tablesorter/beta-testing/widget-reorder.js
vendored
Normal file
@@ -0,0 +1,182 @@
|
||||
/*! tablesorter column reorder - beta testing
|
||||
* Requires tablesorter v2.8+ and jQuery 1.7+
|
||||
* by Rob Garrison
|
||||
*/
|
||||
/*jshint browser:true, jquery:true, unused:false */
|
||||
/*global jQuery: false */
|
||||
;(function($){
|
||||
"use strict";
|
||||
|
||||
$.tablesorter.addWidget({
|
||||
id: 'reorder',
|
||||
priority: 70,
|
||||
options : {
|
||||
reorder_axis : 'xy', // x or xy
|
||||
reorder_delay : 300,
|
||||
reorder_helperClass : 'tablesorter-reorder-helper',
|
||||
reorder_helperBar : 'tablesorter-reorder-helper-bar',
|
||||
reorder_noReorder : 'reorder-false',
|
||||
reorder_blocked : 'reorder-block-left reorder-block-end',
|
||||
reorder_complete : null // callback
|
||||
},
|
||||
init: function(table, thisWidget, c, wo) {
|
||||
var i, timer, $helper, $bar, clickOffset,
|
||||
lastIndx = -1,
|
||||
ts = $.tablesorter,
|
||||
endIndex = -1,
|
||||
startIndex = -1,
|
||||
t = wo.reorder_blocked.split(' '),
|
||||
noReorderLeft = t[0] || 'reorder-block-left',
|
||||
noReorderLast = t[1] || 'reorder-block-end',
|
||||
lastOffset = c.$headers.not('.' + noReorderLeft).first(),
|
||||
offsets = c.$headers.map(function(i){
|
||||
var s, $t = $(this);
|
||||
if ($t.hasClass(noReorderLeft)) {
|
||||
s = lastOffset;
|
||||
$t = s;
|
||||
//lastOffset = $t;
|
||||
}
|
||||
lastOffset = $t;
|
||||
return $t.offset().left;
|
||||
}).get(),
|
||||
len = offsets.length,
|
||||
startReorder = function(e, $th){
|
||||
var p = $th.position(),
|
||||
r = $th.parent().position(),
|
||||
i = startIndex = $th.index();
|
||||
clickOffset = [ e.pageX - p.left, e.pageY - r.top ];
|
||||
$helper = c.$table.clone();
|
||||
$helper.find('> thead > tr:first').children('[data-column!=' + i + ']').remove();
|
||||
$helper.find('thead tr:gt(0), caption, colgroup, tbody, tfoot').remove();
|
||||
$helper
|
||||
.css({
|
||||
position: 'absolute',
|
||||
zIndex : 1,
|
||||
left: p.left - clickOffset[0],
|
||||
top: r.top - clickOffset[1],
|
||||
width: $th.outerWidth()
|
||||
})
|
||||
.appendTo('body')
|
||||
.find('th, td').addClass(wo.reorder_helperClass);
|
||||
$bar = $('<div class="' + wo.reorder_helperBar + '" />')
|
||||
.css({
|
||||
position : 'absolute',
|
||||
top : c.$table.find('thead').offset().top,
|
||||
height : $th.closest('thead').outerHeight() + c.$table.find('tbody').height()
|
||||
})
|
||||
.appendTo('body');
|
||||
positionBar(e);
|
||||
lastIndx = endIndex;
|
||||
},
|
||||
positionBar = function(e){
|
||||
for (i = 0; i <= len; i++) {
|
||||
if ( i > 0 && e.pageX < offsets[i-1] + (offsets[i] - offsets[i-1])/2 && !c.$headers.eq(i).hasClass(noReorderLeft) ) {
|
||||
endIndex = i - 1;
|
||||
// endIndex = offsets.lastIndexOf( offsets[i-1] ); // lastIndexOf not supported by IE8 and older
|
||||
if (endIndex >= 0 && lastIndx === endIndex) { return false; }
|
||||
lastIndx = endIndex;
|
||||
if (c.debug) {
|
||||
ts.log( endIndex === 0 ? 'target before column 0' : endIndex === len ? 'target after last column' : 'target between columns ' + startIndex + ' and ' + endIndex);
|
||||
}
|
||||
$bar.css('left', offsets[i-1]);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (endIndex < 0) {
|
||||
endIndex = len;
|
||||
$bar.css('left', offsets[len]);
|
||||
}
|
||||
},
|
||||
finishReorder = function(){
|
||||
$helper.remove();
|
||||
$bar.remove();
|
||||
// finish reorder
|
||||
var adj, s = startIndex,
|
||||
rows = c.$table.find('tr'),
|
||||
cols;
|
||||
startIndex = -1; // stop mousemove updates
|
||||
if ( s > -1 && endIndex > -1 && s != endIndex && s + 1 !== endIndex ) {
|
||||
adj = endIndex !== 0;
|
||||
if (c.debug) {
|
||||
ts.log( 'Inserting column ' + s + (adj ? ' after' : ' before') + ' column ' + (endIndex - adj ? 1 : 0) );
|
||||
}
|
||||
rows.each(function() {
|
||||
cols = $(this).children();
|
||||
cols.eq(s)[ adj ? 'insertAfter' : 'insertBefore' ]( cols.eq( endIndex - (adj ? 1 : 0) ) );
|
||||
});
|
||||
cols = [];
|
||||
// stored header info needs to be modified too!
|
||||
for (i = 0; i < len; i++) {
|
||||
if (i === s) { continue; }
|
||||
if (i === endIndex - (adj ? 1 : 0)) {
|
||||
if (!adj) { cols.push(c.headerContent[s]); }
|
||||
cols.push(c.headerContent[i]);
|
||||
if (adj) { cols.push(c.headerContent[s]); }
|
||||
} else {
|
||||
cols.push(c.headerContent[i]);
|
||||
}
|
||||
}
|
||||
c.headerContent = cols;
|
||||
// cols = c.headerContent.splice(s, 1);
|
||||
// c.headerContent.splice(endIndex - (adj ? 1 : 0), 0, cols);
|
||||
c.$table.trigger('updateAll', [ true, wo.reorder_complete ]);
|
||||
}
|
||||
endIndex = -1;
|
||||
},
|
||||
mdown = function(e, el){
|
||||
var $t = $(el), evt = e;
|
||||
if ($t.hasClass(wo.reorder_noReorder)) { return; }
|
||||
timer = setTimeout(function(){
|
||||
$t.addClass('tablesorter-reorder');
|
||||
startReorder(evt, $t);
|
||||
}, wo.reorder_delay);
|
||||
};
|
||||
|
||||
console.log( c.$headers.last().hasClass(noReorderLast) );
|
||||
|
||||
if ( c.$headers.last().hasClass(noReorderLast) ) {
|
||||
offsets.push( offsets[ offsets.length - 1 ] );
|
||||
} else {
|
||||
offsets.push( c.$table.offset().left + c.$table.outerWidth() );
|
||||
}
|
||||
|
||||
c.$headers.not('.' + wo.reorder_noReorder).bind('mousedown.reorder', function(e){
|
||||
mdown(e, this);
|
||||
});
|
||||
|
||||
$(document)
|
||||
.bind('mousemove.reorder', function(e){
|
||||
if (startIndex !== -1){
|
||||
var c = { left : e.pageX - clickOffset[0] };
|
||||
endIndex = -1;
|
||||
if (/y/.test(wo.reorder_axis)) {
|
||||
c.top = e.pageY - clickOffset[1];
|
||||
}
|
||||
$helper.css(c);
|
||||
positionBar(e);
|
||||
}
|
||||
})
|
||||
.add( c.$headers )
|
||||
.bind('mouseup.reorder', function(){
|
||||
clearTimeout(timer);
|
||||
if (startIndex !== -1 && endIndex !== -1){
|
||||
finishReorder();
|
||||
} else {
|
||||
startIndex = -1;
|
||||
}
|
||||
});
|
||||
|
||||
// has sticky headers?
|
||||
c.$table.bind('stickyHeadersInit', function(){
|
||||
wo.$sticky.find('thead').children().not('.' + wo.reorder_noReorder).bind('mousedown.reorder', function(e){
|
||||
mdown(e, this);
|
||||
});
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
// add mouse coordinates
|
||||
$x = $('#main h1:last'); $(document).mousemove(function(e){ $x.html( e.pageX ); });
|
||||
|
||||
})(jQuery);
|
Reference in New Issue
Block a user