diff --git a/README.md b/README.md index 04817df..abf3d49 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ Use it just like Papa Parse. However: - encoding - chunk -Otherwise, Baby Parse has nearly all the same functionality as Papa Parse, including the `unparse()` function. +Otherwise, Baby Parse has nearly all the same functionality as Papa Parse 3.0, including the `unparse()` function. Get Started diff --git a/player/player.html b/player/player.html index dfc665c..a818dd5 100644 --- a/player/player.html +++ b/player/player.html @@ -45,7 +45,9 @@

- + +   +

diff --git a/player/player.js b/player/player.js index cdee0da..541519f 100644 --- a/player/player.js +++ b/player/player.js @@ -3,7 +3,7 @@ var start, end; $(function() { - $('#submit').click(function() + $('#submit-parse').click(function() { stepped = 0; chunks = 0; @@ -46,6 +46,21 @@ $(function() } }); + $('#submit-unparse').click(function() + { + var input = $('#input').val(); + var delim = $('#delimiter').val(); + + var results = Papa.unparse(input, { + delimiter: delim + }); + + console.log("Unparse complete!"); + console.log("--------------------------------------"); + console.log(results); + console.log("--------------------------------------"); + }); + $('#insert-tab').click(function() { $('#delimiter').val('\t'); @@ -98,6 +113,6 @@ function completeFn() if (arguments[0] && arguments[0].data) rows = arguments[0].data.length; - console.log("Finished input. Time:", end-start, arguments); + console.log("Finished input (async). Time:", end-start, arguments); console.log("Rows:", rows, "Stepped:", stepped, "Chunks:", chunks); } \ No newline at end of file