pandorafms/pandora_console/include/javascript/buttons.html5.min.js

8 lines
24 KiB
JavaScript
Raw Normal View History

/*!
HTML5 export buttons for Buttons and DataTables.
2016 SpryMedia Ltd - datatables.net/license
FileSaver.js (1.3.3) - MIT license
Copyright © 2016 Eli Grey - http://eligrey.com
*/
2022-12-02 13:12:58 +01:00
!function(t){"function"==typeof define&&define.amd?define(["jquery","datatables.net","datatables.net-buttons"],(function(e){return t(e,window,document)})):"object"==typeof exports?module.exports=function(e,o,l,n){return e||(e=window),o&&o.fn.dataTable||(o=require("datatables.net")(e,o).$),o.fn.dataTable.Buttons||require("datatables.net-buttons")(e,o),t(o,e,e.document,l,n)}:t(jQuery,window,document)}((function(t,e,l,n,r,a){function p(t){for(var e="";0<=t;)e=String.fromCharCode(t%26+65)+e,t=Math.floor(t/26)-1;return e}function d(e,o){F===a&&(F=-1===x.serializeToString(t.parseXML(h["xl/worksheets/sheet1.xml"])).indexOf("xmlns:r")),t.each(o,(function(o,l){if(t.isPlainObject(l))d(o=e.folder(o),l);else{if(F){var n,r=l.childNodes[0],a=[];for(n=r.attributes.length-1;0<=n;n--){var p=r.attributes[n].nodeName,i=r.attributes[n].nodeValue;-1!==p.indexOf(":")&&(a.push({name:p,value:i}),r.removeAttribute(p))}for(n=0,p=a.length;n<p;n++)(i=l.createAttribute(a[n].name.replace(":","_dt_b_namespace_token_"))).value=a[n].value,r.setAttributeNode(i)}l=x.serializeToString(l),F&&(-1===l.indexOf("<?xml")&&(l='<?xml version="1.0" encoding="UTF-8" standalone="yes"?>'+l),l=(l=l.replace(/_dt_b_namespace_token_/g,":")).replace(/xmlns:NS[\d]+="" NS[\d]+:/g,"")),l=l.replace(/<([^<>]*?) xmlns=""([^<>]*?)>/g,"<$1 $2>"),e.file(o,l)}}))}function i(e,o,l){var n=e.createElement(o);return l&&(l.attr&&t(n).attr(l.attr),l.children&&t.each(l.children,(function(t,e){n.appendChild(e)})),null!==l.text&&l.text!==a&&n.appendChild(e.createTextNode(l.text))),n}function s(t,e){var o=t.header[e].length;t.footer&&t.footer[e].length>o&&(o=t.footer[e].length);for(var l=0,n=t.body.length;l<n;l++){var r=t.body[l][e];if(-1!==(r=null!==r&&r!==a?r.toString():"").indexOf("\n")?((r=r.split("\n")).sort((function(t,e){return e.length-t.length})),r=r[0].length):r=r.length,r>o&&(o=r),40<o)return 54}return 6<(o*=1.35)?o:6}var f=t.fn.dataTable;f.Buttons.pdfMake=function(t){if(!t)return r||e.pdfMake;r=m_ake},f.Buttons.jszip=function(t){if(!t)return n||e.JSZip;n=t};var m=function(t){if(!(void 0===t||"undefined"!=typeof navigator&&/MSIE [1-9]\./.test(navigator.userAgent))){var e=t.document.createElementNS("http://www.w3.org/1999/xhtml","a"),l="download"in e,n=/constructor/i.test(t.HTMLElement)||t.safari,r=/CriOS\/[\d]+/.test(navigator.userAgent),a=function(e){(t.setImmediate||t.setTimeout)((function(){throw e}),0)},p=function(e){setTimeout((function(){"string"==typeof e?(t.URL||t.webkitURL||t).revokeObjectURL(e):e.remove()}),4e4)},d=function(t){return/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(t.type)?new Blob([String.fromCharCode(65279),t],{type:t.type}):t},i=function(i,s,f){f||(i=d(i));var m=this,y="application/octet-stream"===i.type,c=function(){for(var t=["writestart","progress","write","writeend"],e=(t=[].concat(t)).length;e--;){var o=m["on"+t[e]];if("function"==typeof o)try{o.call(m,m)}catch(t){a(t)}}};if(m.readyState=m.INIT,l){var u=(t.URL||t.webkitURL||t).createObjectURL(i);setTimeout((function(){e.href=u,e.download=s;var t=new MouseEvent("click");o=getCookie("downloadToken"),setToken("downloadReady",o),e.dispatchEvent(t),c(),p(u),m.readyState=m.DONE}))}else!function(){if((r||y&&n)&&t.FileReader){var e=new FileReader;e.onloadend=function(){var o=r?e.result:e.result.replace(/^data:[^;]*;/,"data:attachment/file;");t.open(o,"_blank")||(t.location.href=o),m.readyState=m.DONE,c()},e.readAsDataURL(i),m.readyState=m.INIT}else u||(u=(t.URL||t.webkitURL||t).createObjectURL(i)),y?t.location.href=u:t.open(u,"_blank")||(t.location.href=u),m.readyState=m.DONE,c(),p(u)}()},s=i.prototype;return"undefined"!=typeof navigator&&navigator.msSaveOrOpenBlob?function(t,e,o){return e=e||t.name||"download",o||(t=d(t)),navigator.msSaveOrOpenBlob(t,e)}:(s.abort=function(){},s.readyState=s.INIT=0,s.WRITING=1,s.DONE=2,s.error=s.onwritestart=s.onprogress=s.onwrite=s.onabort=s.onerror=s.onwriteend=null,function(t,e,o){return new i(t,e||t.name||"download",o)})}}("undefined"!=typeof self&&self||void 0!==e&&e||this.content);f.fileSave=m;var y=function(t){var e="Sheet1";return