jquery-tablesorter 1.10.5 → 1.10.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/jquery-tablesorter/version.rb +1 -1
- data/vendor/assets/javascripts/jquery-tablesorter/jquery.tablesorter.js +3 -3
- data/vendor/assets/javascripts/jquery-tablesorter/jquery.tablesorter.widgets-filter-formatter.js +7 -7
- data/vendor/assets/javascripts/jquery-tablesorter/jquery.tablesorter.widgets.js +2 -2
- data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-alignChar.js +145 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3d3adc7a7db442e6adb168ea1823bad3a8a6e536
|
4
|
+
data.tar.gz: d33937ddb41d6bd2d398596f27b64280f165cf56
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c61b8896dbc3dc199ace46e1e994c731e5adac2c8c8c9654265074ebb165f247a0256e6c96f749a253a64ba62a49ca2f11245304b56e4196974d9edead32d0c1
|
7
|
+
data.tar.gz: a74201f992bc577663ba977a40732909b2f2fe569750b4d25666d100a28d49e48d3c289609a559f462e213d4ef649aa409c6790ed93edfd768f9dc46ffed8f15
|
data/README.md
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
Simple integration of jquery-tablesorter into the asset pipeline.
|
6
6
|
|
7
|
-
Current tablesorter version: 2.15.
|
7
|
+
Current tablesorter version: 2.15.10 (3/13/2014), [documentation]
|
8
8
|
|
9
9
|
Any issue associate with the js/css files, please report to [Mottie's fork].
|
10
10
|
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/**!
|
2
|
-
* TableSorter 2.15.
|
2
|
+
* TableSorter 2.15.10 - Client-side table sorting with ease!
|
3
3
|
* @requires jQuery v1.2.6+
|
4
4
|
*
|
5
5
|
* Copyright (c) 2007 Christian Bach
|
@@ -24,7 +24,7 @@
|
|
24
24
|
|
25
25
|
var ts = this;
|
26
26
|
|
27
|
-
ts.version = "2.15.
|
27
|
+
ts.version = "2.15.10";
|
28
28
|
|
29
29
|
ts.parsers = [];
|
30
30
|
ts.widgets = [];
|
@@ -729,7 +729,7 @@
|
|
729
729
|
}
|
730
730
|
// fall back to built-in numeric sort
|
731
731
|
// var sort = $.tablesorter["sort" + s](table, a[c], b[c], c, colMax[c], dir);
|
732
|
-
sort = c.numberSorter ? c.numberSorter(
|
732
|
+
sort = c.numberSorter ? c.numberSorter(a[col], b[col], dir, colMax[col], table) :
|
733
733
|
ts[ 'sortNumeric' + (dir ? 'Asc' : 'Desc') ](a[col], b[col], num, colMax[col], col, table);
|
734
734
|
} else {
|
735
735
|
// set a & b depending on sort direction
|
data/vendor/assets/javascripts/jquery-tablesorter/jquery.tablesorter.widgets-filter-formatter.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
/*! Filter widget formatter functions - updated 3/
|
1
|
+
/*! Filter widget formatter functions - updated 3/12/2014 (v2.15.9)
|
2
2
|
* requires: tableSorter 2.15+ and jQuery 1.4.3+
|
3
3
|
*
|
4
4
|
* uiSpinner (jQuery UI spinner)
|
@@ -70,6 +70,7 @@ tsff = ts.filterFormatter = {
|
|
70
70
|
disabled : false
|
71
71
|
|
72
72
|
}, spinnerDef ),
|
73
|
+
c = $cell.closest('table')[0].config,
|
73
74
|
// Add a hidden input to hold the range values
|
74
75
|
$input = $('<input class="filter" type="hidden">')
|
75
76
|
.appendTo($cell)
|
@@ -78,7 +79,6 @@ tsff = ts.filterFormatter = {
|
|
78
79
|
updateSpinner({ value: this.value, delayed: false });
|
79
80
|
}),
|
80
81
|
$shcell = [],
|
81
|
-
c = $cell.closest('table')[0].config,
|
82
82
|
|
83
83
|
// this function updates the hidden input and adds the current values to the header cell text
|
84
84
|
updateSpinner = function(ui, notrigger) {
|
@@ -227,6 +227,7 @@ tsff = ts.filterFormatter = {
|
|
227
227
|
step : 1,
|
228
228
|
range : "min"
|
229
229
|
}, sliderDef ),
|
230
|
+
c = $cell.closest('table')[0].config,
|
230
231
|
// Add a hidden input to hold the range values
|
231
232
|
$input = $('<input class="filter" type="hidden">')
|
232
233
|
.appendTo($cell)
|
@@ -235,7 +236,6 @@ tsff = ts.filterFormatter = {
|
|
235
236
|
updateSlider({ value: this.value });
|
236
237
|
}),
|
237
238
|
$shcell = [],
|
238
|
-
c = $cell.closest('table')[0].config,
|
239
239
|
|
240
240
|
// this function updates the hidden input and adds the current values to the header cell text
|
241
241
|
updateSlider = function(ui, notrigger) {
|
@@ -365,6 +365,7 @@ tsff = ts.filterFormatter = {
|
|
365
365
|
max : 100,
|
366
366
|
range : true
|
367
367
|
}, rangeDef ),
|
368
|
+
c = $cell.closest('table')[0].config,
|
368
369
|
// Add a hidden input to hold the range values
|
369
370
|
$input = $('<input class="filter" type="hidden">')
|
370
371
|
.appendTo($cell)
|
@@ -373,7 +374,6 @@ tsff = ts.filterFormatter = {
|
|
373
374
|
getRange();
|
374
375
|
}),
|
375
376
|
$shcell = [],
|
376
|
-
c = $cell.closest('table')[0].config,
|
377
377
|
|
378
378
|
getRange = function(){
|
379
379
|
var val = $input.val(),
|
@@ -495,6 +495,7 @@ tsff = ts.filterFormatter = {
|
|
495
495
|
}, defDate),
|
496
496
|
|
497
497
|
$date,
|
498
|
+
c = $cell.closest('table')[0].config,
|
498
499
|
// make sure we're using parsed dates in the search
|
499
500
|
$hdr = $cell.closest('thead').find('th[data-column=' + indx + ']').addClass('filter-parsed'),
|
500
501
|
// Add a hidden input to hold the range values
|
@@ -508,7 +509,6 @@ tsff = ts.filterFormatter = {
|
|
508
509
|
}
|
509
510
|
}),
|
510
511
|
t, $shcell = [],
|
511
|
-
c = $cell.closest('table')[0].config,
|
512
512
|
|
513
513
|
// this function updates the hidden input
|
514
514
|
date1Compare = function(v, notrigger) {
|
@@ -629,6 +629,7 @@ tsff = ts.filterFormatter = {
|
|
629
629
|
numberOfMonths : 1
|
630
630
|
}, defDate),
|
631
631
|
t, closeTo, closeFrom, $shcell = [],
|
632
|
+
c = $cell.closest('table')[0].config,
|
632
633
|
// Add a hidden input to hold the range values
|
633
634
|
$input = $('<input class="dateRange" type="hidden">')
|
634
635
|
.appendTo($cell)
|
@@ -644,8 +645,7 @@ tsff = ts.filterFormatter = {
|
|
644
645
|
} else if (v.match('<=')) {
|
645
646
|
closeTo( v.replace('<=', '') );
|
646
647
|
}
|
647
|
-
})
|
648
|
-
c = $cell.closest('table')[0].config;
|
648
|
+
});
|
649
649
|
|
650
650
|
// make sure we're using parsed dates in the search
|
651
651
|
$cell.closest('thead').find('th[data-column=' + indx + ']').addClass('filter-parsed');
|
@@ -1,4 +1,4 @@
|
|
1
|
-
/*! tableSorter 2.15+ widgets - updated 3/
|
1
|
+
/*! tableSorter 2.15+ widgets - updated 3/12/2014 (v2.15.8)
|
2
2
|
*
|
3
3
|
* Column Styles
|
4
4
|
* Column Filters
|
@@ -765,7 +765,7 @@ ts.filter = {
|
|
765
765
|
return;
|
766
766
|
}
|
767
767
|
// true flag tells getFilters to skip newest timed input
|
768
|
-
ts.filter.searching( table,
|
768
|
+
ts.filter.searching( table, true, true );
|
769
769
|
});
|
770
770
|
c.$table.bind('filterReset', function(){
|
771
771
|
$el.val('');
|
@@ -0,0 +1,145 @@
|
|
1
|
+
/*! tablesorter Align Character widget - updated 3/12/2014 (core v2.15.8)
|
2
|
+
* Requires tablesorter v2.8+ and jQuery 1.7+
|
3
|
+
* by Rob Garrison
|
4
|
+
*/
|
5
|
+
/*jshint browser:true, jquery:true, unused:false */
|
6
|
+
/*global jQuery: false */
|
7
|
+
;(function($){
|
8
|
+
"use strict";
|
9
|
+
var ts = $.tablesorter;
|
10
|
+
|
11
|
+
ts.alignChar = {
|
12
|
+
|
13
|
+
init : function(table, c, wo) {
|
14
|
+
c.$headers.filter('[' + wo.alignChar_charAttrib + ']').each(function(){
|
15
|
+
var $this = $(this),
|
16
|
+
vars = {
|
17
|
+
column : this.column,
|
18
|
+
align : $this.attr(wo.alignChar_charAttrib),
|
19
|
+
alignIndex : parseInt( $this.attr(wo.alignChar_indexAttrib) || 0, 10),
|
20
|
+
adjust : parseFloat($this.attr(wo.alignChar_adjustAttrib)) || 0,
|
21
|
+
};
|
22
|
+
vars.regex = new RegExp('\\' + vars.align, 'g');
|
23
|
+
if (typeof vars.align !== 'undefined') {
|
24
|
+
wo.alignChar_savedVars[this.column] = vars;
|
25
|
+
ts.alignChar.setup(table, c, wo, vars);
|
26
|
+
}
|
27
|
+
});
|
28
|
+
},
|
29
|
+
|
30
|
+
setup: function(table, c, wo, v){
|
31
|
+
// do nothing for empty tables
|
32
|
+
if ($.isEmptyObject(c.cache)) { return; }
|
33
|
+
var tbodyIndex, rowIndex, start, end, last, index, rows, val, count,
|
34
|
+
len, wLeft, wRight, alignChar, $row,
|
35
|
+
left = [],
|
36
|
+
right = [];
|
37
|
+
for (tbodyIndex = 0; tbodyIndex < c.$tbodies.length; tbodyIndex++){
|
38
|
+
rows = c.cache[tbodyIndex];
|
39
|
+
len = rows.normalized.length;
|
40
|
+
for (rowIndex = 0; rowIndex < len; rowIndex++) {
|
41
|
+
// set up to work with modified cache v2.16.0+
|
42
|
+
$row = rows.row ? rows.row[rowIndex] : rows.normalized[rowIndex][c.columns].$row;
|
43
|
+
val = $row.find('td').eq(v.column).text().replace(/[ ]/g, "\u00a0");
|
44
|
+
// count how many "align" characters are in the string
|
45
|
+
count = (val.match( v.regex ) || []).length;
|
46
|
+
// set alignment @ alignIndex (one-based index)
|
47
|
+
if (count > 0 && v.alignIndex > 0) {
|
48
|
+
end = Math.min(v.alignIndex, count);
|
49
|
+
start = 0;
|
50
|
+
index = 0;
|
51
|
+
last = 0;
|
52
|
+
// find index of nth align character based on alignIndex (data-align-index)
|
53
|
+
while (start++ < end) {
|
54
|
+
last = val.indexOf(v.align, last + 1);
|
55
|
+
index = last < 0 ? index : last;
|
56
|
+
}
|
57
|
+
} else {
|
58
|
+
index = val.indexOf(v.align);
|
59
|
+
}
|
60
|
+
if ( index >= 0 ) {
|
61
|
+
left.push( val.substring(0, index) || '' );
|
62
|
+
right.push( val.substring(index, val.length) || '' );
|
63
|
+
} else {
|
64
|
+
// no align character found!
|
65
|
+
// put val in right or left based on the align index
|
66
|
+
left.push( (count >= 1 && v.alignIndex >= count) ? '' : val || '' );
|
67
|
+
right.push( (count >= 1 && v.alignIndex >= count) ? val || '' : '' );
|
68
|
+
}
|
69
|
+
}
|
70
|
+
}
|
71
|
+
|
72
|
+
// find widest segments
|
73
|
+
wLeft = ($.extend([], left)).sort(function(a,b){ return b.length - a.length; })[0];
|
74
|
+
wRight = ($.extend([], right)).sort(function(a,b){ return b.length - a.length; })[0];
|
75
|
+
// calculate percentage widths
|
76
|
+
v.width = v.width || ( Math.floor(wLeft.length / (wLeft.length + wRight.length) * 100) + v.adjust );
|
77
|
+
wLeft = 'min-width:' + v.width + '%';
|
78
|
+
wRight = 'min-width:' + (100 - v.width) + '%';
|
79
|
+
|
80
|
+
for (tbodyIndex = 0; tbodyIndex < c.$tbodies.length; tbodyIndex++){
|
81
|
+
rows = c.cache[tbodyIndex];
|
82
|
+
len = rows.normalized.length;
|
83
|
+
for (rowIndex = 0; rowIndex < len; rowIndex++) {
|
84
|
+
alignChar = $(wo.alignChar_wrap).length ? $(wo.alignChar_wrap).html(v.align)[0].outerHTML : v.align;
|
85
|
+
$row = rows.row ? rows.row[rowIndex] : rows.normalized[rowIndex][c.columns].$row;
|
86
|
+
$row.find('td').eq(v.column).html(
|
87
|
+
'<span class="ts-align-wrap"><span class="ts-align-left" style="' + wLeft + '">' + left[rowIndex] + '</span>' +
|
88
|
+
'<span class="ts-align-right" style="' + wRight + '">' + alignChar +
|
89
|
+
right[rowIndex].slice(v.align.length) + '</span></span>'
|
90
|
+
);
|
91
|
+
}
|
92
|
+
}
|
93
|
+
wo.alignChar_initialized = true;
|
94
|
+
|
95
|
+
},
|
96
|
+
remove: function(table, c, column){
|
97
|
+
if ($.isEmptyObject(c.cache)) { return; }
|
98
|
+
var tbodyIndex, rowIndex, len, rows, $row, $cell;
|
99
|
+
for (tbodyIndex = 0; tbodyIndex < c.$tbodies.length; tbodyIndex++){
|
100
|
+
rows = c.cache[tbodyIndex];
|
101
|
+
len = rows.normalized.length;
|
102
|
+
for (rowIndex = 0; rowIndex < len; rowIndex++) {
|
103
|
+
$row = rows.row ? rows.row[rowIndex] : rows.normalized[rowIndex][c.columns].$row;
|
104
|
+
$cell = $row.find('td').eq(column);
|
105
|
+
$cell.html( $cell.text().replace(/\s/g, ' ') );
|
106
|
+
}
|
107
|
+
}
|
108
|
+
}
|
109
|
+
};
|
110
|
+
|
111
|
+
ts.addWidget({
|
112
|
+
id: 'alignChar',
|
113
|
+
priority: 100,
|
114
|
+
options: {
|
115
|
+
alignChar_wrap : '',
|
116
|
+
alignChar_charAttrib : 'data-align-char',
|
117
|
+
alignChar_indexAttrib : 'data-align-index',
|
118
|
+
alignChar_adjustAttrib : 'data-align-adjust' // percentage width adjustments
|
119
|
+
},
|
120
|
+
init: function(table, thisWidget, c, wo){
|
121
|
+
wo.alignChar_initialized = false;
|
122
|
+
wo.alignChar_savedVars = [];
|
123
|
+
ts.alignChar.init(table, c, wo);
|
124
|
+
c.$table.on('pagerEnd refreshAlign', function(){
|
125
|
+
c.$headers.filter('[' + wo.alignChar_charAttrib + ']').each(function(){
|
126
|
+
ts.alignChar.remove(table, c, this.column);
|
127
|
+
});
|
128
|
+
ts.alignChar.init(table, c, wo);
|
129
|
+
});
|
130
|
+
},
|
131
|
+
format : function(table, c, wo){
|
132
|
+
// reinitialize in case table is empty when first initialized
|
133
|
+
if (!wo.alignChar_initialized) {
|
134
|
+
c.$table.trigger('refreshAlign');
|
135
|
+
}
|
136
|
+
},
|
137
|
+
remove : function(table, c, wo){
|
138
|
+
c.$headers.filter('[' + wo.alignChar_charAttrib + ']').each(function(){
|
139
|
+
ts.alignChar.remove(table, c, this.column);
|
140
|
+
});
|
141
|
+
wo.alignChar_initialized = false;
|
142
|
+
}
|
143
|
+
});
|
144
|
+
|
145
|
+
})(jQuery);
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jquery-tablesorter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.10.
|
4
|
+
version: 1.10.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jun Lin
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-03-
|
12
|
+
date: 2014-03-14 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: railties
|
@@ -94,6 +94,7 @@ files:
|
|
94
94
|
- vendor/assets/javascripts/jquery-tablesorter/parsers/parser-input-select.js
|
95
95
|
- vendor/assets/javascripts/jquery-tablesorter/parsers/parser-ipv6.js
|
96
96
|
- vendor/assets/javascripts/jquery-tablesorter/parsers/parser-metric.js
|
97
|
+
- vendor/assets/javascripts/jquery-tablesorter/widgets/widget-alignChar.js
|
97
98
|
- vendor/assets/javascripts/jquery-tablesorter/widgets/widget-build-table.js
|
98
99
|
- vendor/assets/javascripts/jquery-tablesorter/widgets/widget-columnSelector.js
|
99
100
|
- vendor/assets/javascripts/jquery-tablesorter/widgets/widget-cssStickyHeaders.js
|