From 6b2943d991cdc9a800ceceda800ec0c4acb478ad Mon Sep 17 00:00:00 2001 From: Samuel Marks Date: Mon, 5 May 2014 16:45:56 +1000 Subject: [PATCH 1/2] Version bump --- bower.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bower.json b/bower.json index 2786abc..5a7f8b3 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "ng-table-export", - "version": "0.1.0", + "version": "0.1.1", "main": [ "ng-table-export.js" ], diff --git a/package.json b/package.json index 26804bf..bc31a6c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ng-table-export", - "version": "0.1.0", + "version": "0.1.1", "author": "Vitalii Savchuk ", "license": "BSD", "repository": { From f28bf9a5d482183de49f6e490b8ba4407ea565a9 Mon Sep 17 00:00:00 2001 From: Samuel Marks Date: Tue, 6 May 2014 19:36:14 +1000 Subject: [PATCH 2/2] Semicolon=>comma --- ng-table-export.js | 2 +- ng-table-export.src.js | 4 ++-- package.json | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ng-table-export.js b/ng-table-export.js index 394e800..4181d64 100644 --- a/ng-table-export.js +++ b/ng-table-export.js @@ -1,3 +1,3 @@ /*! ngTableExport v0.1.0 by Vitalii Savchuk(esvit666@gmail.com) - https://github.com/esvit/ng-table-export - New BSD License */ -angular.module("ngTableExport",[]).config(["$compileProvider",function(a){a.aHrefSanitizationWhitelist(/^\s*(https?|ftp|mailto|data):/)}]).directive("exportCsv",["$parse",function(a){return{restrict:"A",scope:!1,link:function(b,c,d){var e="",f={stringify:function(a){return'"'+a.replace(/^\s\s*/,"").replace(/\s*\s$/,"").replace(/"/g,'""')+'"'},generate:function(){e="";var a=c.find("tr");angular.forEach(a,function(a,b){var c=angular.element(a),d=c.find("th"),g="";c.hasClass("ng-table-filters")||(0==d.length&&(d=c.find("td")),1!=b&&(angular.forEach(d,function(a){g+=f.stringify(angular.element(a).text())+";"}),g=g.slice(0,g.length-1)),e+=g+"\n")})},link:function(){return"data:text/csv;charset=UTF-8,"+encodeURIComponent(e)}};a(d.exportCsv).assign(b.$parent,f)}}}]); +angular.module("ngTableExport",[]).config(["$compileProvider",function(a){a.aHrefSanitizationWhitelist(/^\s*(https?|ftp|mailto|data):/)}]).directive("exportCsv",["$parse",function(a){return{restrict:"A",scope:!1,link:function(b,c,d){var e="",f={stringify:function(a){return'"'+a.replace(/^\s\s*/,"").replace(/\s*\s$/,"").replace(/"/g,'""')+'"'},generate:function(){e="";var a=c.find("tr");angular.forEach(a,function(a,b){var c=angular.element(a),d=c.find("th"),g="";c.hasClass("ng-table-filters")||(0==d.length&&(d=c.find("td")),1!=b&&(angular.forEach(d,function(a){g+=f.stringify(angular.element(a).text())+","}),g=g.slice(0,g.length-1)),e+=g+"\n")})},link:function(){return"data:text/csv;charset=UTF-8,"+encodeURIComponent(e)}};a(d.exportCsv).assign(b.$parent,f)}}}]); //# sourceMappingURL=ng-table-export.map \ No newline at end of file diff --git a/ng-table-export.src.js b/ng-table-export.src.js index 4649845..73ad289 100644 --- a/ng-table-export.src.js +++ b/ng-table-export.src.js @@ -31,9 +31,9 @@ angular.module('ngTableExport', []) } if (i != 1) { angular.forEach(tds, function(td, i) { - rowData += csv.stringify(angular.element(td).text()) + ';'; + rowData += csv.stringify(angular.element(td).text()) + ','; }); - rowData = rowData.slice(0, rowData.length - 1); //remove last semicolon + rowData = rowData.slice(0, rowData.length - 1); //remove last comma } data += rowData + "\n"; }); diff --git a/package.json b/package.json index bc31a6c..451b41d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ng-table-export", - "version": "0.1.1", + "version": "0.1.2", "author": "Vitalii Savchuk ", "license": "BSD", "repository": {