[Laszlo-checkins] r12632 - in openlaszlo/trunk: docs/src/nav lps/components/lz
bargull@openlaszlo.org
bargull at openlaszlo.org
Sat Jan 24 08:21:55 PST 2009
Author: bargull
Date: 2009-01-24 08:21:52 -0800 (Sat, 24 Jan 2009)
New Revision: 12632
Modified:
openlaszlo/trunk/docs/src/nav/nav.lzx
openlaszlo/trunk/lps/components/lz/tree.lzx
Log:
Change 20090124-bargull-lMn by bargull at dell--p4--2-53 on 2009-01-24 12:39:39
in /home/Admin/src/svn/openlaszlo/trunk
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: swf9 fixes for reference-nav
New Features:
Bugs Fixed: LPP-7674
Technical Reviewer: hqm
QA Reviewer: ptw
Doc Reviewer: (pending)
Documentation:
Release Notes:
Details:
swf9 didn't work because of several bugs:
- "fgcolor"-constraint in nav.lzx got nullptr-exception ("classroot.style" was null)
- two calls to lz.basetree#changeFocus with incorrect number of arguments
- and in tree.lzx another bad constraint, this time on "bgcolor" (the same nullptr-exception when accessing classroot.style)
Also changed the "text"-setter for the linktext on "Tags" to escape properly.
For performance improvements:
- the tree will now be created lazily
- the content of the "Classes" and "Tags" tabpanes is now replicated with lazy replication
Tests:
Modified: openlaszlo/trunk/docs/src/nav/nav.lzx
===================================================================
--- openlaszlo/trunk/docs/src/nav/nav.lzx 2009-01-24 11:50:48 UTC (rev 12631)
+++ openlaszlo/trunk/docs/src/nav/nav.lzx 2009-01-24 16:21:52 UTC (rev 12632)
@@ -13,6 +13,7 @@
onmouseover="setAttribute('fgcolor', 'blue')"
onmouseout="setAttribute('fgcolor', 'black')"
onclick="lz.Browser.loadURL(this.datapath.xpathQuery('@href'), canvas.target)"/>
+
<class name="wheelscrollbar" extends="scrollbar" mousewheelactive="true">
<handler name="onmousewheeldelta" reference="lz.Keys" method="mousewheelUpdate"/>
</class>
@@ -30,10 +31,14 @@
: ( classroot.focused
? classroot.style['texthilitecolor']
: classroot.style['textcolor'] ))"
- fgcolor="${ classroot.selected ? 'blue'
- : ( classroot.focused
- ? classroot.style['texthilitecolor']
- : classroot.style['textcolor'] ) }">
+ fgcolor="${classroot.selected
+ ? 'blue'
+ : (classroot.style
+ ? (classroot.focused
+ ? classroot.style['texthilitecolor']
+ : classroot.style['textcolor'])
+ : 'black')}"
+ >
<handler name="onclick">
lz.Browser.loadURL(classroot.datapath.xpathQuery('@href'), canvas.target);
classroot.setAttribute('selected', true);
@@ -75,7 +80,7 @@
var sleaf = cleaf;
var canwrap = true;
if (this.lastfound) {
- this.lastfound.setAttribute( 'fgcolor', 'black' );
+ this.lastfound.setAttribute( 'fgcolor', lz.colors.black );
this.lastfound = null;
}
while( !this.lastfound &&
@@ -88,9 +93,9 @@
if ( curr.text.toLowerCase().indexOf( tok ) > -1 ){
//found one!
cgs.setAttribute( "open", true );
- cgs.changeFocus();
- curr.setAttribute( "fgcolor", 'blue' );
- curr.changeFocus( );
+ cgs.changeFocus(null);
+ curr.setAttribute( "fgcolor", lz.colors.blue );
+ curr.changeFocus(null);
this.lastfound = curr;
}
@@ -101,9 +106,7 @@
this.cleaf = this.cgroup = 0;
}
}
-
}
-
]]>
</method>
@@ -111,7 +114,14 @@
text="$path{'@title'}">
<tree datapath="category" text="$path{'@title'}"
xindent="20" yindent="18" closesiblings="true">
- <linktree datapath="item" text="$path{'@title'}" />
+ <attribute name="createdItems" value="false" type="boolean" />
+ <handler name="onopen" args="o"><![CDATA[
+ if (o && !this.createdItems) {
+ this.createdItems = true;
+ this.items.setAttribute("datapath", "item");
+ }
+ ]]></handler>
+ <linktree name="items" text="$path{'@title'}" />
</tree>
</tree>
<wheelscrollbar/>
@@ -126,8 +136,10 @@
Classes
<view clip="true" height="${parent.parent.height - 50}"
width="${parent.width-20}">
- <view layout="y" width="${parent.width - 20}">
- <link datapath="classesdata:/index/item" text="$path{'@title'}" />
+ <view layout="axis:y" width="${parent.width - 20}">
+ <link text="$path{'@title'}">
+ <datapath xpath="classesdata:/index/item" replication="lazy"/>
+ </link>
</view>
<wheelscrollbar/>
</view>
@@ -136,8 +148,13 @@
Tags
<view clip="true" height="${parent.parent.height - 50}"
width="${parent.width-20}">
- <view layout="y" width="${parent.width - 20}">
- <link datapath="tagsdata:/index/item" text="$path{'@title'}" />
+ <view layout="axis:y" width="${parent.width - 20}">
+ <link text="$path{'@title'}">
+ <setter name="text" args="t" >
+ super.setAttribute("text", this.escapeText(t));
+ </setter>
+ <datapath xpath="tagsdata:/index/item" replication="lazy"/>
+ </link>
</view>
<wheelscrollbar/>
</view>
Modified: openlaszlo/trunk/lps/components/lz/tree.lzx
===================================================================
--- openlaszlo/trunk/lps/components/lz/tree.lzx 2009-01-24 11:50:48 UTC (rev 12631)
+++ openlaszlo/trunk/lps/components/lz/tree.lzx 2009-01-24 16:21:52 UTC (rev 12632)
@@ -112,11 +112,11 @@
:(classroot.open ? 2 : 1)}" />
</view>
<text name="text" text="${classroot.text}" resize="true"
- bgcolor="${classroot.selected
- ? classroot.style['selectedcolor']
- : (classroot.focused
+ bgcolor="${classroot.selected && classroot.style
+ ? classroot.style['selectedcolor']
+ : (classroot.focused && classroot.style
? classroot.style['hilitecolor']
- : classroot.parent.bgcolor ) }">
+ : classroot.parent.bgcolor)}" >
<handler name="onclick">
classroot.toggleOpenAndFocus()
if (classroot.onclick) classroot.onclick.sendEvent();
@@ -232,7 +232,7 @@
</class>
</library>
<!-- * X_LZ_COPYRIGHT_BEGIN ***************************************************
-* Copyright 2001-2008 Laszlo Systems, Inc. All Rights Reserved. *
+* Copyright 2001-2009 Laszlo Systems, Inc. All Rights Reserved. *
* Use is subject to license terms. *
* X_LZ_COPYRIGHT_END ****************************************************** -->
<!-- @LZX_VERSION@ -->
More information about the Laszlo-checkins
mailing list