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