Skip to content

Commit 64981a1

Browse files
committed
show raw data with a link instead
1 parent 648b90a commit 64981a1

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

assets/site.css

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ h1 {
2323
position: absolute;
2424
}
2525
.csv .table {overflow-x: scroll;}
26-
.json pre,
27-
.csv table {cursor: pointer;}
26+
.json pre {cursor: pointer;}
2827

2928

3029
/* show empty textarea by default */

index.html

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,11 @@
250250
$(".json textarea").blur(function() {showJSON(true);});
251251
$(".json pre").click(function() {showJSON(false)});
252252
$(".csv textarea").blur(function() {showCSV(true);})
253-
$(".csv table").click(function() {showCSV(false);})
253+
$(".csv .raw").click(function() {
254+
showCSV(false);
255+
$(".csv textarea").focus().select();
256+
return false;
257+
})
254258

255259
// if there's no CSV to download, don't download anything
256260
$(".csv a.download").click(function() {
@@ -272,9 +276,7 @@
272276
.keyup(doJSON); // harmless to repeat doJSON
273277

274278
// highlight CSV on click
275-
$(".csv textarea").click(function() {
276-
this.focus(); this.select();
277-
});
279+
$(".csv textarea").click(function() {this.focus().select();});
278280

279281
loadPermalink();
280282
});
@@ -320,7 +322,7 @@ <h1>Convert JSON to CSV</h1>
320322
<a download="result.csv" href="#" class="download">
321323
Download the entire CSV</a>,
322324

323-
or click below for the raw data.
325+
or <a href="#" class="raw">show the raw data</a>.
324326
</span>
325327

326328
<span class="editing">

0 commit comments

Comments
 (0)