diff --git a/bower.json b/bower.json new file mode 100644 index 00000000..e9b76043 --- /dev/null +++ b/bower.json @@ -0,0 +1,17 @@ +{ + "name": "jg-TableExport", + "version": "0.1.1", + "homepage": "https://github.com/jongo593/tableExport.jquery.plugin.git", + "authors": [ + "Jonathan Go " + ], + "description": "Exports html5 tables", + "main": [ + "**/**/*.js" + ], + "moduleType": [ + "node" + ], + "license": "MIT", + "private": false +} diff --git a/tableExport.js b/tableExport.js index 1bfaa0fc..b8763229 100644 --- a/tableExport.js +++ b/tableExport.js @@ -75,7 +75,8 @@ THE SOFTWARE.*/ console.log(tdData); } var base64data = "base64," + $.base64.encode(tdData); - window.open('data:application/'+defaults.type+';filename=exportData;' + base64data); + $('').appendTo(document.body).find('span').trigger("click").parent().remove(); + //window.open('data:application/'+defaults.type+';filename=exportData;' + base64data); }else if(defaults.type == 'sql'){ // Header diff --git a/tableExport/tableExport.module.js b/tableExport/tableExport.module.js new file mode 100644 index 00000000..fcc5abc4 --- /dev/null +++ b/tableExport/tableExport.module.js @@ -0,0 +1,18 @@ +(function (){ + 'use strict'; + angular.module('TableExportModule', []) + .directive('tableExport', tableExport); + + function tableExport() { + return { + restrict: 'EAC', + link: link + }; + + function link (scope, elem, attr) { + scope.$on('export-table', function (event, data) { + elem.tableExport(data); + }); + } + } +})(); \ No newline at end of file