diff --git a/datatables.json b/datatables.json index 32379a0..3ce262a 100644 --- a/datatables.json +++ b/datatables.json @@ -15,5 +15,5 @@ ], "src-repo": "http://github.com/DataTables/Buttons", "last-tag": "2.3.5", - "last-sync": "0b1fd42649697aed4f72490eb3c702ded00d79dd" + "last-sync": "c0ce909a29e2dfe354b85597177b72b069b6354c" } \ No newline at end of file diff --git a/js/buttons.bootstrap.js b/js/buttons.bootstrap.js index 6d6afae..3edd363 100644 --- a/js/buttons.bootstrap.js +++ b/js/buttons.bootstrap.js @@ -11,19 +11,8 @@ } else if ( typeof exports === 'object' ) { // CommonJS - module.exports = function (root, $) { - if ( ! root ) { - // CommonJS environments without a window global must pass a - // root. This will give an error otherwise - root = window; - } - - if ( ! $ ) { - $ = typeof window !== 'undefined' ? // jQuery's factory checks for a global window - require('jquery') : - require('jquery')( root ); - } - + var jq = require('jquery'); + var cjsRequires = function (root, $) { if ( ! $.fn.dataTable ) { require('datatables.net-bs')(root, $); } @@ -31,9 +20,28 @@ if ( ! $.fn.dataTable.Buttons ) { require('datatables.net-buttons')(root, $); } - - return factory( $, root, root.document ); }; + + if (typeof window !== 'undefined') { + module.exports = function (root, $) { + if ( ! root ) { + // CommonJS environments without a window global must pass a + // root. This will give an error otherwise + root = window; + } + + if ( ! $ ) { + $ = jq( root ); + } + + cjsRequires( root, $ ); + return factory( $, root, root.document ); + }; + } + else { + cjsRequires( window, jq ); + module.exports = factory( jq, window, window.document ); + } } else { // Browser diff --git a/js/buttons.bootstrap.min.js b/js/buttons.bootstrap.min.js index 1f8f478..d581ce8 100644 --- a/js/buttons.bootstrap.min.js +++ b/js/buttons.bootstrap.min.js @@ -1,4 +1,4 @@ /*! Bootstrap integration for DataTables' Buttons * ©2016 SpryMedia Ltd - datatables.net/license */ -!function(n){"function"==typeof define&&define.amd?define(["jquery","datatables.net-bs","datatables.net-buttons"],function(t){return n(t,window,document)}):"object"==typeof exports?module.exports=function(t,e){return t=t||window,(e=e||("undefined"!=typeof window?require("jquery"):require("jquery")(t))).fn.dataTable||require("datatables.net-bs")(t,e),e.fn.dataTable.Buttons||require("datatables.net-buttons")(t,e),n(e,0,t.document)}:n(jQuery,window,document)}(function(t,e,n,o){"use strict";var a=t.fn.dataTable;return t.extend(!0,a.Buttons.defaults,{dom:{container:{className:"dt-buttons btn-group"},button:{className:"btn btn-default"},collection:{tag:"ul",className:"dropdown-menu",closeButton:!1,button:{tag:"li",className:"dt-button",active:"active",disabled:"disabled"},buttonLiner:{tag:"a",className:""}},splitWrapper:{tag:"div",className:"dt-btn-split-wrapper btn-group",closeButton:!1},splitDropdown:{tag:"button",text:"▼",className:"btn btn-default dt-btn-split-drop dropdown-toggle",closeButton:!1,align:"split-left",splitAlignClass:"dt-button-split-left"},splitDropdownButton:{tag:"button",className:"dt-btn-split-drop-button btn btn-default",closeButton:!1}}}),a.ext.buttons.collection.text=function(t){return t.i18n("buttons.collection",'Collection ')},a}); \ No newline at end of file +!function(e){var o,a;"function"==typeof define&&define.amd?define(["jquery","datatables.net-bs","datatables.net-buttons"],function(t){return e(t,window,document)}):"object"==typeof exports?(o=require("jquery"),a=function(t,n){n.fn.dataTable||require("datatables.net-bs")(t,n),n.fn.dataTable.Buttons||require("datatables.net-buttons")(t,n)},"undefined"!=typeof window?module.exports=function(t,n){return t=t||window,n=n||o(t),a(t,n),e(n,0,t.document)}:(a(window,o),module.exports=e(o,window,window.document))):e(jQuery,window,document)}(function(t,n,e,o){"use strict";var a=t.fn.dataTable;return t.extend(!0,a.Buttons.defaults,{dom:{container:{className:"dt-buttons btn-group"},button:{className:"btn btn-default"},collection:{tag:"ul",className:"dropdown-menu",closeButton:!1,button:{tag:"li",className:"dt-button",active:"active",disabled:"disabled"},buttonLiner:{tag:"a",className:""}},splitWrapper:{tag:"div",className:"dt-btn-split-wrapper btn-group",closeButton:!1},splitDropdown:{tag:"button",text:"▼",className:"btn btn-default dt-btn-split-drop dropdown-toggle",closeButton:!1,align:"split-left",splitAlignClass:"dt-button-split-left"},splitDropdownButton:{tag:"button",className:"dt-btn-split-drop-button btn btn-default",closeButton:!1}}}),a.ext.buttons.collection.text=function(t){return t.i18n("buttons.collection",'Collection ')},a}); \ No newline at end of file diff --git a/js/buttons.bootstrap.mjs b/js/buttons.bootstrap.mjs index b759f7c..0f790aa 100644 --- a/js/buttons.bootstrap.mjs +++ b/js/buttons.bootstrap.mjs @@ -7,7 +7,6 @@ import DataTable from 'datatables.net-bs'; import Buttons from 'datatables.net-buttons'; - $.extend( true, DataTable.Buttons.defaults, { dom: { container: {