You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by "Peter B. West" <pb...@powerup.com.au> on 2003/02/01 00:13:24 UTC

Javascript for frames

Fopdevs,

Here is an extract of what I ended up with in the alt.properties frames.

In index.html (the frameset page)

     script type="text/javascript"
// IE didn't seem to like "type application/x-javascript"
       var isHigh = true;

       function lengthenCol() {
         if (isHigh) { return; }
         fset = document.getElementById("altDesignFramesetRows");
         fset.setAttribute("rows", "95%,*");
         logowin = top.frames[0];
         if (logowin == null) {
           alert(
             "Requires Navigator >= 7, Mozilla >= 1.2.1 or IE >= 6");
           return;
         }
         logodoc = logowin.document;
         lbutton = logodoc.getElementById("lengthenButton");
         lbutton.setAttribute("value", "^");
         isHigh = true;
       }
// I have no idea whether the attempt to warn about browser type
// is valid, because i have no idea fo the point of failure for
// other browsers. Some advice on this would be useful

       function displayCode(src) {
           top.frames[2].location = src;
           shortenCol();
       }

       function displayHtml(src) {
           top.frames[1].location = src;
           lengthenCol();
       }

In logo,html, which contains the menu and the display toggle button, the 
menu items are summoned by:

         <a href= "javascript:window.top.displayHtml(
               'properties/PropertyConsts-class.html' )"
          >PropertyConsts</a>

and code display is triggered by html like

     <a href="javascript:window.top.displayCode(
        'PropertyConsts.html#PropertyConstsClass'
     )">This class</a>, and the singleton object which is <a
     href="javascript:window.top.displayCode(
     'PropertyConsts.html#pconsts' )">generated by the static
     initializer</a>, is essentially a repository of

Peter
-- 
Peter B. West  pbwest@powerup.com.au  http://www.powerup.com.au/~pbwest/
"Lord, to whom shall we go?"


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org