effective_datatables 2.6.6 → 2.6.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (33) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/dataTables/buttons/buttons.bootstrap.js +47 -47
  3. data/app/assets/javascripts/dataTables/buttons/buttons.colVis.js +182 -181
  4. data/app/assets/javascripts/dataTables/buttons/buttons.html5.js +1201 -684
  5. data/app/assets/javascripts/dataTables/buttons/buttons.print.js +144 -127
  6. data/app/assets/javascripts/dataTables/buttons/dataTables.buttons.js +1463 -1405
  7. data/app/assets/javascripts/dataTables/colreorder/dataTables.colReorder.js +27 -0
  8. data/app/assets/javascripts/dataTables/dataTables.bootstrap.js +182 -0
  9. data/app/assets/javascripts/dataTables/jquery.dataTables.js +15278 -0
  10. data/app/assets/javascripts/dataTables/jszip/jszip.js +9155 -0
  11. data/app/assets/javascripts/dataTables/responsive/dataTables.responsive.js +1232 -0
  12. data/app/assets/javascripts/dataTables/responsive/responsive.bootstrap.js +81 -0
  13. data/app/assets/javascripts/effective_datatables.js +7 -8
  14. data/app/assets/stylesheets/dataTables/buttons/{buttons.bootstrap.min.css → buttons.bootstrap.css} +0 -0
  15. data/app/assets/stylesheets/dataTables/colReorder/colReorder.bootstrap.css +11 -0
  16. data/app/assets/stylesheets/dataTables/{dataTables.bootstrap.min.css → dataTables.bootstrap.css} +1 -3
  17. data/app/assets/stylesheets/dataTables/responsive/responsive.bootstrap.css +181 -0
  18. data/app/assets/stylesheets/effective_datatables.scss +4 -10
  19. data/app/assets/stylesheets/effective_datatables/_overrides.scss.erb +5 -25
  20. data/lib/effective_datatables/version.rb +1 -1
  21. metadata +12 -16
  22. data/app/assets/javascripts/dataTables/dataTables.colReorder.min.js +0 -26
  23. data/app/assets/javascripts/dataTables/jquery.dataTables.bootstrap.js +0 -220
  24. data/app/assets/javascripts/dataTables/jquery.dataTables.min.js +0 -164
  25. data/app/assets/javascripts/dataTables/responsive/dataTables.responsive.min.js +0 -23
  26. data/app/assets/javascripts/dataTables/responsive/responsive.bootstrap.min.js +0 -7
  27. data/app/assets/javascripts/vendor/jszip.min.js +0 -14
  28. data/app/assets/stylesheets/dataTables/buttons/buttons.dataTables.min.css +0 -298
  29. data/app/assets/stylesheets/dataTables/colReorder/colReorder.bootstrap.min.css +0 -1
  30. data/app/assets/stylesheets/dataTables/colReorder/colReorder.dataTables.min.css +0 -1
  31. data/app/assets/stylesheets/dataTables/jquery.dataTables.min.css +0 -453
  32. data/app/assets/stylesheets/dataTables/responsive/responsive.bootstrap.min.css +0 -1
  33. data/app/assets/stylesheets/dataTables/responsive/responsive.dataTables.min.css +0 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5975b4b4ba58e69c1e3761287cb562a3a71b2212
4
- data.tar.gz: bdc46b4f28f56f3d696ac007b1ba4c5f06a3d08a
3
+ metadata.gz: 785f08010eeacf3514ddf868347c5719a00aa1de
4
+ data.tar.gz: 62cae48ebd12531d63a3e323ff144c464ea7bb83
5
5
  SHA512:
6
- metadata.gz: e03f4630c067d02924054332414fcbd76e2eb0384d15586238f49a802456ee2633b5dc540596f87eec8715476d1eadb031e9c92d200416950ffe6ec54d90d678
7
- data.tar.gz: 8a1b839bc2c6a4b05910dd075ebdac0d2ac7a419e692da92b9b770ab907616edbf73a06bb6aaf9d08505462c4f462d61296bf5c84987eb6b2531bea76c094a6b
6
+ metadata.gz: 9aedcc7ee4675cb68b2dedf452de2400cd508b96ade8eb1f6681e545ac91fa5786ffb7a79e8d62fe57509e2c2a7948293bcaee4c6e9a5b76b20beb4900503507
7
+ data.tar.gz: 8756e72f0973466a19794d14218ea8b793a27ccddf22f4104e488051ab782f5aa7b99ec166b61a2ec4ed5aed03be9726872f6a447de835a616cedc8996e4b1e3
@@ -1,66 +1,66 @@
1
1
  /*! Bootstrap integration for DataTables' Buttons
2
- * ©2015 SpryMedia Ltd - datatables.net/license
2
+ * ©2016 SpryMedia Ltd - datatables.net/license
3
3
  */
4
4
 
5
5
  (function( factory ){
6
- if ( typeof define === 'function' && define.amd ) {
7
- // AMD
8
- define( ['jquery', 'datatables.net-bs', 'datatables.net-buttons'], function ( $ ) {
9
- return factory( $, window, document );
10
- } );
11
- }
12
- else if ( typeof exports === 'object' ) {
13
- // CommonJS
14
- module.exports = function (root, $) {
15
- if ( ! root ) {
16
- root = window;
17
- }
6
+ if ( typeof define === 'function' && define.amd ) {
7
+ // AMD
8
+ define( ['jquery', 'datatables.net-bs', 'datatables.net-buttons'], function ( $ ) {
9
+ return factory( $, window, document );
10
+ } );
11
+ }
12
+ else if ( typeof exports === 'object' ) {
13
+ // CommonJS
14
+ module.exports = function (root, $) {
15
+ if ( ! root ) {
16
+ root = window;
17
+ }
18
18
 
19
- if ( ! $ || ! $.fn.dataTable ) {
20
- $ = require('datatables.net-bs')(root, $).$;
21
- }
19
+ if ( ! $ || ! $.fn.dataTable ) {
20
+ $ = require('datatables.net-bs')(root, $).$;
21
+ }
22
22
 
23
- if ( ! $.fn.dataTable.Buttons ) {
24
- require('datatables.net-buttons')(root, $);
25
- }
23
+ if ( ! $.fn.dataTable.Buttons ) {
24
+ require('datatables.net-buttons')(root, $);
25
+ }
26
26
 
27
- return factory( $, root, root.document );
28
- };
29
- }
30
- else {
31
- // Browser
32
- factory( jQuery, window, document );
33
- }
27
+ return factory( $, root, root.document );
28
+ };
29
+ }
30
+ else {
31
+ // Browser
32
+ factory( jQuery, window, document );
33
+ }
34
34
  }(function( $, window, document, undefined ) {
35
35
  'use strict';
36
36
  var DataTable = $.fn.dataTable;
37
37
 
38
38
 
39
39
  $.extend( true, DataTable.Buttons.defaults, {
40
- dom: {
41
- container: {
42
- className: 'dt-buttons btn-group'
43
- },
44
- button: {
45
- className: 'btn btn-default'
46
- },
47
- collection: {
48
- tag: 'ul',
49
- className: 'dt-button-collection dropdown-menu',
50
- button: {
51
- tag: 'li',
52
- className: 'dt-button'
53
- },
54
- buttonLiner: {
55
- tag: 'a',
56
- className: ''
57
- }
58
- }
59
- }
40
+ dom: {
41
+ container: {
42
+ className: 'dt-buttons btn-group'
43
+ },
44
+ button: {
45
+ className: 'btn btn-default'
46
+ },
47
+ collection: {
48
+ tag: 'ul',
49
+ className: 'dt-button-collection dropdown-menu',
50
+ button: {
51
+ tag: 'li',
52
+ className: 'dt-button'
53
+ },
54
+ buttonLiner: {
55
+ tag: 'a',
56
+ className: ''
57
+ }
58
+ }
59
+ }
60
60
  } );
61
61
 
62
62
  DataTable.ext.buttons.collection.text = function ( dt ) {
63
- return dt.i18n('buttons.collection', 'Collection <span class="caret"/>');
63
+ return dt.i18n('buttons.collection', 'Collection <span class="caret"/>');
64
64
  };
65
65
 
66
66
 
@@ -1,195 +1,196 @@
1
1
  /*!
2
2
  * Column visibility buttons for Buttons and DataTables.
3
- * 2015 SpryMedia Ltd - datatables.net/license
3
+ * 2016 SpryMedia Ltd - datatables.net/license
4
4
  */
5
5
 
6
6
  (function( factory ){
7
- if ( typeof define === 'function' && define.amd ) {
8
- // AMD
9
- define( ['jquery', 'datatables.net', 'datatables.net-buttons'], function ( $ ) {
10
- return factory( $, window, document );
11
- } );
12
- }
13
- else if ( typeof exports === 'object' ) {
14
- // CommonJS
15
- module.exports = function (root, $) {
16
- if ( ! root ) {
17
- root = window;
18
- }
19
-
20
- if ( ! $ || ! $.fn.dataTable ) {
21
- $ = require('datatables.net')(root, $).$;
22
- }
23
-
24
- if ( ! $.fn.dataTable.Buttons ) {
25
- require('datatables.net-buttons')(root, $);
26
- }
27
-
28
- return factory( $, root, root.document );
29
- };
30
- }
31
- else {
32
- // Browser
33
- factory( jQuery, window, document );
34
- }
7
+ if ( typeof define === 'function' && define.amd ) {
8
+ // AMD
9
+ define( ['jquery', 'datatables.net', 'datatables.net-buttons'], function ( $ ) {
10
+ return factory( $, window, document );
11
+ } );
12
+ }
13
+ else if ( typeof exports === 'object' ) {
14
+ // CommonJS
15
+ module.exports = function (root, $) {
16
+ if ( ! root ) {
17
+ root = window;
18
+ }
19
+
20
+ if ( ! $ || ! $.fn.dataTable ) {
21
+ $ = require('datatables.net')(root, $).$;
22
+ }
23
+
24
+ if ( ! $.fn.dataTable.Buttons ) {
25
+ require('datatables.net-buttons')(root, $);
26
+ }
27
+
28
+ return factory( $, root, root.document );
29
+ };
30
+ }
31
+ else {
32
+ // Browser
33
+ factory( jQuery, window, document );
34
+ }
35
35
  }(function( $, window, document, undefined ) {
36
36
  'use strict';
37
37
  var DataTable = $.fn.dataTable;
38
38
 
39
39
 
40
40
  $.extend( DataTable.ext.buttons, {
41
- // A collection of column visibility buttons
42
- colvis: function ( dt, conf ) {
43
- return {
44
- extend: 'collection',
45
- text: function ( dt ) {
46
- return dt.i18n( 'buttons.colvis', 'Column visibility' );
47
- },
48
- className: 'buttons-colvis',
49
- buttons: [ {
50
- extend: 'columnsToggle',
51
- columns: conf.columns
52
- } ]
53
- };
54
- },
55
-
56
- // Selected columns with individual buttons - toggle column visibility
57
- columnsToggle: function ( dt, conf ) {
58
- var columns = dt.columns( conf.columns ).indexes().map( function ( idx ) {
59
- return {
60
- extend: 'columnToggle',
61
- columns: idx
62
- };
63
- } ).toArray();
64
-
65
- return columns;
66
- },
67
-
68
- // Single button to toggle column visibility
69
- columnToggle: function ( dt, conf ) {
70
- return {
71
- extend: 'columnVisibility',
72
- columns: conf.columns
73
- };
74
- },
75
-
76
- // Selected columns with individual buttons - set column visibility
77
- columnsVisibility: function ( dt, conf ) {
78
- var columns = dt.columns( conf.columns ).indexes().map( function ( idx ) {
79
- return {
80
- extend: 'columnVisibility',
81
- columns: idx,
82
- visibility: conf.visibility
83
- };
84
- } ).toArray();
85
-
86
- return columns;
87
- },
88
-
89
- // Single button to set column visibility
90
- columnVisibility: {
91
- columns: undefined, // column selector
92
- text: function ( dt, button, conf ) {
93
- return conf._columnText( dt, conf.columns );
94
- },
95
- className: 'buttons-columnVisibility',
96
- action: function ( e, dt, button, conf ) {
97
- var col = dt.columns( conf.columns );
98
- var curr = col.visible();
99
-
100
- col.visible( conf.visibility !== undefined ?
101
- conf.visibility :
102
- ! (curr.length ? curr[0] : false )
103
- );
104
- },
105
- init: function ( dt, button, conf ) {
106
- var that = this;
107
- var col = dt.column( conf.columns );
108
-
109
- dt
110
- .on( 'column-visibility.dt'+conf.namespace, function (e, settings, column, state) {
111
- if ( column === conf.columns ) {
112
- that.active( state );
113
- }
114
- } )
115
- .on( 'column-reorder.dt'+conf.namespace, function (e, settings, details) {
116
- // Don't rename buttons based on column name if the button
117
- // controls more than one column!
118
- if ( dt.columns( conf.columns ).count() !== 1 ) {
119
- return;
120
- }
121
-
122
- if ( typeof conf.columns === 'number' ) {
123
- conf.columns = details.mapping[ conf.columns ];
124
- }
125
-
126
- var col = dt.column( conf.columns );
127
-
128
- that.text( conf._columnText( dt, conf.columns ) );
129
- that.active( col.visible() );
130
- } );
131
-
132
- this.active( col.visible() );
133
- },
134
- destroy: function ( dt, button, conf ) {
135
- dt
136
- .off( 'column-visibility.dt'+conf.namespace )
137
- .off( 'column-reorder.dt'+conf.namespace );
138
- },
139
-
140
- _columnText: function ( dt, col ) {
141
- // Use DataTables' internal data structure until this is presented
142
- // is a public API. The other option is to use
143
- // `$( column(col).node() ).text()` but the node might not have been
144
- // populated when Buttons is constructed.
145
- var idx = dt.column( col ).index();
146
- return dt.settings()[0].aoColumns[ idx ].sTitle
147
- .replace(/\n/g," ") // remove new lines
148
- .replace( /<.*?>/g, "" ) // strip HTML
149
- .replace(/^\s+|\s+$/g,""); // trim
150
- }
151
- },
152
-
153
-
154
- colvisRestore: {
155
- className: 'buttons-colvisRestore',
156
-
157
- text: function ( dt ) {
158
- return dt.i18n( 'buttons.colvisRestore', 'Restore visibility' );
159
- },
160
-
161
- init: function ( dt, button, conf ) {
162
- conf._visOriginal = dt.columns().indexes().map( function ( idx ) {
163
- return dt.column( idx ).visible();
164
- } ).toArray();
165
- },
166
-
167
- action: function ( e, dt, button, conf ) {
168
- dt.columns().every( function ( i ) {
169
- // Take into account that ColReorder might have disrupted our
170
- // indexes
171
- var idx = dt.colReorder && dt.colReorder.transpose ?
172
- dt.colReorder.transpose( i, 'toOriginal' ) :
173
- i;
174
-
175
- this.visible( conf._visOriginal[ idx ] );
176
- } );
177
- }
178
- },
179
-
180
-
181
- colvisGroup: {
182
- className: 'buttons-colvisGroup',
183
-
184
- action: function ( e, dt, button, conf ) {
185
- dt.columns( conf.show ).visible( true );
186
- dt.columns( conf.hide ).visible( false );
187
- },
188
-
189
- show: [],
190
-
191
- hide: []
192
- }
41
+ // A collection of column visibility buttons
42
+ colvis: function ( dt, conf ) {
43
+ return {
44
+ extend: 'collection',
45
+ text: function ( dt ) {
46
+ return dt.i18n( 'buttons.colvis', 'Column visibility' );
47
+ },
48
+ className: 'buttons-colvis',
49
+ buttons: [ {
50
+ extend: 'columnsToggle',
51
+ columns: conf.columns
52
+ } ]
53
+ };
54
+ },
55
+
56
+ // Selected columns with individual buttons - toggle column visibility
57
+ columnsToggle: function ( dt, conf ) {
58
+ var columns = dt.columns( conf.columns ).indexes().map( function ( idx ) {
59
+ return {
60
+ extend: 'columnToggle',
61
+ columns: idx
62
+ };
63
+ } ).toArray();
64
+
65
+ return columns;
66
+ },
67
+
68
+ // Single button to toggle column visibility
69
+ columnToggle: function ( dt, conf ) {
70
+ return {
71
+ extend: 'columnVisibility',
72
+ columns: conf.columns
73
+ };
74
+ },
75
+
76
+ // Selected columns with individual buttons - set column visibility
77
+ columnsVisibility: function ( dt, conf ) {
78
+ var columns = dt.columns( conf.columns ).indexes().map( function ( idx ) {
79
+ return {
80
+ extend: 'columnVisibility',
81
+ columns: idx,
82
+ visibility: conf.visibility
83
+ };
84
+ } ).toArray();
85
+
86
+ return columns;
87
+ },
88
+
89
+ // Single button to set column visibility
90
+ columnVisibility: {
91
+ columns: undefined, // column selector
92
+ text: function ( dt, button, conf ) {
93
+ return conf._columnText( dt, conf.columns );
94
+ },
95
+ className: 'buttons-columnVisibility',
96
+ action: function ( e, dt, button, conf ) {
97
+ var col = dt.columns( conf.columns );
98
+ var curr = col.visible();
99
+
100
+ col.visible( conf.visibility !== undefined ?
101
+ conf.visibility :
102
+ ! (curr.length ? curr[0] : false )
103
+ );
104
+ },
105
+ init: function ( dt, button, conf ) {
106
+ var that = this;
107
+
108
+ dt
109
+ .on( 'column-visibility.dt'+conf.namespace, function (e, settings) {
110
+ if ( ! settings.bDestroying ) {
111
+ that.active( dt.column( conf.columns ).visible() );
112
+ }
113
+ } )
114
+ .on( 'column-reorder.dt'+conf.namespace, function (e, settings, details) {
115
+ // Don't rename buttons based on column name if the button
116
+ // controls more than one column!
117
+ if ( dt.columns( conf.columns ).count() !== 1 ) {
118
+ return;
119
+ }
120
+
121
+ if ( typeof conf.columns === 'number' ) {
122
+ conf.columns = details.mapping[ conf.columns ];
123
+ }
124
+
125
+ var col = dt.column( conf.columns );
126
+
127
+ that.text( conf._columnText( dt, conf.columns ) );
128
+ that.active( col.visible() );
129
+ } );
130
+
131
+ this.active( dt.column( conf.columns ).visible() );
132
+ },
133
+ destroy: function ( dt, button, conf ) {
134
+ dt
135
+ .off( 'column-visibility.dt'+conf.namespace )
136
+ .off( 'column-reorder.dt'+conf.namespace );
137
+ },
138
+
139
+ _columnText: function ( dt, col ) {
140
+ // Use DataTables' internal data structure until this is presented
141
+ // is a public API. The other option is to use
142
+ // `$( column(col).node() ).text()` but the node might not have been
143
+ // populated when Buttons is constructed.
144
+ var idx = dt.column( col ).index();
145
+ return dt.settings()[0].aoColumns[ idx ].sTitle
146
+ .replace(/\n/g," ") // remove new lines
147
+ .replace( /<.*?>/g, "" ) // strip HTML
148
+ .replace(/^\s+|\s+$/g,""); // trim
149
+ }
150
+ },
151
+
152
+
153
+ colvisRestore: {
154
+ className: 'buttons-colvisRestore',
155
+
156
+ text: function ( dt ) {
157
+ return dt.i18n( 'buttons.colvisRestore', 'Restore visibility' );
158
+ },
159
+
160
+ init: function ( dt, button, conf ) {
161
+ conf._visOriginal = dt.columns().indexes().map( function ( idx ) {
162
+ return dt.column( idx ).visible();
163
+ } ).toArray();
164
+ },
165
+
166
+ action: function ( e, dt, button, conf ) {
167
+ dt.columns().every( function ( i ) {
168
+ // Take into account that ColReorder might have disrupted our
169
+ // indexes
170
+ var idx = dt.colReorder && dt.colReorder.transpose ?
171
+ dt.colReorder.transpose( i, 'toOriginal' ) :
172
+ i;
173
+
174
+ this.visible( conf._visOriginal[ idx ] );
175
+ } );
176
+ }
177
+ },
178
+
179
+
180
+ colvisGroup: {
181
+ className: 'buttons-colvisGroup',
182
+
183
+ action: function ( e, dt, button, conf ) {
184
+ dt.columns( conf.show ).visible( true, false );
185
+ dt.columns( conf.hide ).visible( false, false );
186
+
187
+ dt.columns.adjust();
188
+ },
189
+
190
+ show: [],
191
+
192
+ hide: []
193
+ }
193
194
  } );
194
195
 
195
196