home *** CD-ROM | disk | FTP | other *** search
/ Chip 2011 November / CHIP_2011_11.iso / Programy / Narzedzia / MediaCoder / MediaCoder2011-R8-5188.exe / htdocs / prefs / prefshtml.xsl < prev    next >
Encoding:
Extensible Markup Language  |  2011-08-17  |  4.5 KB  |  132 lines

  1. ∩╗┐<?xml version="1.0" encoding="utf-8"?>
  2. <!-- DWXMLSource="prefs.xml" -->
  3. <!DOCTYPE xsl:stylesheet  [
  4.     <!ENTITY nbsp   " ">
  5.     <!ENTITY copy   "©">
  6.     <!ENTITY reg    "®">
  7.     <!ENTITY trade  "™">
  8.     <!ENTITY mdash  "—">
  9.     <!ENTITY ldquo  "“">
  10.     <!ENTITY rdquo  "”"> 
  11.     <!ENTITY pound  "£">
  12.     <!ENTITY yen    "¥">
  13.     <!ENTITY euro   "€">
  14. ]>
  15. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  16. <xsl:output method="html" encoding="utf-8"/>
  17. <xsl:template match="/MediaCoderPrefs">
  18. <ul name="_root">
  19. <xsl:call-template name="ShowBranch">
  20.   <xsl:with-param name="cur" select="."/>
  21. </xsl:call-template>
  22. </ul>
  23. </xsl:template>
  24.  
  25. <xsl:template name="ShowBranch">
  26.     <xsl:param name="cur"/>
  27.       <xsl:for-each select="$cur/node">
  28.       <li style="list-style-type: none;cursor:pointer;">
  29.       <xsl:attribute name="name"><xsl:value-of select="@key"/></xsl:attribute>
  30.       <xsl:if test="@type != 'node'">
  31.       <a>
  32.       <xsl:attribute name="onmouseover">ShowDesc(this)</xsl:attribute>
  33.       <xsl:attribute name="onmouseout">tooltip.hide()</xsl:attribute>      
  34.       <span><img src="img/node.png"/> <xsl:value-of select="@text"/></span></a>
  35.       </xsl:if>
  36.       <xsl:choose>
  37.       <xsl:when test="@type = 'node'">
  38.       <a onclick="Toggle(this)">
  39.       <xsl:attribute name="onmouseover">ShowDesc(this)</xsl:attribute>
  40.       <xsl:attribute name="onmouseout">tooltip.hide()</xsl:attribute>      
  41.       <xsl:if test="last() = 1">
  42.       <img src="img/minus.png" /><img src="img/folder_open.png" />
  43.       </xsl:if>
  44.       <xsl:if test="last() != 1">
  45.       <img src="img/plus.png" /><img src="img/folder_closed.png" />
  46.       </xsl:if>
  47.       <span> <xsl:value-of select="@text"/></span></a>
  48.       <ul>
  49.           <xsl:if test="last() != 1">
  50.             <xsl:attribute name="style">display:none</xsl:attribute>
  51.         </xsl:if>
  52.         <xsl:call-template name="ShowBranch">
  53.           <xsl:with-param name="cur" select="."/>
  54.         </xsl:call-template>
  55.       </ul>
  56.       </xsl:when>
  57.       <xsl:otherwise>
  58.          <span> 
  59.            <xsl:call-template name="ShowValue">
  60.           <xsl:with-param name="cur" select="."/>
  61.         </xsl:call-template>
  62.         </span>
  63.       </xsl:otherwise>
  64.       </xsl:choose>
  65.       </li>
  66.       </xsl:for-each>
  67.  
  68. </xsl:template>
  69.  
  70. <xsl:template name="ShowValue">
  71.     <xsl:param name="cur"/>
  72.     <xsl:choose>
  73.     <xsl:when test="$cur/@type='bool'">
  74.     <input onclick="SetValue(this, checked)" name="rb" type="checkbox">
  75.     <xsl:if test="$cur/value='true'"><xsl:attribute name="checked"/></xsl:if>
  76.     </input>
  77.     </xsl:when>
  78.  
  79.     <xsl:when test="$cur/@type='enum'">
  80.     <xsl:if test="count(enum) >= 5">
  81.     <select name="" onchange="SetValue(this, value)">
  82.     <xsl:for-each select="$cur/enum">
  83.       <option>
  84.       <xsl:attribute name="value"><xsl:value-of select="." /></xsl:attribute>
  85.       <xsl:if test=".=../value"><xsl:attribute name="selected"/> </xsl:if>
  86.       <xsl:value-of select="." /></option>
  87.     </xsl:for-each>
  88.     </select>
  89.     </xsl:if>
  90.     <xsl:if test="count(enum) < 5">
  91.       <xsl:for-each select="enum">
  92.       <label>
  93.         <input type="radio">
  94.           <xsl:attribute name="name"><xsl:value-of select="../../../@key"/><xsl:value-of select="../../@key"/><xsl:value-of select="../@key"/></xsl:attribute>
  95.           <xsl:attribute name="onclick">SetValue(this, '<xsl:value-of select="."/>')</xsl:attribute> 
  96.           <xsl:if test=".=../value">
  97.             <xsl:attribute name="checked">true</xsl:attribute>
  98.           </xsl:if>
  99.         </input>
  100.           <xsl:value-of select="."/>
  101.           </label>
  102.       </xsl:for-each>
  103.     </xsl:if>
  104.     </xsl:when>
  105.  
  106.     <xsl:when test="$cur/@type='int' or $cur/@type='float'">
  107.     <input name="text" type='text' onchange='SetValue(this, value)' size='6'>
  108.       <xsl:choose>
  109.       <xsl:when test="$cur/value">
  110.       <xsl:attribute name="value"><xsl:value-of select="$cur/value"/></xsl:attribute>
  111.       </xsl:when>
  112.       <xsl:otherwise>
  113.       <xsl:attribute name="value">0</xsl:attribute>
  114.       </xsl:otherwise>
  115.       </xsl:choose>
  116.     </input>
  117.     <input type="button" value="Save" onclick="SetValue(previousSibling, previousSibling.value)"/>
  118.     <input type="button" value="Revert" onclick="RevertPrefValue(previousSibling.previousSibling)"/>
  119.     </xsl:when>
  120.  
  121.     <xsl:otherwise>
  122.     <input onChange='SetValue(this, value)' type='text' size='30'>
  123.     <xsl:attribute name="value"><xsl:value-of select="$cur/value"/></xsl:attribute>
  124.     </input>
  125.     <input type="button" value="Save" onclick="SetValue(previousSibling, previousSibling.value)"/>
  126.     <input type="button" value="Revert" onclick="RevertPrefValue(previousSibling.previousSibling)"/>
  127.     </xsl:otherwise>
  128.     </xsl:choose>
  129.     
  130. </xsl:template>
  131.  
  132. </xsl:stylesheet>