]> matita.cs.unibo.it Git - helm.git/blob - helm/on-line/xslt/makeGraphLinks.xsl
Initial revision
[helm.git] / helm / on-line / xslt / makeGraphLinks.xsl
1 <?xml version="1.0"?>
2
3 <!-- Copyright (C) 2000, HELM Team                                     -->
4 <!--                                                                   -->
5 <!-- This file is part of HELM, an Hypertextual, Electronic            -->
6 <!-- Library of Mathematics, developed at the Computer Science         -->
7 <!-- Department, University of Bologna, Italy.                         -->
8 <!--                                                                   -->
9 <!-- HELM is free software; you can redistribute it and/or             -->
10 <!-- modify it under the terms of the GNU General Public License       -->
11 <!-- as published by the Free Software Foundation; either version 2    -->
12 <!-- of the License, or (at your option) any later version.            -->
13 <!--                                                                   -->
14 <!-- HELM is distributed in the hope that it will be useful,           -->
15 <!-- but WITHOUT ANY WARRANTY; without even the implied warranty of    -->
16 <!-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the     -->
17 <!-- GNU General Public License for more details.                      -->
18 <!--                                                                   -->
19 <!-- You should have received a copy of the GNU General Public License -->
20 <!-- along with HELM; if not, write to the Free Software               -->
21 <!-- Foundation, Inc., 59 Temple Place - Suite 330, Boston,            -->
22 <!-- MA  02111-1307, USA.                                              -->
23 <!--                                                                   -->
24 <!-- For details, see the HELM World-Wide-Web page,                    -->
25 <!-- http://cs.unibo.it/helm/.                                         -->
26
27 <xsl:stylesheet version="1.0"
28  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
29  xmlns:subst="http://www.cs.unibo.it/helm/subst">
30
31 <xsl:import href="utils.xsl"/>
32
33 <!--CSC: code cut & pasted also in metadataLib.xsl -->
34 <xsl:param name="uri_set_size" select="''"/>
35 <!--CSC: end of cut & paste also in metadataLib.xsl -->
36
37 <xsl:output method="html" encoding="iso-8859-1"/>
38
39 <xsl:template match="/|*">
40   <xsl:copy>
41    <xsl:copy-of select="@*"/>
42    <xsl:apply-templates/>
43   </xsl:copy>
44 </xsl:template>
45
46 <xsl:template match="head">
47   <xsl:copy>
48    <xsl:copy-of select="@*"/>
49    <subst:script language="JavaScript" src="/javascript/defaults.js"/>
50    <subst:script language="JavaScript" src="/javascript/utils.js"/>
51    <subst:script language="JavaScript" src="/javascript/control.js"/>
52    <subst:script language="JavaScript" src="/javascript/graphLinks.js"/>
53    <subst:script language="JavaScript" src="/javascript/helmjsmenu.js"/>
54    <script>
55     var lastX, lastY;
56     var selectedURI;
57    </script>
58    <xsl:apply-templates/>
59   </xsl:copy>
60 </xsl:template>
61
62 <xsl:template match="body">
63   <!--CSC: end of cut & paste also in metadataLib.xsl -->
64   <form name="uri_set_size">
65    Number of nodes to show when following an hyperlink:
66    <input type="text" onClick="return false" value="{$uri_set_size}" size="2"/> (30 suggested)
67   </form>
68   <!--CSC: end of cut & paste also in metadataLib.xsl -->
69   <xsl:copy>
70    <xsl:copy-of select="@*"/>
71    <xsl:attribute name="onClick">hideMenu();</xsl:attribute>
72    <xsl:apply-templates/>
73    <div style="position: absolute" id="HJMmenu">
74     <!-- The two nested tables are for NS 4.0 where every -->
75     <!-- layer has a default transparent background color -->
76     <table bgColor="green" id="pippo">
77      <tr><td>
78       <table bgColor="cyan" border="2">
79        <tr><td><a href="" onClick="this.href=mkDepURL(selectedURI);">Objects this one depends on.</a></td></tr>
80        <tr><td><a href="" onClick="this.href=mkCICURL(selectedURI);" target="cic">Render this object.</a></td></tr>
81        <tr><td><a href="" onClick="this.href=mkMetaTheoryURL(selectedURI);" target="theory">Objects depending directly on this one.</a></td></tr>
82        <tr><td><a href="" onClick="this.href=mkMetaURL(selectedURI);">Objects depending on this one.</a></td></tr>
83       </table>
84      </td></tr>
85     </table>
86    </div>
87    <script>initializeMenu()</script>
88   </xsl:copy>
89 </xsl:template>
90
91 <xsl:template match = "area">
92  <xsl:variable name="quoteduri">
93   <xsl:call-template name="jsquote">
94    <xsl:with-param name="s" select="@href"/>
95   </xsl:call-template>
96  </xsl:variable>
97  <xsl:copy>
98   <xsl:copy-of select="@*"/> 
99   <xsl:if test="starts-with(@href,&quot;cic:&quot;)">
100    <xsl:attribute name="onMouseOver">lastX = getX(event); lastY = getY(event);selectedURI='<xsl:value-of select="$quoteduri"/>';</xsl:attribute>
101    <xsl:attribute name="href">javascript:moveMenu(lastX,lastY); showMenu();</xsl:attribute>
102   </xsl:if>
103   <xsl:apply-templates/>
104  </xsl:copy>
105 </xsl:template>
106
107 </xsl:stylesheet>