jquery-tablesorter 1.19.3 → 1.19.4

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.
@@ -1,4 +1,4 @@
1
- /* Widget: print - updated 11/2/2015 (v2.24.1) *//*
1
+ /* Widget: print - updated 11/22/2015 (v2.24.6) *//*
2
2
  * Requires tablesorter v2.8+ and jQuery 1.2.6+
3
3
  */
4
4
  /*jshint browser:true, jquery:true, unused:false */
@@ -33,7 +33,9 @@
33
33
  // hide filtered rows
34
34
  ', .' + ( wo.filter_filteredRow || 'filtered' ) + ' { display: none; }' +
35
35
  // hide sort arrows
36
- '.' + ( ts.css.header || 'tablesorter-header' ) + ' { background-image: none !important; }';
36
+ '.' + ( ts.css.header || 'tablesorter-header' ) + ' { background-image: none !important; }' +
37
+
38
+ '@media print { .print_widget_hidden { display: none; } }';
37
39
 
38
40
  // replace content with data-attribute content
39
41
  $table.find('[' + wo.print_dataAttrib + ']').each(function(){
@@ -81,21 +83,27 @@
81
83
 
82
84
  printOutput : function(c, data, style) {
83
85
  var wo = c.widgetOptions,
86
+ lang = ts.language,
84
87
  generator = window.open( '', wo.print_title, printTable.popupStyle ),
85
- t = wo.print_title || c.$table.find('caption').text() || c.$table[0].id || document.title || 'table';
88
+ t = wo.print_title || c.$table.find('caption').text() || c.$table[0].id || document.title || 'table',
89
+ button = wo.print_now ? '' : '<div class="print_widget_hidden"><a href="javascript:window.print();">' +
90
+ '<button type="button">' + lang.button_print + '</button></a> <a href="javascript:window.close();">' +
91
+ '<button type="button">' + lang.button_close + '</button></a><hr></div>';
86
92
  generator.document.write(
87
93
  '<html><head><title>' + t + '</title>' +
88
94
  ( wo.print_styleSheet ? '<link rel="stylesheet" href="' + wo.print_styleSheet + '">' : '' ) +
89
95
  '<style>' + style + '</style>' +
90
- '</head><body>' + data + '</body></html>'
96
+ '</head><body>' + button + data + '</body></html>'
91
97
  );
92
98
  generator.document.close();
93
99
  // use timeout to allow browser to build DOM before printing
94
100
  // Print preview in Chrome doesn't work without this code
95
- setTimeout( function() {
96
- generator.print();
97
- generator.close();
98
- }, 10 );
101
+ if ( wo.print_now ) {
102
+ setTimeout( function() {
103
+ generator.print();
104
+ generator.close();
105
+ }, 10 );
106
+ }
99
107
  return true;
100
108
  },
101
109
 
@@ -105,6 +113,9 @@
105
113
 
106
114
  };
107
115
 
116
+ ts.language.button_close = 'Close';
117
+ ts.language.button_print = 'Print';
118
+
108
119
  ts.addWidget({
109
120
  id: 'print',
110
121
  options: {
@@ -114,6 +125,7 @@
114
125
  print_columns : 'selected', // (a)ll, (v)isbible or (s)elected (if columnSelector widget is added)
115
126
  print_extraCSS : '', // add any extra css definitions for the popup window here
116
127
  print_styleSheet : '', // add the url of your print stylesheet
128
+ print_now : true, // Open the print dialog immediately if true
117
129
  // callback executed when processing completes
118
130
  // to continue printing, use the following function:
119
131
  // function( config, $table, printStyle ) {
@@ -1,4 +1,4 @@
1
- /*! tablesorter tbody sorting widget (BETA) - 10/31/2015 (v2.24.0)
1
+ /*! tablesorter tbody sorting widget (BETA) - 11/22/2015 (v2.24.6)
2
2
  * Requires tablesorter v2.22.2+ and jQuery 1.4+
3
3
  * by Rob Garrison
4
4
  */
@@ -124,7 +124,7 @@
124
124
  // fall back to built-in numeric sort
125
125
  // var sort = $.tablesorter['sort' + s](a, b, dir, colMax, table);
126
126
  sort = c.numberSorter ? c.numberSorter( colA, colB, dir, colMax, table ) :
127
- ts[ 'sortNumeric' + ( dir ? 'Asc' : 'Desc' ) ]( colA, colB, num, colMax, col, table );
127
+ ts[ 'sortNumeric' + ( dir ? 'Asc' : 'Desc' ) ]( colA, colB, num, colMax, col, c );
128
128
  } else {
129
129
  // set a & b depending on sort direction
130
130
  x = dir ? colA : colB;
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.19.3
4
+ version: 1.19.4
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: 2015-11-12 00:00:00.000000000 Z
12
+ date: 2015-11-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: railties