jquery-datatables 1.10.15 → 1.10.16

Sign up to get free protection for your applications and to get access to all the features.
Files changed (199) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +23 -16
  3. data/Rakefile +46 -27
  4. data/app/assets/javascripts/datatables/dataTables.bootstrap4.js +3 -3
  5. data/app/assets/javascripts/datatables/dataTables.jqueryui.js +6 -6
  6. data/app/assets/javascripts/datatables/extensions/AutoFill/dataTables.autoFill.js +5 -5
  7. data/app/assets/javascripts/datatables/extensions/Buttons/buttons.bootstrap.js +3 -1
  8. data/app/assets/javascripts/datatables/extensions/Buttons/buttons.bootstrap4.js +3 -1
  9. data/app/assets/javascripts/datatables/extensions/Buttons/buttons.colVis.js +2 -1
  10. data/app/assets/javascripts/datatables/extensions/Buttons/buttons.flash.js +74 -69
  11. data/app/assets/javascripts/datatables/extensions/Buttons/buttons.foundation.js +3 -1
  12. data/app/assets/javascripts/datatables/extensions/Buttons/buttons.html5.js +86 -63
  13. data/app/assets/javascripts/datatables/extensions/Buttons/buttons.print.js +16 -22
  14. data/app/assets/javascripts/datatables/extensions/Buttons/dataTables.buttons.js +131 -3
  15. data/app/assets/javascripts/datatables/extensions/ColReorder/dataTables.colReorder.js +12 -6
  16. data/app/assets/javascripts/datatables/extensions/FixedColumns/dataTables.fixedColumns.js +8 -5
  17. data/app/assets/javascripts/datatables/extensions/FixedHeader/dataTables.fixedHeader.js +14 -9
  18. data/app/assets/javascripts/datatables/extensions/KeyTable/dataTables.keyTable.js +103 -8
  19. data/app/assets/javascripts/datatables/extensions/Responsive/dataTables.responsive.js +106 -6
  20. data/app/assets/javascripts/datatables/extensions/Responsive/responsive.bootstrap4.js +1 -1
  21. data/app/assets/javascripts/datatables/extensions/RowGroup/dataTables.rowGroup.js +8 -6
  22. data/app/assets/javascripts/datatables/extensions/RowReorder/dataTables.rowReorder.js +68 -35
  23. data/app/assets/javascripts/datatables/extensions/Scroller/dataTables.scroller.js +71 -10
  24. data/app/assets/javascripts/datatables/extensions/Select/dataTables.select.js +11 -7
  25. data/app/assets/javascripts/datatables/jquery.dataTables.js +19 -121
  26. data/app/assets/stylesheets/datatables/dataTables.bootstrap.scss +252 -0
  27. data/app/assets/stylesheets/datatables/{dataTables.bootstrap2.css → dataTables.bootstrap2.scss} +6 -6
  28. data/app/assets/stylesheets/datatables/dataTables.bootstrap4.scss +262 -0
  29. data/app/assets/stylesheets/datatables/dataTables.foundation.scss +154 -0
  30. data/app/assets/stylesheets/datatables/dataTables.jqueryui.scss +93 -0
  31. data/app/assets/stylesheets/datatables/dataTables.material.scss +101 -0
  32. data/app/assets/stylesheets/datatables/dataTables.semanticui.scss +138 -0
  33. data/app/assets/stylesheets/datatables/dataTables.uikit.scss +195 -0
  34. data/app/assets/stylesheets/datatables/extensions/AutoFill/autoFill.bootstrap.scss +8 -0
  35. data/app/assets/stylesheets/datatables/extensions/AutoFill/autoFill.bootstrap4.scss +8 -0
  36. data/app/assets/stylesheets/datatables/extensions/AutoFill/autoFill.dataTables.scss +125 -0
  37. data/app/assets/stylesheets/datatables/extensions/AutoFill/autoFill.foundation.scss +13 -0
  38. data/app/assets/stylesheets/datatables/extensions/AutoFill/autoFill.jqueryui.scss +10 -0
  39. data/app/assets/stylesheets/datatables/extensions/AutoFill/autoFill.semanticui.scss +8 -0
  40. data/app/assets/stylesheets/datatables/extensions/Buttons/buttons.bootstrap.scss +40 -0
  41. data/app/assets/stylesheets/datatables/extensions/Buttons/buttons.bootstrap4.scss +53 -0
  42. data/app/assets/stylesheets/datatables/extensions/Buttons/buttons.dataTables.scss +141 -0
  43. data/app/assets/stylesheets/datatables/extensions/Buttons/buttons.foundation.scss +82 -0
  44. data/app/assets/stylesheets/datatables/extensions/Buttons/buttons.jqueryui.scss +98 -0
  45. data/app/assets/stylesheets/datatables/extensions/Buttons/buttons.semanticui.scss +53 -0
  46. data/app/assets/stylesheets/datatables/extensions/ColReorder/colReorder.bootstrap.scss +4 -0
  47. data/app/assets/stylesheets/datatables/extensions/ColReorder/colReorder.bootstrap4.scss +4 -0
  48. data/app/assets/stylesheets/datatables/extensions/ColReorder/colReorder.dataTables.scss +17 -0
  49. data/app/assets/stylesheets/datatables/extensions/ColReorder/colReorder.foundation.scss +4 -0
  50. data/app/assets/stylesheets/datatables/extensions/ColReorder/colReorder.jqueryui.scss +2 -0
  51. data/app/assets/stylesheets/datatables/extensions/ColReorder/colReorder.semanticui.scss +4 -0
  52. data/app/assets/stylesheets/datatables/extensions/FixedColumns/fixedColumns.bootstrap.scss +50 -0
  53. data/app/assets/stylesheets/datatables/extensions/FixedColumns/fixedColumns.bootstrap4.scss +11 -0
  54. data/app/assets/stylesheets/datatables/extensions/FixedColumns/fixedColumns.dataTables.scss +22 -0
  55. data/app/assets/stylesheets/datatables/extensions/FixedColumns/{fixedColumns.foundation.css → fixedColumns.foundation.scss} +15 -6
  56. data/app/assets/stylesheets/datatables/extensions/FixedColumns/fixedColumns.jqueryui.scss +16 -0
  57. data/app/assets/stylesheets/datatables/extensions/FixedColumns/fixedColumns.semanticui.scss +41 -0
  58. data/app/assets/stylesheets/datatables/extensions/FixedHeader/{fixedHeader.bootstrap4.css → fixedHeader.bootstrap.scss} +6 -5
  59. data/app/assets/stylesheets/datatables/extensions/FixedHeader/{fixedHeader.foundation.css → fixedHeader.bootstrap4.scss} +6 -5
  60. data/app/assets/stylesheets/datatables/extensions/FixedHeader/fixedHeader.dataTables.scss +21 -0
  61. data/app/assets/stylesheets/datatables/extensions/FixedHeader/{fixedHeader.bootstrap.css → fixedHeader.foundation.scss} +6 -5
  62. data/app/assets/stylesheets/datatables/extensions/FixedHeader/{fixedHeader.semanticui.css → fixedHeader.jqueryui.scss} +7 -3
  63. data/app/assets/stylesheets/datatables/extensions/FixedHeader/fixedHeader.semanticui.scss +16 -0
  64. data/app/assets/stylesheets/datatables/extensions/KeyTable/keyTable.bootstrap.scss +4 -0
  65. data/app/assets/stylesheets/datatables/extensions/KeyTable/keyTable.bootstrap4.scss +4 -0
  66. data/app/assets/stylesheets/datatables/extensions/KeyTable/keyTable.dataTables.scss +10 -0
  67. data/app/assets/stylesheets/datatables/extensions/KeyTable/keyTable.foundation.scss +4 -0
  68. data/app/assets/stylesheets/datatables/extensions/KeyTable/keyTable.jqueryui.scss +2 -0
  69. data/app/assets/stylesheets/datatables/extensions/KeyTable/keyTable.semanticui.scss +4 -0
  70. data/app/assets/stylesheets/datatables/extensions/Responsive/responsive.bootstrap.scss +8 -0
  71. data/app/assets/stylesheets/datatables/extensions/Responsive/responsive.bootstrap4.scss +9 -0
  72. data/app/assets/stylesheets/datatables/extensions/Responsive/responsive.dataTables.scss +240 -0
  73. data/app/assets/stylesheets/datatables/extensions/Responsive/responsive.foundation.scss +10 -0
  74. data/app/assets/stylesheets/datatables/extensions/Responsive/responsive.jqueryui.scss +2 -0
  75. data/app/assets/stylesheets/datatables/extensions/Responsive/responsive.semanticui.scss +9 -0
  76. data/app/assets/stylesheets/datatables/extensions/RowGroup/rowGroup.bootstrap.scss +2 -0
  77. data/app/assets/stylesheets/datatables/extensions/RowGroup/rowGroup.bootstrap4.scss +2 -0
  78. data/app/assets/stylesheets/datatables/extensions/RowGroup/rowGroup.dataTables.scss +9 -0
  79. data/app/assets/stylesheets/datatables/extensions/RowGroup/rowGroup.foundation.scss +2 -0
  80. data/app/assets/stylesheets/datatables/extensions/RowGroup/rowGroup.jqueryui.scss +2 -0
  81. data/app/assets/stylesheets/datatables/extensions/RowGroup/rowGroup.semanticui.scss +4 -0
  82. data/app/assets/stylesheets/datatables/extensions/RowReorder/rowReorder.bootstrap.scss +5 -0
  83. data/app/assets/stylesheets/datatables/extensions/RowReorder/{semanticui.scss → rowReorder.bootstrap4.scss} +0 -0
  84. data/app/assets/stylesheets/datatables/extensions/RowReorder/rowReorder.dataTables.scss +26 -0
  85. data/app/assets/stylesheets/datatables/extensions/RowReorder/rowReorder.foundation.scss +5 -0
  86. data/app/assets/stylesheets/datatables/extensions/RowReorder/rowReorder.jqueryui.scss +2 -0
  87. data/app/assets/stylesheets/datatables/extensions/RowReorder/rowReorder.semanticui.scss +5 -0
  88. data/app/assets/stylesheets/datatables/extensions/Scroller/scroller.bootstrap.scss +9 -0
  89. data/app/assets/stylesheets/datatables/extensions/Scroller/scroller.bootstrap4.scss +9 -0
  90. data/app/assets/stylesheets/datatables/extensions/Scroller/scroller.dataTables.scss +36 -0
  91. data/app/assets/stylesheets/datatables/extensions/Scroller/scroller.foundation.scss +31 -0
  92. data/app/assets/stylesheets/datatables/extensions/Scroller/scroller.jqueryui.scss +2 -0
  93. data/app/assets/stylesheets/datatables/extensions/Scroller/scroller.semanticui.scss +2 -0
  94. data/app/assets/stylesheets/datatables/extensions/Select/select.bootstrap.scss +17 -0
  95. data/app/assets/stylesheets/datatables/extensions/Select/select.bootstrap4.scss +17 -0
  96. data/app/assets/stylesheets/datatables/extensions/Select/select.dataTables.scss +143 -0
  97. data/app/assets/stylesheets/datatables/extensions/Select/select.foundation.scss +18 -0
  98. data/app/assets/stylesheets/datatables/extensions/Select/select.jqueryui.scss +4 -0
  99. data/app/assets/stylesheets/datatables/extensions/Select/select.semanticui.scss +14 -0
  100. data/app/assets/stylesheets/datatables/jquery.dataTables.scss +599 -0
  101. data/lib/generators/jquery/datatables/install_generator.rb +1 -1
  102. data/lib/generators/jquery/datatables/templates/bootstrap.js.tt +3 -1
  103. data/lib/generators/jquery/datatables/templates/bootstrap.scss.tt +15 -0
  104. data/lib/generators/jquery/datatables/templates/bootstrap4.js.tt +3 -1
  105. data/lib/generators/jquery/datatables/templates/bootstrap4.scss.tt +15 -0
  106. data/lib/generators/jquery/datatables/templates/foundation.js.tt +4 -4
  107. data/lib/generators/jquery/datatables/templates/foundation.scss.tt +33 -0
  108. data/lib/generators/jquery/datatables/templates/jqueryui.js.tt +7 -1
  109. data/lib/generators/jquery/datatables/templates/jqueryui.scss.tt +15 -0
  110. data/lib/generators/jquery/datatables/templates/material.js.tt +3 -1
  111. data/lib/generators/jquery/datatables/templates/material.scss.tt +1 -0
  112. data/lib/generators/jquery/datatables/templates/regular.js.tt +4 -3
  113. data/lib/generators/jquery/datatables/templates/regular.scss.tt +33 -0
  114. data/lib/generators/jquery/datatables/templates/semanticui.js.tt +4 -2
  115. data/lib/generators/jquery/datatables/templates/semanticui.scss.tt +15 -0
  116. data/lib/generators/jquery/datatables/templates/uikit.js.tt +4 -2
  117. data/lib/generators/jquery/datatables/templates/uikit.scss.tt +1 -0
  118. data/lib/jquery-datatables/version.rb +1 -1
  119. metadata +86 -90
  120. data/app/assets/stylesheets/datatables/dataTables.bootstrap.css +0 -184
  121. data/app/assets/stylesheets/datatables/dataTables.bootstrap4.css +0 -194
  122. data/app/assets/stylesheets/datatables/dataTables.foundation.css +0 -118
  123. data/app/assets/stylesheets/datatables/dataTables.jqueryui.css +0 -482
  124. data/app/assets/stylesheets/datatables/dataTables.material.css +0 -87
  125. data/app/assets/stylesheets/datatables/dataTables.semanticui.css +0 -102
  126. data/app/assets/stylesheets/datatables/dataTables.uikit.css +0 -146
  127. data/app/assets/stylesheets/datatables/extensions/AutoFill/autoFill.bootstrap.css +0 -81
  128. data/app/assets/stylesheets/datatables/extensions/AutoFill/autoFill.bootstrap4.css +0 -81
  129. data/app/assets/stylesheets/datatables/extensions/AutoFill/autoFill.dataTables.css +0 -92
  130. data/app/assets/stylesheets/datatables/extensions/AutoFill/autoFill.foundation.css +0 -85
  131. data/app/assets/stylesheets/datatables/extensions/AutoFill/autoFill.jqueryui.css +0 -85
  132. data/app/assets/stylesheets/datatables/extensions/AutoFill/autoFill.semanticui.css +0 -81
  133. data/app/assets/stylesheets/datatables/extensions/Buttons/buttons.bootstrap.css +0 -158
  134. data/app/assets/stylesheets/datatables/extensions/Buttons/buttons.bootstrap4.css +0 -219
  135. data/app/assets/stylesheets/datatables/extensions/Buttons/buttons.dataTables.css +0 -354
  136. data/app/assets/stylesheets/datatables/extensions/Buttons/buttons.foundation.css +0 -189
  137. data/app/assets/stylesheets/datatables/extensions/Buttons/buttons.jqueryui.css +0 -218
  138. data/app/assets/stylesheets/datatables/extensions/Buttons/buttons.semanticui.css +0 -171
  139. data/app/assets/stylesheets/datatables/extensions/ColReorder/colReorder.bootstrap.css +0 -11
  140. data/app/assets/stylesheets/datatables/extensions/ColReorder/colReorder.bootstrap4.css +0 -11
  141. data/app/assets/stylesheets/datatables/extensions/ColReorder/colReorder.dataTables.css +0 -11
  142. data/app/assets/stylesheets/datatables/extensions/ColReorder/colReorder.foundation.css +0 -11
  143. data/app/assets/stylesheets/datatables/extensions/ColReorder/colReorder.jqueryui.css +0 -11
  144. data/app/assets/stylesheets/datatables/extensions/ColReorder/colReorder.semanticui.css +0 -11
  145. data/app/assets/stylesheets/datatables/extensions/FixedColumns/fixedColumns.bootstrap.css +0 -44
  146. data/app/assets/stylesheets/datatables/extensions/FixedColumns/fixedColumns.bootstrap4.css +0 -44
  147. data/app/assets/stylesheets/datatables/extensions/FixedColumns/fixedColumns.dataTables.css +0 -18
  148. data/app/assets/stylesheets/datatables/extensions/FixedColumns/fixedColumns.jqueryui.css +0 -8
  149. data/app/assets/stylesheets/datatables/extensions/FixedColumns/fixedColumns.semanticui.css +0 -16
  150. data/app/assets/stylesheets/datatables/extensions/FixedHeader/fixedHeader.dataTables.css +0 -19
  151. data/app/assets/stylesheets/datatables/extensions/FixedHeader/fixedHeader.jqueryui.css +0 -15
  152. data/app/assets/stylesheets/datatables/extensions/KeyTable/keyTable.bootstrap.css +0 -5
  153. data/app/assets/stylesheets/datatables/extensions/KeyTable/keyTable.bootstrap4.css +0 -5
  154. data/app/assets/stylesheets/datatables/extensions/KeyTable/keyTable.dataTables.css +0 -5
  155. data/app/assets/stylesheets/datatables/extensions/KeyTable/keyTable.foundation.css +0 -5
  156. data/app/assets/stylesheets/datatables/extensions/KeyTable/keyTable.jqueryui.css +0 -5
  157. data/app/assets/stylesheets/datatables/extensions/KeyTable/keyTable.semanticui.css +0 -5
  158. data/app/assets/stylesheets/datatables/extensions/Responsive/responsive.bootstrap.css +0 -181
  159. data/app/assets/stylesheets/datatables/extensions/Responsive/responsive.bootstrap4.css +0 -181
  160. data/app/assets/stylesheets/datatables/extensions/Responsive/responsive.dataTables.css +0 -178
  161. data/app/assets/stylesheets/datatables/extensions/Responsive/responsive.foundation.css +0 -181
  162. data/app/assets/stylesheets/datatables/extensions/Responsive/responsive.jqueryui.css +0 -178
  163. data/app/assets/stylesheets/datatables/extensions/Responsive/responsive.semanticui.css +0 -181
  164. data/app/assets/stylesheets/datatables/extensions/RowGroup/rowGroup.bootstrap.css +0 -4
  165. data/app/assets/stylesheets/datatables/extensions/RowGroup/rowGroup.bootstrap4.css +0 -4
  166. data/app/assets/stylesheets/datatables/extensions/RowGroup/rowGroup.dataTables.css +0 -4
  167. data/app/assets/stylesheets/datatables/extensions/RowGroup/rowGroup.foundation.css +0 -4
  168. data/app/assets/stylesheets/datatables/extensions/RowGroup/rowGroup.jqueryui.css +0 -4
  169. data/app/assets/stylesheets/datatables/extensions/RowGroup/rowGroup.semanticui.css +0 -4
  170. data/app/assets/stylesheets/datatables/extensions/RowReorder/rowReorder.bootstrap.css +0 -22
  171. data/app/assets/stylesheets/datatables/extensions/RowReorder/rowReorder.bootstrap4.css +0 -22
  172. data/app/assets/stylesheets/datatables/extensions/RowReorder/rowReorder.dataTables.css +0 -22
  173. data/app/assets/stylesheets/datatables/extensions/RowReorder/rowReorder.foundation.css +0 -22
  174. data/app/assets/stylesheets/datatables/extensions/RowReorder/rowReorder.jqueryui.css +0 -22
  175. data/app/assets/stylesheets/datatables/extensions/RowReorder/rowReorder.semanticui.css +0 -22
  176. data/app/assets/stylesheets/datatables/extensions/Scroller/scroller.bootstrap.css +0 -24
  177. data/app/assets/stylesheets/datatables/extensions/Scroller/scroller.bootstrap4.css +0 -24
  178. data/app/assets/stylesheets/datatables/extensions/Scroller/scroller.dataTables.css +0 -20
  179. data/app/assets/stylesheets/datatables/extensions/Scroller/scroller.foundation.css +0 -17
  180. data/app/assets/stylesheets/datatables/extensions/Scroller/scroller.jqueryui.css +0 -20
  181. data/app/assets/stylesheets/datatables/extensions/Scroller/scroller.semanticui.css +0 -20
  182. data/app/assets/stylesheets/datatables/extensions/Select/select.bootstrap.css +0 -115
  183. data/app/assets/stylesheets/datatables/extensions/Select/select.bootstrap4.css +0 -115
  184. data/app/assets/stylesheets/datatables/extensions/Select/select.dataTables.css +0 -105
  185. data/app/assets/stylesheets/datatables/extensions/Select/select.foundation.css +0 -117
  186. data/app/assets/stylesheets/datatables/extensions/Select/select.jqueryui.css +0 -105
  187. data/app/assets/stylesheets/datatables/extensions/Select/select.semanticui.css +0 -110
  188. data/app/assets/stylesheets/datatables/jquery.dataTables.css +0 -455
  189. data/app/assets/stylesheets/datatables/jquery.dataTables_themeroller.css +0 -416
  190. data/lib/generators/jquery/datatables/templates/bootstrap.css.tt +0 -15
  191. data/lib/generators/jquery/datatables/templates/bootstrap2.css.tt +0 -15
  192. data/lib/generators/jquery/datatables/templates/bootstrap2.js.tt +0 -22
  193. data/lib/generators/jquery/datatables/templates/bootstrap4.css.tt +0 -15
  194. data/lib/generators/jquery/datatables/templates/foundation.css.tt +0 -15
  195. data/lib/generators/jquery/datatables/templates/jqueryui.css.tt +0 -15
  196. data/lib/generators/jquery/datatables/templates/material.css.tt +0 -15
  197. data/lib/generators/jquery/datatables/templates/regular.css.tt +0 -15
  198. data/lib/generators/jquery/datatables/templates/semanticui.css.tt +0 -16
  199. data/lib/generators/jquery/datatables/templates/uikit.css.tt +0 -15
@@ -49,7 +49,9 @@ var collection = DataTable.ext.foundationVersion === 6 ?
49
49
  className: 'dt-button-collection f-dropdown open dropdown-pane is-open',
50
50
  button: {
51
51
  tag: 'li',
52
- className: 'small'
52
+ className: 'small',
53
+ active: 'active',
54
+ disabled: 'disabled'
53
55
  },
54
56
  buttonLiner: {
55
57
  tag: 'a'
@@ -228,35 +228,6 @@ DataTable.fileSave = _saveAs;
228
228
  * Local (private) functions
229
229
  */
230
230
 
231
- /**
232
- * Get the file name for an exported file.
233
- *
234
- * @param {object} config Button configuration
235
- * @param {boolean} incExtension Include the file name extension
236
- */
237
- var _filename = function ( config, incExtension )
238
- {
239
- // Backwards compatibility
240
- var filename = config.filename === '*' && config.title !== '*' && config.title !== undefined ?
241
- config.title :
242
- config.filename;
243
-
244
- if ( typeof filename === 'function' ) {
245
- filename = filename();
246
- }
247
-
248
- if ( filename.indexOf( '*' ) !== -1 ) {
249
- filename = $.trim( filename.replace( '*', $('title').text() ) );
250
- }
251
-
252
- // Strip characters which the OS will object to
253
- filename = filename.replace(/[^a-zA-Z0-9_\u00A1-\uFFFF\.,\-_ !\(\)]/g, "");
254
-
255
- return incExtension === undefined || incExtension === true ?
256
- filename+config.extension :
257
- filename;
258
- };
259
-
260
231
  /**
261
232
  * Get the sheet name for Excel exports.
262
233
  *
@@ -270,25 +241,7 @@ var _sheetname = function ( config )
270
241
  sheetName = config.sheetName.replace(/[\[\]\*\/\\\?\:]/g, '');
271
242
  }
272
243
 
273
- return sheetName;
274
- };
275
-
276
- /**
277
- * Get the title for an exported file.
278
- *
279
- * @param {object} config Button configuration
280
- */
281
- var _title = function ( config )
282
- {
283
- var title = config.title;
284
-
285
- if ( typeof title === 'function' ) {
286
- title = title();
287
- }
288
-
289
- return title.indexOf( '*' ) !== -1 ?
290
- title.replace( '*', $('title').text() || 'Exported data' ) :
291
- title;
244
+ return sheetName;
292
245
  };
293
246
 
294
247
  /**
@@ -498,13 +451,13 @@ function _createNode( doc, nodeName, opts ) {
498
451
  $(tempNode).attr( opts.attr );
499
452
  }
500
453
 
501
- if( opts.children ) {
454
+ if ( opts.children ) {
502
455
  $.each( opts.children, function ( key, value ) {
503
456
  tempNode.appendChild( value );
504
- });
457
+ } );
505
458
  }
506
459
 
507
- if( opts.text ) {
460
+ if ( opts.text !== null && opts.text !== undefined ) {
508
461
  tempNode.appendChild( doc.createTextNode( opts.text ) );
509
462
  }
510
463
  }
@@ -605,6 +558,7 @@ var excelStrings = {
605
558
  '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>'+
606
559
  '<worksheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="x14ac" xmlns:x14ac="http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac">'+
607
560
  '<sheetData/>'+
561
+ '<mergeCells count="0"/>'+
608
562
  '</worksheet>',
609
563
 
610
564
  "xl/styles.xml":
@@ -831,6 +785,8 @@ DataTable.ext.buttons.copyHtml5 = {
831
785
 
832
786
  var that = this;
833
787
  var exportData = _exportData( dt, config );
788
+ var info = dt.buttons.exportInfo( config );
789
+ var newline = _newLine(config);
834
790
  var output = exportData.str;
835
791
  var hiddenDiv = $('<div/>')
836
792
  .css( {
@@ -842,6 +798,18 @@ DataTable.ext.buttons.copyHtml5 = {
842
798
  left: 0
843
799
  } );
844
800
 
801
+ if ( info.title ) {
802
+ output = info.title + newline + newline + output;
803
+ }
804
+
805
+ if ( info.messageTop ) {
806
+ output = info.messageTop + newline + newline + output;
807
+ }
808
+
809
+ if ( info.messageBottom ) {
810
+ output = output + newline + newline + info.messageBottom;
811
+ }
812
+
845
813
  if ( config.customize ) {
846
814
  output = config.customize( output, config );
847
815
  }
@@ -921,7 +889,13 @@ DataTable.ext.buttons.copyHtml5 = {
921
889
 
922
890
  header: true,
923
891
 
924
- footer: false
892
+ footer: false,
893
+
894
+ title: '*',
895
+
896
+ messageTop: '*',
897
+
898
+ messageBottom: '*'
925
899
  };
926
900
 
927
901
  //
@@ -945,6 +919,7 @@ DataTable.ext.buttons.csvHtml5 = {
945
919
 
946
920
  // Set the text
947
921
  var output = _exportData( dt, config ).str;
922
+ var info = dt.buttons.exportInfo(config);
948
923
  var charset = config.charset;
949
924
 
950
925
  if ( config.customize ) {
@@ -970,7 +945,7 @@ DataTable.ext.buttons.csvHtml5 = {
970
945
 
971
946
  _saveAs(
972
947
  new Blob( [output], {type: 'text/csv'+charset} ),
973
- _filename( config ),
948
+ info.filename,
974
949
  true
975
950
  );
976
951
 
@@ -1144,9 +1119,34 @@ DataTable.ext.buttons.excelHtml5 = {
1144
1119
  config.customizeData( data );
1145
1120
  }
1146
1121
 
1122
+ var mergeCells = function ( row, colspan ) {
1123
+ var mergeCells = $('mergeCells', rels);
1124
+
1125
+ mergeCells[0].appendChild( _createNode( rels, 'mergeCell', {
1126
+ attr: {
1127
+ ref: 'A'+row+':'+createCellPos(colspan)+row
1128
+ }
1129
+ } ) );
1130
+ mergeCells.attr( 'count', mergeCells.attr( 'count' )+1 );
1131
+ $('row:eq('+(row-1)+') c', rels).attr( 's', '51' ); // centre
1132
+ };
1133
+
1134
+ // Title and top messages
1135
+ var exportInfo = dt.buttons.exportInfo( config );
1136
+ if ( exportInfo.title ) {
1137
+ addRow( [exportInfo.title], rowPos );
1138
+ mergeCells( rowPos, data.header.length-1 );
1139
+ }
1140
+
1141
+ if ( exportInfo.messageTop ) {
1142
+ addRow( [exportInfo.messageTop], rowPos );
1143
+ mergeCells( rowPos, data.header.length-1 );
1144
+ }
1145
+
1146
+ // Table itself
1147
1147
  if ( config.header ) {
1148
1148
  addRow( data.header, rowPos );
1149
- $('row c', rels).attr( 's', '2' ); // bold
1149
+ $('row:last c', rels).attr( 's', '2' ); // bold
1150
1150
  }
1151
1151
 
1152
1152
  for ( var n=0, ie=data.body.length ; n<ie ; n++ ) {
@@ -1158,6 +1158,12 @@ DataTable.ext.buttons.excelHtml5 = {
1158
1158
  $('row:last c', rels).attr( 's', '2' ); // bold
1159
1159
  }
1160
1160
 
1161
+ // Below the table
1162
+ if ( exportInfo.messageBottom ) {
1163
+ addRow( [exportInfo.messageBottom], rowPos );
1164
+ mergeCells( rowPos, data.header.length-1 );
1165
+ }
1166
+
1161
1167
  // Set column widths
1162
1168
  var cols = _createNode( rels, 'cols' );
1163
1169
  $('worksheet', rels).prepend( cols );
@@ -1192,7 +1198,7 @@ DataTable.ext.buttons.excelHtml5 = {
1192
1198
  zip
1193
1199
  .generateAsync( zipConfig )
1194
1200
  .then( function ( blob ) {
1195
- _saveAs( blob, _filename( config ) );
1201
+ _saveAs( blob, exportInfo.filename );
1196
1202
  that.processing( false );
1197
1203
  } );
1198
1204
  }
@@ -1200,7 +1206,7 @@ DataTable.ext.buttons.excelHtml5 = {
1200
1206
  // JSZip 2.5
1201
1207
  _saveAs(
1202
1208
  zip.generate( zipConfig ),
1203
- _filename( config )
1209
+ exportInfo.filename
1204
1210
  );
1205
1211
  this.processing( false );
1206
1212
  }
@@ -1214,7 +1220,13 @@ DataTable.ext.buttons.excelHtml5 = {
1214
1220
 
1215
1221
  header: true,
1216
1222
 
1217
- footer: false
1223
+ footer: false,
1224
+
1225
+ title: '*',
1226
+
1227
+ messageTop: '*',
1228
+
1229
+ messageBottom: '*'
1218
1230
  };
1219
1231
 
1220
1232
  //
@@ -1236,6 +1248,7 @@ DataTable.ext.buttons.pdfHtml5 = {
1236
1248
 
1237
1249
  var that = this;
1238
1250
  var data = dt.buttons.exportData( config.exportOptions );
1251
+ var info = dt.buttons.exportInfo( config );
1239
1252
  var rows = [];
1240
1253
 
1241
1254
  if ( config.header ) {
@@ -1306,17 +1319,25 @@ DataTable.ext.buttons.pdfHtml5 = {
1306
1319
  }
1307
1320
  };
1308
1321
 
1309
- if ( config.message ) {
1322
+ if ( info.messageTop ) {
1310
1323
  doc.content.unshift( {
1311
- text: typeof config.message == 'function' ? config.message(dt, button, config) : config.message,
1324
+ text: info.messageTop,
1312
1325
  style: 'message',
1313
1326
  margin: [ 0, 0, 0, 12 ]
1314
1327
  } );
1315
1328
  }
1316
1329
 
1317
- if ( config.title ) {
1330
+ if ( info.messageBottom ) {
1331
+ doc.content.push( {
1332
+ text: info.messageBottom,
1333
+ style: 'message',
1334
+ margin: [ 0, 0, 0, 12 ]
1335
+ } );
1336
+ }
1337
+
1338
+ if ( info.title ) {
1318
1339
  doc.content.unshift( {
1319
- text: _title( config, false ),
1340
+ text: info.title,
1320
1341
  style: 'title',
1321
1342
  margin: [ 0, 0, 0, 12 ]
1322
1343
  } );
@@ -1336,7 +1357,7 @@ DataTable.ext.buttons.pdfHtml5 = {
1336
1357
  pdf.getBuffer( function (buffer) {
1337
1358
  var blob = new Blob( [buffer], {type:'application/pdf'} );
1338
1359
 
1339
- _saveAs( blob, _filename( config ) );
1360
+ _saveAs( blob, info.filename );
1340
1361
  that.processing( false );
1341
1362
  } );
1342
1363
  }
@@ -1358,7 +1379,9 @@ DataTable.ext.buttons.pdfHtml5 = {
1358
1379
 
1359
1380
  footer: false,
1360
1381
 
1361
- message: null,
1382
+ messageTop: '*',
1383
+
1384
+ messageBottom: '*',
1362
1385
 
1363
1386
  customize: null,
1364
1387
 
@@ -87,7 +87,11 @@ DataTable.ext.buttons.print = {
87
87
  },
88
88
 
89
89
  action: function ( e, dt, button, config ) {
90
- var data = dt.buttons.exportData( config.exportOptions );
90
+ var data = dt.buttons.exportData(
91
+ $.extend( {decodeEntities: false}, config.exportOptions ) // XSS protection
92
+ );
93
+ var exportInfo = dt.buttons.exportInfo( config );
94
+
91
95
  var addRow = function ( d, tag ) {
92
96
  var str = '<tr>';
93
97
 
@@ -114,26 +118,17 @@ DataTable.ext.buttons.print = {
114
118
  if ( config.footer && data.footer ) {
115
119
  html += '<tfoot>'+ addRow( data.footer, 'th' ) +'</tfoot>';
116
120
  }
121
+ html += '</table>';
117
122
 
118
123
  // Open a new window for the printable table
119
124
  var win = window.open( '', '' );
120
- var title = config.title;
121
-
122
- if ( typeof title === 'function' ) {
123
- title = title();
124
- }
125
-
126
- if ( title.indexOf( '*' ) !== -1 ) {
127
- title= title.replace( '*', $('title').text() );
128
- }
129
-
130
125
  win.document.close();
131
126
 
132
127
  // Inject the title and also a copy of the style and link tags from this
133
128
  // document so the table can retain its base styling. Note that we have
134
129
  // to use string manipulation as IE won't allow elements to be created
135
130
  // in the host document and then appended to the new window.
136
- var head = '<title>'+title+'</title>';
131
+ var head = '<title>'+exportInfo.title+'</title>';
137
132
  $('style, link').each( function () {
138
133
  head += _styleToAbs( this );
139
134
  } );
@@ -147,14 +142,10 @@ DataTable.ext.buttons.print = {
147
142
 
148
143
  // Inject the table and other surrounding information
149
144
  win.document.body.innerHTML =
150
- '<h1>'+title+'</h1>'+
151
- '<div>'+
152
- (typeof config.message === 'function' ?
153
- config.message( dt, button, config ) :
154
- config.message
155
- )+
156
- '</div>'+
157
- html;
145
+ '<h1>'+exportInfo.title+'</h1>'+
146
+ '<div>'+(exportInfo.messageTop || '')+'</div>'+
147
+ html+
148
+ '<div>'+(exportInfo.messageBottom || '')+'</div>';
158
149
 
159
150
  $(win.document.body).addClass('dt-print-view');
160
151
 
@@ -166,17 +157,20 @@ DataTable.ext.buttons.print = {
166
157
  config.customize( win );
167
158
  }
168
159
 
160
+ // Allow stylesheets time to load
169
161
  setTimeout( function () {
170
162
  if ( config.autoPrint ) {
171
163
  win.print(); // blocking - so close will not
172
164
  win.close(); // execute until this is done
173
165
  }
174
- }, 250 );
166
+ }, 1000 );
175
167
  },
176
168
 
177
169
  title: '*',
178
170
 
179
- message: '',
171
+ messageTop: '*',
172
+
173
+ messageBottom: '*',
180
174
 
181
175
  exportOptions: {},
182
176
 
@@ -1,5 +1,5 @@
1
- /*! Buttons for DataTables 1.3.1
2
- * ©2016 SpryMedia Ltd - datatables.net/license
1
+ /*! Buttons for DataTables 1.4.2
2
+ * ©2016-2017 SpryMedia Ltd - datatables.net/license
3
3
  */
4
4
 
5
5
  (function( factory ){
@@ -433,6 +433,7 @@ $.extend( Buttons.prototype, {
433
433
 
434
434
  for ( var i=0, ien=buttons.length ; i<ien ; i++ ) {
435
435
  container.append( buttons[i].inserter );
436
+ container.append( ' ' );
436
437
 
437
438
  if ( buttons[i].buttons && buttons[i].buttons.length ) {
438
439
  this._draw( buttons[i].collection, buttons[i].buttons );
@@ -1142,7 +1143,7 @@ Buttons.defaults = {
1142
1143
  * @type {string}
1143
1144
  * @static
1144
1145
  */
1145
- Buttons.version = '1.3.1';
1146
+ Buttons.version = '1.4.2';
1146
1147
 
1147
1148
 
1148
1149
  $.extend( _dtButtons, {
@@ -1183,6 +1184,21 @@ $.extend( _dtButtons, {
1183
1184
  left: hostOffset.left
1184
1185
  } );
1185
1186
 
1187
+ // calculate overflow when positioned beneath
1188
+ var tableBottom = tableContainer.offset().top + tableContainer.height();
1189
+ var listBottom = hostOffset.top + host.outerHeight() + config._collection.outerHeight();
1190
+ var bottomOverflow = listBottom - tableBottom;
1191
+
1192
+ // calculate overflow when positioned above
1193
+ var listTop = hostOffset.top - config._collection.outerHeight();
1194
+ var tableTop = tableContainer.offset().top;
1195
+ var topOverflow = tableTop - listTop;
1196
+
1197
+ // if bottom overflow is larger, move to the top because it fits better
1198
+ if (bottomOverflow > topOverflow) {
1199
+ config._collection.css( 'top', hostOffset.top - config._collection.outerHeight() - 5);
1200
+ }
1201
+
1186
1202
  var listRight = hostOffset.left + config._collection.outerWidth();
1187
1203
  var tableRight = tableContainer.offset().left + tableContainer.width();
1188
1204
  if ( listRight > tableRight ) {
@@ -1559,6 +1575,118 @@ DataTable.Api.register( 'buttons.exportData()', function ( options ) {
1559
1575
  }
1560
1576
  } );
1561
1577
 
1578
+ // Get information about the export that is common to many of the export data
1579
+ // types (DRY)
1580
+ DataTable.Api.register( 'buttons.exportInfo()', function ( conf ) {
1581
+ if ( ! conf ) {
1582
+ conf = {};
1583
+ }
1584
+
1585
+ return {
1586
+ filename: _filename( conf ),
1587
+ title: _title( conf ),
1588
+ messageTop: _message(this, conf.messageTop || conf.message, 'top'),
1589
+ messageBottom: _message(this, conf.messageBottom, 'bottom')
1590
+ };
1591
+ } );
1592
+
1593
+
1594
+
1595
+ /**
1596
+ * Get the file name for an exported file.
1597
+ *
1598
+ * @param {object} config Button configuration
1599
+ * @param {boolean} incExtension Include the file name extension
1600
+ */
1601
+ var _filename = function ( config )
1602
+ {
1603
+ // Backwards compatibility
1604
+ var filename = config.filename === '*' && config.title !== '*' && config.title !== undefined ?
1605
+ config.title :
1606
+ config.filename;
1607
+
1608
+ if ( typeof filename === 'function' ) {
1609
+ filename = filename();
1610
+ }
1611
+
1612
+ if ( filename === undefined || filename === null ) {
1613
+ return null;
1614
+ }
1615
+
1616
+ if ( filename.indexOf( '*' ) !== -1 ) {
1617
+ filename = $.trim( filename.replace( '*', $('title').text() ) );
1618
+ }
1619
+
1620
+ // Strip characters which the OS will object to
1621
+ filename = filename.replace(/[^a-zA-Z0-9_\u00A1-\uFFFF\.,\-_ !\(\)]/g, "");
1622
+
1623
+ var extension = _stringOrFunction( config.extension );
1624
+ if ( ! extension ) {
1625
+ extension = '';
1626
+ }
1627
+
1628
+ return filename + extension;
1629
+ };
1630
+
1631
+ /**
1632
+ * Simply utility method to allow parameters to be given as a function
1633
+ *
1634
+ * @param {undefined|string|function} option Option
1635
+ * @return {null|string} Resolved value
1636
+ */
1637
+ var _stringOrFunction = function ( option )
1638
+ {
1639
+ if ( option === null || option === undefined ) {
1640
+ return null;
1641
+ }
1642
+ else if ( typeof option === 'function' ) {
1643
+ return option();
1644
+ }
1645
+ return option;
1646
+ };
1647
+
1648
+ /**
1649
+ * Get the title for an exported file.
1650
+ *
1651
+ * @param {object} config Button configuration
1652
+ */
1653
+ var _title = function ( config )
1654
+ {
1655
+ var title = _stringOrFunction( config.title );
1656
+
1657
+ return title === null ?
1658
+ null : title.indexOf( '*' ) !== -1 ?
1659
+ title.replace( '*', $('title').text() || 'Exported data' ) :
1660
+ title;
1661
+ };
1662
+
1663
+ var _message = function ( dt, option, position )
1664
+ {
1665
+ var message = _stringOrFunction( option );
1666
+ if ( message === null ) {
1667
+ return null;
1668
+ }
1669
+
1670
+ var caption = $('caption', dt.table().container()).eq(0);
1671
+ if ( message === '*' ) {
1672
+ var side = caption.css( 'caption-side' );
1673
+ if ( side !== position ) {
1674
+ return null;
1675
+ }
1676
+
1677
+ return caption.length ?
1678
+ caption.text() :
1679
+ '';
1680
+ }
1681
+
1682
+ return message;
1683
+ };
1684
+
1685
+
1686
+
1687
+
1688
+
1689
+
1562
1690
 
1563
1691
  var _exportTextarea = $('<textarea/>')[0];
1564
1692
  var _exportData = function ( dt, inOpts )