annotate tsv2html.pl @ 8:86219e4aa239 draft

Uploaded
author saskia-hiltemann
date Mon, 28 Aug 2017 10:23:21 -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>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
3 <html>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
4 <head>
1
440f4aa3db97 Added option to dowload iReports
saskia-hiltemann
parents: 0
diff changeset
5 <script src=\"jquery-1.10.2.js\"></script>
440f4aa3db97 Added option to dowload iReports
saskia-hiltemann
parents: 0
diff changeset
6 <script src=\"jquery-ui.js\"></script>
0
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
7 <script type="text/javascript" src="jquery.dataTables.js"></script>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
8 <script type="text/javascript" src="iframe-resizer/js/iframeResizer.contentWindow.min.js"></script>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
9 <script>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
10
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
11 <!-- data tables -->
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
12 \$(document).ready(function() {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
13 \$('#datatable').dataTable( {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
14 "bPaginate": true,
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
15 "bLengthChange": true,
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
16 "bFilter": true,
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
17 "bSort": true,
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
18 "bInfo": true,
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
19 "bAutoWidth": true
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
20 } );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
21 } );
6
42076db43d42 Fixed auto resizing plus various other minor bugs
saskia-hiltemann
parents: 1
diff changeset
22 <!-- data tables tsv2html.pl-->
0
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
23 </script>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
24
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
25 <link rel="stylesheet" type="text/css" href="jquery.dataTables.css">
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
26 </head>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
27 <body>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
28 <table class="display dataTable" id="datatable" border="1" cellspacing="0" cellpadding="0" style="font-size: 12px;" >
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
29 <thead>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
30 <tr><th>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
31 END
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
32 chomp ($_ = <STDIN>);
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
33 s?\t?</th><th>?g;
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
34 print "$_</th></tr>\n";
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
35 #print "</tr>\n</thead>\n<tbody>\n";
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
36 print "</thead>\n<tbody>\n";
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
37 while (<>) {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
38 print "<tr>\n";
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
39 my @fields = split('\t');
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
40 my $first=1;
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
41 for $cell(@fields) {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
42 if($first == 1){
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
43 print "<td> $cell </td>";
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
44 $first=0;
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
45 }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
46 elsif($cell =~ /^(\d|\s)+$/) {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
47 print "<td align=\"right\">$cell</td>"; }
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