Skip to content

Commit ac9b6f3

Browse files
authored
Merge pull request #6 from LCluber/dev
dev
2 parents 03e42df + 39e5809 commit ac9b6f3

File tree

7 files changed

+13
-12
lines changed

7 files changed

+13
-12
lines changed

dist/csvx.iife.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1007,7 +1007,8 @@ var CSVx = (function (exports) {
10071007
};
10081008

10091009
Export.download = function download(table, filename) {
1010-
//let encodedUri = encodeURI(table);
1010+
table = encodeURI(table); //encodeURIComponent
1011+
10111012
var link = Dom.addHTMLElement(document.body, 'a', {
10121013
href: table,
10131014
download: filename + '.csv'
@@ -1050,7 +1051,7 @@ var CSVx = (function (exports) {
10501051
table += this.createRow(parsedRow);
10511052
}
10521053

1053-
return encodeURIComponent(table);
1054+
return table;
10541055
};
10551056

10561057
Export.createLabels = function createLabels(data) {

dist/csvx.iife.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/csvx.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class Export {
6161
}
6262
}
6363
static download(table, filename) {
64-
//let encodedUri = encodeURI(table);
64+
table = encodeURI(table); //encodeURIComponent
6565
let link = Dom.addHTMLElement(document.body, 'a', { href: table, download: filename + '.csv' });
6666
link.click();
6767
document.body.removeChild(link);
@@ -82,7 +82,7 @@ class Export {
8282
}
8383
table += this.createRow(parsedRow);
8484
}
85-
return encodeURIComponent(table);
85+
return table;
8686
}
8787
static createLabels(data) {
8888
let labels = Is.json(data[0]) || data[0];

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,13 @@
6464
"grunt-nodemon": "0.4.2",
6565
"grunt-open": "0.2.3",
6666
"grunt-rollup": "9.0.0",
67-
"grunt-sass": "3.0.2",
67+
"grunt-sass": "3.1.0",
6868
"grunt-strip-code": "1.0.6",
6969
"grunt-ts": "6.0.0-beta.22",
7070
"grunt-typedoc": "0.2.4",
7171
"jquery": "3.2.1",
7272
"jquery-easing": "0.0.1",
73-
"node-sass": "4.11.0",
73+
"node-sass": "4.13.1",
7474
"rollup-plugin-babel": "4.1.0",
7575
"rollup-plugin-node-resolve": "4.0.0",
7676
"time-grunt": "1.4.0",

src/ts/export.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export class Export {
5454
}
5555

5656
private static download(table:string, filename: string): void {
57-
//let encodedUri = encodeURI(table);
57+
table = encodeURI(table);//encodeURIComponent
5858
let link = Dom.addHTMLElement(document.body, 'a', {href:table,download:filename+'.csv'})
5959
link.click();
6060
document.body.removeChild(link);
@@ -76,7 +76,7 @@ export class Export {
7676
}
7777
table += this.createRow(parsedRow);
7878
}
79-
return encodeURIComponent(table);
79+
return table;
8080
}
8181

8282
private static createLabels( data: Object[]|string[] ): string {

web/js/example.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
1+
var customLabels = ['First name', 'Last name', 'Born', 'Died'];
22
var array = [
33
{
44
firstname:'Galileo',
@@ -21,7 +21,7 @@ var array = [
2121
];
2222
var exportButton = Wee.Dom.findById('csv');
2323
exportButton.addEventListener('click', function() {
24-
CSVx.Export.data('scientists',array, {separator:';'});
24+
CSVx.Export.data('scientists',array, {separator:';', customLabels: customLabels});
2525
});
2626

2727
var data = '"Firstname";"Lastname";"Born";"Died"\r\n\

web/public/js/main.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)