--- /dev/null
+// Global variables.
+var HJMmenu;
+
+function initializeMenu() {
+ HJMmenu =
+ document.getElementById ?
+ // A DOM browser
+ document.getElementById("HJMmenu").style
+ : // Probably Netscape Navigator 4.0
+ document.HJMmenu;
+ HJMmenu.visibility="hidden";
+}
+
+function showMenu() {
+ HJMmenu.visibility="visible";
+}
+
+function hideMenu() {
+ HJMmenu.visibility="hidden";
+}
+
+function moveMenu(x,y) {
+ var y2 = y - 25;
+ var x2 = x - 25;
+ if (document.getElementById) {
+ // Not Netscape Navigator 4.0
+ HJMmenu.left = x2 + "px";
+ HJMmenu.top = y2 + "px";
+ } else {
+ // Probably Netscape Navigator 4.0
+ HJMmenu.left = x2;
+ HJMmenu.top = y2;
+ }
+}
+
+function getX(event) {
+ if(!event.pageX)
+ // Probably Internet Explorer
+ return event.clientX + document.body.scrollLeft;
+ else
+ // Probably Netscape Navigator
+ return event.pageX;
+}
+
+function getY(event) {
+ if(!event.pageY)
+ // Probably Internet Explorer
+ return event.clientY + document.body.scrollTop;
+ else
+ // Probably Netscape Navigator
+ return event.pageY;
+}
+
+if (!document.getElementById) {
+ // Probably Netscape Navigator
+ document.captureEvents(Event.MOUSEDOWN);
+ document.onmousedown = hideMenu;
+}
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:subst="http://www.cs.unibo.it/helm/subst">
+<xsl:import href="utils.xsl"/>
+
<!--CSC: code cut & pasted also in metadataLib.xsl -->
-<xsl:param name="uri_set_size" select="'30'"/>
+<xsl:param name="uri_set_size" select="''"/>
<!--CSC: end of cut & paste also in metadataLib.xsl -->
<xsl:output method="html" encoding="iso-8859-1"/>
<subst:script language="JavaScript" src="/javascript/utils.js"/>
<subst:script language="JavaScript" src="/javascript/control.js"/>
<subst:script language="JavaScript" src="/javascript/graphLinks.js"/>
- <script language="JavaScript" type="text/javascript">
- <!-- topurl will be used by the code in jsmenu/* -->
- var topurl = "<subst:topurl/>";
- </script>
- <script language="JavaScript" type="text/javascript">
-<![CDATA[
-if(window.event + "" == "undefined") event = null;
-function HM_f_PopUp(){return false};
-function HM_f_PopDown(){return false};
-popUp = HM_f_PopUp;
-popDown = HM_f_PopDown;
-var selectedURI;
-var lastEvent;
-]]>
- </script>
- <script language="JavaScript1.2" type="text/javascript">
-<![CDATA[
-HM_PG_MenuWidth = 300;
-HM_PG_FontFamily = "Arial,sans-serif";
-HM_PG_FontSize = 10;
-HM_PG_FontBold = 0;
-HM_PG_FontItalic = 0;
-HM_PG_FontColor = "blue";
-HM_PG_FontColorOver = "green";
-HM_PG_BGColor = "#DDDDDD";
-HM_PG_BGColorOver = "#FFCCCC";
-HM_PG_ItemPadding = 3;
-
-HM_PG_BorderWidth = 2;
-HM_PG_BorderColor = "black";
-HM_PG_BorderStyle = "solid";
-HM_PG_SeparatorSize = 2;
-HM_PG_SeparatorColor = "#d0ff00";
-
-HM_PG_ImageSrc = ]]> topurl + <![CDATA["/javascript/jsmenu/HM_More_black_right.gif";
-HM_PG_ImageSrcLeft = ]]> topurl + <![CDATA["/javascript/jsmenu/HM_More_black_left.gif";
-HM_PG_ImageSrcOver = ]]> topurl + <![CDATA["/javascript/jsmenu/HM_More_white_right.gif";
-HM_PG_ImageSrcLeftOver = ]]> topurl + <![CDATA["/javascript/jsmenu/HM_More_white_left.gif";
-
-HM_PG_ImageSize = 5;
-HM_PG_ImageHorizSpace = 0;
-HM_PG_ImageVertSpace = 2;
-
-HM_PG_KeepHilite = true;
-HM_PG_ClickStart = 0;
-HM_PG_ClickKill = false;
-HM_PG_ChildOverlap = 20;
-HM_PG_ChildOffset = 10;
-HM_PG_ChildPerCentOver = null;
-HM_PG_TopSecondsVisible = .5;
-HM_PG_StatusDisplayBuild =0;
-HM_PG_StatusDisplayLink = 0;
-HM_PG_UponDisplay = null;
-HM_PG_UponHide = null;
-HM_PG_RightToLeft = 0;
-
-HM_PG_CreateTopOnly = 0;
-HM_PG_ShowLinkCursor = 1;
-HM_PG_NSFontOver = true;
-
-//HM_a_TreesToBuild = [2];
-]]>
+ <subst:script language="JavaScript" src="/javascript/helmjsmenu.js"/>
+ <script>
+ var lastX, lastY;
+ var selectedURI;
</script>
<xsl:apply-templates/>
</xsl:copy>
<!--CSC: end of cut & paste also in metadataLib.xsl -->
<xsl:copy>
<xsl:copy-of select="@*"/>
+ <xsl:attribute name="onClick">hideMenu();</xsl:attribute>
<xsl:apply-templates/>
- <script>
-HM_Array1 = [
-<![CDATA[
-[,,,
-,,,,,,,,,,,,,,,,
-1,true],
-["Objects this one depends on.","javascript:window.open(mkDepURL(selectedURI),'graph')",1,0,0],
-["Render this object.","javascript:window.open(mkCICURL(selectedURI),'cic')",1,0,0],
-["Objects depending directly on this one.","javascript:window.open(mkMetaTheoryURL(selectedURI),'theory')",1,0,0],
-["Objects depending on this one.","javascript:window.open(mkMetaURL(selectedURI),'graph')",1,0,0]
-];
-]]>
- </script>
- <subst:script Language="JavaScript1.2" src="/javascript/jsmenu/HM_Loader_prova.js"/>
+ <div style="position: absolute" id="HJMmenu">
+ <!-- The two nested tables are for NS 4.0 where every -->
+ <!-- layer has a default transparent background color -->
+ <table bgColor="green" id="pippo">
+ <tr><td>
+ <table bgColor="cyan" border="2">
+ <tr><td><a href="" onClick="this.href=mkDepURL(selectedURI);">Objects this one depends on.</a></td></tr>
+ <tr><td><a href="" onClick="this.href=mkCICURL(selectedURI);" target="cic">Render this object.</a></td></tr>
+ <tr><td><a href="" onClick="this.href=mkMetaTheoryURL(selectedURI);" target="theory">Objects depending directly on this one.</a></td></tr>
+ <tr><td><a href="" onClick="this.href=mkMetaURL(selectedURI);">Objects depending on this one.</a></td></tr>
+ </table>
+ </td></tr>
+ </table>
+ </div>
+ <script>initializeMenu()</script>
</xsl:copy>
</xsl:template>
<xsl:template match = "area">
- <xsl:variable name="uri" select="@href"/>
+ <xsl:variable name="quoteduri">
+ <xsl:call-template name="jsquote">
+ <xsl:with-param name="s" select="@href"/>
+ </xsl:call-template>
+ </xsl:variable>
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:if test="starts-with(@href,"cic:")">
-<!-- CSC: I don't know why the following one does not work.
- CSC: Replaced with the following line
- <xsl:attribute name="onMouseOver">selectedURI=this.href;HM_f_PopUp('elMenu1',event)</xsl:attribute>
--->
- <xsl:attribute name="onMouseOver">selectedURI="<xsl:value-of select="$uri"/>";lastEvent=event;HM_f_PopUp('elMenu1',event)</xsl:attribute>
- <xsl:attribute name="onMouseOut">HM_f_PopDown('elMenu1')</xsl:attribute>
- <xsl:attribute name="href">javascript: HM_f_PopUp('elMenu1',lastEvent); void(0);</xsl:attribute>
+ <xsl:attribute name="onMouseOver">lastX = getX(event); lastY = getY(event);selectedURI='<xsl:value-of select="$quoteduri"/>';</xsl:attribute>
+ <xsl:attribute name="href">javascript:moveMenu(lastX,lastY); showMenu();</xsl:attribute>
</xsl:if>
<xsl:apply-templates/>
</xsl:copy>