[Laszlo-checkins] r3987 - in openlaszlo/branches/legals: WEB-INF/lps/lfc/data WEB-INF/lps/lfc/services WEB-INF/lps/lfc/views WEB-INF/lps/server/src/org/openlaszlo/js2doc docs/src/xsl lps/components/debugger lps/components/extensions

jgrandy@openlaszlo.org jgrandy at openlaszlo.org
Wed Feb 28 16:35:22 PST 2007


Author: jgrandy
Date: 2007-02-28 16:35:13 -0800 (Wed, 28 Feb 2007)
New Revision: 3987

Removed:
   openlaszlo/branches/legals/docs/src/xsl/make-php.xsl
Modified:
   openlaszlo/branches/legals/WEB-INF/lps/lfc/data/LzDatapath.lzs
   openlaszlo/branches/legals/WEB-INF/lps/lfc/data/LzDatapointer.lzs
   openlaszlo/branches/legals/WEB-INF/lps/lfc/data/LzDataset.lzs
   openlaszlo/branches/legals/WEB-INF/lps/lfc/services/LzKeys.as
   openlaszlo/branches/legals/WEB-INF/lps/lfc/views/LzInputText.lzs
   openlaszlo/branches/legals/WEB-INF/lps/server/src/org/openlaszlo/js2doc/ReprocessComments.java
   openlaszlo/branches/legals/docs/src/xsl/common-html.xsl
   openlaszlo/branches/legals/docs/src/xsl/doc2dbk.xsl
   openlaszlo/branches/legals/docs/src/xsl/format.xsl
   openlaszlo/branches/legals/docs/src/xsl/js2doc-comment2dbk.xsl
   openlaszlo/branches/legals/docs/src/xsl/js2doc2dbk.xsl
   openlaszlo/branches/legals/lps/components/debugger/library.lzx
   openlaszlo/branches/legals/lps/components/extensions/html.lzx
Log:
Change 20070228-jgrandyw-V by jgrandyw at jgrandy-pb.local on 2007-02-28 14:17:01 PST
    in /Users/jgrandyw/dev/svn/openlaszlo/branches/legals

Summary: Improvements to refguide

New Features:

Bugs Fixed:LPP-3606 LPP-3548

Technical Reviewer: max
QA Reviewer: jsundman
Doc Reviewer: jsundman

Details:Various changes:

+ convert to use new embedding scheme for live examples in all docs
+ rewrite code that was detecting canvas dimensions of examples
+ remove XSL script (make-php.xsl) that is no longer used
+ add support for @usage js2doc tag, to be displayed before Description in refguide entries. 
+ add @usage for LzDataPath, which has an LzNode attribute shorthand.
+ convert <example><title> idiom to <example title=""> in refguide to be consistent with devguide
+ add @runtimes js2doc tag for LZX to avoid processing <switch> structure
+ add '@runtimes dhtml' tag to <html> extension tag
+ make dummy class LzDebugWindow private

Tests:

To test, run 'ant clean build doc' and open refguide over
localhost:8080. LzView refguide entry has a live example, LzDatapath has
a @usage tag, examples for LzInputText should run propertly and have
titles, <html> should be tagged as a DHTML feature, LzDebugWindow should
not appear in refguide

Files:
M      WEB-INF/lps/lfc/services/LzKeys.as
M      WEB-INF/lps/lfc/views/LzInputText.lzs
M      WEB-INF/lps/lfc/data/LzDatapointer.lzs
M      WEB-INF/lps/lfc/data/LzDataset.lzs
M      WEB-INF/lps/lfc/data/LzDatapath.lzs
M      WEB-INF/lps/server/src/org/openlaszlo/js2doc/ReprocessComments.java
M      docs/src/xsl/js2doc-comment2dbk.xsl
M      docs/src/xsl/js2doc2dbk.xsl
M      docs/src/xsl/format.xsl
M      docs/src/xsl/common-html.xsl
D      docs/src/xsl/make-php.xsl
M      docs/src/xsl/doc2dbk.xsl
M      lps/components/extensions/html.lzx
M      lps/components/debugger/library.lzx


Modified: openlaszlo/branches/legals/WEB-INF/lps/lfc/data/LzDatapath.lzs
===================================================================
--- openlaszlo/branches/legals/WEB-INF/lps/lfc/data/LzDatapath.lzs	2007-03-01 00:13:01 UTC (rev 3986)
+++ openlaszlo/branches/legals/WEB-INF/lps/lfc/data/LzDatapath.lzs	2007-03-01 00:35:13 UTC (rev 3987)
@@ -34,13 +34,13 @@
   * <p>
   * A node can only have one datapath, and datapaths always have the name
   * <code>datapath</code>.  Additional options available on datapath such
-  * as <a href="#attr-pooling">pooling</a> and <a
-  * href="#attr-replication">lazy replication</a> are specified by writing
-  * the <tagname>datapath</tagname> tag as a separate node.
+  * as <a href="#LzDatapath.__ivars__.pooling">pooling</a> and <a
+  * href="#LzDatapath.__ivars__.replication">lazy replication</a> are specified 
+  * by writing the <tagname>datapath</tagname> tag as a separate node.
   * </p>
   * 
-  * <example><title>Mapping data to views using datapaths.</title><programlisting>
-  * &lt;canvas height="120"&gt;
+  * <example title="Mapping data to views using datapaths">
+  * <programlisting>&lt;canvas height="120"&gt;
   *   &lt;dataset name="testdata"&gt;
   *     &lt;Monday temp="Hi 48"&gt; Partly Cloudly &lt;/Monday&gt;
   *     &lt;Tuesday temp="Hi 60"&gt; Showers Likely &lt;/Tuesday&gt;
@@ -57,9 +57,13 @@
   *       &lt;text <em>datapath="@temp"</em>/&gt;
   *     &lt;/view&gt;
   *   &lt;/view&gt;
-  * &lt;/canvas&gt;
-  * </programlisting></example>
+  * &lt;/canvas&gt;</programlisting></example>
   *
+  * @usage <programlisting>&lt;view&gt;
+  *   &lt;datapath xpath="<em>xpath</em>" sortorder="ascending"/&gt;
+  * &lt;/view&gt;</programlisting>
+  * <programlisting>&lt;view datapath="<em>xpath</em>" /&gt;</programlisting>
+  *
   * @shortdesc The binder between data and nodes.
   * @lzxname datapath
   * @initarg Boolean datacontrolsvisibility

Modified: openlaszlo/branches/legals/WEB-INF/lps/lfc/data/LzDatapointer.lzs
===================================================================
--- openlaszlo/branches/legals/WEB-INF/lps/lfc/data/LzDatapointer.lzs	2007-03-01 00:13:01 UTC (rev 3986)
+++ openlaszlo/branches/legals/WEB-INF/lps/lfc/data/LzDatapointer.lzs	2007-03-01 00:35:13 UTC (rev 3987)
@@ -31,8 +31,8 @@
   * <p>The example below demonstrates the use of some of the
   * features of datapaths to retrieve data from a dataset.</p>
   * 
-  * <example><title>Using a datapointer to retrieve data from a dataset</title><programlisting>
-  * &lt;canvas height="80"&gt;
+  * <example title="Using a datapointer to retrieve data from a dataset">
+  * <programlisting>&lt;canvas height="80"&gt;
   *   &lt;simplelayout spacing="5"/&gt;
   *   &lt;dataset name="mydata"&gt;
   *     &lt;record&gt; This is some text 
@@ -68,8 +68,7 @@
   *   &lt;/view&gt;
   * 
   *   &lt;text name="output" width="200"&gt;Data will appear here.&lt;/text&gt;
-  * &lt;/canvas&gt;
-  * </programlisting></example>
+  * &lt;/canvas&gt;</programlisting></example>
   *
   * @shortdesc A cursor in a dataset.
   * @lzxname datapointer

Modified: openlaszlo/branches/legals/WEB-INF/lps/lfc/data/LzDataset.lzs
===================================================================
--- openlaszlo/branches/legals/WEB-INF/lps/lfc/data/LzDataset.lzs	2007-03-01 00:13:01 UTC (rev 3986)
+++ openlaszlo/branches/legals/WEB-INF/lps/lfc/data/LzDataset.lzs	2007-03-01 00:35:13 UTC (rev 3987)
@@ -50,9 +50,8 @@
   * <p>
   * The example below makes a request of the cgi script on Laszlo's website that serves up weather information in xml form.</p>
   * 
-  * <example><title>Making a request using a dataset</title>
-  * <programlisting>
-  * &lt;canvas height="250" width="800" debug="true"&gt;
+  * <example title="Making a request using a dataset">
+  * <programlisting>&lt;canvas height="250" width="800" debug="true"&gt;
   *  &lt;debug y="100"/&gt; 
   *  &lt;dataset type="http" name="weatherdata"
   *           src="http://www.laszlosystems.com/cgi-pub/weather.cgi"/&gt; 
@@ -76,8 +75,7 @@
   *     &lt;/datapointer&gt;
   *     &lt;simplelayout axis="x"/&gt;
   *   &lt;/view&gt;
-  * &lt;/canvas&gt; 
-  * </programlisting></example>
+  * &lt;/canvas&gt;</programlisting></example>
   *
   * @shortdesc An in-memory xml-style data hierarchy.
   * @lzxname dataset

Modified: openlaszlo/branches/legals/WEB-INF/lps/lfc/services/LzKeys.as
===================================================================
--- openlaszlo/branches/legals/WEB-INF/lps/lfc/services/LzKeys.as	2007-03-01 00:13:01 UTC (rev 3986)
+++ openlaszlo/branches/legals/WEB-INF/lps/lfc/services/LzKeys.as	2007-03-01 00:35:13 UTC (rev 3987)
@@ -15,8 +15,8 @@
   * 
   * <p>Here is a simple example:</p>
   * 
-  * <example><title>LzKeys</title><programlisting>
-  * &lt;canvas height="140" debug="true"&gt;
+  * <example title="LzKeys">
+  * <programlisting>&lt;canvas height="140" debug="true"&gt;
   *   &lt;handler name="onkeydown" reference="LzKeys" args="k"&gt;
   *     Debug.write("key " + k + " down");
   *   &lt;/handler&gt;
@@ -30,8 +30,7 @@
   *     del = new LzDelegate(this, "pressA");
   *     LzKeys.callOnKeyCombo(del, ["A"]);
   *   &lt;/handler&gt; 
-  * &lt;/canvas&gt;
-  * </programlisting></example>
+  * &lt;/canvas&gt;</programlisting></example>
   *
   * @shortdesc Keyboard input service.
   */

Modified: openlaszlo/branches/legals/WEB-INF/lps/lfc/views/LzInputText.lzs
===================================================================
--- openlaszlo/branches/legals/WEB-INF/lps/lfc/views/LzInputText.lzs	2007-03-01 00:13:01 UTC (rev 3986)
+++ openlaszlo/branches/legals/WEB-INF/lps/lfc/views/LzInputText.lzs	2007-03-01 00:35:13 UTC (rev 3987)
@@ -26,7 +26,7 @@
   * type="text"&gt;</code> tag.  In this use, long lines of text are
   * clipped according to the <attribute>width</attribute> attribute.</p>
   * 
-  * <example><title>Simple inputtext</title><programlisting>&lt;canvas height="20"&gt;
+  * <example title="Simple inputtext"><programlisting>&lt;canvas height="20"&gt;
   *   &lt;inputtext width="150"&gt;This text is editable.&lt;/inputtext&gt;
   * &lt;/canvas&gt;</programlisting></example>
   * 
@@ -38,7 +38,7 @@
   * the length of the <attribute>width</attribute> attribute, and the user
   * can press Enter to create multiple lines of input.</p>
   * 
-  * <example><title>Simple inputtext</title><programlisting>&lt;canvas height="20"&gt;
+  * <example title="Simple inputtext"><programlisting>&lt;canvas height="20"&gt;
   *   &lt;inputtext width="150" multiline="true"&gt;This text is editable.&lt;/inputtext&gt;
   * &lt;/canvas&gt;</programlisting></example>
   * 
@@ -49,7 +49,7 @@
   * tag.  Input characters are displayed as the asterisk
   * ('<code>*</code>') character.</p>
   * 
-  * <example><title>Password inputtext</title><programlisting>&lt;canvas height="20"&gt;
+  * <example title="Password inputtext"><programlisting>&lt;canvas height="20"&gt;
   *   &lt;inputtext width="100" password="true"&gt;password.&lt;/inputtext&gt;
   * &lt;/canvas&gt;</programlisting></example>
   * 
@@ -82,7 +82,7 @@
   * <tagname>inputtext</tagname> tags within a class definition, as in the
   * second example below.</p>
   * 
-  * <example><title>Optimized inputtext</title><programlisting>
+  * <example title="Optimized inputtext"><programlisting>
   * &lt;canvas height="20"&gt;
   *   &lt;inputtext resizable="false" width="150" height="20"&gt;
   *     This text is editable.
@@ -90,7 +90,7 @@
   * &lt;/canvas&gt;
   * </programlisting></example>
   * 
-  * <example><title>Component with optimized inputtext</title><programlisting>
+  * <example title="Component with optimized inputtext"><programlisting>
   * &lt;canvas height="20"&gt;
   *   &lt;class name="mytext" width="150" height="20" bgcolor="gray"&gt;
   *     &lt;attribute name="text" type="text"/&gt;

Modified: openlaszlo/branches/legals/WEB-INF/lps/server/src/org/openlaszlo/js2doc/ReprocessComments.java
===================================================================
--- openlaszlo/branches/legals/WEB-INF/lps/server/src/org/openlaszlo/js2doc/ReprocessComments.java	2007-03-01 00:13:01 UTC (rev 3986)
+++ openlaszlo/branches/legals/WEB-INF/lps/server/src/org/openlaszlo/js2doc/ReprocessComments.java	2007-03-01 00:35:13 UTC (rev 3987)
@@ -114,6 +114,9 @@
                 } else {
                     logger.warning("Invalid @access keyword: '" + keyword + "'");
                 }
+            } else if (fieldName.equals("runtimes")) {
+              node.setAttribute("runtimes", fieldValue);
+              return true;
             }
             return false;
         }

Modified: openlaszlo/branches/legals/docs/src/xsl/common-html.xsl
===================================================================
--- openlaszlo/branches/legals/docs/src/xsl/common-html.xsl	2007-03-01 00:13:01 UTC (rev 3986)
+++ openlaszlo/branches/legals/docs/src/xsl/common-html.xsl	2007-03-01 00:35:13 UTC (rev 3987)
@@ -23,8 +23,11 @@
   <xsl:param name="show.fixmes" select="0"/>
   
   <xsl:template name="user.head.content">
-    <script type="text/javascript" language="JavaScript" src="{$lpsdir}lps/includes/embed.js"/>
+    <script type="text/javascript" language="JavaScript" src="{$lpsdir}lps/includes/embed-compressed.js"/>
     <script type="text/javascript" language="JavaScript" src="{$lpsdir}docs/includes/docs.js"/>
+<?ignore
+    <script type="text/javascript" language="JavaScript"><xsl:text>Lz.dhtmlEmbedLFC('</xsl:text><xsl:value-of select="$lpsdir"/><xsl:text>/lps/includes/lfc/LFCdhtml.js');</xsl:text></script>
+?>
   </xsl:template>
   
   <xsl:template name="body.attributes">
@@ -139,11 +142,11 @@
   <xsl:param name="language">
     <xsl:choose>
       <xsl:when test="@language and not(@language='')">
-	    <xsl:value-of select="@language"/>
+        <xsl:value-of select="@language"/>
       </xsl:when>
       <xsl:otherwise>
         <xsl:message><xsl:value-of select="concat('defaulting synopsis language for ', name(.), ' to: ', $default-classsynopsis-language)"/></xsl:message>
-	    <xsl:value-of select="$default-classsynopsis-language"/>
+        <xsl:value-of select="$default-classsynopsis-language"/>
       </xsl:otherwise>
     </xsl:choose>
   </xsl:param>

Modified: openlaszlo/branches/legals/docs/src/xsl/doc2dbk.xsl
===================================================================
--- openlaszlo/branches/legals/docs/src/xsl/doc2dbk.xsl	2007-03-01 00:13:01 UTC (rev 3986)
+++ openlaszlo/branches/legals/docs/src/xsl/doc2dbk.xsl	2007-03-01 00:35:13 UTC (rev 3987)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <!-- * X_LZ_COPYRIGHT_BEGIN ***************************************************
-* Copyright 2001-2004 Laszlo Systems, Inc.  All Rights Reserved.              *
+* Copyright 2001-2007 Laszlo Systems, Inc.  All Rights Reserved.              *
 * Use is subject to license terms.                                            *
 * X_LZ_COPYRIGHT_END ****************************************************** -->
 <!--
@@ -24,7 +24,7 @@
                 xmlns:d="docbook"
                 xmlns:h="http://www.w3.org/1999/xhtml"
                 extension-element-prefixes="my-ext xalanredirect"
-                exclude-result-prefixes="d dyn exslt h my-ext xalan"
+                exclude-result-prefixes="d dyn exslt h xalan"
                 version="1.0">
   
   <xsl:import href="html2dbk.xsl"/>
@@ -318,27 +318,38 @@
   <!--
     live examples
   -->
-  <!-- This breaks new ant 1.6.5 build system. -bshine 6.22.06  
-  <xalan:component prefix="my-ext" functions="lower getCanvasAttribute">
-    <xalan:script lang="javascript"><![CDATA[
-      function lower(s) {
-        return s.toLowerCase();
-      }
-      function getCanvasAttribute(s, aname, defaultValue) {
-        var i = s.indexOf('>');
-        if (i > 0) s = s.substring(0, i);
-        var m = s.match(new RegExp(aname + '=[\'"]([^\'"]*)[\'"]', 'gm'));
-        if (m) {
-          return m[0];
-        }
-        return defaultValue;
-      }
-    ]]></xalan:script>
-  </xalan:component>
-  --> 
   
+  <xsl:template name="get-canvas-attribute">
+    <xsl:param name="text"/>
+    <xsl:param name="attribute"/>
+    <xsl:param name="default"/>
+    
+    <xsl:variable name="snip1" select="substring-after($text,'&lt;canvas')"/>
+    <xsl:variable name="snip2">
+      <xsl:if test="$snip1 and $snip1 != ''">
+        <xsl:value-of select="substring-before($snip1,'&gt;')"/>
+      </xsl:if>
+    </xsl:variable>
+    <xsl:variable name="snip3">
+      <xsl:if test="$snip2 and $snip2 != ''">
+        <xsl:value-of select="substring-after($snip2, concat($attribute,'=&#34;'))"/>
+      </xsl:if>
+    </xsl:variable>
+    <xsl:variable name="snip4">
+      <xsl:if test="$snip3 and $snip3 != ''">
+        <xsl:value-of select="substring-before($snip3,'&#34;')"/>
+      </xsl:if>
+    </xsl:variable>
+    <xsl:choose>
+      <xsl:when test="$snip4 and $snip4 != ''">
+        <xsl:value-of select="$snip4"/>
+      </xsl:when>
+      <xsl:otherwise><xsl:value-of select="$default"/></xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+  
   <xsl:template match="h:example">
-    <xsl:param name="fname">
+    <xsl:variable name="fname">
       <xsl:choose>
         <xsl:when test="@extract='false'"/>
         <xsl:when test="@filename">
@@ -353,16 +364,16 @@
           <xsl:message terminate="yes">The root element of this document requires an id attribute.</xsl:message>
         </xsl:otherwise>
       </xsl:choose>
-    </xsl:param>
+    </xsl:variable>
     
-    <xsl:param name="executable" select="(not(@executable) or @executable='true') and (not(@extract) or @extract='true')"/>
+    <xsl:variable name="executable" select="(not(@executable) or @executable='true') and (not(@extract) or @extract='true')"/>
     
-    <xsl:param name="exampleclass">
+    <xsl:variable name="exampleclass">
       <xsl:if test="@title">example</xsl:if>
       <xsl:if test="not(@title)">informalexample</xsl:if>
-    </xsl:param>
+    </xsl:variable>
     
-    <xsl:param name="text">
+    <xsl:variable name="text">
       <xsl:if test="@class='fragment'">
         <xsl:text>&lt;canvas&gt;</xsl:text>
       </xsl:if>
@@ -373,14 +384,30 @@
       <xsl:if test="@class='fragment'">
         <xsl:text>&lt;/canvas&gt;</xsl:text>
       </xsl:if>
-    </xsl:param>
+    </xsl:variable>
     
-    <xsl:param name="query-parameters">
+    <xsl:variable name="query-parameters">
       <xsl:if test="@query-parameters">&amp;<xsl:value-of select="@query-parameters"></xsl:value-of></xsl:if>
-    </xsl:param>
+    </xsl:variable>
+
+    <xsl:variable name="canvas-width">
+      <xsl:call-template name="get-canvas-attribute">
+        <xsl:with-param name="text" select="string($text)"/>
+        <xsl:with-param name="attribute" select="'width'"/>
+        <xsl:with-param name="default" select="'500'"/>
+      </xsl:call-template>
+    </xsl:variable>
     
-    <xsl:param name="js-embed-params">{url: '<xsl:value-of select="concat($lzxdir, $fname, '?lzt=swf', $query-parameters)"/>', width: 500, height: 400}</xsl:param>
+    <xsl:variable name="canvas-height">
+      <xsl:call-template name="get-canvas-attribute">
+        <xsl:with-param name="text" select="string($text)"/>
+        <xsl:with-param name="attribute" select="'height'"/>
+        <xsl:with-param name="default" select="'400'"/>
+      </xsl:call-template>
+    </xsl:variable>
     
+    <xsl:variable name="js-embed-params">{url: '<xsl:value-of select="concat($lzxdir, $fname, '?lzt=swf', $query-parameters)"/>', width: toString(<xsl:copy-of select="$canvas-width"/>), height: toString(<xsl:copy-of select="$canvas-height"/>)}</xsl:variable>
+    
     <xsl:element name="{$exampleclass}">
       <xsl:attribute name="role">live-example</xsl:attribute>
       <xsl:if test="@id">
@@ -393,11 +420,11 @@
         <xsl:processing-instruction name="lzx-embed">
           <xsl:choose>
             <xsl:when test="$requestType='js'">
-              lzEmbed(<xsl:value-of select="$js-embed-params"/>);
+              Lz.swfEmbed(<xsl:value-of select="$js-embed-params"/>);
             </xsl:when>
             <xsl:otherwise>
               if (lzShowInlineExamples()) {
-                lzEmbed(<xsl:value-of select="$js-embed-params"/>);
+                Lz.swfEmbed(<xsl:value-of select="$js-embed-params"/>);
               } else {
                 document.write('&lt;button onclick="lzSetShowInlineExamples(true)"&gt;Show Examples&lt;/button&gt;');
               }

Modified: openlaszlo/branches/legals/docs/src/xsl/format.xsl
===================================================================
--- openlaszlo/branches/legals/docs/src/xsl/format.xsl	2007-03-01 00:13:01 UTC (rev 3986)
+++ openlaszlo/branches/legals/docs/src/xsl/format.xsl	2007-03-01 00:35:13 UTC (rev 3987)
@@ -105,7 +105,7 @@
   <xsl:template match="/xhtml:html/xhtml:head">
     <xsl:element name="{local-name()}">
       <xsl:apply-templates select="@*"/>
-      <script type="text/javascript" language="JavaScript" src="{$lpsdir}lps/includes/embed.js"/>&cr;
+      <script type="text/javascript" language="JavaScript" src="{$lpsdir}lps/includes/embed-compressed.js"/>&cr;
       <script type="text/javascript" language="JavaScript" src="{$lpsdir}docs/includes/docs.js"/>&cr;
       <xsl:if test="not(link[@rel='STYLESHEET']) and not(xhtml:link[@rel='STYLESHEET'])">
         <link rel="STYLESHEET" type="text/css" href="{$lpsdir}docs/includes/styles.css"/>
@@ -472,6 +472,35 @@
     Inline examples
   -->
   
+  <xsl:template name="get-canvas-attribute">
+    <xsl:param name="text"/>
+    <xsl:param name="attribute"/>
+    <xsl:param name="default"/>
+    
+    <xsl:variable name="snip1" select="substring-after($text,'&lt;canvas')"/>
+    <xsl:variable name="snip2">
+      <xsl:if test="$snip1 and $snip1 != ''">
+        <xsl:value-of select="substring-before($snip1,'&gt;')"/>
+      </xsl:if>
+    </xsl:variable>
+    <xsl:variable name="snip3">
+      <xsl:if test="$snip2 and $snip2 != ''">
+        <xsl:value-of select="substring-after($snip2, concat($attribute,'=&#34;'))"/>
+      </xsl:if>
+    </xsl:variable>
+    <xsl:variable name="snip4">
+      <xsl:if test="$snip3 and $snip3 != ''">
+        <xsl:value-of select="substring-before($snip3,'&#34;')"/>
+      </xsl:if>
+    </xsl:variable>
+    <xsl:choose>
+      <xsl:when test="$snip4 and $snip4 != ''">
+        <xsl:value-of select="$snip4"/>
+      </xsl:when>
+      <xsl:otherwise><xsl:value-of select="$default"/></xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+  
   <xsl:template mode="title" match="xhtml:example">
     <xsl:choose>
       <xsl:when test="@title">
@@ -522,9 +551,25 @@
       </xsl:if>
     </xsl:param>
     
+    <xsl:variable name="canvas-width">
+      <xsl:call-template name="get-canvas-attribute">
+        <xsl:with-param name="text" select="string($text)"/>
+        <xsl:with-param name="attribute" select="'width'"/>
+        <xsl:with-param name="default" select="'497'"/>
+      </xsl:call-template>
+    </xsl:variable>
+    
+    <xsl:variable name="canvas-height">
+      <xsl:call-template name="get-canvas-attribute">
+        <xsl:with-param name="text" select="string($text)"/>
+        <xsl:with-param name="attribute" select="'height'"/>
+        <xsl:with-param name="default" select="'403'"/>
+      </xsl:call-template>
+    </xsl:variable>
+    
     <xsl:param name="query-parameters"><xsl:if test="@query-parameters">&amp;<xsl:value-of select="@query-parameters"></xsl:value-of></xsl:if></xsl:param>
     
-    <xsl:param name="js-embed-params">{url: '<xsl:value-of select="concat($lzxdir, $fname, '?lzt=swf', $query-parameters)"/>', width: 497, height: 403 }</xsl:param>
+    <xsl:param name="js-embed-params">{url: '<xsl:value-of select="concat($lzxdir, $fname, '?lzt=swf', $query-parameters)"/>', width: toString(<xsl:copy-of select="$canvas-width"/>), height: toString(<xsl:copy-of select="$canvas-height"/>) }</xsl:param>
     
     <div class="liveExample">
       <a name="{generate-id(.)}"/>
@@ -541,11 +586,11 @@
           <script type="text/javascript" language="JavaScript">
             <xsl:choose>
               <xsl:when test="$requestType='js'">
-                lzEmbed(<xsl:value-of select="$js-embed-params"/>);
+                Lz.swfEmbed(<xsl:value-of select="$js-embed-params"/>);
               </xsl:when>
               <xsl:otherwise>
                 if (lzShowInlineExamples()) {
-                  lzEmbed(<xsl:value-of select="$js-embed-params"/>);
+                  Lz.swfEmbed(<xsl:value-of select="$js-embed-params"/>);
                 } else {
                   document.write('&lt;button onclick="lzSetShowInlineExamples(true)"&gt;Show Examples&lt;/button&gt;');
                 }

Modified: openlaszlo/branches/legals/docs/src/xsl/js2doc-comment2dbk.xsl
===================================================================
--- openlaszlo/branches/legals/docs/src/xsl/js2doc-comment2dbk.xsl	2007-03-01 00:13:01 UTC (rev 3986)
+++ openlaszlo/branches/legals/docs/src/xsl/js2doc-comment2dbk.xsl	2007-03-01 00:35:13 UTC (rev 3987)
@@ -253,9 +253,38 @@
     </programlisting>
   </xsl:template>
   
+  <xsl:template name="get-canvas-attribute">
+    <xsl:param name="text"/>
+    <xsl:param name="attribute"/>
+    <xsl:param name="default"/>
+    
+    <xsl:variable name="snip1" select="substring-after($text,'&lt;canvas')"/>
+    <xsl:variable name="snip2">
+      <xsl:if test="$snip1 and $snip1 != ''">
+        <xsl:value-of select="substring-before($snip1,'&gt;')"/>
+      </xsl:if>
+    </xsl:variable>
+    <xsl:variable name="snip3">
+      <xsl:if test="$snip2 and $snip2 != ''">
+        <xsl:value-of select="substring-after($snip2, concat($attribute,'=&#34;'))"/>
+      </xsl:if>
+    </xsl:variable>
+    <xsl:variable name="snip4">
+      <xsl:if test="$snip3 and $snip3 != ''">
+        <xsl:value-of select="substring-before($snip3,'&#34;')"/>
+      </xsl:if>
+    </xsl:variable>
+    <xsl:choose>
+      <xsl:when test="$snip4 and $snip4 != ''">
+        <xsl:value-of select="$snip4"/>
+      </xsl:when>
+      <xsl:otherwise><xsl:value-of select="$default"/></xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+  
   <xsl:template match="example" mode="html2dbk">
 
-    <xsl:param name="fname">
+    <xsl:variable name="fname">
       <xsl:choose>
         <xsl:when test="@extract='false'"/>
         <xsl:when test="@filename">
@@ -270,16 +299,19 @@
           <xsl:message terminate="yes">The root element of this document requires an id attribute.</xsl:message>
         </xsl:otherwise>
       </xsl:choose>
-    </xsl:param>
+    </xsl:variable>
     
-    <xsl:param name="executable" select="(not(@executable) or @executable='true') and (not(@extract) or @extract='true')"/>
+    <xsl:variable name="executable" select="(not(@executable) or @executable='true') and (not(@extract) or @extract='true')"/>
     
-    <xsl:param name="exampleclass">
+    <xsl:variable name="exampleclass">
       <xsl:if test="@title">example</xsl:if>
       <xsl:if test="not(@title)">informalexample</xsl:if>
-    </xsl:param>
+    </xsl:variable>
 
-    <xsl:param name="text">
+    <xsl:variable name="textnode">
+    </xsl:variable>
+    
+    <xsl:variable name="text">
       <xsl:if test="@class='fragment'">
         <xsl:text>&lt;canvas&gt;</xsl:text>
       </xsl:if>
@@ -290,14 +322,30 @@
       <xsl:if test="@class='fragment'">
         <xsl:text>&lt;/canvas&gt;</xsl:text>
       </xsl:if>
-    </xsl:param>
+    </xsl:variable>
     
-    <xsl:param name="query-parameters">
+    <xsl:variable name="query-parameters">
       <xsl:if test="@query-parameters">&amp;<xsl:value-of select="@query-parameters"></xsl:value-of></xsl:if>
-    </xsl:param>
+    </xsl:variable>
 
-    <xsl:param name="js-embed-params">{url: '<xsl:value-of select="concat($lzxdir, $fname, '?lzt=swf', $query-parameters)"/>', width: 500, height: 400}</xsl:param>
+    <xsl:variable name="canvas-width">
+      <xsl:call-template name="get-canvas-attribute">
+        <xsl:with-param name="text" select="string($text)"/>
+        <xsl:with-param name="attribute" select="'width'"/>
+        <xsl:with-param name="default" select="'500'"/>
+      </xsl:call-template>
+    </xsl:variable>
     
+    <xsl:variable name="canvas-height">
+      <xsl:call-template name="get-canvas-attribute">
+        <xsl:with-param name="text" select="string($text)"/>
+        <xsl:with-param name="attribute" select="'height'"/>
+        <xsl:with-param name="default" select="'400'"/>
+      </xsl:call-template>
+    </xsl:variable>
+    
+    <xsl:variable name="js-embed-params">{url: '<xsl:value-of select="concat($lzxdir, $fname, '?lzt=swf', $query-parameters)"/>', width: toString(<xsl:copy-of select="$canvas-width"/>), height: toString(<xsl:copy-of select="$canvas-height"/>)}</xsl:variable>
+    
     <xsl:element name="{$exampleclass}">
       <xsl:attribute name="role">live-example</xsl:attribute>
       <xsl:if test="@id">
@@ -312,11 +360,11 @@
         <xsl:processing-instruction name="lzx-embed">
           <xsl:choose>
             <xsl:when test="$requestType='js'">
-              lzEmbed(<xsl:value-of select="$js-embed-params"/>);
+              Lz.swfEmbed(<xsl:value-of select="$js-embed-params"/>);
             </xsl:when>
             <xsl:otherwise>
               if (lzShowInlineExamples()) {
-                lzEmbed(<xsl:value-of select="$js-embed-params"/>);
+                Lz.swfEmbed(<xsl:value-of select="$js-embed-params"/>);
               } else {
                 document.write('&lt;button onclick="lzSetShowInlineExamples(true)"&gt;Show Examples&lt;/button&gt;');
               }

Modified: openlaszlo/branches/legals/docs/src/xsl/js2doc2dbk.xsl
===================================================================
--- openlaszlo/branches/legals/docs/src/xsl/js2doc2dbk.xsl	2007-03-01 00:13:01 UTC (rev 3986)
+++ openlaszlo/branches/legals/docs/src/xsl/js2doc2dbk.xsl	2007-03-01 00:35:13 UTC (rev 3987)
@@ -185,6 +185,11 @@
     <!-- DESCRIPTION -->
     
     <xsl:template name="declaration-description">
+      <xsl:if test="doc/tag[@name='usage']/text">
+        <refsect1><title>Usage</title>
+          <xsl:apply-templates select="doc/tag[@name='usage']/text" mode="doc2dbk"/>
+        </refsect1>
+      </xsl:if>
       <xsl:if test="doc/text">
         <refsect1><title>Description</title>
           <xsl:apply-templates select="doc/text" mode="doc2dbk"/>

Deleted: openlaszlo/branches/legals/docs/src/xsl/make-php.xsl

Modified: openlaszlo/branches/legals/lps/components/debugger/library.lzx
===================================================================
--- openlaszlo/branches/legals/lps/components/debugger/library.lzx	2007-03-01 00:13:01 UTC (rev 3986)
+++ openlaszlo/branches/legals/lps/components/debugger/library.lzx	2007-03-01 00:35:13 UTC (rev 3987)
@@ -5,7 +5,9 @@
 <library>
   <switch>
     <when runtime="dhtml">
-      <!-- dummy class -->
+      <!--- dummy class for DHTML
+            @access private
+            @runtimes dhtml -->
       <class name="LzDebugWindow" />
     </when>
     <otherwise>

Modified: openlaszlo/branches/legals/lps/components/extensions/html.lzx
===================================================================
--- openlaszlo/branches/legals/lps/components/extensions/html.lzx	2007-03-01 00:13:01 UTC (rev 3986)
+++ openlaszlo/branches/legals/lps/components/extensions/html.lzx	2007-03-01 00:35:13 UTC (rev 3987)
@@ -7,6 +7,8 @@
 <library>
   <switch>
     <when runtime="dhtml">
+        <!--- @access public
+              @runtimes dhtml -->
         <class name="html" extends="view">
             <method event="onx" args="x">
                 if (this._i) this._i.style.left = x + 'px';



More information about the Laszlo-checkins mailing list