Author: ben
Date: 2007-11-13 19:34:59 -0800 (Tue, 13 Nov 2007)
New Revision: 7254

Modified:
   openlaszlo/trunk/docs/src/xsl/common-html.xsl
Log:
Change 20071113-ben-1 by [EMAIL PROTECTED] on 2007-11-13 19:22:03 PST
    in /Users/ben/src/svn/openlaszlo/trunk
    for http://svn.openlaszlo.org/openlaszlo/trunk

Summary: Fix live examples' editors links in developers/tutorials

Bugs Fixed: LPP-4943 edit button in tutorials doesn't work
  LPP-5099 devguide: embedded examples are broken (partial) 

Technical Reviewer: none
Doc Reviewer: lou

Documentation:
The pesky tutorials live one directory deeper into the docs 
hierarchy than do the rest of the developers chapters. This change
makes relative paths to related resources (like the editor.jsp)
have an extra ../ at the beginning, to find stuff in this 
structure. 

Tests:
http://localhost:8080/trunk/docs/developers/tutorials/comp-intro.html
and 
http://localhost:8080/trunk/docs/developers/tutorials/scripting-tutorial.html
Notice that the "edit" buttons are rendered nicely, not just text. 
Click the "edit" button after a live example in each chapter. 
Notice that it opens up the editor.jsp in a new tab, with the correct 
source loaded into the editor. 



Modified: openlaszlo/trunk/docs/src/xsl/common-html.xsl
===================================================================
--- openlaszlo/trunk/docs/src/xsl/common-html.xsl       2007-11-14 03:30:46 UTC 
(rev 7253)
+++ openlaszlo/trunk/docs/src/xsl/common-html.xsl       2007-11-14 03:34:59 UTC 
(rev 7254)
@@ -45,7 +45,7 @@
   
   <xsl:param name="warn.no.programlisting.canvas.width" select="false()"/>
   
-  <xsl:param name="show.examples.debuginfo" select="false()" />
+  <xsl:param name="show.examples.debuginfo" select="true()" />
   
   <xsl:template name="base.book.name">
     <xsl:choose>
@@ -72,6 +72,13 @@
     <xsl:value-of select="number(2)"/>  
   </xsl:variable>
   
+  <xsl:template name="relative.path.to.lpshome">      
+      <xsl:choose>
+          <xsl:when test="contains(ancestor::part/@id, 
'developers.tutorials')">../../../</xsl:when>
+          <xsl:otherwise>../../</xsl:otherwise>
+      </xsl:choose>
+  </xsl:template>
+  
   <xsl:variable name="relative.path.to.lpshome">
     <xsl:call-template name="copy-string">
       <xsl:with-param name="string" select="'../'"/>
@@ -232,7 +239,7 @@
     <xsl:if test="$live">
       
       <xsl:variable name="edit-href">
-        <xsl:value-of select="$relative.path.to.lpshome"/>
+        <xsl:call-template name="relative.path.to.lpshome" />
         <xsl:text>laszlo-explorer/editor.jsp?src=docs/</xsl:text>         
         <xsl:call-template name="base.book.name"/>
         <xsl:text>/</xsl:text>
@@ -242,7 +249,7 @@
         <!-- TODO [bshine 10.19.2007]
           If we're in the top-level directory, we only need to go ../includes 
to get to the edit button.
           If we're in something/tutorial then we need to go up ../../includes 
-->
-        <xsl:value-of select="$relative.path.to.lpshome"/>
+        <xsl:call-template name="relative.path.to.lpshome"/>
         <xsl:text>docs/includes/d_t_editbutton.gif</xsl:text>
       </xsl:variable>
       <xsl:text>&#x0a;</xsl:text>
@@ -259,7 +266,7 @@
           fname: <xsl:value-of select="$fname"/>
           base.book.name: <xsl:call-template name="base.book.name"  />
           root.relative: <xsl:value-of select="$root.relative"/>
-          relative.path.to.lpshome: <xsl:value-of 
select="$relative.path.to.lpshome"/>
+          relative.path.to.lpshome: <xsl:call-template 
name="relative.path.to.lpshome"/>
         </pre> 
       </xsl:if>
     </xsl:if>


_______________________________________________
Laszlo-checkins mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-checkins

Reply via email to