diff --git a/vendors/datatables.net-buttons/.bower.json b/vendors/datatables.net-buttons/.bower.json index 1ba81036..b8890c48 100644 --- a/vendors/datatables.net-buttons/.bower.json +++ b/vendors/datatables.net-buttons/.bower.json @@ -42,14 +42,15 @@ ], "homepage": "https://datatables.net", "license": "MIT", - "version": "1.2.1", - "_release": "1.2.1", + "version": "1.2.2", + "_release": "1.2.2", "_resolution": { "type": "version", - "tag": "1.2.1", - "commit": "0518965e46150aa2a62d0132053f338cabe165fb" + "tag": "1.2.2", + "commit": "16f453f3c50ce39b44812ba056cbd10a1b1eb245" }, "_source": "https://github.com/DataTables/Dist-DataTables-Buttons.git", - "_target": "^1.1.2", - "_originalSource": "datatables.net-buttons" + "_target": "1.2.2", + "_originalSource": "datatables.net-buttons", + "_direct": true } \ No newline at end of file diff --git a/vendors/datatables.net-buttons/js/buttons.colVis.js b/vendors/datatables.net-buttons/js/buttons.colVis.js index 08e42fae..d6490996 100755 --- a/vendors/datatables.net-buttons/js/buttons.colVis.js +++ b/vendors/datatables.net-buttons/js/buttons.colVis.js @@ -104,12 +104,11 @@ $.extend( DataTable.ext.buttons, { }, init: function ( dt, button, conf ) { var that = this; - var col = dt.column( conf.columns ); dt .on( 'column-visibility.dt'+conf.namespace, function (e, settings) { if ( ! settings.bDestroying ) { - that.active( col.visible() ); + that.active( dt.column( conf.columns ).visible() ); } } ) .on( 'column-reorder.dt'+conf.namespace, function (e, settings, details) { @@ -129,7 +128,7 @@ $.extend( DataTable.ext.buttons, { that.active( col.visible() ); } ); - this.active( col.visible() ); + this.active( dt.column( conf.columns ).visible() ); }, destroy: function ( dt, button, conf ) { dt diff --git a/vendors/datatables.net-buttons/js/buttons.colVis.min.js b/vendors/datatables.net-buttons/js/buttons.colVis.min.js index e007073b..16af2273 100644 --- a/vendors/datatables.net-buttons/js/buttons.colVis.min.js +++ b/vendors/datatables.net-buttons/js/buttons.colVis.min.js @@ -1,5 +1,5 @@ (function(g){"function"===typeof define&&define.amd?define(["jquery","datatables.net","datatables.net-buttons"],function(d){return g(d,window,document)}):"object"===typeof exports?module.exports=function(d,e){d||(d=window);if(!e||!e.fn.dataTable)e=require("datatables.net")(d,e).$;e.fn.dataTable.Buttons||require("datatables.net-buttons")(d,e);return g(e,d,d.document)}:g(jQuery,window,document)})(function(g,d,e,h){d=g.fn.dataTable;g.extend(d.ext.buttons,{colvis:function(a,b){return{extend:"collection", text:function(a){return a.i18n("buttons.colvis","Column visibility")},className:"buttons-colvis",buttons:[{extend:"columnsToggle",columns:b.columns}]}},columnsToggle:function(a,b){return a.columns(b.columns).indexes().map(function(a){return{extend:"columnToggle",columns:a}}).toArray()},columnToggle:function(a,b){return{extend:"columnVisibility",columns:b.columns}},columnsVisibility:function(a,b){return a.columns(b.columns).indexes().map(function(a){return{extend:"columnVisibility",columns:a,visibility:b.visibility}}).toArray()}, -columnVisibility:{columns:h,text:function(a,b,c){return c._columnText(a,c.columns)},className:"buttons-columnVisibility",action:function(a,b,c,f){a=b.columns(f.columns);b=a.visible();a.visible(f.visibility!==h?f.visibility:!(b.length&&b[0]))},init:function(a,b,c){var f=this,d=a.column(c.columns);a.on("column-visibility.dt"+c.namespace,function(a,b){b.bDestroying||f.active(d.visible())}).on("column-reorder.dt"+c.namespace,function(b,d,e){1===a.columns(c.columns).count()&&("number"===typeof c.columns&& -(c.columns=e.mapping[c.columns]),b=a.column(c.columns),f.text(c._columnText(a,c.columns)),f.active(b.visible()))});this.active(d.visible())},destroy:function(a,b,c){a.off("column-visibility.dt"+c.namespace).off("column-reorder.dt"+c.namespace)},_columnText:function(a,b){var c=a.column(b).index();return a.settings()[0].aoColumns[c].sTitle.replace(/\n/g," ").replace(/<.*?>/g,"").replace(/^\s+|\s+$/g,"")}},colvisRestore:{className:"buttons-colvisRestore",text:function(a){return a.i18n("buttons.colvisRestore", +columnVisibility:{columns:h,text:function(a,b,c){return c._columnText(a,c.columns)},className:"buttons-columnVisibility",action:function(a,b,c,f){a=b.columns(f.columns);b=a.visible();a.visible(f.visibility!==h?f.visibility:!(b.length&&b[0]))},init:function(a,b,c){var f=this;a.on("column-visibility.dt"+c.namespace,function(b,d){d.bDestroying||f.active(a.column(c.columns).visible())}).on("column-reorder.dt"+c.namespace,function(b,d,e){1===a.columns(c.columns).count()&&("number"===typeof c.columns&& +(c.columns=e.mapping[c.columns]),b=a.column(c.columns),f.text(c._columnText(a,c.columns)),f.active(b.visible()))});this.active(a.column(c.columns).visible())},destroy:function(a,b,c){a.off("column-visibility.dt"+c.namespace).off("column-reorder.dt"+c.namespace)},_columnText:function(a,b){var c=a.column(b).index();return a.settings()[0].aoColumns[c].sTitle.replace(/\n/g," ").replace(/<.*?>/g,"").replace(/^\s+|\s+$/g,"")}},colvisRestore:{className:"buttons-colvisRestore",text:function(a){return a.i18n("buttons.colvisRestore", "Restore visibility")},init:function(a,b,c){c._visOriginal=a.columns().indexes().map(function(b){return a.column(b).visible()}).toArray()},action:function(a,b,c,d){b.columns().every(function(a){a=b.colReorder&&b.colReorder.transpose?b.colReorder.transpose(a,"toOriginal"):a;this.visible(d._visOriginal[a])})}},colvisGroup:{className:"buttons-colvisGroup",action:function(a,b,c,d){b.columns(d.show).visible(!0,!1);b.columns(d.hide).visible(!1,!1);b.columns.adjust()},show:[],hide:[]}});return d.Buttons}); diff --git a/vendors/datatables.net-buttons/js/buttons.flash.js b/vendors/datatables.net-buttons/js/buttons.flash.js index bbc3254f..695de992 100644 --- a/vendors/datatables.net-buttons/js/buttons.flash.js +++ b/vendors/datatables.net-buttons/js/buttons.flash.js @@ -891,7 +891,7 @@ var excelStrings = { ''+ '', - "xl/styles.xml": + "xl/styles.xml": ''+ ''+ ''+ @@ -977,7 +977,7 @@ var excelStrings = { ''+ ''+ ''+ - ''+ + ''+ ''+ ''+ ''+ @@ -1028,6 +1028,24 @@ var excelStrings = { ''+ ''+ ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ ''+ ''+ ''+ @@ -1193,11 +1211,7 @@ DataTable.ext.buttons.excelFlash = $.extend( {}, flashButton, { // Replace non standard characters for text output var text = ! row[i].replace ? row[i] : - row[i] - .replace(/&(?!amp;)/g, '&') - .replace(//g, '>') - .replace(/[\x00-\x09\x0B\x0C\x0E-\x1F\x7F-\x9F]/g, ''); + row[i].replace(/[\x00-\x09\x0B\x0C\x0E-\x1F\x7F-\x9F]/g, ''); cell = _createNode( rels, 'c', { attr: { @@ -1299,7 +1313,7 @@ DataTable.ext.buttons.pdfFlash = $.extend( {}, flashButton, { _setText( flash, JSON.stringify( { title: _filename(config, false), - message: config.message, + message: typeof config.message == 'function' ? config.message(dt, button, config) : config.message, colWidth: ratios.toArray(), orientation: config.orientation, size: config.pageSize, diff --git a/vendors/datatables.net-buttons/js/buttons.flash.min.js b/vendors/datatables.net-buttons/js/buttons.flash.min.js index 82fc495f..bc326407 100644 --- a/vendors/datatables.net-buttons/js/buttons.flash.min.js +++ b/vendors/datatables.net-buttons/js/buttons.flash.min.js @@ -1,29 +1,29 @@ -(function(g){"function"===typeof define&&define.amd?define(["jquery","datatables.net","datatables.net-buttons"],function(i){return g(i,window,document)}):"object"===typeof exports?module.exports=function(i,k){i||(i=window);if(!k||!k.fn.dataTable)k=require("datatables.net")(i,k).$;k.fn.dataTable.Buttons||require("datatables.net-buttons")(i,k);return g(k,i,i.document)}:g(jQuery,window,document)})(function(g,i,k,o){function l(a,b,d){var c=a.createElement(b);d&&(d.attr&&g(c).attr(d.attr),d.children&& -g.each(d.children,function(a,b){c.appendChild(b)}),d.text&&c.appendChild(a.createTextNode(d.text)));return c}function y(a,b){var d=a.header[b].length,c;a.footer&&a.footer[b].length>d&&(d=a.footer[b].length);for(var e=0,f=a.body.length;ed&&(d=c),40'+c),c=c.replace(/_dt_b_namespace_token_/g,":"));c=c.replace(//g,"");a[b]=c}})}var j=g.fn.dataTable,h={version:"1.0.4-TableTools2",clients:{},moviePath:"",nextId:1,$:function(a){"string"==typeof a&&(a=k.getElementById(a));a.addClass||(a.hide=function(){this.style.display="none"},a.show=function(){this.style.display=""},a.addClass=function(a){this.removeClass(a);this.className+=" "+a},a.removeClass=function(a){this.className=this.className.replace(RegExp("\\s*"+a+"\\s*")," ").replace(/^\s+/,"").replace(/\s+$/,"")},a.hasClass= +(function(f){"function"===typeof define&&define.amd?define(["jquery","datatables.net","datatables.net-buttons"],function(j){return f(j,window,document)}):"object"===typeof exports?module.exports=function(j,k){j||(j=window);if(!k||!k.fn.dataTable)k=require("datatables.net")(j,k).$;k.fn.dataTable.Buttons||require("datatables.net-buttons")(j,k);return f(k,j,j.document)}:f(jQuery,window,document)})(function(f,j,k,o){function l(a,b,d){var c=a.createElement(b);d&&(d.attr&&f(c).attr(d.attr),d.children&& +f.each(d.children,function(a,b){c.appendChild(b)}),d.text&&c.appendChild(a.createTextNode(d.text)));return c}function z(a,b){var d=a.header[b].length,c;a.footer&&a.footer[b].length>d&&(d=a.footer[b].length);for(var e=0,g=a.body.length;ed&&(d=c),40'+c),c=c.replace(/_dt_b_namespace_token_/g,":"));c=c.replace(//g,"");a[b]=c}})}var i=f.fn.dataTable,h={version:"1.0.4-TableTools2",clients:{},moviePath:"",nextId:1,$:function(a){"string"==typeof a&&(a=k.getElementById(a));a.addClass||(a.hide=function(){this.style.display="none"},a.show=function(){this.style.display=""},a.addClass=function(a){this.removeClass(a);this.className+=" "+a},a.removeClass=function(a){this.className=this.className.replace(RegExp("\\s*"+a+"\\s*")," ").replace(/^\s+/,"").replace(/\s+$/,"")},a.hasClass= function(a){return!!this.className.match(RegExp("\\s*"+a+"\\s*"))});return a},setMoviePath:function(a){this.moviePath=a},dispatch:function(a,b,d){(a=this.clients[a])&&a.receiveEvent(b,d)},log:function(a){console.log("Flash: "+a)},register:function(a,b){this.clients[a]=b},getDOMObjectPosition:function(a){var b={left:0,top:0,width:a.width?a.width:a.offsetWidth,height:a.height?a.height:a.offsetHeight};""!==a.style.width&&(b.width=a.style.width.replace("px",""));""!==a.style.height&&(b.height=a.style.height.replace("px", ""));for(;a;)b.left+=a.offsetLeft,b.top+=a.offsetTop,a=a.offsetParent;return b},Client:function(a){this.handlers={};this.id=h.nextId++;this.movieId="ZeroClipboard_TableToolsMovie_"+this.id;h.register(this.id,this);a&&this.glue(a)}};h.Client.prototype={id:0,ready:!1,movie:null,clipText:"",fileName:"",action:"copy",handCursorEnabled:!0,cssEffects:!0,handlers:null,sized:!1,sheetName:"",glue:function(a,b){this.domElement=h.$(a);var d=99;this.domElement.style.zIndex&&(d=parseInt(this.domElement.style.zIndex, 10)+1);var c=h.getDOMObjectPosition(this.domElement);this.div=k.createElement("div");var e=this.div.style;e.position="absolute";e.left="0px";e.top="0px";e.width=c.width+"px";e.height=c.height+"px";e.zIndex=d;"undefined"!=typeof b&&""!==b&&(this.div.title=b);0!==c.width&&0!==c.height&&(this.sized=!0);this.domElement&&(this.domElement.appendChild(this.div),this.div.innerHTML=this.getHTML(c.width,c.height).replace(/&/g,"&"))},positionElement:function(){var a=h.getDOMObjectPosition(this.domElement), b=this.div.style;b.position="absolute";b.width=a.width+"px";b.height=a.height+"px";0!==a.width&&0!==a.height&&(this.sized=!0,b=this.div.childNodes[0],b.width=a.width,b.height=a.height)},getHTML:function(a,b){var d="",c="id="+this.id+"&width="+a+"&height="+b;if(navigator.userAgent.match(/MSIE/))var e=location.href.match(/^https/i)?"https://":"http://",d=d+('');else d+='';return d},hide:function(){this.div&&(this.div.style.left="-2000px")},show:function(){this.reposition()},destroy:function(){var a=this;this.domElement&&this.div&&(g(this.div).remove(),this.div=this.domElement=null,g.each(h.clients,function(b,d){d===a&&delete h.clients[b]}))}, +a+'" height="'+b+'" name="'+this.movieId+'" align="middle" allowScriptAccess="always" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="'+c+'" wmode="transparent" />';return d},hide:function(){this.div&&(this.div.style.left="-2000px")},show:function(){this.reposition()},destroy:function(){var a=this;this.domElement&&this.div&&(f(this.div).remove(),this.div=this.domElement=null,f.each(h.clients,function(b,d){d===a&&delete h.clients[b]}))}, reposition:function(a){a&&((this.domElement=h.$(a))||this.hide());if(this.domElement&&this.div){var a=h.getDOMObjectPosition(this.domElement),b=this.div.style;b.left=""+a.left+"px";b.top=""+a.top+"px"}},clearText:function(){this.clipText="";this.ready&&this.movie.clearText()},appendText:function(a){this.clipText+=a;this.ready&&this.movie.appendText(a)},setText:function(a){this.clipText=a;this.ready&&this.movie.setText(a)},setFileName:function(a){this.fileName=a;this.ready&&this.movie.setFileName(a)}, setSheetData:function(a){this.ready&&this.movie.setSheetData(JSON.stringify(a))},setAction:function(a){this.action=a;this.ready&&this.movie.setAction(a)},addEventListener:function(a,b){a=a.toString().toLowerCase().replace(/^on/,"");this.handlers[a]||(this.handlers[a]=[]);this.handlers[a].push(b)},setHandCursor:function(a){this.handCursorEnabled=a;this.ready&&this.movie.setHandCursor(a)},setCSSEffects:function(a){this.cssEffects=!!a},receiveEvent:function(a,b){var d,a=a.toString().toLowerCase().replace(/^on/, "");switch(a){case "load":this.movie=k.getElementById(this.movieId);if(!this.movie){d=this;setTimeout(function(){d.receiveEvent("load",null)},1);return}if(!this.ready&&navigator.userAgent.match(/Firefox/)&&navigator.userAgent.match(/Windows/)){d=this;setTimeout(function(){d.receiveEvent("load",null)},100);this.ready=!0;return}this.ready=!0;this.movie.clearText();this.movie.appendText(this.clipText);this.movie.setFileName(this.fileName);this.movie.setAction(this.action);this.movie.setHandCursor(this.handCursorEnabled); break;case "mouseover":this.domElement&&this.cssEffects&&this.recoverActive&&this.domElement.addClass("active");break;case "mouseout":this.domElement&&this.cssEffects&&(this.recoverActive=!1,this.domElement.hasClass("active")&&(this.domElement.removeClass("active"),this.recoverActive=!0));break;case "mousedown":this.domElement&&this.cssEffects&&this.domElement.addClass("active");break;case "mouseup":this.domElement&&this.cssEffects&&(this.domElement.removeClass("active"),this.recoverActive=!1)}if(this.handlers[a])for(var c= -0,e=this.handlers[a].length;c',"xl/_rels/workbook.xml.rels":'', "[Content_Types].xml":'', "xl/workbook.xml":'', -"xl/worksheets/sheet1.xml":'',"xl/styles.xml":''}; -j.Buttons.swfPath="//cdn.datatables.net/buttons/1.2.0/swf/flashExport.swf";j.Api.register("buttons.resize()",function(){g.each(h.clients,function(a,b){b.domElement!==o&&b.domElement.parentNode&&b.positionElement()})});j.ext.buttons.copyFlash=g.extend({},s,{className:"buttons-copy buttons-flash",text:function(a){return a.i18n("buttons.copy","Copy")},action:function(a,b,d,c){c._fromFlash&&(a=c._flash,d=x(b,c),c=c.customize?c.customize(d.str,c):d.str,a.setAction("copy"),r(a,c),b.buttons.info(b.i18n("buttons.copyTitle", -"Copy to clipboard"),b.i18n("buttons.copySuccess",{_:"Copied %d rows to clipboard",1:"Copied 1 row to clipboard"},d.rows),3E3))},fieldSeparator:"\t",fieldBoundary:""});j.ext.buttons.csvFlash=g.extend({},s,{className:"buttons-csv buttons-flash",text:function(a){return a.i18n("buttons.csv","CSV")},action:function(a,b,d,c){a=c._flash;b=x(b,c);b=c.customize?c.customize(b.str,c):b.str;a.setAction("csv");a.setFileName(q(c));r(a,b)},escapeChar:'"'});j.ext.buttons.excelFlash=g.extend({},s,{className:"buttons-excel buttons-flash", -text:function(a){return a.i18n("buttons.excel","Excel")},action:function(a,b,d,c){var a=c._flash,e=0,f=g.parseXML(p["xl/worksheets/sheet1.xml"]),h=f.getElementsByTagName("sheetData")[0],d={_rels:{".rels":g.parseXML(p["_rels/.rels"])},xl:{_rels:{"workbook.xml.rels":g.parseXML(p["xl/_rels/workbook.xml.rels"])},"workbook.xml":g.parseXML(p["xl/workbook.xml"]),"styles.xml":g.parseXML(p["xl/styles.xml"]),worksheets:{"sheet1.xml":f}},"[Content_Types].xml":g.parseXML(p["[Content_Types].xml"])},b=b.buttons.exportData(c.exportOptions), -i,k,j=function(a){i=e+1;k=l(f,"row",{attr:{r:i}});for(var b=0,c=a.length;b/g,">").replace(/[\x00-\x09\x0B\x0C\x0E-\x1F\x7F-\x9F]/g, -""),d=l(f,"c",{attr:{t:"inlineStr",r:d},children:{row:l(f,"is",{children:{row:l(f,"t",{text:j})}})}}));k.appendChild(d)}h.appendChild(k);e++};g("sheets sheet",d.xl["workbook.xml"]).attr("name",z(c));c.customizeData&&c.customizeData(b);c.header&&(j(b.header,e),g("row c",f).attr("s","2"));for(var m=0,n=b.body.length;m',"xl/styles.xml":''}; +i.Buttons.swfPath="//cdn.datatables.net/buttons/1.2.0/swf/flashExport.swf";i.Api.register("buttons.resize()",function(){f.each(h.clients,function(a,b){b.domElement!==o&&b.domElement.parentNode&&b.positionElement()})});i.ext.buttons.copyFlash=f.extend({},t,{className:"buttons-copy buttons-flash",text:function(a){return a.i18n("buttons.copy","Copy")},action:function(a,b,d,c){c._fromFlash&&(a=c._flash,d=y(b,c),c=c.customize?c.customize(d.str,c):d.str,a.setAction("copy"),s(a,c),b.buttons.info(b.i18n("buttons.copyTitle", +"Copy to clipboard"),b.i18n("buttons.copySuccess",{_:"Copied %d rows to clipboard",1:"Copied 1 row to clipboard"},d.rows),3E3))},fieldSeparator:"\t",fieldBoundary:""});i.ext.buttons.csvFlash=f.extend({},t,{className:"buttons-csv buttons-flash",text:function(a){return a.i18n("buttons.csv","CSV")},action:function(a,b,d,c){a=c._flash;b=y(b,c);b=c.customize?c.customize(b.str,c):b.str;a.setAction("csv");a.setFileName(r(c));s(a,b)},escapeChar:'"'});i.ext.buttons.excelFlash=f.extend({},t,{className:"buttons-excel buttons-flash", +text:function(a){return a.i18n("buttons.excel","Excel")},action:function(a,b,d,c){var a=c._flash,e=0,g=f.parseXML(p["xl/worksheets/sheet1.xml"]),h=g.getElementsByTagName("sheetData")[0],d={_rels:{".rels":f.parseXML(p["_rels/.rels"])},xl:{_rels:{"workbook.xml.rels":f.parseXML(p["xl/_rels/workbook.xml.rels"])},"workbook.xml":f.parseXML(p["xl/workbook.xml"]),"styles.xml":f.parseXML(p["xl/styles.xml"]),worksheets:{"sheet1.xml":g}},"[Content_Types].xml":f.parseXML(p["[Content_Types].xml"])},b=b.buttons.exportData(c.exportOptions), +j,k,i=function(a){j=e+1;k=l(g,"row",{attr:{r:j}});for(var b=0,c=a.length;b'+ '', - "xl/styles.xml": + "xl/styles.xml": ''+ ''+ ''+ @@ -759,7 +759,7 @@ var excelStrings = { ''+ ''+ ''+ - ''+ + ''+ ''+ ''+ ''+ @@ -810,6 +810,24 @@ var excelStrings = { ''+ ''+ ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ ''+ ''+ ''+ @@ -865,19 +883,20 @@ DataTable.ext.buttons.copyHtml5 = { textarea[0].select(); try { - document.execCommand( 'copy' ); + var successful = document.execCommand( 'copy' ); hiddenDiv.remove(); - dt.buttons.info( - dt.i18n( 'buttons.copyTitle', 'Copy to clipboard' ), - dt.i18n( 'buttons.copySuccess', { - 1: "Copied one row to clipboard", - _: "Copied %d rows to clipboard" + if (successful) { + dt.buttons.info( + dt.i18n( 'buttons.copyTitle', 'Copy to clipboard' ), + dt.i18n( 'buttons.copySuccess', { + 1: 'Copied one row to clipboard', + _: 'Copied %d rows to clipboard' }, exportData.rows ), - 2000 - ); - - return; + 2000 + ); + return; + } } catch (t) {} } @@ -931,6 +950,8 @@ DataTable.ext.buttons.copyHtml5 = { // CSV export // DataTable.ext.buttons.csvHtml5 = { + bom: false, + className: 'buttons-csv buttons-html5', available: function () { @@ -963,9 +984,14 @@ DataTable.ext.buttons.csvHtml5 = { charset = ''; } + if ( config.bom ) { + output = '\ufeff' + output; + } + _saveAs( new Blob( [output], {type: 'text/csv'+charset} ), - _filename( config ) + _filename( config ), + true ); }, @@ -995,7 +1021,7 @@ DataTable.ext.buttons.excelHtml5 = { className: 'buttons-excel buttons-html5', available: function () { - return window.FileReader !== undefined && jsZip !== undefined && ! _isSafari() && _serialiser; + return window.FileReader !== undefined && _jsZip() !== undefined && ! _isSafari() && _serialiser; }, text: function ( dt ) { @@ -1068,11 +1094,7 @@ DataTable.ext.buttons.excelHtml5 = { // Replace non standard characters for text output var text = ! row[i].replace ? row[i] : - row[i] - .replace(/&(?!amp;)/g, '&') - .replace(//g, '>') - .replace(/[\x00-\x09\x0B\x0C\x0E-\x1F\x7F-\x9F]/g, ''); + row[i].replace(/[\x00-\x09\x0B\x0C\x0E-\x1F\x7F-\x9F]/g, ''); cell = _createNode( rels, 'c', { attr: { @@ -1137,7 +1159,8 @@ DataTable.ext.buttons.excelHtml5 = { config.customize( xlsx ); } - var zip = new jsZip(); + var jszip = _jsZip(); + var zip = new jszip(); var zipConfig = { type: 'blob', mimeType: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' @@ -1180,7 +1203,7 @@ DataTable.ext.buttons.pdfHtml5 = { className: 'buttons-pdf buttons-html5', available: function () { - return window.FileReader !== undefined && pdfMake; + return window.FileReader !== undefined && _pdfMake(); }, text: function ( dt ) { @@ -1261,11 +1284,11 @@ DataTable.ext.buttons.pdfHtml5 = { }; if ( config.message ) { - doc.content.unshift( { - text: config.message, - style: 'message', - margin: [ 0, 0, 0, 12 ] - } ); + doc.content.unshift( { + text: typeof config.message == 'function' ? config.message(dt, button, config) : config.message, + style: 'message', + margin: [ 0, 0, 0, 12 ] + } ); } if ( config.title ) { @@ -1280,7 +1303,7 @@ DataTable.ext.buttons.pdfHtml5 = { config.customize( doc, config ); } - var pdf = pdfMake.createPdf( doc ); + var pdf = _pdfMake().createPdf( doc ); if ( config.download === 'open' && ! _isSafari() ) { pdf.open(); diff --git a/vendors/datatables.net-buttons/js/buttons.html5.min.js b/vendors/datatables.net-buttons/js/buttons.html5.min.js index 3fc13418..d0c96fed 100644 --- a/vendors/datatables.net-buttons/js/buttons.html5.min.js +++ b/vendors/datatables.net-buttons/js/buttons.html5.min.js @@ -1,26 +1,26 @@ -(function(g){"function"===typeof define&&define.amd?define(["jquery","datatables.net","datatables.net-buttons"],function(j){return g(j,window,document)}):"object"===typeof exports?module.exports=function(j,i,q,r){j||(j=window);if(!i||!i.fn.dataTable)i=require("datatables.net")(j,i).$;i.fn.dataTable.Buttons||require("datatables.net-buttons")(j,i);return g(i,j,j.document,q,r)}:g(jQuery,window,document)})(function(g,j,i,q,r,m){function E(a,b){v===m&&(v=-1===y.serializeToString(g.parseXML(F["xl/worksheets/sheet1.xml"])).indexOf("xmlns:r")); -g.each(b,function(b,c){if(g.isPlainObject(c)){var e=a.folder(b);E(e,c)}else{if(v){var e=c.childNodes[0],f,h,n=[];for(f=e.attributes.length-1;0<=f;f--){h=e.attributes[f].nodeName;var k=e.attributes[f].nodeValue;-1!==h.indexOf(":")&&(n.push({name:h,value:k}),e.removeAttribute(h))}f=0;for(h=n.length;f'+ -e),e=e.replace(/_dt_b_namespace_token_/g,":"));e=e.replace(//g,"");a.file(b,e)}})}function o(a,b,d){var c=a.createElement(b);d&&(d.attr&&g(c).attr(d.attr),d.children&&g.each(d.children,function(a,b){c.appendChild(b)}),d.text&&c.appendChild(a.createTextNode(d.text)));return c}function N(a,b){var d=a.header[b].length,c;a.footer&&a.footer[b].length>d&&(d=a.footer[b].length);for(var e=0,f=a.body.length;ed&& -(d=c),400&&(b=b+f);b=b+(e?e+(""+a[c]).replace(g,h+e)+e:a[c])}return b},j=b.header?k(c.header)+d:"",i=b.footer&&c.footer?d+k(c.footer):"",u=[],D=0,l=c.body.length;D', -"xl/_rels/workbook.xml.rels":'',"[Content_Types].xml":'', +(function(g){"function"===typeof define&&define.amd?define(["jquery","datatables.net","datatables.net-buttons"],function(i){return g(i,window,document)}):"object"===typeof exports?module.exports=function(i,j,t,u){i||(i=window);if(!j||!j.fn.dataTable)j=require("datatables.net")(i,j).$;j.fn.dataTable.Buttons||require("datatables.net-buttons")(i,j);return g(j,i,i.document,t,u)}:g(jQuery,window,document)})(function(g,i,j,t,u,o){function E(a,b){v===o&&(v=-1===y.serializeToString(g.parseXML(F["xl/worksheets/sheet1.xml"])).indexOf("xmlns:r")); +g.each(b,function(b,c){if(g.isPlainObject(c)){var f=a.folder(b);E(f,c)}else{if(v){var f=c.childNodes[0],e,h,l=[];for(e=f.attributes.length-1;0<=e;e--){h=f.attributes[e].nodeName;var n=f.attributes[e].nodeValue;-1!==h.indexOf(":")&&(l.push({name:h,value:n}),f.removeAttribute(h))}e=0;for(h=l.length;e'+ +f),f=f.replace(/_dt_b_namespace_token_/g,":"));f=f.replace(//g,"");a.file(b,f)}})}function p(a,b,d){var c=a.createElement(b);d&&(d.attr&&g(c).attr(d.attr),d.children&&g.each(d.children,function(a,b){c.appendChild(b)}),d.text&&c.appendChild(a.createTextNode(d.text)));return c}function N(a,b){var d=a.header[b].length,c;a.footer&&a.footer[b].length>d&&(d=a.footer[b].length);for(var f=0,e=a.body.length;fd&& +(d=c),40',"xl/_rels/workbook.xml.rels":'', +"[Content_Types].xml":'', "xl/workbook.xml":'', -"xl/worksheets/sheet1.xml":'',"xl/styles.xml":''}; -s.ext.buttons.copyHtml5={className:"buttons-copy buttons-html5",text:function(a){return a.i18n("buttons.copy","Copy")},action:function(a,b,d,c){var a=L(b,c),e=a.str,d=g("
").css({height:1,width:1,overflow:"hidden",position:"fixed",top:0,left:0});c.customize&&(e=c.customize(e,c));c=g("