Skip to content

Commit

Permalink
Merge pull request #83 from stravinskij/fix-csv-export
Browse files Browse the repository at this point in the history
fix for issue 82
  • Loading branch information
peter-dolkens authored May 23, 2021
2 parents d277980 + 2b2bb81 commit d9c5c6c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/web_resources/HangarXPLOR.Download.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ HangarXPLOR._callbacks = HangarXPLOR._callbacks || {};

// TODO: CSV support will need to be careful of user-entered data...
var buffer = "Manufacturer, Ship, Lti, Warbond, ID, Pledge, Cost, Date\n";
buffer = buffer + HangarXPLOR.GetShipList($target).map(function(ship) { return [ '"' + ship.manufacturer + '"', '"' + ship.name + '"', ship.lti, ship.warbond, ship.package_id, '"' + ship.pledge + '"', '"' + ship.cost + '"', '"' + ship.pledge_date + '"' ].join(',')}).join('\n')
buffer = buffer + HangarXPLOR.GetShipList($target).map(function(ship) { return [ '"' + ship.manufacturer_code + '"', '"' + ship.name + '"', ship.lti, ship.warbond, ship.pledge_id, '"' + ship.pledge_name + '"', '"' + ship.pledge_cost + '"', '"' + ship.pledge_date + '"' ].join(',')}).join('\n')

$download.attr('href', 'data:text/csv;charset=utf-8,' + encodeURIComponent(buffer));
$download.attr('download', 'shiplist.csv');
Expand Down

0 comments on commit d9c5c6c

Please sign in to comment.