Ignore:
Timestamp:
2005-05-04T16:07:06+12:00 (19 years ago)
Author:
kjdon
Message:

instead of always showing the errors, toggle them hidden/visible using javascript - doesn't work now if javascript disabled. need to fix this

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/ant-install-branch/gsdl3/web/interfaces/default/transform/style.xsl

    r9274 r9810  
    2929          <tr><td>
    3030          <xsl:apply-templates select="pageResponse"/>
    31           <xsl:apply-templates select="descendant::error"/>
     31          <xsl:if test="descendant::error">
     32            <script language="Javascript">
     33              <xsl:text disable-output-escaping="yes">
     34            function removeAllChildren(node) {
     35             while (node.hasChildNodes()) {
     36              node.removeChild(node.firstChild);
     37             }
     38            }
     39
     40              function toggleHideError(obj) {
     41              if (obj.style.display == "none") {
     42            obj.style.display = "";
     43            hide_link = document.getElementById("hide");
     44            removeAllChildren(hide_link);
     45            hide_link.appendChild(document.createTextNode("Hide Error"));
     46              } else {
     47            obj.style.display = "none";
     48            hide_link = document.getElementById("hide");
     49            removeAllChildren(hide_link);
     50            hide_link.appendChild(document.createTextNode("Show Error"));
     51           
     52            }
     53              }
     54              </xsl:text>
     55            </script>
     56            <p align='right'><a id="hide" href="javascript:toggleHideError(error);">Show Error</a></p>
     57            <div id="error" style="display: none;">
     58              <xsl:apply-templates select="descendant::error"/>
     59            </div>
     60          </xsl:if>
    3261          <xsl:call-template name="greenstoneFooter"/>
    3362        </td></tr>
     
    6695    Error: <xsl:value-of select="."/>
    6796  </xsl:template>
     97
    6898  <xsl:template name="standardPageBanner">
    6999    <xsl:param name="collName"/>
Note: See TracChangeset for help on using the changeset viewer.