annotate tsv2html_simple.pl @ 9:7300ed4c1481 draft default tip

Uploaded
author saskia-hiltemann
date Mon, 04 Sep 2017 10:49:00 -0400
parents 42076db43d42
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
1 print <<END;
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
2 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
3 "http://www.w3.org/TR/html4/strict.dtd">
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
4 <html>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
5 <head>
6
42076db43d42 Fixed auto resizing plus various other minor bugs
saskia-hiltemann
parents: 0
diff changeset
6 <script src=\"jquery-1.10.2.js\"></script>
42076db43d42 Fixed auto resizing plus various other minor bugs
saskia-hiltemann
parents: 0
diff changeset
7 <script src=\"jquery-ui.js\"></script>
0
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
8 <script type="text/javascript" src="jquery.dataTables.js"></script>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
9 <script type="text/javascript" src="iframe-resizer/js/iframeResizer.contentWindow.min.js"></script>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
10 <script>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
11
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
12 <!-- data tables -->
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
13 \$(document).ready(function() {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
14 \$('#datatable').dataTable( {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
15 "bPaginate": false,
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
16 "bLengthChange": false,
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
17 "bFilter": false,
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
18 "bSort": false,
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
19 "bInfo": false,
6
42076db43d42 Fixed auto resizing plus various other minor bugs
saskia-hiltemann
parents: 0
diff changeset
20 "bAutoWidth": false
0
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
21 } );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
22 } );
6
42076db43d42 Fixed auto resizing plus various other minor bugs
saskia-hiltemann
parents: 0
diff changeset
23 <!-- data tables tsv2html_simple.pl -->
0
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
24 </script>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
25
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
26 <link rel="stylesheet" type="text/css" href="jquery.dataTables.css">
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
27 </head>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
28 <body>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
29 <table class="display dataTable" id="datatable" border="1" cellspacing="0" cellpadding="0" style="font-size: 12px;" >
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
30 <thead>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
31 <tr><th>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
32 END
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
33 chomp ($_ = <STDIN>);
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
34 s?\t?</th><th>?g;
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
35 print "$_</th></tr>\n";
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
36 #print "</tr>\n</thead>\n<tbody>\n";
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
37 print "</thead>\n<tbody>\n";
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
38 while (<>) {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
39 print "<tr>\n";
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
40 my @fields = split('\t');
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
41 my $first=1;
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
42 for $cell(@fields) {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
43 if($cell =~ /^(\d|\s)+$/) {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
44 1 while ($cell =~ s/^(-?\d+)(\d{3})/$1,$2/);
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
45 print "<td align=\"right\">$cell</td>";
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
46 #print "<td>$cell</td>";
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
47 }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
48 else {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
49 print "<td>$cell</td>"; } }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
50 print "</tr>\n"; }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
51 #print "</tr>\n</tbody>\n</table></body></html>\n";
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
52 print "</tbody>\n</table></body></html>\n";
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
53