You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Plugins/buttons/button.download.min.js

2 lines
1.3 KiB
JavaScript

/*! © SpryMedia Ltd - datatables.net/license */
!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("<iframe/>").css({border:"none",height:0,width:0}).appendTo(u.body)[0].contentWindow.document,r=(d.open(),d.close(),i("<form/>",d).attr("method",o.type).attr("action",o.url).appendTo(d.body));i.each(e,function(t,e){i("<input/>",d).attr("type","text").attr("name",t.toString()).attr("autocomplete","no").val(e).appendTo(r)}),r.submit()},url:"",type:"POST",data:{}},n});