]> matita.cs.unibo.it Git - helm.git/commitdiff
Espansione dinamica delle prove per Mozilla/Galeon.
authorAndrea Asperti <andrea.asperti@unibo.it>
Tue, 28 Aug 2001 11:12:25 +0000 (11:12 +0000)
committerAndrea Asperti <andrea.asperti@unibo.it>
Tue, 28 Aug 2001 11:12:25 +0000 (11:12 +0000)
helm/style/content_to_html.xsl

index 1211e4881be96e555eba8e9d9245832cff02fdb8..9d0e5673580ed9dc397c5ae24744222d9b8de900 100644 (file)
       <head>
         <title> <xsl:value-of select="$CICURI"/> </title> <!-- FG -->
          <style> A { text-decoration: none } </style>
+         <script>
+          <xsl:text disable-output-escaping="yes">
+           <![CDATA[
+            function Hide(which){
+             if (!document.getElementById)
+              return
+             which.style.display="none"
+            }
+
+            function Show(which){
+             if (!document.getElementById)
+              return
+             which.style.display=""
+            }
+
+            document.to_be_deleted = new Array();
+          ]]>
+          </xsl:text>
+         </script>
       </head>
       <body bgcolor="white">
+         <xsl:attribute name="onLoad">
+          if(document.getElementById)
+           for(var i=0;i&lt;document.to_be_deleted.length;i++)
+            Hide(document.getElementById(document.to_be_deleted[i]));
+         </xsl:attribute>
          <xsl:apply-templates>
             <xsl:with-param name="current_indent" select="0"/>
          </xsl:apply-templates>
       <!-- ***************************************** -->
       <!-- PROOF -->
       <xsl:when test="$name='proof'">
-       <xsl:apply-templates select="*[position()=2]">
-        <xsl:with-param name="current_indent" select="$current_indent"/>
-       </xsl:apply-templates>
-       <br/>
-       <!-- <xsl:element name="br"/> -->
-       <xsl:call-template name="make_indent">
-        <xsl:with-param name="current_indent" select="$current_indent"/> 
-       </xsl:call-template>
-       <FONT color="red">we proved&#x00a0;</FONT>
+       <xsl:variable name="nonce" select="generate-id()"/>
+       <xsl:variable name="freshid1" select="concat('a',$nonce)"/>
+       <xsl:variable name="freshid2" select="concat('b',$nonce)"/>
+       <xsl:variable name="freshid3" select="concat('c',$nonce)"/>
+       <span ID="{$freshid1}">
+        <xsl:apply-templates select="*[position()=2]">
+         <xsl:with-param name="current_indent" select="$current_indent"/>
+        </xsl:apply-templates>
+        &#x00a0;
+       </span>
+       <xsl:choose>
+        <xsl:when test="preceding-sibling::*[1]/text()='letin1'">
+         <br/>
+         <xsl:call-template name="make_indent">
+          <xsl:with-param name="current_indent" select="$current_indent"/>
+         </xsl:call-template>
+         <FONT color="red">we proved&#x00a0;</FONT> 
+        </xsl:when>
+        <xsl:otherwise>
+         <script>
+          if(document.getElementById) {
+           document.write('\
+            <span ID="{$freshid2}">\
+             <a style="text-decoration:underline ; color:green" href="" onClick="Show(document.getElementById(\'{$freshid1}\')); Hide(document.getElementById(\'{$freshid2}\'));Show(document.getElementById(\'{$freshid3}\'));return (0==1);">Proof of</a>\
+            </span>\
+            <span ID="{$freshid3}">\
+             <br/>\
+             <xsl:call-template name="make_indent">
+              <xsl:with-param name="current_indent" select="$current_indent"/>
+             </xsl:call-template>\
+             <a style="text-decoration:underline ; color:red" href="" onClick="Hide(document.getElementById(\'{$freshid1}\')); Show(document.getElementById(\'{$freshid2}\'));Hide(document.getElementById(\'{$freshid3}\'));return (0==1);">we proved</a>\
+            </span>\
+           ');
+           document.to_be_deleted.push('<xsl:value-of select="$freshid1"/>');
+           document.to_be_deleted.push('<xsl:value-of select="$freshid3"/>');
+           document.write('&#x00a0;');
+          } else {
+           document.write('\
+            <br/>\
+            <xsl:call-template name="make_indent">
+             <xsl:with-param name="current_indent" select="$current_indent"/>
+            </xsl:call-template>\
+            <FONT color="red">we proved&#x00a0;</FONT>\
+           ');
+          }
+         </script>
+        </xsl:otherwise>
+       </xsl:choose>
        <xsl:apply-templates select="*[position()=3]">
         <xsl:with-param name="current_indent" select="$current_indent + 16"/>
        </xsl:apply-templates>