]> matita.cs.unibo.it Git - helm.git/blob - helm/on-line/xslt/makeGraphLinks.xsl
Small bug: the theory was open in the graph windows instead of its own.
[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 <!--CSC: code cut & pasted also in metadataLib.xsl -->
32 <xsl:param name="uri_set_size" select="'30'"/>
33 <!--CSC: end of cut & paste also in metadataLib.xsl -->
34
35 <xsl:output method="html" encoding="iso-8859-1"/>
36
37 <xsl:template match="/|*">
38   <xsl:copy>
39    <xsl:copy-of select="@*"/>
40    <xsl:apply-templates/>
41   </xsl:copy>
42 </xsl:template>
43
44 <xsl:template match="head">
45   <xsl:copy>
46    <xsl:copy-of select="@*"/>
47    <subst:script language="JavaScript" src="/javascript/defaults.js"/>
48    <subst:script language="JavaScript" src="/javascript/utils.js"/>
49    <subst:script language="JavaScript" src="/javascript/control.js"/>
50    <subst:script language="JavaScript" src="/javascript/graphLinks.js"/>
51    <script language="JavaScript" type="text/javascript">
52     <!-- topurl will be used by the code in jsmenu/* -->
53     var topurl = "<subst:topurl/>";
54    </script>
55    <script language="JavaScript" type="text/javascript">
56 <![CDATA[
57 if(window.event + "" == "undefined") event = null;
58 function HM_f_PopUp(){return false};
59 function HM_f_PopDown(){return false};
60 popUp = HM_f_PopUp;
61 popDown = HM_f_PopDown;
62 var selectedURI;
63 var lastEvent;
64 ]]>
65    </script>
66    <script language="JavaScript1.2" type="text/javascript">
67 <![CDATA[
68 HM_PG_MenuWidth = 300;
69 HM_PG_FontFamily = "Arial,sans-serif";
70 HM_PG_FontSize = 10;
71 HM_PG_FontBold = 0;
72 HM_PG_FontItalic = 0;
73 HM_PG_FontColor = "blue";
74 HM_PG_FontColorOver = "green";
75 HM_PG_BGColor = "#DDDDDD";
76 HM_PG_BGColorOver = "#FFCCCC";
77 HM_PG_ItemPadding = 3;
78
79 HM_PG_BorderWidth = 2;
80 HM_PG_BorderColor = "black";
81 HM_PG_BorderStyle = "solid";
82 HM_PG_SeparatorSize = 2;
83 HM_PG_SeparatorColor = "#d0ff00";
84
85 HM_PG_ImageSrc = ]]> topurl + <![CDATA["/javascript/jsmenu/HM_More_black_right.gif";
86 HM_PG_ImageSrcLeft = ]]> topurl + <![CDATA["/javascript/jsmenu/HM_More_black_left.gif";
87 HM_PG_ImageSrcOver = ]]> topurl + <![CDATA["/javascript/jsmenu/HM_More_white_right.gif";
88 HM_PG_ImageSrcLeftOver = ]]> topurl + <![CDATA["/javascript/jsmenu/HM_More_white_left.gif";
89
90 HM_PG_ImageSize = 5;
91 HM_PG_ImageHorizSpace = 0;
92 HM_PG_ImageVertSpace = 2;
93
94 HM_PG_KeepHilite = true; 
95 HM_PG_ClickStart = 0;
96 HM_PG_ClickKill = false;
97 HM_PG_ChildOverlap = 20;
98 HM_PG_ChildOffset = 10;
99 HM_PG_ChildPerCentOver = null;
100 HM_PG_TopSecondsVisible = .5;
101 HM_PG_StatusDisplayBuild =0;
102 HM_PG_StatusDisplayLink = 0;
103 HM_PG_UponDisplay = null;
104 HM_PG_UponHide = null;
105 HM_PG_RightToLeft = 0;
106
107 HM_PG_CreateTopOnly = 0;
108 HM_PG_ShowLinkCursor = 1;
109 HM_PG_NSFontOver = true;
110
111 //HM_a_TreesToBuild = [2];
112 ]]>
113    </script>
114    <xsl:apply-templates/>
115   </xsl:copy>
116 </xsl:template>
117
118 <xsl:template match="body">
119   <!--CSC: end of cut & paste also in metadataLib.xsl -->
120   <form name="uri_set_size">
121    Number of nodes to show when following an hyperlink:
122    <input type="text" onClick="return false" value="{$uri_set_size}" size="2"/> (30 suggested)
123   </form>
124   <!--CSC: end of cut & paste also in metadataLib.xsl -->
125   <xsl:copy>
126    <xsl:copy-of select="@*"/>
127    <xsl:apply-templates/>
128    <script>
129 HM_Array1 = [
130 <![CDATA[
131 [,,,
132 ,,,,,,,,,,,,,,,,
133 1,true],
134 ["Objects this one depends on.","javascript:window.open(mkDepURL(selectedURI),'graph')",1,0,0],
135 ["Render this object.","javascript:window.open(mkCICURL(selectedURI),'cic')",1,0,0],
136 ["Objects depending directly on this one.","javascript:window.open(mkMetaTheoryURL(selectedURI),'theory')",1,0,0],
137 ["Objects depending on this one.","javascript:window.open(mkMetaURL(selectedURI),'graph')",1,0,0]
138 ];
139 ]]>
140    </script>
141    <subst:script Language="JavaScript1.2" src="/javascript/jsmenu/HM_Loader_prova.js"/>
142   </xsl:copy>
143 </xsl:template>
144
145 <xsl:template match = "area">
146  <xsl:variable name="uri" select="@href"/>
147  <xsl:copy>
148   <xsl:copy-of select="@*"/> 
149   <xsl:if test="starts-with(@href,&quot;cic:&quot;)">
150 <!-- CSC: I don't know why the following one does not work.
151      CSC: Replaced with the following line
152    <xsl:attribute name="onMouseOver">selectedURI=this.href;HM_f_PopUp('elMenu1',event)</xsl:attribute>
153 -->
154    <xsl:attribute name="onMouseOver">selectedURI="<xsl:value-of select="$uri"/>";lastEvent=event;HM_f_PopUp('elMenu1',event)</xsl:attribute>
155    <xsl:attribute name="onMouseOut">HM_f_PopDown('elMenu1')</xsl:attribute>
156    <xsl:attribute name="href">javascript: HM_f_PopUp('elMenu1',lastEvent); void(0);</xsl:attribute>
157   </xsl:if>
158   <xsl:apply-templates/>
159  </xsl:copy>
160 </xsl:template>
161
162 </xsl:stylesheet>