jquery-datatables 1.10.12 → 1.10.13

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 (43) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/app/assets/javascripts/datatables/dataTables.bootstrap.js +2 -2
  4. data/app/assets/javascripts/datatables/dataTables.bootstrap4.js +5 -5
  5. data/app/assets/javascripts/datatables/dataTables.foundation.js +1 -1
  6. data/app/assets/javascripts/datatables/dataTables.material.js +1 -1
  7. data/app/assets/javascripts/datatables/dataTables.semanticui.js +1 -1
  8. data/app/assets/javascripts/datatables/extensions/AutoFill/dataTables.autoFill.js +63 -31
  9. data/app/assets/javascripts/datatables/extensions/Buttons/buttons.colVis.js +2 -3
  10. data/app/assets/javascripts/datatables/extensions/Buttons/buttons.flash.js +145 -55
  11. data/app/assets/javascripts/datatables/extensions/Buttons/buttons.html5.js +224 -206
  12. data/app/assets/javascripts/datatables/extensions/Buttons/buttons.print.js +14 -8
  13. data/app/assets/javascripts/datatables/extensions/Buttons/dataTables.buttons.js +54 -24
  14. data/app/assets/javascripts/datatables/extensions/KeyTable/dataTables.keyTable.js +137 -68
  15. data/app/assets/javascripts/datatables/extensions/Responsive/dataTables.responsive.js +30 -7
  16. data/app/assets/javascripts/datatables/extensions/Responsive/responsive.bootstrap.js +6 -2
  17. data/app/assets/javascripts/datatables/extensions/Responsive/responsive.bootstrap4.js +6 -2
  18. data/app/assets/javascripts/datatables/extensions/RowReorder/dataTables.rowReorder.js +64 -6
  19. data/app/assets/javascripts/datatables/extensions/Select/dataTables.select.js +40 -15
  20. data/app/assets/javascripts/datatables/jquery.dataTables.js +246 -217
  21. data/app/assets/javascripts/datatables/plugins/api/average.js +32 -0
  22. data/app/assets/javascripts/datatables/plugins/api/sum.js +51 -0
  23. data/app/assets/javascripts/datatables/plugins/pagination/input.js +224 -0
  24. data/app/assets/javascripts/datatables/plugins/search/alphabetSearch.js +368 -0
  25. data/app/assets/javascripts/datatables/plugins/sorting/file-size.js +43 -0
  26. data/app/assets/javascripts/datatables/plugins/sorting/ip-address.js +103 -0
  27. data/app/assets/stylesheets/datatables/dataTables.bootstrap.css +0 -1
  28. data/app/assets/stylesheets/datatables/dataTables.semanticui.css +0 -1
  29. data/app/assets/stylesheets/datatables/extensions/Responsive/responsive.bootstrap.css +4 -4
  30. data/app/assets/stylesheets/datatables/extensions/Responsive/responsive.bootstrap4.css +4 -4
  31. data/app/assets/stylesheets/datatables/extensions/Responsive/responsive.dataTables.css +4 -4
  32. data/app/assets/stylesheets/datatables/extensions/Responsive/responsive.foundation.css +4 -4
  33. data/app/assets/stylesheets/datatables/extensions/Responsive/responsive.jqueryui.css +4 -4
  34. data/app/assets/stylesheets/datatables/extensions/Responsive/responsive.semanticui.css +4 -4
  35. data/app/assets/stylesheets/datatables/extensions/Select/select.bootstrap.css +9 -4
  36. data/app/assets/stylesheets/datatables/extensions/Select/select.bootstrap4.css +9 -4
  37. data/app/assets/stylesheets/datatables/extensions/Select/select.dataTables.css +9 -4
  38. data/app/assets/stylesheets/datatables/extensions/Select/select.foundation.css +9 -4
  39. data/app/assets/stylesheets/datatables/extensions/Select/select.jqueryui.css +9 -4
  40. data/app/assets/stylesheets/datatables/extensions/Select/select.semanticui.css +9 -4
  41. data/app/assets/stylesheets/datatables/plugins/search/alphabetSearch.css +43 -0
  42. data/lib/jquery-datatables/version.rb +1 -1
  43. metadata +10 -3
@@ -0,0 +1,43 @@
1
+ /**
2
+ * When dealing with computer file sizes, it is common to append a post fix
3
+ * such as B, KB, MB or GB to a string in order to easily denote the order of
4
+ * magnitude of the file size. This plug-in allows sorting to take these
5
+ * indicates of size into account.
6
+ *
7
+ * A counterpart type detection plug-in is also available.
8
+ *
9
+ * @name File size
10
+ * @summary Sort abbreviated file sizes correctly (8MB, 4KB, etc)
11
+ * @author Allan Jardine - datatables.net
12
+ *
13
+ * @example
14
+ * $('#example').DataTable( {
15
+ * columnDefs: [
16
+ * { type: 'file-size', targets: 0 }
17
+ * ]
18
+ * } );
19
+ */
20
+
21
+ jQuery.fn.dataTable.ext.type.order['file-size-pre'] = function ( data ) {
22
+ var matches = data.match( /^(\d+(?:\.\d+)?)\s*([a-z]+)/i );
23
+ var multipliers = {
24
+ b: 1,
25
+ kb: 1000,
26
+ kib: 1024,
27
+ mb: 1000000,
28
+ mib: 1048576,
29
+ gb: 1000000000,
30
+ gib: 1073741824,
31
+ tb: 1000000000000,
32
+ tib: 1099511627776,
33
+ pb: 1000000000000000,
34
+ pib: 1125899906842624
35
+ };
36
+
37
+ if (matches) {
38
+ var multiplier = multipliers[matches[2].toLowerCase()];
39
+ return parseFloat( matches[1] ) * multiplier;
40
+ } else {
41
+ return -1;
42
+ };
43
+ };
@@ -0,0 +1,103 @@
1
+ /**
2
+ * Sorts a column containing IP addresses (IPv4 and IPv6) in typical dot
3
+ * notation / colon. This can be most useful when using DataTables for a
4
+ * networking application, and reporting information containing IP address.
5
+ *
6
+ * @name IP addresses
7
+ * @summary Sort IP addresses numerically
8
+ * @author Dominique Fournier
9
+ * @author Brad Wasson
10
+ *
11
+ * @example
12
+ * $('#example').dataTable( {
13
+ * columnDefs: [
14
+ * { type: 'ip-address', targets: 0 }
15
+ * ]
16
+ * } );
17
+ */
18
+
19
+ jQuery.extend( jQuery.fn.dataTableExt.oSort, {
20
+ "ip-address-pre": function ( a ) {
21
+ var i, item;
22
+ var m = a.split("."),
23
+ n = a.split(":"),
24
+ x = "",
25
+ xa = "";
26
+
27
+ if (m.length == 4) {
28
+ // IPV4
29
+ for(i = 0; i < m.length; i++) {
30
+ item = m[i];
31
+
32
+ if(item.length == 1) {
33
+ x += "00" + item;
34
+ }
35
+ else if(item.length == 2) {
36
+ x += "0" + item;
37
+ }
38
+ else {
39
+ x += item;
40
+ }
41
+ }
42
+ }
43
+ else if (n.length > 0) {
44
+ // IPV6
45
+ var count = 0;
46
+ for(i = 0; i < n.length; i++) {
47
+ item = n[i];
48
+
49
+ if (i > 0) {
50
+ xa += ":";
51
+ }
52
+
53
+ if(item.length === 0) {
54
+ count += 0;
55
+ }
56
+ else if(item.length == 1) {
57
+ xa += "000" + item;
58
+ count += 4;
59
+ }
60
+ else if(item.length == 2) {
61
+ xa += "00" + item;
62
+ count += 4;
63
+ }
64
+ else if(item.length == 3) {
65
+ xa += "0" + item;
66
+ count += 4;
67
+ }
68
+ else {
69
+ xa += item;
70
+ count += 4;
71
+ }
72
+ }
73
+
74
+ // Padding the ::
75
+ n = xa.split(":");
76
+ var paddDone = 0;
77
+
78
+ for (i = 0; i < n.length; i++) {
79
+ item = n[i];
80
+
81
+ if (item.length === 0 && paddDone === 0) {
82
+ for (var padding = 0 ; padding < (32-count) ; padding++) {
83
+ x += "0";
84
+ paddDone = 1;
85
+ }
86
+ }
87
+ else {
88
+ x += item;
89
+ }
90
+ }
91
+ }
92
+
93
+ return x;
94
+ },
95
+
96
+ "ip-address-asc": function ( a, b ) {
97
+ return ((a < b) ? -1 : ((a > b) ? 1 : 0));
98
+ },
99
+
100
+ "ip-address-desc": function ( a, b ) {
101
+ return ((a < b) ? 1 : ((a > b) ? -1 : 0));
102
+ }
103
+ });
@@ -8,7 +8,6 @@ table.dataTable {
8
8
  table.dataTable td,
9
9
  table.dataTable th {
10
10
  -webkit-box-sizing: content-box;
11
- -moz-box-sizing: content-box;
12
11
  box-sizing: content-box;
13
12
  }
14
13
  table.dataTable td.dataTables_empty,
@@ -41,7 +41,6 @@ table.dataTable.table thead td.sorting_desc:after {
41
41
  table.dataTable.table td,
42
42
  table.dataTable.table th {
43
43
  -webkit-box-sizing: content-box;
44
- -moz-box-sizing: content-box;
45
44
  box-sizing: content-box;
46
45
  }
47
46
  table.dataTable.table td.dataTables_empty,
@@ -92,20 +92,20 @@ table.dataTable > tbody > tr.child {
92
92
  table.dataTable > tbody > tr.child:hover {
93
93
  background: transparent !important;
94
94
  }
95
- table.dataTable > tbody > tr.child ul {
95
+ table.dataTable > tbody > tr.child ul.dtr-details {
96
96
  display: inline-block;
97
97
  list-style-type: none;
98
98
  margin: 0;
99
99
  padding: 0;
100
100
  }
101
- table.dataTable > tbody > tr.child ul li {
101
+ table.dataTable > tbody > tr.child ul.dtr-details li {
102
102
  border-bottom: 1px solid #efefef;
103
103
  padding: 0.5em 0;
104
104
  }
105
- table.dataTable > tbody > tr.child ul li:first-child {
105
+ table.dataTable > tbody > tr.child ul.dtr-details li:first-child {
106
106
  padding-top: 0;
107
107
  }
108
- table.dataTable > tbody > tr.child ul li:last-child {
108
+ table.dataTable > tbody > tr.child ul.dtr-details li:last-child {
109
109
  border-bottom: none;
110
110
  }
111
111
  table.dataTable > tbody > tr.child span.dtr-title {
@@ -92,20 +92,20 @@ table.dataTable > tbody > tr.child {
92
92
  table.dataTable > tbody > tr.child:hover {
93
93
  background: transparent !important;
94
94
  }
95
- table.dataTable > tbody > tr.child ul {
95
+ table.dataTable > tbody > tr.child ul.dtr-details {
96
96
  display: inline-block;
97
97
  list-style-type: none;
98
98
  margin: 0;
99
99
  padding: 0;
100
100
  }
101
- table.dataTable > tbody > tr.child ul li {
101
+ table.dataTable > tbody > tr.child ul.dtr-details li {
102
102
  border-bottom: 1px solid #efefef;
103
103
  padding: 0.5em 0;
104
104
  }
105
- table.dataTable > tbody > tr.child ul li:first-child {
105
+ table.dataTable > tbody > tr.child ul.dtr-details li:first-child {
106
106
  padding-top: 0;
107
107
  }
108
- table.dataTable > tbody > tr.child ul li:last-child {
108
+ table.dataTable > tbody > tr.child ul.dtr-details li:last-child {
109
109
  border-bottom: none;
110
110
  }
111
111
  table.dataTable > tbody > tr.child span.dtr-title {
@@ -92,20 +92,20 @@ table.dataTable > tbody > tr.child {
92
92
  table.dataTable > tbody > tr.child:hover {
93
93
  background: transparent !important;
94
94
  }
95
- table.dataTable > tbody > tr.child ul {
95
+ table.dataTable > tbody > tr.child ul.dtr-details {
96
96
  display: inline-block;
97
97
  list-style-type: none;
98
98
  margin: 0;
99
99
  padding: 0;
100
100
  }
101
- table.dataTable > tbody > tr.child ul li {
101
+ table.dataTable > tbody > tr.child ul.dtr-details li {
102
102
  border-bottom: 1px solid #efefef;
103
103
  padding: 0.5em 0;
104
104
  }
105
- table.dataTable > tbody > tr.child ul li:first-child {
105
+ table.dataTable > tbody > tr.child ul.dtr-details li:first-child {
106
106
  padding-top: 0;
107
107
  }
108
- table.dataTable > tbody > tr.child ul li:last-child {
108
+ table.dataTable > tbody > tr.child ul.dtr-details li:last-child {
109
109
  border-bottom: none;
110
110
  }
111
111
  table.dataTable > tbody > tr.child span.dtr-title {
@@ -92,20 +92,20 @@ table.dataTable > tbody > tr.child {
92
92
  table.dataTable > tbody > tr.child:hover {
93
93
  background: transparent !important;
94
94
  }
95
- table.dataTable > tbody > tr.child ul {
95
+ table.dataTable > tbody > tr.child ul.dtr-details {
96
96
  display: inline-block;
97
97
  list-style-type: none;
98
98
  margin: 0;
99
99
  padding: 0;
100
100
  }
101
- table.dataTable > tbody > tr.child ul li {
101
+ table.dataTable > tbody > tr.child ul.dtr-details li {
102
102
  border-bottom: 1px solid #efefef;
103
103
  padding: 0.5em 0;
104
104
  }
105
- table.dataTable > tbody > tr.child ul li:first-child {
105
+ table.dataTable > tbody > tr.child ul.dtr-details li:first-child {
106
106
  padding-top: 0;
107
107
  }
108
- table.dataTable > tbody > tr.child ul li:last-child {
108
+ table.dataTable > tbody > tr.child ul.dtr-details li:last-child {
109
109
  border-bottom: none;
110
110
  }
111
111
  table.dataTable > tbody > tr.child span.dtr-title {
@@ -92,20 +92,20 @@ table.dataTable > tbody > tr.child {
92
92
  table.dataTable > tbody > tr.child:hover {
93
93
  background: transparent !important;
94
94
  }
95
- table.dataTable > tbody > tr.child ul {
95
+ table.dataTable > tbody > tr.child ul.dtr-details {
96
96
  display: inline-block;
97
97
  list-style-type: none;
98
98
  margin: 0;
99
99
  padding: 0;
100
100
  }
101
- table.dataTable > tbody > tr.child ul li {
101
+ table.dataTable > tbody > tr.child ul.dtr-details li {
102
102
  border-bottom: 1px solid #efefef;
103
103
  padding: 0.5em 0;
104
104
  }
105
- table.dataTable > tbody > tr.child ul li:first-child {
105
+ table.dataTable > tbody > tr.child ul.dtr-details li:first-child {
106
106
  padding-top: 0;
107
107
  }
108
- table.dataTable > tbody > tr.child ul li:last-child {
108
+ table.dataTable > tbody > tr.child ul.dtr-details li:last-child {
109
109
  border-bottom: none;
110
110
  }
111
111
  table.dataTable > tbody > tr.child span.dtr-title {
@@ -92,20 +92,20 @@ table.dataTable > tbody > tr.child {
92
92
  table.dataTable > tbody > tr.child:hover {
93
93
  background: transparent !important;
94
94
  }
95
- table.dataTable > tbody > tr.child ul {
95
+ table.dataTable > tbody > tr.child ul.dtr-details {
96
96
  display: inline-block;
97
97
  list-style-type: none;
98
98
  margin: 0;
99
99
  padding: 0;
100
100
  }
101
- table.dataTable > tbody > tr.child ul li {
101
+ table.dataTable > tbody > tr.child ul.dtr-details li {
102
102
  border-bottom: 1px solid #efefef;
103
103
  padding: 0.5em 0;
104
104
  }
105
- table.dataTable > tbody > tr.child ul li:first-child {
105
+ table.dataTable > tbody > tr.child ul.dtr-details li:first-child {
106
106
  padding-top: 0;
107
107
  }
108
- table.dataTable > tbody > tr.child ul li:last-child {
108
+ table.dataTable > tbody > tr.child ul.dtr-details li:last-child {
109
109
  border-bottom: none;
110
110
  }
111
111
  table.dataTable > tbody > tr.child span.dtr-title {
@@ -59,10 +59,13 @@ table.dataTable.display tbody > tr > .selected:hover, table.dataTable.order-colu
59
59
  table.dataTable.order-column.hover tbody > tr > .selected:hover {
60
60
  background-color: #007dbb;
61
61
  }
62
- table.dataTable td.select-checkbox {
62
+ table.dataTable td.select-checkbox,
63
+ table.dataTable th.select-checkbox {
63
64
  position: relative;
64
65
  }
65
- table.dataTable td.select-checkbox:before, table.dataTable td.select-checkbox:after {
66
+ table.dataTable td.select-checkbox:before, table.dataTable td.select-checkbox:after,
67
+ table.dataTable th.select-checkbox:before,
68
+ table.dataTable th.select-checkbox:after {
66
69
  display: block;
67
70
  position: absolute;
68
71
  top: 1.2em;
@@ -71,14 +74,16 @@ table.dataTable td.select-checkbox:before, table.dataTable td.select-checkbox:af
71
74
  height: 12px;
72
75
  box-sizing: border-box;
73
76
  }
74
- table.dataTable td.select-checkbox:before {
77
+ table.dataTable td.select-checkbox:before,
78
+ table.dataTable th.select-checkbox:before {
75
79
  content: ' ';
76
80
  margin-top: -6px;
77
81
  margin-left: -6px;
78
82
  border: 1px solid black;
79
83
  border-radius: 3px;
80
84
  }
81
- table.dataTable tr.selected td.select-checkbox:after {
85
+ table.dataTable tr.selected td.select-checkbox:after,
86
+ table.dataTable tr.selected th.select-checkbox:after {
82
87
  content: '\2714';
83
88
  margin-top: -11px;
84
89
  margin-left: -4px;
@@ -59,10 +59,13 @@ table.dataTable.display tbody > tr > .selected:hover, table.dataTable.order-colu
59
59
  table.dataTable.order-column.hover tbody > tr > .selected:hover {
60
60
  background-color: #026bc6;
61
61
  }
62
- table.dataTable td.select-checkbox {
62
+ table.dataTable td.select-checkbox,
63
+ table.dataTable th.select-checkbox {
63
64
  position: relative;
64
65
  }
65
- table.dataTable td.select-checkbox:before, table.dataTable td.select-checkbox:after {
66
+ table.dataTable td.select-checkbox:before, table.dataTable td.select-checkbox:after,
67
+ table.dataTable th.select-checkbox:before,
68
+ table.dataTable th.select-checkbox:after {
66
69
  display: block;
67
70
  position: absolute;
68
71
  top: 1.2em;
@@ -71,14 +74,16 @@ table.dataTable td.select-checkbox:before, table.dataTable td.select-checkbox:af
71
74
  height: 12px;
72
75
  box-sizing: border-box;
73
76
  }
74
- table.dataTable td.select-checkbox:before {
77
+ table.dataTable td.select-checkbox:before,
78
+ table.dataTable th.select-checkbox:before {
75
79
  content: ' ';
76
80
  margin-top: -6px;
77
81
  margin-left: -6px;
78
82
  border: 1px solid black;
79
83
  border-radius: 3px;
80
84
  }
81
- table.dataTable tr.selected td.select-checkbox:after {
85
+ table.dataTable tr.selected td.select-checkbox:after,
86
+ table.dataTable tr.selected th.select-checkbox:after {
82
87
  content: '\2714';
83
88
  margin-top: -11px;
84
89
  margin-left: -4px;
@@ -59,10 +59,13 @@ table.dataTable.display tbody > tr > .selected:hover, table.dataTable.order-colu
59
59
  table.dataTable.order-column.hover tbody > tr > .selected:hover {
60
60
  background-color: #a2aec7;
61
61
  }
62
- table.dataTable td.select-checkbox {
62
+ table.dataTable td.select-checkbox,
63
+ table.dataTable th.select-checkbox {
63
64
  position: relative;
64
65
  }
65
- table.dataTable td.select-checkbox:before, table.dataTable td.select-checkbox:after {
66
+ table.dataTable td.select-checkbox:before, table.dataTable td.select-checkbox:after,
67
+ table.dataTable th.select-checkbox:before,
68
+ table.dataTable th.select-checkbox:after {
66
69
  display: block;
67
70
  position: absolute;
68
71
  top: 1.2em;
@@ -71,14 +74,16 @@ table.dataTable td.select-checkbox:before, table.dataTable td.select-checkbox:af
71
74
  height: 12px;
72
75
  box-sizing: border-box;
73
76
  }
74
- table.dataTable td.select-checkbox:before {
77
+ table.dataTable td.select-checkbox:before,
78
+ table.dataTable th.select-checkbox:before {
75
79
  content: ' ';
76
80
  margin-top: -6px;
77
81
  margin-left: -6px;
78
82
  border: 1px solid black;
79
83
  border-radius: 3px;
80
84
  }
81
- table.dataTable tr.selected td.select-checkbox:after {
85
+ table.dataTable tr.selected td.select-checkbox:after,
86
+ table.dataTable tr.selected th.select-checkbox:after {
82
87
  content: '\2714';
83
88
  margin-top: -11px;
84
89
  margin-left: -4px;
@@ -59,10 +59,13 @@ table.dataTable.display tbody > tr > .selected:hover, table.dataTable.order-colu
59
59
  table.dataTable.order-column.hover tbody > tr > .selected:hover {
60
60
  background-color: #0081ab;
61
61
  }
62
- table.dataTable td.select-checkbox {
62
+ table.dataTable td.select-checkbox,
63
+ table.dataTable th.select-checkbox {
63
64
  position: relative;
64
65
  }
65
- table.dataTable td.select-checkbox:before, table.dataTable td.select-checkbox:after {
66
+ table.dataTable td.select-checkbox:before, table.dataTable td.select-checkbox:after,
67
+ table.dataTable th.select-checkbox:before,
68
+ table.dataTable th.select-checkbox:after {
66
69
  display: block;
67
70
  position: absolute;
68
71
  top: 1.2em;
@@ -71,14 +74,16 @@ table.dataTable td.select-checkbox:before, table.dataTable td.select-checkbox:af
71
74
  height: 12px;
72
75
  box-sizing: border-box;
73
76
  }
74
- table.dataTable td.select-checkbox:before {
77
+ table.dataTable td.select-checkbox:before,
78
+ table.dataTable th.select-checkbox:before {
75
79
  content: ' ';
76
80
  margin-top: -6px;
77
81
  margin-left: -6px;
78
82
  border: 1px solid black;
79
83
  border-radius: 3px;
80
84
  }
81
- table.dataTable tr.selected td.select-checkbox:after {
85
+ table.dataTable tr.selected td.select-checkbox:after,
86
+ table.dataTable tr.selected th.select-checkbox:after {
82
87
  content: '\2714';
83
88
  margin-top: -11px;
84
89
  margin-left: -4px;