forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nicola...@apache.org
Subject cvs commit: xml-forrest/src/resources/skins/common/xslt/html document2html.xsl
Date Mon, 17 Mar 2003 17:03:57 GMT
nicolaken    2003/03/17 09:03:56

  Modified:    src/resources/skins/common/xslt/html document2html.xsl
  Log:
  Enabling fixed version of the multiple output links on each page
  print - pdf - xml
  
  Still dunno how to disable them; I added attributes like for the PDF but
  dunno where it's set :-/
  
  Revision  Changes    Path
  1.15      +35 -17    xml-forrest/src/resources/skins/common/xslt/html/document2html.xsl
  
  Index: document2html.xsl
  ===================================================================
  RCS file: /home/cvs/xml-forrest/src/resources/skins/common/xslt/html/document2html.xsl,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- document2html.xsl	17 Feb 2003 00:10:44 -0000	1.14
  +++ document2html.xsl	17 Mar 2003 17:03:56 -0000	1.15
  @@ -19,8 +19,8 @@
   
     <!-- If non-blank, a PDF link for this page will not be generated -->
     <xsl:param name="nopdf"/>
  -  <!-- If non-blank, a "printer-friendly" link for this page will not be generated -->
  -  <xsl:param name="noprinterfriendly"/>
  +  <!-- If non-blank, a "print" link for this page will not be generated -->
  +  <xsl:param name="noprint"/>
     <!-- If non-blank, an XML link for this page will not be generated -->
     <xsl:param name="noxml"/>  
     <xsl:param name="notoc"/>
  @@ -54,13 +54,9 @@
                   <xsl:value-of select="header/title"/>
                 </h1>
               </td>
  -            <!-- NKB disabling till it's more tested -->
  -            <!--     anyone, feel free to work on it  -->
  -            <!-- <xsl:call-template name="printerfriendlylink"/> -->
  +            <xsl:call-template name="printlink"/> 
               <xsl:call-template name="pdflink"/>
  -            <!-- NKB disabling till it's more tested -->
  -            <!--     anyone, feel free to work on it  -->
  -            <!-- <xsl:call-template name="xmllink"/> -->
  +            <xsl:call-template name="xmllink"/>
             </tr>
           </table>
         </xsl:if>
  @@ -87,13 +83,35 @@
     </xsl:template>
   
     <!-- Generates the "printer friendly version" link -->
  -  <xsl:template name="printerfriendlylink">
  -    <xsl:if test="$noprinterfriendly = ''"> <!-- noprinterfriendly flag unset
-->
  -      <td align="center" width="40" nowrap="nowrap"><a href="printer-friendly/{$filename-noext}.html"
class="dida">
  -          <img border="0" src="{$skin-img-dir}/printer.gif" alt="printer friendly"/><br/>
  -          printer<br/>
  -          friendly</a>
  -      </td>
  +  <xsl:template name="printlink">
  +    <xsl:if test="$noprint = ''"> <!-- noprint flag unset -->
  +    
  +<script Language="Javascript">
  +
  +function printit(){  
  +if (window.print) {
  +    window.print() ;  
  +} else {
  +    var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH="0" HEIGHT="0" CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
  +document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
  +    WebBrowser1.ExecWB(6, 2);//Use a 1 vs. a 2 for a prompting dialog box    WebBrowser1.outerHTML
= "";  
  +}
  +}
  +</script>
  +            
  +
  +<script Language="Javascript">  
  +var NS = (navigator.appName == "Netscape");
  +var VERSION = parseInt(navigator.appVersion);
  +if (VERSION > 3) {
  +    document.write('<td align="center" width="40" nowrap="nowrap">');     
  +    document.write('  <a href="javascript:printit()" class="dida">');        
  +    document.write('    <img border="0" src="{$skin-img-dir}/printer.gif" alt="Print
this Page"/><br/>');   
  +    document.write('  print</a>');   
  +    document.write('</td>');           
  +}
  +</script>
  +
       </xsl:if>
     </xsl:template>
   
  @@ -111,7 +129,7 @@
     <!-- Generates the XML link -->
     <xsl:template name="xmllink">
       <xsl:if test="$noxml = ''"> <!-- noxml flag unset -->
  -      <td align="center" width="40" nowrap="nowrap"><a href="doc-source/{$filename-noext}.html"
class="dida">
  +      <td align="center" width="40" nowrap="nowrap"><a href="{$filename-noext}.xml"
class="dida">
             <img border="0" src="{$skin-img-dir}/xmldoc.gif" alt="xml"/><br/>
             xml</a>
         </td>
  
  
  

Mime
View raw message