Change 20071220-ben-8 by [EMAIL PROTECTED] on 2007-12-20 12:42:09 PST
in /Users/ben/src/svn/openlaszlo/trunk
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: Make example canvases get their height from the example code
New Features:
Bugs Fixed: LPP-5207 (really, this time) change height of example
code window from 200 to 400 pixels
Technical Reviewer: iorio (pending)
QA Reviewer: brynn (pending)
Documentation:
Two crucial changes here! First, our build file was set up wrong when it
generated the intermediate developers/index.dbk. It has to put this
file into
docs/src/build/developers/index.dbk; it used to put it into
docs/developers/index.dbk -- effectively losing all the delicious
processing that
had been done to it by the dbkpreprocessexamles.xsl worksheet. That
delicious
processing includes a step that determines the canvas width and
height from the
program listing itself.
Second! The part of common-html.xsl that actually sends canvas
parameters to
Lz.swfEmbed(...) was only sending the first canvas parameter it
found! This
code...
<xsl:variable name="canvas-parameters">
<xsl:if
test="[EMAIL PROTECTED]'canvas']">
<xsl:value-of select="[EMAIL PROTECTED]'canvas']"/>
</xsl:if> ...
</xsl:variable>
...actually only puts the first answer to the xpath query
[EMAIL PROTECTED]'canvas'] into the variable $canvas-parameters. This
is an xsl
subtlety that I don't understand, but it has something to do with how
node-sets
are coerced into strings when their value is taken. To fix this, I
have added a
for-each which explicitly concatenates the value of each canvas
parameter, with a
comma between them. This (thank goodness) inserts the correct canvas
width and
height parameters into the call to Lz.swfEmbed.
Tests:
Note the canvas height for example 34.1, basecomponent, is 260 pixels,
as specified in the program listing:
http://localhost:8080/trunk/docs/developers/custom-components.html
Note that the canvas height of the first two examples is 30 pixels,
as specified in the program listing:
http://localhost:8080/trunk/docs/reference/lz.button.html
Files:
M docs/src/build.xml
M docs/src/xsl/common-html.xsl
Changeset: http://svn.openlaszlo.org/openlaszlo/patches/20071220-
ben-8.tar