You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by jm...@apache.org on 2003/04/01 06:29:18 UTC

cvs commit: jakarta-struts/contrib/tag-doc/src/resources/taglibreport xbPositionableElement.js index.xsl taglib-report.xsl

jmitchell    2003/03/31 20:29:17

  Modified:    contrib/tag-doc/src/resources/taglibreport index.xsl
                        taglib-report.xsl
  Added:       contrib/tag-doc/src/resources/taglibreport
                        xbPositionableElement.js
  Log:
  Applied patch by Mohan Kishore.
  
  Thanks!!!
  
  Revision  Changes    Path
  1.2       +6 -6      jakarta-struts/contrib/tag-doc/src/resources/taglibreport/index.xsl
  
  Index: index.xsl
  ===================================================================
  RCS file: /home/cvs/jakarta-struts/contrib/tag-doc/src/resources/taglibreport/index.xsl,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- index.xsl	29 Mar 2003 05:51:40 -0000	1.1
  +++ index.xsl	1 Apr 2003 04:29:17 -0000	1.2
  @@ -1,9 +1,9 @@
   <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
   <xsl:output
  -	method="html"
  -	version="4.0"
  -	omit-xml-declaration="yes"
  -	indent="yes"
  +  method="html"
  +  version="4.0"
  +  omit-xml-declaration="yes"
  +  indent="yes"
   />
   
   <xsl:template match="*">
  @@ -11,7 +11,7 @@
   <HEAD>
     <TITLE>Taglib Documentation</TITLE>
   </HEAD>
  -<FRAMESET cols="10%,80%">
  +<FRAMESET cols="100,*">
     <FRAME src="overview-frame.html" name="taglibListFrame"/>
     <FRAME src="" name="taglibFrame"/>
   </FRAMESET>
  @@ -20,7 +20,7 @@
   <NOFRAMES>
     <H2>Frame Alert</H2>
     <P/>
  -  This document is designed to be viewed using the frames feature. 
  +  This document is designed to be viewed using the frames feature.
     If you see this message, you are using a non-frame-capable web client.
     <BR/>
     Link to <A HREF="overview-frame.html">Non-frame version.</A>
  
  
  
  1.2       +115 -16   jakarta-struts/contrib/tag-doc/src/resources/taglibreport/taglib-report.xsl
  
  Index: taglib-report.xsl
  ===================================================================
  RCS file: /home/cvs/jakarta-struts/contrib/tag-doc/src/resources/taglibreport/taglib-report.xsl,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- taglib-report.xsl	29 Mar 2003 05:51:40 -0000	1.1
  +++ taglib-report.xsl	1 Apr 2003 04:29:17 -0000	1.2
  @@ -1,43 +1,91 @@
   <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
   <xsl:output
  -	method="html"
  -	version="4.0"
  -	omit-xml-declaration="yes"
  -	indent="yes"
  +  method="html"
  +  version="4.0"
  +  omit-xml-declaration="yes"
  +  indent="yes"
   />
   
   <xsl:template match="*">
   <HTML>
   <HEAD>
     <LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style" />
  +  <STYLE TYPE="text/css">
  +    #ATTR_HEADER {
  +      position: absolute;
  +      top: 0px;
  +      left: 0px;
  +      z-index: 1;
  +    }
  +    #TAG_HEADER {
  +      position: absolute;
  +      top: 0px;
  +      left: 0px;
  +      z-index: 2;
  +    }
  +    #TOP_LEFT {
  +      position: absolute;
  +      top: 0px;
  +      left: 0px;
  +      z-index: 3;
  +    }
  +    #DATA_TABLE {
  +      position: absolute;
  +      top: 0px;
  +      left: 0px;
  +    }
  +  </STYLE>
  +  <SCRIPT LANGUAGE="JavaScript" SRC="xbPositionableElement.js"/>
  +  <SCRIPT LANGUAGE="JavaScript">&lt;!--
  +    var s0, s1, s2;
  +    if (!document.layers) {
  +      s0 = new xbPositionableElement('TOP_LEFT', 'left', 'top', 0, 0);
  +      s1 = new xbPositionableElement('ATTR_HEADER', 'none', 'top', 0, 0);
  +      s2 = new xbPositionableElement('TAG_HEADER', 'left', 'none', 0, 0);
  +    }
  +    function init() {
  +      if (!document.layers) {
  +        s0.start();
  +        s1.start();
  +        s2.start();
  +      }
  +    }
  +  //--&gt;</SCRIPT>
   </HEAD>
  -<BODY>
  -
  -<TABLE BORDER="1" WIDTH="100%" CELLSPACING="0" CELLPADDING="0">
  +<BODY onLoad="init()">
   
  +<!-- Data Table -->
  +<DIV ID="DATA_TABLE">
  +<TABLE BORDER="1" CELLSPACING="0" CELLPADDING="0">
   <TR CLASS="TableHeadingColor">
  -<TD>&#160;</TD>
  -<TD NOWRAP="true">&#160;<B>body-content</B>&#160;</TD>
  +  <TD WIDTH="150" NOWRAP="true">
  +    <DIV STYLE="width: 150px;">&#160;</DIV>
  +  </TD>
  +  <TD WIDTH="75" NOWRAP="true">
  +    <DIV>&#160;<B>bodyContent</B>&#160;</DIV>
  +  </TD>
   <xsl:for-each select="//attributes/attribute">
   <xsl:sort select="."/>
  -  <TD NOWRAP="true" STYLE="width: 75px;">
  -    &#160;<B><xsl:value-of select="."/></B>&#160;
  +  <TD WIDTH="75" NOWRAP="true">
  +    <DIV>&#160;<B><xsl:value-of select="."/></B>&#160;</DIV>
     </TD>
   </xsl:for-each>
   </TR>
  -
  -<!-- Add 'bodycontent' as the second column?? -->
  -
   <xsl:for-each select="//taglib/tag">
   <xsl:sort select="name"/>
   <TR>
     <xsl:variable name="curr_tag" select="."/>
  -  <TD CLASS="TableHeadingColor">&#160;<B><xsl:value-of select="$curr_tag/name"/></B>&#160;</TD>
  -  <TD>&#160;<xsl:value-of select="$curr_tag/bodycontent"/>&#160;</TD>
  +  <TD CLASS="TableHeadingColor" WIDTH="150" NOWRAP="true">
  +    <DIV STYLE="width: 150px; overflow: hidden;">&#160;<B><xsl:value-of select="$curr_tag/name"/></B>&#160;</DIV>
  +  </TD>
  +  <TD WIDTH="75" NOWRAP="true">
  +    &#160;<xsl:value-of select="$curr_tag/bodycontent"/>&#160;
  +  </TD>
     <xsl:for-each select="//attributes/attribute">
     <xsl:sort select="."/>
       <xsl:variable name="curr_attr" select="."/>
       <xsl:element name="TD">
  +      <xsl:attribute name="WIDTH">75</xsl:attribute>
         <xsl:attribute name="NOWRAP">true</xsl:attribute>
         <xsl:for-each select="$curr_tag/attribute">
         <xsl:sort select="name"/>
  @@ -66,6 +114,57 @@
   </xsl:for-each>
   
   </TABLE>
  +</DIV>
  +
  +<!-- Top Left Blank Cell -->
  +<LAYER VISIBILITY="hide"><DIV ID="TOP_LEFT">
  +<TABLE BORDER="1" CELLSPACING="0" CELLPADDING="0">
  +<TR CLASS="TableHeadingColor">
  +  <TD WIDTH="150" NOWRAP="true">
  +    <DIV STYLE="width: 150px;">&#160;</DIV>
  +  </TD>
  +</TR>
  +</TABLE>
  +</DIV></LAYER>
  +
  +<!-- Attribute Header Table -->
  +<LAYER VISIBILITY="hide"><DIV ID="ATTR_HEADER">
  +<TABLE BORDER="1" CELLSPACING="0" CELLPADDING="0">
  +<TR CLASS="TableHeadingColor">
  +  <TD WIDTH="150" NOWRAP="true">
  +    <DIV STYLE="width: 150px;">&#160;</DIV>
  +  </TD>
  +  <TD WIDTH="75" NOWRAP="true">
  +    <DIV>&#160;<B>bodyContent</B>&#160;</DIV>
  +  </TD>
  +<xsl:for-each select="//attributes/attribute">
  +<xsl:sort select="."/>
  +  <TD WIDTH="75" NOWRAP="true">
  +    <DIV>&#160;<B><xsl:value-of select="."/></B>&#160;</DIV>
  +  </TD>
  +</xsl:for-each>
  +</TR>
  +</TABLE>
  +</DIV></LAYER>
  +
  +<!-- Tag Header Table -->
  +<LAYER VISIBILITY="hide"><DIV ID="TAG_HEADER">
  +<TABLE BORDER="1" CELLSPACING="0" CELLPADDING="0">
  +<TR CLASS="TableHeadingColor">
  +  <TD WIDTH="150" NOWRAP="true">
  +    <DIV STYLE="width: 150px;">&#160;</DIV>
  +  </TD>
  +</TR>
  +<xsl:for-each select="//taglib/tag">
  +<xsl:sort select="name"/>
  +<TR CLASS="TableHeadingColor">
  +  <TD WIDTH="150" NOWRAP="true">
  +    <DIV STYLE="width: 150px; overflow: hidden;">&#160;<B><xsl:value-of select="./name"/></B>&#160;</DIV>
  +  </TD>
  +</TR>
  +</xsl:for-each>
  +</TABLE>
  +</DIV></LAYER>
   
   
   </BODY>
  
  
  
  1.1                  jakarta-struts/contrib/tag-doc/src/resources/taglibreport/xbPositionableElement.js
  
  Index: xbPositionableElement.js
  ===================================================================
  /*
   * xbPositionableElement.js
   * $Revision: 1.1 $ $Date: 2003/04/01 04:29:17 $
  */
  /* ***** BEGIN LICENSE BLOCK *****
   * Version: MPL 1.1/GPL 2.0/LGPL 2.1
   *
   * The contents of this file are subject to the Mozilla Public License Version
   * 1.1 (the "License"); you may not use this file except in compliance with
   * the License. You may obtain a copy of the License at
   * http://www.mozilla.org/MPL/
   *
   * Software distributed under the License is distributed on an "AS IS" basis,
   * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
   * for the specific language governing rights and limitations under the
   * License.
   *
   * The Original Code is Netscape Cross Browser Positionable Element code.
   *
   * The Initial Developer of the Original Code is
   * Netscape Communications Corporation.
   * Portions created by the Initial Developer are Copyright (C) 2002
   * the Initial Developer. All Rights Reserved.
   *
   * Contributor(s): Doron Rosenberg <do...@netscape.com>
   *                 Bob Clary <bc...@netscape.com>
   *                 
   *
   * ***** END LICENSE BLOCK ***** */
  
  /*
   * xbPositionableElement - 
   * use DHMTL to position an element displaces (offsetX, offsetY)
   * from a geometric position in the viewport.
   * 
   */
  
  function xbPositionableElement(id, sideX, sideY, offsetX, offsetY)
  {
    this.id              = id;
    this.name            = 'xbPositionableElement_' + (++xbPositionableElement._name);
    this.runId           = null;  
    this.refreshInterval = 100;
    this.div             = null;
    
    if (typeof(sideX) != 'string')
    {
      sideX = 'left'
    }
    else
    {
      sideX = sideX.toLowerCase();
    }
  
    if (typeof(sideY) != 'string')
    {
      sideY = 'top'
    }
    else
    {
      sideY = sideY.toLowerCase();
    }
  
    if (typeof(offsetX) != 'number')
    {
      offsetX = 0;
    }
  
    if (typeof(offsetY) != 'number')
    {
      offsetY = 0;
    }
  
    this.sideX   = sideX;
    this.sideY   = sideY;
    this.offsetX = offsetX;
    this.offsetY = offsetY;
  
    window[this.name] = this;
  }  
  
  xbPositionableElement._name = -1;
  
  xbPositionableElement.prototype.start = function ()
  {
    this.stop();
    
    // since start() should be called after the document has loaded, we can finally assign element
    if (!this.div)
    {
      if (document.getElementById)
      {
        this.div = document.getElementById(this.id);
        this.styleObj = this.div.style;	
      }
      else if (document.layers)
      {
        this.div = document.layers[this.id];
        this.styleObj = this.div;
      }
      else if (document.all)
      {
        this.div = document.all[this.id];
        this.styleObj = this.div.style;	
      }
  
      this.width = this._getInnerSize("width");
    }	
    
    this._updatePosition();
    this.runId = setTimeout(this.name + '.start()', this.refreshInterval);    
  };
  
  xbPositionableElement.prototype.stop = function ()
  {
    if (this.runId)
      clearTimeout(this.runId);
      
    this.runId = null;
  };
  
  xbPositionableElement.prototype._getInnerSize = function (propName)
  {
    var val = 0;
  
    if (document.layers)
    {
      // navigator 4
      val = this.div.document[propName];
    }
    else if (typeof(this.div.style[propName]) == 'number')
    {
      // opera
      // bug in Opera 6 width/offsetWidth. Use clientWidth
      if (propName == 'width' && typeof(this.div.clientWidth) == 'number')
        val = this.div.clientWidth;
      else
        val =  this.styleObj[propName];
    }
    else
    {
      //mozilla and IE
      switch (propName)
      {
      case 'height':
         if (typeof(this.div.offsetHeight) == 'number')
           val =  this.div.offsetHeight;
         if (val == 0)
           val =  this.height;
         break;
   
      case 'width':
         if (typeof(this.div.offsetWidth) == 'number')
           val = this.div.offsetWidth;
         if (val == 0)
           val =  this.width;
         break;
      }
    }
    return val;
  };
  
  xbPositionableElement.prototype._getScrollOffset = function (propName)
  {
    var rv = 0;
  
    if (document.body && typeof(document.body.scrollTop) == 'number')
    {
      rv = document.body[propName=='top'?'scrollTop':'scrollLeft'];
    }
    else if (typeof(window.pageYOffset) == 'number')
    {
      rv = window[propName=='top'?'pageYOffset':'pageXOffset'];  
    }
  
    return rv;
  };
  
  xbPositionableElement.prototype._updatePosition = function ()
  {
    var windowHeight;
    var windowWidth;
    var x = 0;
    var y = 0;
  
    if (document.body && typeof(document.body.clientHeight) == 'number')
    {
      windowHeight = document.body.clientHeight;
      windowWidth  = document.body.clientWidth;
    }
    else if (typeof(window.innerHeight) == 'number')
    {
      windowHeight = window.innerHeight - 16;
      windowWidth  = window.innerWidth  - 16;  
    }
  
    // calculate the positions of the view port position
    switch (this.sideX)
    {
      case 'left':
        x = this._getScrollOffset('left');
        break;
  
      case 'center':
        x = (windowWidth / 2) - (this._getInnerSize('width')/2) + this._getScrollOffset('left');
        break;
  	  
      case 'right':
        x = windowWidth - this._getInnerSize('width') + this._getScrollOffset('left');
        break;
    }
  
    switch (this.sideY)
    {
      case 'top':
        y = this._getScrollOffset('top');
        break;
  
      case 'center':
        y = (windowHeight / 2) - (this._getInnerSize('height') / 2) + this._getScrollOffset('top');
        break; 
  	  
      case 'bottom':
        y = windowHeight - this._getInnerSize('height') + this._getScrollOffset('top');
        break;
    }
    
    if (typeof(this.styleObj.left) == 'number')
    {
      this.styleObj.left = (x + this.offsetX);
      this.styleObj.top  = (y + this.offsetY);
    }
    else
    {
      this.styleObj.left = (x + this.offsetX) + 'px';
      this.styleObj.top  = (y + this.offsetY) + 'px';
    }
  };
  
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-dev-help@jakarta.apache.org