annotate tsv2html_simple.pl @ 3:4a6ebda2a3ae draft

fixed tool dependency issue
author saskia-hiltemann
date Tue, 30 Sep 2014 09:56:12 -0400
parents ac5f9272033b
children 42076db43d42
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>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
6 <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
7 <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.js"></script>
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,
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
20 "bAutoWidth": true
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
21 } );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
22 } );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
23 <!-- data tables -->
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