jquery-tablesorter 1.10.2 → 1.10.3

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.
Files changed (28) hide show
  1. checksums.yaml +4 -4
  2. data/README.markdown +6 -3
  3. data/Rakefile +30 -16
  4. data/lib/jquery-tablesorter/version.rb +1 -1
  5. data/vendor/assets/javascripts/jquery-tablesorter/extras/jquery.quicksearch.js +191 -0
  6. data/vendor/assets/javascripts/jquery-tablesorter/extras/semver-mod.js +1026 -0
  7. data/vendor/assets/javascripts/jquery-tablesorter/extras/semver.js +1011 -0
  8. data/vendor/assets/javascripts/jquery-tablesorter/jquery.tablesorter.js +2 -2
  9. data/vendor/assets/javascripts/jquery-tablesorter/parsers/parser-date-iso8601.js +34 -0
  10. data/vendor/assets/javascripts/jquery-tablesorter/parsers/parser-date-month.js +33 -0
  11. data/vendor/assets/javascripts/jquery-tablesorter/parsers/parser-date-two-digit-year.js +74 -0
  12. data/vendor/assets/javascripts/jquery-tablesorter/parsers/parser-date-weekday.js +33 -0
  13. data/vendor/assets/javascripts/jquery-tablesorter/parsers/parser-date.js +36 -0
  14. data/vendor/assets/javascripts/jquery-tablesorter/parsers/parser-feet-inch-fraction.js +63 -0
  15. data/vendor/assets/javascripts/jquery-tablesorter/parsers/parser-file-type.js +73 -0
  16. data/vendor/assets/javascripts/jquery-tablesorter/parsers/parser-ignore-articles.js +47 -0
  17. data/vendor/assets/javascripts/jquery-tablesorter/parsers/parser-input-select.js +86 -0
  18. data/vendor/assets/javascripts/jquery-tablesorter/parsers/parser-ipv6.js +76 -0
  19. data/vendor/assets/javascripts/jquery-tablesorter/parsers/parser-metric.js +77 -0
  20. data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-build-table.js +441 -0
  21. data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-columnSelector.js +291 -0
  22. data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-cssStickyHeaders.js +67 -0
  23. data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-editable.js +89 -0
  24. data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-grouping.js +183 -0
  25. data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-pager.js +834 -0
  26. data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-repeatheaders.js +50 -0
  27. data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-scroller.js +241 -0
  28. metadata +24 -2
@@ -0,0 +1,50 @@
1
+ /*! tablesorter repeatHeaders widget - updated 4/12/2013
2
+ * Requires tablesorter v2.8+ and jQuery 1.7+
3
+ * Original by Christian Bach from the example-widgets.html demo
4
+ */
5
+ /*global jQuery: false */
6
+ ;(function($){
7
+ "use strict";
8
+
9
+ $.tablesorter.addWidget({
10
+ id: "repeatHeaders",
11
+ priority: 10,
12
+ options: {
13
+ rowsToSkip : 4
14
+ },
15
+ // format is called on init and when a sorting has finished
16
+ format: function(table, c, wo) {
17
+ var h = '', i, $tr, l, skip;
18
+ // cache and collect all TH headers
19
+ if (!wo.repeatHeaders) {
20
+ h = '<tr class="repeated-header remove-me">';
21
+ $.each(c.headerContent, function(i,t) {
22
+ h += '<th>' + t + '</th>';
23
+ });
24
+ // "remove-me" class was added in case the table needs to be updated, the "remove-me" rows will be
25
+ // removed prior to the update to prevent including the rows in the update - see "selectorRemove" option
26
+ wo.repeatHeaders = h + '</tr>';
27
+ }
28
+
29
+ // number of rows to skip
30
+ skip = wo && wo.rowsToSkip || 4;
31
+
32
+ // remove appended headers by classname
33
+ c.$table.find("tr.repeated-header").remove();
34
+ $tr = c.$tbodies.find('tr');
35
+ l = $tr.length;
36
+ // loop all tr elements and insert a copy of the "headers"
37
+ for (i = skip; i < l; i += skip) {
38
+ // insert a copy of the table head every X rows
39
+ $tr.eq(i).before(wo.repeatHeaders);
40
+ }
41
+ },
42
+ // this remove function is called when using the refreshWidgets method or when destroying the tablesorter plugin
43
+ // this function only applies to tablesorter v2.4+
44
+ remove: function(table, c){
45
+ c.$table.find("tr.repeated-header").remove();
46
+ }
47
+
48
+ });
49
+
50
+ })(jQuery);
@@ -0,0 +1,241 @@
1
+ /*!
2
+ Copyright (C) 2011 T. Connell & Associates, Inc.
3
+
4
+ Dual-licensed under the MIT and GPL licenses
5
+
6
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
7
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
8
+ FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
9
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
10
+
11
+ Resizable scroller widget for the jQuery tablesorter plugin
12
+
13
+ Version 2.0 - modified by Rob Garrison (4/12/2013)
14
+ Requires jQuery, v1.2.3 or higher
15
+ Requires the tablesorter plugin, v2.0 or higher, available at http://mottie.github.com/tablesorter/docs/
16
+
17
+ Usage:
18
+
19
+ $(function() {
20
+
21
+ $('table.tablesorter').tablesorter({
22
+ widgets: ['zebra', 'scroller'],
23
+ widgetOptions : {
24
+ scroller_height : 300, // height of scroll window
25
+ scroller_barWidth : 17, // scroll bar width
26
+ scroller_jumpToHeader : true, // header snap to browser top when scrolling the tbody
27
+ scroller_idPrefix : 's_' // cloned thead id prefix (random number added to end)
28
+ }
29
+ });
30
+
31
+ });
32
+
33
+ Website: www.tconnell.com
34
+ */
35
+ /*jshint browser:true, jquery:true, unused:false */
36
+ ;(function($){
37
+ "use strict";
38
+
39
+ $.fn.hasScrollBar = function(){
40
+ return this.get(0).scrollHeight > this.height();
41
+ };
42
+ var ts = $.tablesorter;
43
+
44
+ ts.window_resize = function(){
45
+ if (this.resize_timer) {
46
+ clearTimeout(this.resize_timer);
47
+ }
48
+ this.resize_timer = setTimeout(function(){
49
+ $(this).trigger('resizeEnd');
50
+ }, 250);
51
+ };
52
+
53
+ // Add extra scroller css
54
+ $(function(){
55
+ var s = '<style>' +
56
+ '.tablesorter-scroller-header table.tablesorter { margin-bottom: 0; }' +
57
+ '.tablesorter-scroller-table table.tablesorter { margin-top: 0; } ' +
58
+ '.tablesorter-scroller-table .tablesorter-filter-row, .tablesorter-scroller-table tfoot { display: none; }' +
59
+ '.tablesorter-scroller-table table.tablesorter thead tr.tablesorter-headerRow * {' +
60
+ 'line-height:0;height:0;border:none;background-image:none;padding-top:0;padding-bottom:0;margin-top:0;margin-bottom:0;overflow:hidden;' +
61
+ '}</style>';
62
+ $(s).appendTo('body');
63
+ });
64
+
65
+ ts.addWidget({
66
+ id: 'scroller',
67
+ priority: 60, // run after the filter widget
68
+ options: {
69
+ scroller_height : 300,
70
+ scroller_barWidth : 17,
71
+ scroller_jumpToHeader: true,
72
+ scroller_idPrefix : 's_'
73
+ },
74
+ init: function(table, thisWidget, c, wo){
75
+ var $win = $(window);
76
+ //Setup window.resizeEnd event
77
+ $win
78
+ .bind('resize', ts.window_resize)
79
+ .bind('resizeEnd', function(e) {
80
+ // init is run before format, so scroller_resizeWidth
81
+ // won't be defined within the "c" or "wo" parameters
82
+ if (typeof table.config.widgetOptions.scroller_resizeWidth === 'function') {
83
+ //IE calls resize when you modify content, so we have to unbind the resize event
84
+ //so we don't end up with an infinite loop. we can rebind after we're done.
85
+ $win.unbind('resize', ts.window_resize);
86
+ table.config.widgetOptions.scroller_resizeWidth();
87
+ $win.bind('resize', ts.window_resize);
88
+ }
89
+ });
90
+ },
91
+ format: function(table, c, wo) {
92
+ var h, $hdr, id, t, resize, $cells,
93
+ $win = $(window),
94
+ $tbl = c.$table,
95
+ flag = false,
96
+ filterInputs = 'input, select';
97
+
98
+ if (!c.isScrolling) {
99
+ h = wo.scroller_height || 300;
100
+ t = $tbl.find('tbody').height();
101
+ if (t !== 0 && h > t) { h = t + 10; } // Table is less than h px
102
+ id = wo.scroller_id = wo.scroller_idPrefix + Math.floor(Math.random() * 101);
103
+
104
+ $hdr = $('<table class="' + $tbl.attr('class') + '" cellpadding=0 cellspacing=0><thead>' + $tbl.find('thead:first').html() + '</thead></table>');
105
+ $tbl
106
+ .wrap('<div id="' + id + '" class="tablesorter-scroller" style="text-align:left;" />')
107
+ .before($hdr)
108
+ .find('.tablesorter-filter-row').addClass('hideme');
109
+
110
+ $cells = $hdr
111
+ .wrap('<div class="tablesorter-scroller-header" style="width:' + $tbl.width() + ';" />')
112
+ .find('.' + ts.css.header)
113
+ .bind('mousedown', function(){
114
+ this.onselectstart = function(){ return false; };
115
+ return false;
116
+ });
117
+
118
+ $tbl
119
+ .wrap('<div class="tablesorter-scroller-table" style="height:' + h + 'px;width:' + $tbl.width() + ';overflow-y:scroll;" />')
120
+ .unbind('sortEnd.tsScroller')
121
+ .bind('sortEnd.tsScroller', function(){
122
+ c.$headers.each(function(i){
123
+ var t = $cells.eq(i);
124
+ t
125
+ .attr('class', $(this).attr('class'))
126
+ // remove processing icon
127
+ .removeClass(ts.css.processing + ' ' + c.cssProcessing);
128
+ if (ts.css.icon){
129
+ t
130
+ .find('.' + ts.css.icon)
131
+ .attr('class', $(this).find('.' + ts.css.icon).attr('class'));
132
+ }
133
+ });
134
+ });
135
+
136
+ // make scroller header sortable
137
+ c.$headers.find(c.selectorSort).add( c.$headers.filter(c.selectorSort) ).each(function(i){
138
+ var t = $(this);
139
+ $cells.eq(i)
140
+ // clicking on new header will trigger a sort
141
+ .bind('mouseup', function(e){
142
+ t.trigger(e, true); // external mouseup flag (click timer is ignored)
143
+ })
144
+ // prevent header text selection
145
+ .bind('mousedown', function(){
146
+ this.onselectstart = function(){ return false; };
147
+ return false;
148
+ });
149
+ });
150
+
151
+ // look for filter widget
152
+ $tbl.bind('filterEnd', function(){
153
+ if (flag) { return; }
154
+ $cells.each(function(i){
155
+ $(this).find(filterInputs).val( c.$filters.find(filterInputs).eq(i).val() );
156
+ });
157
+ });
158
+ $hdr.find(filterInputs).bind('keyup search', function(e){
159
+ // ignore arrow and meta keys; allow backspace
160
+ if ((e.which < 32 && e.which !== 8) || (e.which >= 37 && e.which <=40)) { return; }
161
+ flag = true;
162
+ var $f = $(this), col = $f.attr('data-column');
163
+ c.$filters.find(filterInputs).eq(col)
164
+ .val( $f.val() )
165
+ .trigger('search');
166
+ setTimeout(function(){
167
+ flag = false;
168
+ }, wo.filter_searchDelay);
169
+ });
170
+
171
+ resize = function(){
172
+ var d,
173
+ //Hide other scrollers so we can resize
174
+ $div = $('div.scroller[id != "' + id + '"]').hide();
175
+
176
+ $tbl.find('thead').show();
177
+
178
+ //Reset sizes so parent can resize.
179
+ $hdr
180
+ .width(0)
181
+ .parent().width(0)
182
+ .find('th,td').width(0);
183
+
184
+ $tbl
185
+ .width(0)
186
+ .find('thead').find('th,td').width(0);
187
+ d = $tbl.parent();
188
+ d.width(0);
189
+
190
+ d.parent().trigger('resize');
191
+ // Shrink a bit to accommodate scrollbar
192
+ d.width( d.parent().innerWidth() - ( d.parent().hasScrollBar() ? wo.scroller_barWidth : 0 ) );
193
+
194
+ $tbl.width( d.innerWidth() - ( d.hasScrollBar() ? wo.scroller_barWidth : 0 ) );
195
+ $tbl.find('thead').find('th,td').filter(':visible').each(function(i, c){
196
+ var $th = $(c),
197
+ //Wrap in browser detect??
198
+ w = parseInt( $th.css('min-width').replace('auto', '0').replace(/(px|em)/, ''), 10 );
199
+ if ( $th.width() < w ) {
200
+ $th.width(w);
201
+ } else {
202
+ w = $th.width();
203
+ }
204
+ $hdr.find('th,td').eq(i).width(w);
205
+ });
206
+
207
+ $hdr.width($tbl.innerWidth());
208
+ $div.show();
209
+ };
210
+
211
+ //Expose to external calls
212
+ wo.scroller_resizeWidth = resize;
213
+
214
+ resize();
215
+
216
+ $tbl.find('thead').css('visibility', 'hidden');
217
+ c.isScrolling = true;
218
+
219
+ t = $tbl.parent().parent().height();
220
+ // The header will always jump into view if scrolling the table body
221
+ $tbl.parent().bind('scroll', function(){
222
+ if (wo.scroller_jumpToHeader) {
223
+ var pos = $win.scrollTop() - $hdr.offset().top;
224
+ if ($(this).scrollTop() !== 0 && pos < t && pos > 0) {
225
+ $win.scrollTop( $hdr.offset().top );
226
+ }
227
+ }
228
+ });
229
+
230
+ }
231
+
232
+ //Sorting, so scroll to top
233
+ $tbl.parent().animate({ scrollTop: 0 }, 'fast');
234
+
235
+ },
236
+ remove : function(table, c, wo){
237
+
238
+ }
239
+ });
240
+
241
+ })(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.2
4
+ version: 1.10.3
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-02-22 00:00:00.000000000 Z
12
+ date: 2014-02-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: railties
@@ -76,10 +76,32 @@ files:
76
76
  - vendor/assets/images/jquery-tablesorter/white-unsorted.gif
77
77
  - vendor/assets/javascripts/jquery-tablesorter.js
78
78
  - vendor/assets/javascripts/jquery-tablesorter/addons/pager/jquery.tablesorter.pager.js
79
+ - vendor/assets/javascripts/jquery-tablesorter/extras/jquery.quicksearch.js
80
+ - vendor/assets/javascripts/jquery-tablesorter/extras/semver-mod.js
81
+ - vendor/assets/javascripts/jquery-tablesorter/extras/semver.js
79
82
  - vendor/assets/javascripts/jquery-tablesorter/jquery.metadata.js
80
83
  - vendor/assets/javascripts/jquery-tablesorter/jquery.tablesorter.js
81
84
  - vendor/assets/javascripts/jquery-tablesorter/jquery.tablesorter.widgets-filter-formatter.js
82
85
  - vendor/assets/javascripts/jquery-tablesorter/jquery.tablesorter.widgets.js
86
+ - vendor/assets/javascripts/jquery-tablesorter/parsers/parser-date-iso8601.js
87
+ - vendor/assets/javascripts/jquery-tablesorter/parsers/parser-date-month.js
88
+ - vendor/assets/javascripts/jquery-tablesorter/parsers/parser-date-two-digit-year.js
89
+ - vendor/assets/javascripts/jquery-tablesorter/parsers/parser-date-weekday.js
90
+ - vendor/assets/javascripts/jquery-tablesorter/parsers/parser-date.js
91
+ - vendor/assets/javascripts/jquery-tablesorter/parsers/parser-feet-inch-fraction.js
92
+ - vendor/assets/javascripts/jquery-tablesorter/parsers/parser-file-type.js
93
+ - vendor/assets/javascripts/jquery-tablesorter/parsers/parser-ignore-articles.js
94
+ - vendor/assets/javascripts/jquery-tablesorter/parsers/parser-input-select.js
95
+ - vendor/assets/javascripts/jquery-tablesorter/parsers/parser-ipv6.js
96
+ - vendor/assets/javascripts/jquery-tablesorter/parsers/parser-metric.js
97
+ - vendor/assets/javascripts/jquery-tablesorter/widgets/widget-build-table.js
98
+ - vendor/assets/javascripts/jquery-tablesorter/widgets/widget-columnSelector.js
99
+ - vendor/assets/javascripts/jquery-tablesorter/widgets/widget-cssStickyHeaders.js
100
+ - vendor/assets/javascripts/jquery-tablesorter/widgets/widget-editable.js
101
+ - vendor/assets/javascripts/jquery-tablesorter/widgets/widget-grouping.js
102
+ - vendor/assets/javascripts/jquery-tablesorter/widgets/widget-pager.js
103
+ - vendor/assets/javascripts/jquery-tablesorter/widgets/widget-repeatheaders.js
104
+ - vendor/assets/javascripts/jquery-tablesorter/widgets/widget-scroller.js
83
105
  - vendor/assets/stylesheets/jquery-tablesorter/addons/pager/jquery.tablesorter.pager.css
84
106
  - vendor/assets/stylesheets/jquery-tablesorter/filter.formatter.css
85
107
  - vendor/assets/stylesheets/jquery-tablesorter/theme.black-ice.css