jquery-datatables-rails 3.2.0 → 3.3.0

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 (24) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/dataTables/bootstrap/2/jquery.dataTables.bootstrap.js +110 -96
  3. data/app/assets/javascripts/dataTables/bootstrap/3/jquery.dataTables.bootstrap.js +6 -6
  4. data/app/assets/javascripts/dataTables/extras/dataTables.colReorder.js +28 -27
  5. data/app/assets/javascripts/dataTables/extras/dataTables.colVis.js +27 -11
  6. data/app/assets/javascripts/dataTables/extras/dataTables.fixedColumns.js +53 -29
  7. data/app/assets/javascripts/dataTables/extras/dataTables.responsive.js +110 -47
  8. data/app/assets/javascripts/dataTables/extras/dataTables.tableTools.js +90 -25
  9. data/app/assets/javascripts/dataTables/jquery.dataTables.foundation.js +133 -139
  10. data/app/assets/javascripts/dataTables/jquery.dataTables.js +483 -375
  11. data/app/assets/javascripts/dataTables/jquery.dataTables.sorting.numbersHtml.js +37 -14
  12. data/app/assets/javascripts/dataTables/jquery.dataTables.typeDetection.numbersHtml.js +49 -33
  13. data/app/assets/media/dataTables/extras/swf/copy_csv_xls.swf +0 -0
  14. data/app/assets/media/dataTables/extras/swf/copy_csv_xls_pdf.swf +0 -0
  15. data/app/assets/stylesheets/dataTables/bootstrap/2/jquery.dataTables.bootstrap.scss +34 -9
  16. data/app/assets/stylesheets/dataTables/bootstrap/3/jquery.dataTables.bootstrap.scss +122 -31
  17. data/app/assets/stylesheets/dataTables/extras/dataTables.colvis.jqueryui.scss +18 -0
  18. data/app/assets/stylesheets/dataTables/extras/dataTables.fixedColumns.scss +1 -0
  19. data/app/assets/stylesheets/dataTables/extras/dataTables.responsive.scss +29 -12
  20. data/app/assets/stylesheets/dataTables/extras/dataTables.tableTools.scss +43 -19
  21. data/app/assets/stylesheets/dataTables/jquery.dataTables.foundation.scss +15 -4
  22. data/app/assets/stylesheets/dataTables/jquery.dataTables.scss +22 -11
  23. data/lib/jquery/datatables/rails/version.rb +1 -1
  24. metadata +18 -18
@@ -1,15 +1,38 @@
1
- jQuery.fn.dataTableExt.oSort['num-html-asc'] = function(a,b) {
2
- var x = a.replace( /<.*?>/g, "" );
3
- var y = b.replace( /<.*?>/g, "" );
4
- x = parseFloat( x );
5
- y = parseFloat( y );
6
- return ((x < y) ? -1 : ((x > y) ? 1 : 0));
7
- };
1
+ /**
2
+ * This sorting plug-in allows for HTML tags with numeric data. With the 'html'
3
+ * type it will strip the HTML and then sorts by strings, with this type it
4
+ * strips the HTML and then sorts by numbers. Note also that this sorting
5
+ * plug-in has an equivalent type detection plug-in which can make integration
6
+ * easier.
7
+ *
8
+ * DataTables 1.10+ has HTML numeric data type detection and sorting abilities
9
+ * built-in. As such this plug-in is marked as deprecated, but might be useful
10
+ * when working with old versions of DataTables.
11
+ *
12
+ * @name Numbers with HTML
13
+ * @summary Sort data which is a mix of HTML and numeric data.
14
+ * @deprecated
15
+ * @author [Allan Jardine](http://sprymedia.co.uk)
16
+ *
17
+ * @example
18
+ * $('#example').dataTable( {
19
+ * columnDefs: [
20
+ * { type: 'num-html', targets: 0 }
21
+ * ]
22
+ * } );
23
+ */
8
24
 
9
- jQuery.fn.dataTableExt.oSort['num-html-desc'] = function(a,b) {
10
- var x = a.replace( /<.*?>/g, "" );
11
- var y = b.replace( /<.*?>/g, "" );
12
- x = parseFloat( x );
13
- y = parseFloat( y );
14
- return ((x < y) ? 1 : ((x > y) ? -1 : 0));
15
- };
25
+ jQuery.extend( jQuery.fn.dataTableExt.oSort, {
26
+ "num-html-pre": function ( a ) {
27
+ var x = String(a).replace( /<[\s\S]*?>/g, "" );
28
+ return parseFloat( x );
29
+ },
30
+
31
+ "num-html-asc": function ( a, b ) {
32
+ return ((a < b) ? -1 : ((a > b) ? 1 : 0));
33
+ },
34
+
35
+ "num-html-desc": function ( a, b ) {
36
+ return ((a < b) ? 1 : ((a > b) ? -1 : 0));
37
+ }
38
+ } );
@@ -1,40 +1,56 @@
1
+ /**
2
+ * This type-detection plug-in will look at an HTML string from a data cell,
3
+ * strip the HTML tags and then check to see if the remaining data is numeric.
4
+ * If it is, then the data can be sorted numerically with the Numbers with HTML
5
+ * sorting plug-in.
6
+ *
7
+ * DataTables 1.10+ has numeric HTML data type and sorting abilities built-in.
8
+ * As such this plug-in is marked as deprecated, but might be useful when
9
+ * working with old versions of DataTables.
10
+ *
11
+ * @name Numbers with HTML
12
+ * @summary Detect data which is a mix of HTML and numeric data.
13
+ * @deprecated
14
+ * @author [Allan Jardine](http://sprymedia.co.uk)
15
+ */
16
+
1
17
  jQuery.fn.dataTableExt.aTypes.unshift( function ( sData )
2
18
  {
3
- sData = typeof sData.replace == 'function' ?
4
- sData.replace( /<.*?>/g, "" ) : sData;
5
- sData = $.trim(sData);
19
+ sData = typeof sData.replace == 'function' ?
20
+ sData.replace( /<[\s\S]*?>/g, "" ) : sData;
21
+ sData = $.trim(sData);
6
22
 
7
- var sValidFirstChars = "0123456789-";
8
- var sValidChars = "0123456789.";
9
- var Char;
10
- var bDecimal = false;
23
+ var sValidFirstChars = "0123456789-";
24
+ var sValidChars = "0123456789.";
25
+ var Char;
26
+ var bDecimal = false;
11
27
 
12
- /* Check for a valid first char (no period and allow negatives) */
13
- Char = sData.charAt(0);
14
- if (sValidFirstChars.indexOf(Char) == -1)
15
- {
16
- return null;
17
- }
28
+ /* Check for a valid first char (no period and allow negatives) */
29
+ Char = sData.charAt(0);
30
+ if (sValidFirstChars.indexOf(Char) == -1)
31
+ {
32
+ return null;
33
+ }
18
34
 
19
- /* Check all the other characters are valid */
20
- for ( var i=1 ; i<sData.length ; i++ )
21
- {
22
- Char = sData.charAt(i);
23
- if (sValidChars.indexOf(Char) == -1)
24
- {
25
- return null;
26
- }
35
+ /* Check all the other characters are valid */
36
+ for ( var i=1 ; i<sData.length ; i++ )
37
+ {
38
+ Char = sData.charAt(i);
39
+ if (sValidChars.indexOf(Char) == -1)
40
+ {
41
+ return null;
42
+ }
27
43
 
28
- /* Only allowed one decimal place... */
29
- if ( Char == "." )
30
- {
31
- if ( bDecimal )
32
- {
33
- return null;
34
- }
35
- bDecimal = true;
36
- }
37
- }
44
+ /* Only allowed one decimal place... */
45
+ if ( Char == "." )
46
+ {
47
+ if ( bDecimal )
48
+ {
49
+ return null;
50
+ }
51
+ bDecimal = true;
52
+ }
53
+ }
38
54
 
39
- return 'num-html';
40
- } );
55
+ return 'num-html';
56
+ } );
@@ -5,7 +5,6 @@
5
5
  //= depend_on_asset "dataTables/sort_desc_disabled.png"
6
6
 
7
7
  div.dataTables_length label {
8
- float: left;
9
8
  text-align: left;
10
9
  }
11
10
 
@@ -13,8 +12,17 @@ div.dataTables_length select {
13
12
  width: 75px;
14
13
  }
15
14
 
15
+ div.dataTables_filter {
16
+ text-align: right;
17
+ }
18
+
16
19
  div.dataTables_filter label {
17
- float: right;
20
+ text-align: left;
21
+ }
22
+
23
+ div.dataTables_filter input {
24
+ margin-left: 0.5em;
25
+ display: inline-block;
18
26
  }
19
27
 
20
28
  div.dataTables_info {
@@ -22,10 +30,23 @@ div.dataTables_info {
22
30
  }
23
31
 
24
32
  div.dataTables_paginate {
25
- float: right;
33
+ text-align: right;
34
+ margin: 0;
35
+ }
36
+
37
+ div.dataTables_paginate div.pagination {
26
38
  margin: 0;
27
39
  }
28
40
 
41
+ @media screen and (max-width: 767px) {
42
+ div.dataTables_length,
43
+ div.dataTables_filter,
44
+ div.dataTables_info,
45
+ div.dataTables_paginate {
46
+ text-align: center;
47
+ }
48
+ }
49
+
29
50
  table.table {
30
51
  clear: both;
31
52
  margin-bottom: 6px !important;
@@ -67,6 +88,7 @@ div.dataTables_scrollHead table thead tr:last-child td:first-child {
67
88
 
68
89
  div.dataTables_scrollBody table {
69
90
  border-top: none;
91
+ margin-top: 0 !important;
70
92
  margin-bottom: 0 !important;
71
93
  }
72
94
 
@@ -76,6 +98,7 @@ div.dataTables_scrollBody tbody tr:first-child td {
76
98
  }
77
99
 
78
100
  div.dataTables_scrollFoot table {
101
+ margin-top: 0 !important;
79
102
  border-top: none;
80
103
  }
81
104
 
@@ -137,7 +160,7 @@ ul.DTTT_dropdown.dropdown-menu li:hover a {
137
160
  }
138
161
 
139
162
  div.DTTT_collection_background {
140
- z-index: 2002;
163
+ z-index: 2002;
141
164
  }
142
165
 
143
166
  /* TableTools information display */
@@ -170,8 +193,9 @@ div.DTFC_RightHeadWrapper table,
170
193
  div.DTFC_RightFootWrapper table,
171
194
  table.DTFC_Cloned tr.even {
172
195
  background-color: white;
196
+ margin-bottom: 0;
173
197
  }
174
-
198
+
175
199
  div.DTFC_RightHeadWrapper table ,
176
200
  div.DTFC_LeftHeadWrapper table {
177
201
  margin-bottom: 0 !important;
@@ -179,7 +203,7 @@ div.DTFC_LeftHeadWrapper table {
179
203
  border-bottom-left-radius: 0 !important;
180
204
  border-bottom-right-radius: 0 !important;
181
205
  }
182
-
206
+
183
207
  div.DTFC_RightHeadWrapper table thead tr:last-child th:first-child,
184
208
  div.DTFC_RightHeadWrapper table thead tr:last-child td:first-child,
185
209
  div.DTFC_LeftHeadWrapper table thead tr:last-child th:first-child,
@@ -187,21 +211,22 @@ div.DTFC_LeftHeadWrapper table thead tr:last-child td:first-child {
187
211
  border-bottom-left-radius: 0 !important;
188
212
  border-bottom-right-radius: 0 !important;
189
213
  }
190
-
214
+
191
215
  div.DTFC_RightBodyWrapper table,
192
216
  div.DTFC_LeftBodyWrapper table {
193
217
  border-top: none;
194
218
  margin-bottom: 0 !important;
195
219
  }
196
-
220
+
197
221
  div.DTFC_RightBodyWrapper tbody tr:first-child th,
198
222
  div.DTFC_RightBodyWrapper tbody tr:first-child td,
199
223
  div.DTFC_LeftBodyWrapper tbody tr:first-child th,
200
224
  div.DTFC_LeftBodyWrapper tbody tr:first-child td {
201
225
  border-top: none;
202
226
  }
203
-
227
+
204
228
  div.DTFC_RightFootWrapper table,
205
229
  div.DTFC_LeftFootWrapper table {
206
230
  border-top: none;
207
231
  }
232
+
@@ -1,29 +1,39 @@
1
1
  div.dataTables_length label {
2
2
  font-weight: normal;
3
- float: left;
4
3
  text-align: left;
4
+ white-space: nowrap;
5
5
  }
6
6
 
7
7
  div.dataTables_length select {
8
8
  width: 75px;
9
+ display: inline-block;
10
+ }
11
+
12
+ div.dataTables_filter {
13
+ text-align: right;
9
14
  }
10
15
 
11
16
  div.dataTables_filter label {
12
17
  font-weight: normal;
13
- float: right;
18
+ white-space: nowrap;
19
+ text-align: left;
14
20
  }
15
21
 
16
22
  div.dataTables_filter input {
17
- width: 16em;
23
+ margin-left: 0.5em;
24
+ display: inline-block;
25
+ width: auto;
18
26
  }
19
27
 
20
28
  div.dataTables_info {
21
29
  padding-top: 8px;
30
+ white-space: nowrap;
22
31
  }
23
32
 
24
33
  div.dataTables_paginate {
25
- float: right;
26
34
  margin: 0;
35
+ white-space: nowrap;
36
+ text-align: right;
27
37
  }
28
38
 
29
39
  div.dataTables_paginate ul.pagination {
@@ -31,6 +41,21 @@ div.dataTables_paginate ul.pagination {
31
41
  white-space: nowrap;
32
42
  }
33
43
 
44
+ @media screen and (max-width: 767px) {
45
+ div.dataTables_wrapper > div.row > div,
46
+ div.dataTables_length,
47
+ div.dataTables_filter,
48
+ div.dataTables_info,
49
+ div.dataTables_paginate {
50
+ text-align: center;
51
+ }
52
+
53
+ div.DTTT {
54
+ margin-bottom: 0.5em;
55
+ }
56
+ }
57
+
58
+
34
59
  table.dataTable td,
35
60
  table.dataTable th {
36
61
  -webkit-box-sizing: content-box;
@@ -52,24 +77,61 @@ table.dataTable thead .sorting_desc,
52
77
  table.dataTable thead .sorting_asc_disabled,
53
78
  table.dataTable thead .sorting_desc_disabled {
54
79
  cursor: pointer;
80
+ position: relative;
55
81
  }
56
82
 
57
- table.dataTable thead .sorting { background: image-url('dataTables/sort_both.png') no-repeat center right; }
58
- table.dataTable thead .sorting_asc { background: image-url('dataTables/sort_asc.png') no-repeat center right; }
59
- table.dataTable thead .sorting_desc { background: image-url('dataTables/sort_desc.png') no-repeat center right; }
83
+ table.dataTable thead .sorting:after,
84
+ table.dataTable thead .sorting_asc:after,
85
+ table.dataTable thead .sorting_desc:after {
86
+ position: absolute;
87
+ top: 8px;
88
+ right: 8px;
89
+ display: block;
90
+ font-family: 'Glyphicons Halflings';
91
+ opacity: 0.5;
92
+ }
93
+ table.dataTable thead .sorting:after {
94
+ opacity: 0.2;
95
+ content: "\e150"; /* sort */
96
+ }
97
+ table.dataTable thead .sorting_asc:after {
98
+ content: "\e155"; /* sort-by-attributes */
99
+ }
100
+ table.dataTable thead .sorting_desc:after {
101
+ content: "\e156"; /* sort-by-attributes-alt */
102
+ }
103
+ div.dataTables_scrollBody table.dataTable thead .sorting:after,
104
+ div.dataTables_scrollBody table.dataTable thead .sorting_asc:after,
105
+ div.dataTables_scrollBody table.dataTable thead .sorting_desc:after {
106
+ display: none;
107
+ }
60
108
 
61
- table.dataTable thead .sorting_asc_disabled { background: image-url('dataTables/sort_asc_disabled.png') no-repeat center right; }
62
- table.dataTable thead .sorting_desc_disabled { background: image-url('dataTables/sort_desc_disabled.png') no-repeat center right; }
109
+ table.dataTable thead .sorting_asc_disabled:after,
110
+ table.dataTable thead .sorting_desc_disabled:after {
111
+ color: #eee;
112
+ }
63
113
 
64
114
  table.dataTable thead > tr > th {
65
- padding-left: 18px;
66
- padding-right: 18px;
115
+ padding-right: 30px;
67
116
  }
68
117
 
69
118
  table.dataTable th:active {
70
119
  outline: none;
71
120
  }
72
121
 
122
+
123
+ /* Condensed */
124
+ table.dataTable.table-condensed thead > tr > th {
125
+ padding-right: 20px;
126
+ }
127
+
128
+ table.dataTable.table-condensed thead .sorting:after,
129
+ table.dataTable.table-condensed thead .sorting_asc:after,
130
+ table.dataTable.table-condensed thead .sorting_desc:after {
131
+ top: 6px;
132
+ right: 6px;
133
+ }
134
+
73
135
  /* Scrolling */
74
136
  div.dataTables_scrollHead table {
75
137
  margin-bottom: 0 !important;
@@ -116,6 +178,11 @@ table.table-bordered tbody td {
116
178
  border-left-width: 0;
117
179
  border-bottom-width: 0;
118
180
  }
181
+ table.table-bordered tfoot th,
182
+ table.table-bordered tfoot td {
183
+ border-left-width: 0;
184
+ border-bottom-width: 0;
185
+ }
119
186
  table.table-bordered th:last-child,
120
187
  table.table-bordered td:last-child {
121
188
  border-right-width: 0;
@@ -130,23 +197,24 @@ div.dataTables_scrollHead table.table-bordered {
130
197
  /*
131
198
  * TableTools styles
132
199
  */
133
- .table tbody tr.active td,
134
- .table tbody tr.active th {
200
+ .table.dataTable tbody tr.active td,
201
+ .table.dataTable tbody tr.active th {
135
202
  background-color: #08C;
136
203
  color: white;
137
204
  }
138
205
 
139
- .table tbody tr.active:hover td,
140
- .table tbody tr.active:hover th {
206
+ .table.dataTable tbody tr.active:hover td,
207
+ .table.dataTable tbody tr.active:hover th {
141
208
  background-color: #0075b0 !important;
142
209
  }
143
210
 
144
- .table tbody tr.active a {
211
+ .table.dataTable tbody tr.active th > a,
212
+ .table.dataTable tbody tr.active td > a {
145
213
  color: white;
146
214
  }
147
215
 
148
- .table-striped tbody tr.active:nth-child(odd) td,
149
- .table-striped tbody tr.active:nth-child(odd) th {
216
+ .table-striped.dataTable tbody tr.active:nth-child(odd) td,
217
+ .table-striped.dataTable tbody tr.active:nth-child(odd) th {
150
218
  background-color: #017ebc;
151
219
  }
152
220
 
@@ -154,11 +222,6 @@ table.DTTT_selectable tbody tr {
154
222
  cursor: pointer;
155
223
  }
156
224
 
157
- div.DTTT .btn {
158
- color: #333 !important;
159
- font-size: 12px;
160
- }
161
-
162
225
  div.DTTT .btn:hover {
163
226
  text-decoration: none !important;
164
227
  }
@@ -181,14 +244,29 @@ ul.DTTT_dropdown.dropdown-menu li:hover a {
181
244
  }
182
245
 
183
246
  div.DTTT_collection_background {
184
- z-index: 2002;
247
+ z-index: 2002;
185
248
  }
186
249
 
187
250
  /* TableTools information display */
188
- div.DTTT_print_info.modal {
251
+ div.DTTT_print_info {
252
+ position: fixed;
253
+ top: 50%;
254
+ left: 50%;
255
+ width: 400px;
189
256
  height: 150px;
257
+ margin-left: -200px;
190
258
  margin-top: -75px;
191
259
  text-align: center;
260
+ color: #333;
261
+ padding: 10px 30px;
262
+ opacity: 0.95;
263
+
264
+ background-color: white;
265
+ border: 1px solid rgba(0, 0, 0, 0.2);
266
+ border-radius: 6px;
267
+
268
+ -webkit-box-shadow: 0 3px 7px rgba(0, 0, 0, 0.5);
269
+ box-shadow: 0 3px 7px rgba(0, 0, 0, 0.5);
192
270
  }
193
271
 
194
272
  div.DTTT_print_info h6 {
@@ -208,10 +286,11 @@ div.dataTables_processing {
208
286
  top: 50%;
209
287
  left: 50%;
210
288
  width: 100%;
211
- height: 40px;
289
+ height: 60px;
212
290
  margin-left: -50%;
213
291
  margin-top: -25px;
214
292
  padding-top: 20px;
293
+ padding-bottom: 20px;
215
294
  text-align: center;
216
295
  font-size: 1.2em;
217
296
  background-color: white;
@@ -236,15 +315,16 @@ table.DTFC_Cloned tr.even {
236
315
  background-color: white;
237
316
  margin-bottom: 0;
238
317
  }
239
-
318
+
240
319
  div.DTFC_RightHeadWrapper table ,
241
320
  div.DTFC_LeftHeadWrapper table {
321
+ border-bottom: none !important;
242
322
  margin-bottom: 0 !important;
243
323
  border-top-right-radius: 0 !important;
244
324
  border-bottom-left-radius: 0 !important;
245
325
  border-bottom-right-radius: 0 !important;
246
326
  }
247
-
327
+
248
328
  div.DTFC_RightHeadWrapper table thead tr:last-child th:first-child,
249
329
  div.DTFC_RightHeadWrapper table thead tr:last-child td:first-child,
250
330
  div.DTFC_LeftHeadWrapper table thead tr:last-child th:first-child,
@@ -252,23 +332,34 @@ div.DTFC_LeftHeadWrapper table thead tr:last-child td:first-child {
252
332
  border-bottom-left-radius: 0 !important;
253
333
  border-bottom-right-radius: 0 !important;
254
334
  }
255
-
335
+
256
336
  div.DTFC_RightBodyWrapper table,
257
337
  div.DTFC_LeftBodyWrapper table {
258
338
  border-top: none;
259
339
  margin: 0 !important;
260
340
  }
261
-
341
+
262
342
  div.DTFC_RightBodyWrapper tbody tr:first-child th,
263
343
  div.DTFC_RightBodyWrapper tbody tr:first-child td,
264
344
  div.DTFC_LeftBodyWrapper tbody tr:first-child th,
265
345
  div.DTFC_LeftBodyWrapper tbody tr:first-child td {
266
346
  border-top: none;
267
347
  }
268
-
348
+
269
349
  div.DTFC_RightFootWrapper table,
270
350
  div.DTFC_LeftFootWrapper table {
271
351
  border-top: none;
352
+ margin-top: 0 !important;
353
+ }
354
+
355
+
356
+ div.DTFC_LeftBodyWrapper table.dataTable thead .sorting:after,
357
+ div.DTFC_LeftBodyWrapper table.dataTable thead .sorting_asc:after,
358
+ div.DTFC_LeftBodyWrapper table.dataTable thead .sorting_desc:after,
359
+ div.DTFC_RightBodyWrapper table.dataTable thead .sorting:after,
360
+ div.DTFC_RightBodyWrapper table.dataTable thead .sorting_asc:after,
361
+ div.DTFC_RightBodyWrapper table.dataTable thead .sorting_desc:after {
362
+ display: none;
272
363
  }
273
364
 
274
365