webjack icon indicating copy to clipboard operation
webjack copied to clipboard

enable downloading log as a CSV

Open jywarren opened this issue 6 years ago • 5 comments

It'd be great to be able to download the log as a CSV! Of course, you can just copy and paste it into a file right now. But still, a one-click button would be nice!

jywarren avatar Apr 23 '19 18:04 jywarren

var csv = connection.history.received.join('\n'); // the CSV data

// old school, but doesn't seem to work for me?

window.open("data:text/csv;charset=utf-8," + escape(csv));

or generate a link: https://stackoverflow.com/questions/17564103/using-javascript-to-download-file-as-a-csv-file

<a href="data:text/csv;charset=utf-8,'+escape(csv)+'" download="webjack.csv">download</a>

We should put the timestamp (and ideally the better-formatted date + time) in the filename; new Date().toJSON().slice(0,10).replace(/-/g,'/'); gets the date, and we can add timestamp after that maybe...

jywarren avatar May 05 '19 21:05 jywarren

Let's put the button here! https://github.com/publiclab/webjack/blob/ce5d2a943bd18e55911a7ecbef7702570e533164/examples/index.html#L55-L58

jywarren avatar May 05 '19 21:05 jywarren

Hey, if its still open, can I claim it?

DevanshCodes avatar Dec 29 '19 08:12 DevanshCodes

Yes please! Thanks for the help!

On Sun, Dec 29, 2019, 3:02 AM Devansh Agarwal [email protected] wrote:

Hey, if its still open, can I claim it?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/publiclab/webjack/issues/103?email_source=notifications&email_token=AAAF6J5K6W6TEBUOHAKRSSTQ3BKQPA5CNFSM4HH5PGP2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHY2FIQ#issuecomment-569483938, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAF6JZVUW2Q7U463OQLRCTQ3BKQPANCNFSM4HH5PGPQ .

jywarren avatar Dec 29 '19 13:12 jywarren

Hello! Just wondering if there's been any progress on this? I'd like to submit a pull request if its still open.

sifihog avatar Jan 31 '20 06:01 sifihog