From 08ff56663ea26a1b142c5a4e8e02f53e6183754f Mon Sep 17 00:00:00 2001 From: Jonathan Go Date: Fri, 13 Nov 2015 13:03:50 -0500 Subject: [PATCH 1/2] bowerified --- bower.json | 17 +++++++++++++++++ tableExport/tableExport.module.js | 18 ++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 bower.json create mode 100644 tableExport/tableExport.module.js diff --git a/bower.json b/bower.json new file mode 100644 index 00000000..3a988a49 --- /dev/null +++ b/bower.json @@ -0,0 +1,17 @@ +{ + "name": "jg-TableExport", + "version": "0.1.0", + "homepage": "https://github.com/jongo593/tableExport.jquery.plugin", + "authors": [ + "Jonathan Go " + ], + "description": "Exports html5 tables", + "main": [ + "**/**/*.js" + ], + "moduleType": [ + "node" + ], + "license": "MIT", + "private": false +} 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 From f1ba6c2fb8843d4d1ab9a97b63ac128b76d9e7b8 Mon Sep 17 00:00:00 2001 From: Jonathan Go Date: Tue, 24 Nov 2015 15:48:13 -0500 Subject: [PATCH 2/2] export with filename --- bower.json | 4 ++-- tableExport.js | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/bower.json b/bower.json index 3a988a49..e9b76043 100644 --- a/bower.json +++ b/bower.json @@ -1,7 +1,7 @@ { "name": "jg-TableExport", - "version": "0.1.0", - "homepage": "https://github.com/jongo593/tableExport.jquery.plugin", + "version": "0.1.1", + "homepage": "https://github.com/jongo593/tableExport.jquery.plugin.git", "authors": [ "Jonathan Go " ], 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