Browse Source

Added unparse to the player page

pull/93/head
Matthew Holt 11 years ago
parent
commit
a159c9fd11
  1. 2
      README.md
  2. 4
      player/player.html
  3. 19
      player/player.js

2
README.md

@ -47,7 +47,7 @@ Use it just like Papa Parse. However:
- encoding - encoding
- chunk - 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 Get Started

4
player/player.html

@ -45,7 +45,9 @@
<br><br> <br><br>
<button id="submit">Parse</button> <button id="submit-parse">Parse</button>
&nbsp;
<button id="submit-unparse">Unparse</button>
<br><br> <br><br>

19
player/player.js

@ -3,7 +3,7 @@ var start, end;
$(function() $(function()
{ {
$('#submit').click(function() $('#submit-parse').click(function()
{ {
stepped = 0; stepped = 0;
chunks = 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() $('#insert-tab').click(function()
{ {
$('#delimiter').val('\t'); $('#delimiter').val('\t');
@ -98,6 +113,6 @@ function completeFn()
if (arguments[0] && arguments[0].data) if (arguments[0] && arguments[0].data)
rows = arguments[0].data.length; 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); console.log("Rows:", rows, "Stepped:", stepped, "Chunks:", chunks);
} }
Loading…
Cancel
Save