diff --git a/api/average().js b/api/average().js index c410226..e9c8688 100644 --- a/api/average().js +++ b/api/average().js @@ -9,25 +9,33 @@ } 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')(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/api/average().min.js b/api/average().min.js index 806a0a8..0ee91f3 100644 --- a/api/average().min.js +++ b/api/average().min.js @@ -1,2 +1,2 @@ /*! © SpryMedia Ltd - datatables.net/license */ -!function(t){"function"==typeof define&&define.amd?define(["jquery","datatables.net"],function(e){return t(e,window,document)}):"object"==typeof exports?module.exports=function(e,n){return e=e||window,(n=n||("undefined"!=typeof window?require("jquery"):require("jquery")(e))).fn.dataTable||require("datatables.net")(e,n),t(n,0,e.document)}:t(jQuery,window,document)}(function(e,n,t,r){"use strict";e=e.fn.dataTable;return e.Api.register("average()",function(){var e=this.flatten();return e.reduce(function(e,n){return+e+ +n},0)/e.length}),e}); \ No newline at end of file +!function(t){var o,r;"function"==typeof define&&define.amd?define(["jquery","datatables.net"],function(e){return t(e,window,document)}):"object"==typeof exports?(o=require("jquery"),r=function(e,n){n.fn.dataTable||require("datatables.net")(e,n)},"undefined"!=typeof window?module.exports=function(e,n){return e=e||window,n=n||o(e),r(e,n),t(n,0,e.document)}:(r(window,o),module.exports=t(o,window,window.document))):t(jQuery,window,document)}(function(e,n,t,o){"use strict";e=e.fn.dataTable;return e.Api.register("average()",function(){var e=this.flatten();return e.reduce(function(e,n){return+e+ +n},0)/e.length}),e}); \ No newline at end of file diff --git a/api/average().mjs b/api/average().mjs index d126146..da6deb1 100644 --- a/api/average().mjs +++ b/api/average().mjs @@ -3,7 +3,6 @@ import $ from 'jquery'; import DataTable from 'datatables.net'; - /** * It can sometimes be useful to get the average of data in an API result set, * be it from a column, or a collection of cells. This method provides exactly diff --git a/api/column().title().js b/api/column().title().js index 3a98c89..e8b78da 100644 --- a/api/column().title().js +++ b/api/column().title().js @@ -9,25 +9,33 @@ } 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')(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/api/column().title().min.js b/api/column().title().min.js index 9bda90c..516c12f 100644 --- a/api/column().title().min.js +++ b/api/column().title().min.js @@ -1,2 +1,2 @@ /*! © Alejandro Navarro - datatables.net/license */ -!function(n){"function"==typeof define&&define.amd?define(["jquery","datatables.net"],function(e){return n(e,window,document)}):"object"==typeof exports?module.exports=function(e,t){return e=e||window,(t=t||("undefined"!=typeof window?require("jquery"):require("jquery")(e))).fn.dataTable||require("datatables.net")(e,t),n(t,0,e.document)}:n(jQuery,window,document)}(function(t,e,n,r){"use strict";var u=t.fn.dataTable;return u.Api.register("column().title()",function(){var e=this.header();return t(e).text().trim()}),u}); \ No newline at end of file +!function(t){var o,i;"function"==typeof define&&define.amd?define(["jquery","datatables.net"],function(e){return t(e,window,document)}):"object"==typeof exports?(o=require("jquery"),i=function(e,n){n.fn.dataTable||require("datatables.net")(e,n)},"undefined"!=typeof window?module.exports=function(e,n){return e=e||window,n=n||o(e),i(e,n),t(n,0,e.document)}:(i(window,o),module.exports=t(o,window,window.document))):t(jQuery,window,document)}(function(n,e,t,o){"use strict";var i=n.fn.dataTable;return i.Api.register("column().title()",function(){var e=this.header();return n(e).text().trim()}),i}); \ No newline at end of file diff --git a/api/column().title().mjs b/api/column().title().mjs index 65209b2..ce064c1 100644 --- a/api/column().title().mjs +++ b/api/column().title().mjs @@ -3,7 +3,6 @@ import $ from 'jquery'; import DataTable from 'datatables.net'; - /** * This plug-in will read the text from the header cell of a column, returning * that value. diff --git a/api/columns().order().js b/api/columns().order().js index 5ab8cf0..0b3b012 100644 --- a/api/columns().order().js +++ b/api/columns().order().js @@ -9,25 +9,33 @@ } 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')(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/api/columns().order().min.js b/api/columns().order().min.js index afffa5c..a95bede 100644 --- a/api/columns().order().min.js +++ b/api/columns().order().min.js @@ -1,2 +1,2 @@ /*! © SpryMedia Ltd - datatables.net/license */ -!function(r){"function"==typeof define&&define.amd?define(["jquery","datatables.net"],function(e){return r(e,window,document)}):"object"==typeof exports?module.exports=function(e,n){return e=e||window,(n=n||("undefined"!=typeof window?require("jquery"):require("jquery")(e))).fn.dataTable||require("datatables.net")(e,n),r(n,0,e.document)}:r(jQuery,window,document)}(function(e,n,r,t){"use strict";var i=e.fn.dataTable;return i.Api.register("columns().order()",function(u){return this.iterator("columns",function(e,n){for(var r=[],t=0,o=n.length;t=e.start&&t=e.start&&t").css({border:"none",height:0,width:0}).appendTo(u.body)[0].contentWindow.document,d=(r.open(),r.close(),i("
",r).attr("method",o.type).attr("action",o.url).appendTo(r.body));i.each(e,function(t,e){i("",r).attr("type","text").attr("name",t.toString()).attr("autocomplete","no").val(e).appendTo(d)}),d.submit()},url:"",type:"POST",data:{}},n}); \ No newline at end of file +!function(n){var o,a;"function"==typeof define&&define.amd?define(["jquery","datatables.net"],function(t){return n(t,window,document)}):"object"==typeof exports?(o=require("jquery"),a=function(t,e){e.fn.dataTable||require("datatables.net")(t,e)},"undefined"!=typeof window?module.exports=function(t,e){return t=t||window,e=e||o(t),a(t,e),n(e,0,t.document)}:(a(window,o),module.exports=n(o,window,window.document))):n(jQuery,window,document)}(function(i,t,u,e){"use strict";var n=i.fn.dataTable;return n.ext.buttons.download={text:"Download",action:function(t,e,n,o){var a={},e=(e.page.info().serverSide&&i.extend(a,e.ajax.params()),"function"==typeof o.data?o.data(a):"object"==typeof o.data&&i.extend(a,o.data),function n(t,o,a){return a=a||{},o=o||"",i.isPlainObject(t)||Array.isArray(t)?i.each(t,function(t,e){n(e,""===o?t:o+"["+t.toString()+"]",a)}):a[o]=t,a}(a)),d=i("