home *** CD-ROM | disk | FTP | other *** search
/ Clickx 75 / Clickx 75.iso / software / expressionweb / expressionwebv3 / ExpressionWeb_en.exe / Setup / WeConen.cab / xweb.VERTICAL.VERTICAL.XSL.en < prev    next >
Encoding:
Extensible Markup Language  |  2009-06-09  |  8.5 KB  |  287 lines

  1. <?xml version="1.0" ?> 
  2. <xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
  3.  
  4. <xsl:script>
  5. <![CDATA[
  6.     //generate a random int to identify the functions and objects in this gallery
  7.     var rnd = Math.round(Math.random() * 10000);    
  8.     var gnumPerRow = ""
  9.     var count = ""
  10.     
  11.   function breakRow(e) {
  12.         if (gnumPerRow == "") {
  13.             gnumPerRow = e.selectSingleNode("//options").getAttribute("numperrow");
  14.         }
  15.         return ((absoluteChildNumber(e) - 1)%gnumPerRow) == 0;
  16.   } 
  17.  
  18.   function isPreviewOutput(e) {
  19.         if (e.selectSingleNode("/xml[@output='preview']")) {
  20.             return true;
  21.         } else {
  22.             return false;
  23.         }
  24.   }
  25.  
  26.   function isLastCell(e) {
  27.           if (count == "") {
  28.             count = e.selectNodes("//picture").length;
  29.         }
  30.         return (count == absoluteChildNumber(e));
  31.   }
  32.  
  33.  
  34.   function HR()
  35.   {
  36.         return "<hr noshade='noshade' width='95%' size='1' color='#000000' />";
  37.   }
  38.  
  39.     function FillTableEnd(e) {
  40.         if (gnumPerRow == "") {
  41.             gnumPerRow = e.selectSingleNode("//options").getAttribute("numperrow");
  42.         }
  43.         if (count == "") {
  44.             count = e.selectNodes("//picture").length;
  45.         }
  46.         
  47.         var index = count % gnumPerRow;
  48.         var html = "";
  49.         var i = 0;
  50.         if (index == 0)
  51.         {
  52.             index = gnumPerRow;
  53.         }
  54.  
  55.         // only do that for more than one row situation.
  56.         if (count > gnumPerRow)
  57.         {
  58.             for(i=0; i<gnumPerRow - index; i++)
  59.             {
  60.                 if (isPreviewOutput(e))
  61.                 {
  62.                 html +="<td valign=\"top\"> \n\
  63.                     <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">\n\
  64.                     <tr> \n\
  65.                         <td colspan=\"2\" height=\"1\" style=\"border-top-style: solid; border-top-width: 1; border-top-color:black\">\n\
  66.                         </td>\n\
  67.                         <td width=\"10\"><font color=\"white\"> </font></td>\n\
  68.                     </tr>\n\
  69.                     </table></td>\n";
  70.                 }
  71.                 else{
  72.                 html +="<td valign=\"top\"> \n\
  73.                     <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">\n\
  74.                     <tr> \n\
  75.                         <td colspan=\"2\" height=\"1\" width=\"95%\">\n\
  76.                         <script language=\"JavaScript1.1\">\n\
  77.                             document.write(\"<hr noshade='noshade' width='95%' size='1' color='#000000' />\");\n\
  78.                         </script>\n\
  79.                         </td>\n\
  80.                         <td width=\"10\"><font color=\"white\"> </font></td>\n\
  81.                     </tr>\n\
  82.                     </table></td>\n";
  83.                 }
  84.             }
  85.         }
  86.  
  87.         html += "\n<tr>\n";
  88.         for(i=0; i<index; i++)
  89.         {    
  90.             if (isPreviewOutput(e))
  91.             {
  92.             html +="<td valign=\"top\"> \n\
  93.                     <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">\n\
  94.                     <tr> \n\
  95.                         <td colspan=\"2\" height=\"1\" style=\"border-top-style: solid; border-top-width: 1; border-top-color:black\">\n\
  96.                         </td>\n\
  97.                         <td width=\"10\"><font color=\"white\"> </font></td>\n\
  98.                     </tr>\n\
  99.                     </table></td>\n";            
  100.             }
  101.             else{
  102.             html +="<td valign=\"top\"> \n\
  103.                     <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">\n\
  104.                     <tr> \n\
  105.                         <td colspan=\"2\" height=\"1\" width=\"95%\">\n\
  106.                         <script language=\"JavaScript1.1\">\n\
  107.                             document.write(\"<hr noshade='noshade' width='95%' size='1' color='#000000' />\");\n\
  108.                         </script>\n\
  109.                         </td>\n\
  110.                         <td width=\"10\"><font color=\"white\"> </font></td>\n\
  111.                     </tr>\n\
  112.                     </table></td>\n";
  113.             }
  114.         }
  115.         html += "\n</tr>\n";
  116.         return html;
  117.   }
  118.  
  119.  
  120.   function lastTwoRow(e) {
  121.         if (gnumPerRow == "") {
  122.             gnumPerRow = e.selectSingleNode("//options").getAttribute("numperrow");
  123.         }
  124.         if (count == "") {
  125.             count = e.selectNodes("//picture").length;
  126.         }
  127.         var index = count % gnumPerRow;
  128.         return (count - absoluteChildNumber(e) - index < gnumPerRow);
  129.   }
  130.  
  131.   function notLastRow(e) {
  132.         if (gnumPerRow == "") {
  133.             gnumPerRow = e.selectSingleNode("//options").getAttribute("numperrow");
  134.         }
  135.         if (count == "") {
  136.             count = e.selectNodes("//picture").length;
  137.         }
  138.         var index = count % gnumPerRow;
  139.         return (count - absoluteChildNumber(e) >= index);
  140.   }
  141. ]]>
  142. </xsl:script>
  143.  
  144. <!--
  145.     the template block describes this template.
  146.     this info is used by FP when building the photo galery dialog
  147. -->
  148. <template>
  149.     <title>Vertical Layout</title>
  150.     <description>- Thumbnails of your images are created automatically.
  151. - Thumbnail images are arranged in columns.
  152. - Descriptive text is placed to the right of the images.
  153. </description>
  154.     <defaults imgPerRow="2" thumbWidth="100" />
  155.     <dependent-files/>
  156. </template>
  157.  
  158.  
  159. <xsl:template><xsl:copy><xsl:apply-templates select="@* | * | comment() | pi() | text()"/></xsl:copy></xsl:template>
  160.  
  161.  
  162. <xsl:template match="/">
  163.     <xsl:apply-templates select="xml"/>
  164. </xsl:template>
  165.  
  166. <xsl:template match="xml[@output !='subpage']">
  167. <html>
  168. <head>
  169. <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  170. <title><xsl:value-of select="//options/@pageName"/></title>
  171. </head>
  172. <body>
  173. <xsl:choose>
  174. <xsl:when expr="isPreviewOutput(this)">
  175. </xsl:when>
  176. <xsl:otherwise>
  177. <picture file-href="real_p.htm" /> 
  178. <picture file-href="real_x.htm" />
  179. </xsl:otherwise>
  180. </xsl:choose>
  181. <table border="0" cellspacing="0" cellpadding="0">
  182.     <xsl:attribute name="id">fpGalleryTable_<xsl:eval>rnd</xsl:eval></xsl:attribute>
  183.     <xsl:apply-templates select="//pictures"/>
  184. </table>
  185. </body>
  186. </html>
  187. </xsl:template>
  188.  
  189.  
  190. <!-- this is the output we generate for each sub page of the gallery -->
  191. <xsl:template match="xml[@output='subpage']">
  192. <html>
  193. <head>
  194. <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  195. <title><xsl:value-of select="//picture/caption"/></title>
  196. </head>
  197. <body>
  198. <div align="center">
  199.     <table width="100%" align="center">
  200.         <tr>
  201.             <td width="100%" align="center" colspan="3">
  202.             <img hspace="10" border="0">
  203.             <xsl:attribute name="width"><xsl:value-of select="//picture/@filewidth"/></xsl:attribute>
  204.             <xsl:attribute name="height"><xsl:value-of select="//picture/@fileheight"/></xsl:attribute>
  205.             <xsl:attribute name="src"><xsl:value-of select="//picture/@file-href"/></xsl:attribute>
  206.             <xsl:attribute name="title"><xsl:value-of select="//picture/caption"/></xsl:attribute>
  207.             </img>
  208.             </td>
  209.         </tr>
  210.         <tr><td colspan="3"><xsl:apply-templates select="//picture/caption"/></td></tr>
  211.         <tr><td colspan="3"><xsl:apply-templates select="//picture/desc"/></td></tr>
  212.         <tr>
  213.             <td><a><xsl:attribute name="href"><xsl:value-of select="//picture/@prevImgPath"/></xsl:attribute>Previous Image</a></td>
  214.             <td><a><xsl:attribute name="href"><xsl:value-of select="//picture/@galleryPath"/></xsl:attribute>Back To Gallery</a></td>
  215.             <td><a><xsl:attribute name="href"><xsl:value-of select="//picture/@nextImgPath"/></xsl:attribute>Next Image</a></td>
  216.         </tr>
  217.     </table>
  218. </div>
  219. </body>
  220. </html>
  221. </xsl:template>
  222.  
  223. <xsl:template match="pictures">
  224.     <xsl:apply-templates />
  225. </xsl:template>
  226.  
  227. <xsl:template match="picture">
  228.     <xsl:if expr="breakRow(this)">
  229.     <tr/>
  230.     </xsl:if>
  231.         <td valign="top">
  232.             <table border="0" cellpadding="0" cellspacing="0" width="100%">
  233.                 
  234.                 <tr>
  235.                     <xsl:choose>
  236.                     <xsl:when expr="isPreviewOutput(this)">
  237.                         <td colspan="2" height="1" style="border-top-style: solid; border-top-width: 1; border-top-color:black"></td>
  238.                     </xsl:when>
  239.                     <xsl:otherwise>
  240.                         <td colspan="2" height="1">
  241.                             <xsl:eval no-entities='t'>HR()</xsl:eval>
  242.                         </td>
  243.                     </xsl:otherwise>
  244.                     </xsl:choose>
  245.                     <td width="10"><font color="white"> </font></td>
  246.                 </tr>
  247.                 
  248.                 <tr>
  249.                     <td valign="top">
  250.                         <a>
  251.                         <xsl:attribute name="href"><xsl:value-of select="@file-href"/></xsl:attribute>
  252.                         <img border="0" vspace="10" hspace="10">
  253.                         <xsl:attribute name="src"><xsl:value-of select="@thumb-href"/></xsl:attribute>
  254.                         <xsl:attribute name="width"><xsl:value-of select="@thumbwidth"/></xsl:attribute>
  255.                         <xsl:attribute name="height"><xsl:value-of select="@thumbheight"/></xsl:attribute>
  256.                         <xsl:attribute name="title"><xsl:eval>this.selectSingleNode("caption").text</xsl:eval></xsl:attribute>
  257.                         </img></a>
  258.                     </td>
  259.                     <td width="130" height="123" valign="top"> 
  260.                         <table width="130" border="0" cellspacing="0" cellpadding="0">
  261.                             <tr valign="top"> 
  262.                                 <td height="10"><font color="white"> </font></td>
  263.                             </tr>
  264.                             <tr valign="top">
  265.                                 <td>
  266.                                     <xsl:apply-templates select="caption"/>
  267.                                 </td>
  268.                             </tr>
  269.                             <tr valign="top">
  270.                                 <td>
  271.                                     <xsl:apply-templates select="desc"/>
  272.                                 </td>
  273.                             </tr>
  274.                         </table>
  275.                     </td>
  276.                     <td width="10"><font color="white"> </font></td>
  277.                 </tr>
  278.                 
  279.             </table>
  280.         </td>
  281.     <xsl:if expr="isLastCell(this)">
  282.     <xsl:eval no-entities="t">FillTableEnd(this)</xsl:eval>
  283.     </xsl:if>
  284. </xsl:template>
  285.  
  286. <xsl:template match="caption | desc"><xsl:apply-templates /></xsl:template>
  287. </xsl:stylesheet>