]> matita.cs.unibo.it Git - helm.git/blob - helm/graphs/tools/mk_html.pl
BU_Conversion + omit-conclusion is a mess. I have partially fixed the
[helm.git] / helm / graphs / tools / mk_html.pl
1 #!/usr/bin/perl
2
3 use URI::Escape;
4
5 print <<EOT;
6 <?xml version="1.0"?>
7 <html>
8  <head>
9   <title>Graph</title>
10  </head>
11  <body bgcolor="white" onLoad="window.focus()">
12   <script>
13 <![CDATA[
14    // NOTE: getParam will be defined during the application
15    // of the next stylesheet in the stylesheet chain
16    var draw_graphURL = unescape(getParam("param.draw_graphURL"));
17    document.write('<img border="false" src="' + draw_graphURL + 'get_gif?pid=$ARGV[0]" usemap="#graphe">');
18 ]]>
19   </script>
20   <map name="graphe">
21 EOT
22
23 my $count = 0;
24
25 while (<STDIN>) {
26  $count++;
27  my (undef,$point1,$point2,$uri) = split;
28  my ($point1x,$point1y) = split /,/,$point1;
29  my ($point2x,$point2y) = split /,/,$point2;
30  $point1y = substr($point1y,0,-1);
31  $point2y = substr($point2y,0,-1);
32  $point1x = substr($point1x,1);
33  $point2x = substr($point2x,1);
34
35  print <<EOT;
36    <area shape="rect" href="$uri" coords="$point1x,$point2y,$point2x,$point1y" />
37 EOT
38 }
39
40 print <<EOT;
41    </map>
42   <script>
43 <![CDATA[
44    document.write('</img>');
45 ]]>
46   </script>
47  </body>
48 </html>
49 EOT