[Laszlo-checkins] r6470 - in openlaszlo/branches/legals: . WEB-INF/lps/lfc/core WEB-INF/lps/lfc/data WEB-INF/lps/lfc/events WEB-INF/lps/lfc/kernel/dhtml WEB-INF/lps/lfc/kernel/swf WEB-INF/lps/lfc/services WEB-INF/lps/lfc/services/platform/dhtml WEB-INF/lps/lfc/services/platform/swf WEB-INF/lps/lfc/views WEB-INF/lps/misc WEB-INF/lps/schema WEB-INF/lps/server/src/org/openlaszlo/compiler WEB-INF/lps/server/src/org/openlaszlo/sc demos/chat lps/components/incubator/rich-text lps/components/incubator/rich-text/test lps/components/rpc/library/swf lps/components/utils/replicator lps/includes/source test test/data test/explicit-replicators test/history test/lfc/data test/lztest test/performance test/style test/style/constraints test/style/resource test/style/simple
ben@openlaszlo.org
ben at openlaszlo.org
Thu Sep 13 14:44:34 PDT 2007
Author: ben
Date: 2007-09-13 14:44:23 -0700 (Thu, 13 Sep 2007)
New Revision: 6470
Added:
openlaszlo/branches/legals/WEB-INF/lps/lfc/data/LzDataProvider.lzs
openlaszlo/branches/legals/WEB-INF/lps/lfc/data/LzDataRequest.lzs
openlaszlo/branches/legals/WEB-INF/lps/lfc/data/LzHTTPDataProvider.lzs
openlaszlo/branches/legals/test/data/datatag-1.lzx
openlaszlo/branches/legals/test/explicit-replicators/
openlaszlo/branches/legals/test/explicit-replicators/lazy-replicator.lzx
openlaszlo/branches/legals/test/explicit-replicators/replicator.lzx
openlaszlo/branches/legals/test/explicit-replicators/test-replicator.lzx
openlaszlo/branches/legals/test/lztest/lztest-lzdatapointer.lzx
openlaszlo/branches/legals/test/performance/getTimer-vs-newDate.lzx
openlaszlo/branches/legals/test/style/constraints/contention.lzx
openlaszlo/branches/legals/test/style/simple/main.lzx
openlaszlo/branches/legals/test/style/simple/undefineds.lzx
Removed:
openlaszlo/branches/legals/lps/components/utils/replicator/datalistlazyreplicator.lzx
openlaszlo/branches/legals/lps/components/utils/replicator/datalistreplicator.lzx
openlaszlo/branches/legals/test/explicit-replicators/lazy-replicator.lzx
openlaszlo/branches/legals/test/explicit-replicators/replicator.lzx
openlaszlo/branches/legals/test/explicit-replicators/test-replicator.lzx
openlaszlo/branches/legals/test/style/trait/
Modified:
openlaszlo/branches/legals/
openlaszlo/branches/legals/WEB-INF/lps/lfc/core/LzNode.lzs
openlaszlo/branches/legals/WEB-INF/lps/lfc/data/Library.lzs
openlaszlo/branches/legals/WEB-INF/lps/lfc/data/LzDataElement.lzs
openlaszlo/branches/legals/WEB-INF/lps/lfc/data/LzDataNode.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/data/LzReplicationManager.lzs
openlaszlo/branches/legals/WEB-INF/lps/lfc/events/LaszloEvents.lzs
openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/dhtml/LzHTTPLoader.js
openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/dhtml/LzXMLTranslator.js
openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/swf/LzHTTPLoader.as
openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/swf/LzLoadQueue.as
openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/swf/LzLoader.lzs
openlaszlo/branches/legals/WEB-INF/lps/lfc/services/LzCSSStyle.js
openlaszlo/branches/legals/WEB-INF/lps/lfc/services/platform/dhtml/LzHistory.js
openlaszlo/branches/legals/WEB-INF/lps/lfc/services/platform/swf/LzHistory.as
openlaszlo/branches/legals/WEB-INF/lps/lfc/views/LaszloView.lzs
openlaszlo/branches/legals/WEB-INF/lps/misc/lzx-autoincludes.properties
openlaszlo/branches/legals/WEB-INF/lps/schema/lzx.rnc
openlaszlo/branches/legals/WEB-INF/lps/server/src/org/openlaszlo/compiler/DataCompiler.java
openlaszlo/branches/legals/WEB-INF/lps/server/src/org/openlaszlo/compiler/NodeModel.java
openlaszlo/branches/legals/WEB-INF/lps/server/src/org/openlaszlo/compiler/ViewSchema.java
openlaszlo/branches/legals/WEB-INF/lps/server/src/org/openlaszlo/sc/CodeGenerator.java
openlaszlo/branches/legals/WEB-INF/lps/server/src/org/openlaszlo/sc/JavascriptGenerator.java
openlaszlo/branches/legals/demos/chat/chatlib.lzx
openlaszlo/branches/legals/lps/components/incubator/rich-text/formatfontcolor.lzx
openlaszlo/branches/legals/lps/components/incubator/rich-text/richtexteditarea.lzx
openlaszlo/branches/legals/lps/components/incubator/rich-text/test/linkdialog-driver.lzx
openlaszlo/branches/legals/lps/components/incubator/rich-text/test/linkdialog-test.lzx
openlaszlo/branches/legals/lps/components/rpc/library/swf/rpc.js
openlaszlo/branches/legals/lps/components/utils/replicator/lazyreplicator.lzx
openlaszlo/branches/legals/lps/components/utils/replicator/library.lzx
openlaszlo/branches/legals/lps/components/utils/replicator/replicator.lzx
openlaszlo/branches/legals/lps/components/utils/replicator/replicatorselectionmanager.lzx
openlaszlo/branches/legals/lps/includes/source/embednew.js
openlaszlo/branches/legals/test/history/history.lzx
openlaszlo/branches/legals/test/lfc/data/dollarpath.lzx
openlaszlo/branches/legals/test/lztest/lztest-textheight.lzx
openlaszlo/branches/legals/test/style/constraints/main.lzx
openlaszlo/branches/legals/test/style/constraints/speedtest.lzx
openlaszlo/branches/legals/test/style/constraints/subclassing.lzx
openlaszlo/branches/legals/test/style/metasuite.lzx
openlaszlo/branches/legals/test/style/resource/resource-not-found.lzx
openlaszlo/branches/legals/test/style/simple/simple.lzx
Log:
Merged revisions 5900-6000 via svnmerge from
http://svn.openlaszlo.org/openlaszlo/branches/wafflecone
.......
r5901 | max | 2007-08-01 16:37:11 -0700 (Wed, 01 Aug 2007) | 24 lines
Change 20070801-maxcarlson-k by maxcarlson at plastik on 2007-08-01 12:24:00 PDT
in /Users/maxcarlson/openlaszlo/wafflecone
for http://svn.openlaszlo.org/openlaszlo/branches/wafflecone
Summary: Inline LzCSSStyle._selectorApplies() testing and first level of recursion
New Features:
Bugs Fixed: LPP-4414 - Improve startup performance (partial)
Technical Reviewer: promanik
QA Reviewer: ben
Doc Reviewer: (pending)
Documentation:
Release Notes:
Details: Do early tests to short-circuit calls to _selectorApplies(). Change structure of _selectorApplies() to set a result variable and break rather than retunring immediately. Inline first level of recursion (ugly, but it gets the most results).
Tests: Silver main.lzx?lzr=dhtml&lzt=html shows a total of 56350 fewer function calls in firebug (from 307750 to 251400). Calls to _selectorApplies() have been reduced from 125068 to 66294 calls.
.......
r5910 | max | 2007-08-02 10:18:46 -0700 (Thu, 02 Aug 2007) | 28 lines
20070801-maxcarlson-V by maxcarlson at plastik on 2007-08-01 20:51:00 PDT
in /Users/maxcarlson/openlaszlo/wafflecone
for http://svn.openlaszlo.org/openlaszlo/branches/wafflecone
Summary: More optimization of LFC
New Features:
Bugs Fixed: LPP-4414 - Improve startup performance (partial)
Technical Reviewer: promanik
QA Reviewer: ben
Doc Reviewer: (pending)
Documentation:
Release Notes:
Details: LzCSSStyle.js - Cache getPropertyValueFor() calls. Only call _selectorApplies() for compound css statements.
LzNode.lzs - Only call constructWithArgs() if it exists.
LaszloEvents.lzs - Check for null reference.
Tests: ...silver/main.lzx?lzr=dhtml&lzt=html shows ~24029 fewer total calls (252524 total before, 228495 now). http://localhost:8080/wafflecone/test/style/constraints/main.lzx?lzr=swf8 passes as before, shows 405ms for lookup test.
.......
r5912 | pbr | 2007-08-02 11:28:54 -0700 (Thu, 02 Aug 2007) | 61 lines
Change 20070802-Philip-6 by Philip at Philip-DC on 2007-08-02 10:58:11 EST
in /cygdrive/f/laszlo/svn/src/svn/openlaszlo/branches/wafflecone
for http://svn.openlaszlo.org/openlaszlo/branches/wafflecone
Summary: Fix LzDataElement.makeNodeList()
New Features:
Bugs Fixed: LPP-4418
Technical Reviewer: ptw
QA Reviewer: (pending)
Doc Reviewer: (pending)
Documentation:
Release Notes:
Details:
In 3.4 you can call the static method LzDataElement.makeNodeList() to create an
array of LzDataElement objects. This is broken in Wafflecone (and Legals). In Wa
fflecone, the method isn't defined as static and it exists in LzDataElementTrait
. I fixed the static in the trait and created a static in LzDataElement. The def
inition of makeNodeList() also broke (it produced at most 1 object) when the fil
e was updated to the new class system.
Tests:
This app now runs in wafflecone and produces the same results as 3.4:
<canvas debug="true">
<method event="oninit"><![CDATA[
var nodes = LzDataElement.makeNodeList(5, 'mynode');
for (var i=0; i<nodes.length; i++) {
Debug.write(i, nodes[i]);
}
]]>
</method>
</canvas>
If you run this on an unpatched version of wafflecone:
ERROR: makeNodeList.lzx:3: call to undefined method 'makeNodeList'
ERROR: makeNodeList.lzx:4: undefined object does not have a property 'length'
WARNING: makeNodeList.lzx:4: reference to undefined property 'length'
If you run this on a patched version of wafflecone (or 3.4):
0 ?\194?\171LzDataElement#0| <mynode/>?\194?\187
1 ?\194?\171LzDataElement#1| <mynode/>?\194?\187
2 ?\194?\171LzDataElement#2| <mynode/>?\194?\187
3 ?\194?\171LzDataElement#3| <mynode/>?\194?\187
4 ?\194?\171LzDataElement#4| <mynode/>?\194?\187
Files:
M WEB-INF/lps/lfc/data/LzDataElement.lzs
Changeset: http://svn.openlaszlo.org/openlaszlo/patches/20070802-Philip-6.tar
.......
r5913 | ptw | 2007-08-02 12:53:23 -0700 (Thu, 02 Aug 2007) | 20 lines
Change 20070802-ptw-S by ptw at dueling-banjos.local on 2007-08-02 13:37:54 EDT
in /Users/ptw/OpenLaszlo/wafflecone
for http://svn.openlaszlo.org/openlaszlo/branches/wafflecone
Summary: Inline simple case of nextMethod
Bugs Fixed:
LPP-4414 'Improve startup performance' (partial)
Technical Reviewer: max (Message-ID: <46B22C21.7040805 at openlaszlo.org>)
QA Reviewer: pbr (Message-Id: <6.2.1.2.0.20070802145647.02207620 at na>)
Tests:
smokecheck
QA reviewer: please test against target app. Note
you will have to do a clean build so that all sources are
recompiled.
.......
r5914 | ben | 2007-08-02 14:40:27 -0700 (Thu, 02 Aug 2007) | 34 lines
Change 20070801-ben-F by ben at cooper.local on 2007-08-01 16:02:41 PDT
in /Users/ben/src/svn/openlaszlo/branches/wafflecone
for http://svn.openlaszlo.org/openlaszlo/branches/wafflecone
Summary: More tests for CSS
New Features:
Bugs Fixed:
Technical Reviewer: (pending)
QA Reviewer: (pending)
Doc Reviewer: (pending)
Documentation:
added a test for (NOT FIXED) LPP-4182 undefined CSS values used to be null. now they're undefined (NOT FIXED)
Release Notes:
Details:
Tests:
http://localhost:8080/wafflecone/test/style/simple/main.lzx
passes
http://localhost:8080/wafflecone/test/style/metasuite.lzx?debug=true&lzr=swf7 fails
with these errors:
Tests: 531 Failures: 3 Errors: 0
TestFailure: SimpleTestCase >>> testBasics failed: Equals: expected 50 got 279
TestFailure: CSSSubclassingTestCase >>> testSubclassOverrideConstraint failed: Equals: expected 32768 got 8388736
TestFailure: CSSSubclassingTestCase >>> testSubclassOverrideConstraint failed: Equals: expected 17337 got 8388736
.......
r5915 | ben | 2007-08-02 16:02:51 -0700 (Thu, 02 Aug 2007) | 31 lines
Change 20070802-ben-2 by ben at cooper.local on 2007-08-02 15:45:14 PDT
in /Users/ben/src/svn/openlaszlo/branches/wafflecone
for http://svn.openlaszlo.org/openlaszlo/branches/wafflecone
Summary: Remove some css tests that were never completed
New Features:
Bugs Fixed:
Technical Reviewer: none
QA Reviewer: (pending)
Doc Reviewer: (pending)
Documentation:
These tests, for a "cssable" trait, were never completed, and the
cssable feature is not being clamored for, so I'm just going to
delete these half-baked tests.
I've also removed the reference to these tests in the css metasuite
test.
Release Notes:
Details:
Tests:
http://localhost:8080/wafflecone/test/style/metasuite.lzx?debug=true
(has failures, but doesn't refer to traits test or traits errors.)
.......
r5916 | ben | 2007-08-02 18:09:29 -0700 (Thu, 02 Aug 2007) | 33 lines
Change 20070802-ben-n by ben at cooper.local on 2007-08-02 18:05:09 PDT
in /Users/ben/src/svn/openlaszlo/branches/wafflecone
for http://svn.openlaszlo.org/openlaszlo/branches/wafflecone
Summary: Hook up link panel to rich text editor in test files
New Features:
Bugs Fixed:
LPP-4356 link dialog does not make links (regression from r4356)
LPP-4421 linkdialog driver can't make links
LPP-4350 linkdialog-test fails
Technical Reviewer: none
QA Reviewer: mamye (pending)
Doc Reviewer: frisco (pending)
Documentation:
To properly set up references to the link panel at startup, richtexteditarea's
should call setLinkPanel( idOfLinkPanel ). This change just adds that call to the
linkdialog test and driver.
Doc reviewer, please also document this in the rich text chapter.
Release Notes:
Details:
Tests:
.......
r5924 | ben | 2007-08-03 14:00:47 -0700 (Fri, 03 Aug 2007) | 33 lines
Change 20070803-ben-e by ben at slim.local on 2007-08-03 12:56:12 PDT
in /Users/ben/src/svn/openlaszlo/branches/wafflecone
for http://svn.openlaszlo.org/openlaszlo/branches/wafflecone
Summary: Issue a runtime warning if the result of a $style lookup is null or undefined
New Features:
Bugs Fixed: LPP-3024 If a css'd resource is not found, an error or warning should be issued
Technical Reviewer: max
QA Reviewer: frisco (pending)
Doc Reviewer: (pending)
Documentation:
If the developer creates a style constraint, and that constraint evaluates to
null, they've probably made an error. Therefore, in debug mode,
we give runtime warnings. For speed, we don't do this check when running
in non-debug mode.
Release Notes:
Details:
Tests:
http://localhost:8080/wafflecone/test/style/resource/main.lzx
We get this warning:
WARNING: got null for CSS property lookup for nostyledefined
which is the warning requested by the bug reporter.
(Note that this test file sets itself to run in debug mode.)
.......
r5928 | max | 2007-08-03 15:29:00 -0700 (Fri, 03 Aug 2007) | 28 lines
ehange 20070803-maxcarlson-n by maxcarlson at Plastik.local on 2007-08-03 15:22:00 PDT
in /Users/maxcarlson/openlaszlo/wafflecone
for http://svn.openlaszlo.org/openlaszlo/branches/wafflecone
Summary: More LFC optimization/simplification
New Features:
Bugs Fixed: LPP-4414 - Improve startup performance
Technical Reviewer: ben
QA Reviewer: promanik
Doc Reviewer: (pending)
Documentation:
Release Notes:
Details: lztest-textheight.lzx - label multiline inputtext test better.
LzCSSStyle.js - Remove recursion, correct getPropertyValueFor() warnings, simplify _selectorApplies().
LzNode.lzs - Clean up getUID().
Tests: http://localhost:8080/wafflecone/test/style/metasuite.lzx?lzr=swf8&debug=true passes (with new warnings!) and silver/main.lzx?lzr=dhtml&lzt=html is slightly faster (with the same number of method calls)
.......
r5931 | ben | 2007-08-03 16:35:17 -0700 (Fri, 03 Aug 2007) | 31 lines
Change 20070803-ben-D by ben at slim.local on 2007-08-03 16:24:30 PDT
in /Users/ben/src/svn/openlaszlo/branches/wafflecone
for http://svn.openlaszlo.org/openlaszlo/branches/wafflecone
Summary: Better warning messages for nonexistent CSS property
New Features:
Bugs Fixed: LPP-4428 Make warning on CSS value is null more informative
Technical Reviewer: max
QA Reviewer: (pending)
Doc Reviewer: (pending)
Documentation:
The warning if a developer tries to look up a CSS property which isn't
defined now lists the node, the node's id, and the node's name --
warnings only appear in debug mode.
Release Notes:
Details:
Tests:
http://localhost:8080/wafflecone/test/style/resource/main.lzx
says
WARNING: No CSS value found for node LzView id: gMissing called gMissing for property name nostyledefined
.......
r5932 | ben | 2007-08-03 16:44:02 -0700 (Fri, 03 Aug 2007) | 1 line
Fixed test of css lookup to allow for really fast results
.......
r5936 | ptw | 2007-08-04 11:48:44 -0700 (Sat, 04 Aug 2007) | 26 lines
Change 20070803-ptw-Q by ptw at dueling-banjos.local on 2007-08-03 18:39:12 EDT
in /Users/ptw/OpenLaszlo/wafflecone
for http://svn.openlaszlo.org/openlaszlo/branches/wafflecone
Summary: Bring replicator tag more in compliance with spec
Bugs Fixed:
LPP-4405 'Implement ExplicitReplication' (partial)
Technical Reviewer: henry (pending)
QA Reviewer: max, pablo (Message-ID: <46B3B867.3010101 at openlaszlo.org>)
Details:
LzNode: add a setter for `data`. If you set data to an
LzDataElement, that element becomes the data context for the node
(i.e., the datapath of the node will point to that data element).
replicator: Make this a node, not a view. Add axis, spacing,
dataset, and xpath attributes. Remove private API's from
interface. Pass the layout up to the parent, compute the nodes
from the xpath on init.
Tests:
The test in this change
.......
r5937 | hqm | 2007-08-04 22:00:51 -0700 (Sat, 04 Aug 2007) | 38 lines
Change 20070805-hqm-4 by hqm at IBM-2E06404CB67 on 2007-08-05 00:48:45 EDT
in /cygdrive/c/users/hqm/openlaszlo/wafflecone
for http://svn.openlaszlo.org/openlaszlo/branches/wafflecone
Summary: checkin of dataprovider implementation for dataset
New Features:
Bugs Fixed: LPP-4404
Technical Reviewer: pkang (pending)
QA Reviewer: (pending)
Doc Reviewer: (pending)
Documentation:
Release Notes:
Details:
Tests:
test/lfc/data/alldata.lzx
test/lfc/data/runtestdatapath.lzx
test/lfc/data/dollarpath.lzx
test/lfc/data/lzunit-lzparsedpath.lzx
test/lfc/data/xpath.lzx
demos/amazon
demos/weather
demos/vacation-survey
demos/calendar
.......
r5942 | ptw | 2007-08-06 06:06:13 -0700 (Mon, 06 Aug 2007) | 10 lines
Change 20070806-ptw-l by ptw at dueling-banjos.local on 2007-08-06 09:04:16 EDT
in /Users/ptw/OpenLaszlo/wafflecone
for http://svn.openlaszlo.org/openlaszlo/branches/wafflecone
Summary: Measure the cost of getTimer vs. (new Date).getTime()
Technical Reviewer: henry (pending)
QA Reviewer: max (pending)
.......
r5944 | ben | 2007-08-06 12:41:44 -0700 (Mon, 06 Aug 2007) | 25 lines
Change 20070806-ben-Q by ben at slim.local on 2007-08-06 12:30:20 PDT
in /Users/ben/src/svn/openlaszlo/branches/wafflecone
for http://svn.openlaszlo.org/openlaszlo/branches/wafflecone
Summary: Tiny improvement to CSS style-not-found warning
New Features:
Bugs Fixed: (more) LPP-4428 Make warning on CSS value is null more informative
Technical Reviewer: ptw
QA Reviewer: (pending)
Doc Reviewer: (pending)
Documentation:
Instead of separately printing node name and id, just format the node with %#w, which prints both name and id if present, in click-for-more-info form.
Release Notes:
Details:
Tests:
http://localhost:8080/wafflecone/test/style/resource/main.lzx
.......
r5947 | max | 2007-08-06 14:48:12 -0700 (Mon, 06 Aug 2007) | 26 lines
Change 20070806-maxcarlson-x by maxcarlson at plastik on 2007-08-06 14:30:15 PDT
in /Users/maxcarlson/openlaszlo/wafflecone
for http://svn.openlaszlo.org/openlaszlo/branches/wafflecone
Summary: Remove setter for LzNode.data
New Features:
Bugs Fixed: LPP-4405 'Implement ExplicitReplication' (partial)
Technical Reviewer: promanik
QA Reviewer: ptw, pkang
Doc Reviewer: (pending)
Documentation:
Release Notes:
Details: LzNode.lzs - Remove setter for .data -> setData().
replicator.lzx - Call v.setData( this.nodes[ n ] ); instead of setAttribute('data', ...)
Tests: silver/main.lzx?lzr=swf8 runs again, http://localhost:8080/wafflecone/test/explicit-replicators/replicator.lzx?lzr=swf8 passes
.......
r5949 | max | 2007-08-06 18:56:53 -0700 (Mon, 06 Aug 2007) | 1 line
+ fix bad color value in test
.......
r5951 | max | 2007-08-06 19:38:56 -0700 (Mon, 06 Aug 2007) | 24 lines
Change 20070806-maxcarlson-l by maxcarlson at plastik on 2007-08-06 18:53:14 PDT
in /Users/maxcarlson/openlaszlo/wafflecone
for http://svn.openlaszlo.org/openlaszlo/branches/wafflecone
Summary: Only set style constraints if the existing value is null
New Features:
Bugs Fixed: LPP-2894 - CSS: subclasses and instances can't override style constraints set on superclass*
Technical Reviewer: promanik
QA Reviewer: ben, ptw
Doc Reviewer: (pending)
Documentation:
Release Notes:
Details: LzNode.lzs - Only set styleConstraints[k] if this[k] is null.
Tests: http://localhost:8080/wafflecone/test/style/constraints/main.lzx?lzr=swf8 now passes.
.......
r5955 | ben | 2007-08-07 12:17:42 -0700 (Tue, 07 Aug 2007) | 32 lines
Change 20070807-ben-K by ben at slim.local on 2007-08-07 12:07:55 PDT
in /Users/ben/src/svn/openlaszlo/branches/wafflecone
for http://svn.openlaszlo.org/openlaszlo/branches/wafflecone
Summary: Added test for LPP-4443, Don't warn on undefined style constraints when constant specified
New Features:
Bugs Fixed: LPP-4443 (not fixed; this is a test case for it)
Bug: LPP-4443
(not fixed; this is a test case for it)
Technical Reviewer: none
QA Reviewer: (pending)
Doc Reviewer: (pending)
Documentation:
This test case demonstrates a spurious warning, which actually ends up
happening a lot in certain large applications. The warning is filed as
LPP-4443.
Release Notes:
Details:
Tests:
http://localhost:8080/wafflecone/test/style/constraints/main.lzx?debug=true
test passes, but there's a warning about node id dyson; there should not
be a warning about dyson.
.......
r5956 | hqm | 2007-08-07 13:48:53 -0700 (Tue, 07 Aug 2007) | 32 lines
Change 20070807-hqm-8 by hqm at IBM-2E06404CB67 on 2007-08-07 15:45:03 EDT
in /cygdrive/c/users/hqm/openlaszlo/wafflecone
for http://svn.openlaszlo.org/openlaszlo/branches/wafflecone
Summary:
New Features: make datarequest and dataprovider extendable in LZX code
Bugs Fixed: LPP-4404, LPP-4401
Bug: LPP-4404
Technical Reviewer: pkang
QA Reviewer: (pending)
Doc Reviewer: (pending)
Documentation:
Release Notes:
Details:
added datarequest to the schema as a primitive LzNode equivalent
made base LzDataProvider class
also fix for LPP-4401- namespace prefix bug when loading DHTML data
Tests:
.......
r5958 | max | 2007-08-07 16:47:40 -0700 (Tue, 07 Aug 2007) | 1 line
+ update testcase - validates ptw's assertion 'if I have a superclass attribute with a simple value that a subclass and instance can override that simple value with a style constraint'
.......
r5959 | max | 2007-08-07 18:24:40 -0700 (Tue, 07 Aug 2007) | 30 lines
Change 20070807-maxcarlson-F by maxcarlson at plastik on 2007-08-07 14:38:37 PDT
in /Users/maxcarlson/openlaszlo/wafflecone
for http://svn.openlaszlo.org/openlaszlo/branches/wafflecone
Summary: Turn off history persistence by default
New Features:
Bugs Fixed: LPP-4442 - history mechanism seems to take effect on startup
Technical Reviewer: promanik
QA Reviewer: ben
Doc Reviewer: (pending)
Documentation:
Release Notes:
Details: history.lzx - Change example to use new setPersist(true) API (so persistence still works in swf)
LzHistory.as - Turn persistence off by default. Rename setHistory to __setHistory. Add more safety checking and warnings to save() method (using 3.4-style code would have hanged the browser before). Clean up existing persistent object, if any in __initPersist(). Add setPersist() API to turn persistence on/off.
LzHistory.js - Add setPersist() API with warning for DHTML (not yet implemented).
embednew.js - Make sure initial history event is sent even if the hash is empty.
Tests: silver/main.lzx?lzr=swf8 now has correct back-button behavior. http://localhost:8080/wafflecone/test/history/ works as before - with persistence across page reloads in swf via setPersist(true)
.......
r5963 | ptw | 2007-08-08 06:54:50 -0700 (Wed, 08 Aug 2007) | 25 lines
Change 20070808-ptw-o by ptw at dueling-banjos.local on 2007-08-08 08:34:48 EDT
in /Users/ptw/OpenLaszlo/wafflecone
for http://svn.openlaszlo.org/openlaszlo/branches/wafflecone
Summary: Incorporate Pablo's fixes to explicit replication
Bugs Fixed:
Bug: LPP-4405 'Implement ExplicitReplication'
Technical Reviewer: hminsky (pending)
QA Reviewer: pkang (pending)
Release Notes:
Details:
Added Pablo's test case for lazy-replicator.
Added Pablo's changes to lazyreplicator and replicator.
Removed obsolete datalist*replicator.
Tests:
explicit-replicators tests
.......
r5965 | ptw | 2007-08-08 07:53:09 -0700 (Wed, 08 Aug 2007) | 7 lines
Change 20070808-ptw-b by ptw at dueling-banjos.local on 2007-08-08 10:51:57 EDT
in /Users/ptw/OpenLaszlo/wafflecone
for http://svn.openlaszlo.org/openlaszlo/branches/wafflecone
Summary: Test case for LPP-4451
.......
r5966 | hqm | 2007-08-08 10:06:26 -0700 (Wed, 08 Aug 2007) | 31 lines
Change 20070808-hqm-4 by hqm at IBM-2E06404CB67 on 2007-08-08 10:24:43 EDT
in /cygdrive/c/users/hqm/openlaszlo/wafflecone/WEB-INF/lps/lfc
for http://svn.openlaszlo.org/openlaszlo/branches/wafflecone/WEB-INF/lps/lfc
Summary: minor fixes to dataprovider
New Features:
Bugs Fixed: LPP-4448
Bug: LPP-4448
Technical Reviewer: pkang
QA Reviewer: max
Doc Reviewer: (pending)
Documentation:
Release Notes:
Details:
remove call in doRequest to send event status on datarequest in loading state
fix typo setRequestErrorError
Tests:
.......
r5967 | mkratt | 2007-08-08 10:39:37 -0700 (Wed, 08 Aug 2007) | 1 line
checkin test from webtop group for replicators
.......
r5968 | pbr | 2007-08-08 13:42:10 -0700 (Wed, 08 Aug 2007) | 36 lines
(Note: I took Tucker's suggestion and modified the warning message)
Change 20070802-Philip-2 by Philip at Philip-DC on 2007-08-02 11:34:48 EST
in /cygdrive/f/laszlo/svn/src/svn/openlaszlo/branches/wafflecone
for http://svn.openlaszlo.org/openlaszlo/branches/wafflecone
Summary: Fix how LzDatapointer handles null values
New Features:
Bugs Fixed: LPP-2760
Technical Reviewer: ben
QA Reviewer: (pending)
Doc Reviewer: (pending)
Documentation:
Release Notes:
Details:
The decision is to return undefined when the internal pointer is null (same as 3
.4). This was the current behavior of wafflecone. I added warning messages in de
bug mode whenever this condition is found. The new test file, lztest-lzdatapoint
er.lzx, only tests the undefined behavior of LzDatapointer.
Tests:
Run new unit test, /test/lztest/lztest-lzdatapointer.lzx
Files:
A test/lztest/lztest-lzdatapointer.lzx
M WEB-INF/lps/lfc/data/LzDatapointer.lzs
Changeset: http://svn.openlaszlo.org/openlaszlo/patches/20070802-Philip-2.tar
.......
r5977 | hqm | 2007-08-09 05:55:55 -0700 (Thu, 09 Aug 2007) | 30 lines
Change 20070808-hqm-4 by hqm at IBM-2E06404CB67 on 2007-08-08 23:47:31 EDT
in /cygdrive/c/users/hqm/openlaszlo/wafflecone/WEB-INF/lps/lfc
for http://svn.openlaszlo.org/openlaszlo/branches/wafflecone/WEB-INF/lps/lfc
Summary: fix for 'Visible property not respected for replication'
New Features:
Bugs Fixed: LPP-4459
Bug: LPP-4459
Technical Reviewer: pbr
QA Reviewer: max
Doc Reviewer: (pending)
Documentation:
Release Notes:
Details:
suggested fix from bug report; check for visible property in _instanceAttrs if view is
not yet initialized
Tests:
test case in bug report
.......
r5980 | hqm | 2007-08-09 11:03:19 -0700 (Thu, 09 Aug 2007) | 31 lines
Change 20070809-hqm-8 by hqm at IBM-2E06404CB67 on 2007-08-09 12:08:48 EDT
in /cygdrive/c/users/hqm/openlaszlo/wafflecone
for http://svn.openlaszlo.org/openlaszlo/branches/wafflecone
Summary: fix for selectParent bug on LzDataText
New Features:
Bugs Fixed: LPP-4453
Bug: LPP-4453
Technical Reviewer: max
QA Reviewer: promanik
Doc Reviewer: (pending)
Documentation:
Release Notes:
Details:
The legals-refactored code for datapointer expects selectParent to find a getParent method,
which is only defined on LzDataElement now. Fix is to move that getParent method to the common
LzDataNode class. Also moved getOffset to LzDataNode.
Tests:
test case in bug report
.......
r5985 | ben | 2007-08-09 13:19:51 -0700 (Thu, 09 Aug 2007) | 41 lines
Change 20070808-ben-z by ben at slim.local on 2007-08-08 17:24:47 PDT
in /Users/ben/src/svn/openlaszlo/branches/wafflecone
for http://svn.openlaszlo.org/openlaszlo/branches/wafflecone
Summary: Cleanup of insertion point movement in rich text editor
New Features:
Bugs Fixed: LPP-4396 rich text editor: clicking bold moves insertion point
Technical Reviewer: max
QA Reviewer: mamye (pending)
Doc Reviewer: (pending)
Documentation:
Using the fix for LPP-4015 (Text selection position and size should be available during onblur event) I sanitized the rich text editor's saving and restoring of the selected region.
There is a new bug introduced with this checkin: LPP-4461: In rich text editor, font color combo box does not update when cursor moves to different colored text. I am tracking this down.
Release Notes:
Details:
richtexteditarea.lzx -- The big change here was in the onblur method. Now that LPP-4015 has been fixed, we can store the correct selection range whenever we're about to lose focus. I also undid a change suggested by an external contributor, because it was causing problems in the new world, perhaps because it was incompatible with the platform/wafflecone rich text editor.
linkdialog-test.lzx -- very explicitly created connections between the link dialog and the editor.
formatfontcolor.lzx -- moved dataset describing color choices out of a state. This will slow startup a little bit, but the whole thing doesn't work if the color choices are in a state. (This state/dataset behavior interaction filed as LPP-4469 for investigation.)
Tests:
Interactive test available here:
http://localhost:8080/wafflecone/lps/components/incubator/rich-text/test/richtexteditarea-test.lzx?debug=true&lzr=swf8
lzunit tests here:
http://localhost:8080/wafflecone/lps/components/incubator/rich-text/test/linkdialog-test.lzx?debug=true&lzr=swf8
http://localhost:8080/wafflecone/lps/components/incubator/rich-text/test/scrollrichedittext-test.lzx?debug=true&lzr=swf8
http://localhost:8080/wafflecone/lps/components/incubator/rich-text/test/richtexteditor-test.lzx?lzr=swf8&debug=true
http://localhost:8080/wafflecone/lps/components/incubator/rich-text/test/richtexteditarea-test.lzx?debug=true&lzr=swf8
.......
r5987 | ben | 2007-08-09 14:53:42 -0700 (Thu, 09 Aug 2007) | 26 lines
Change 20070809-ben-a by ben at slim.local on 2007-08-09 14:45:56 PDT
in /Users/ben/src/svn/openlaszlo/branches/wafflecone
for http://svn.openlaszlo.org/openlaszlo/branches/wafflecone
Summary: Added a test file for testing the lzcombobox
New Features:
Bugs Fixed: LPP-4470 Make a test/driver file for lzcombobox
Technical Reviewer: none
QA Reviewer: (pending)
Doc Reviewer: (pending)
Documentation:
Release Notes:
Details:
Tests:
http://localhost:8080/wafflecone/lps/components/incubator/rich-text/test/test-lzcombobox.lzx?debug=true&lzr=swf8
(Runs with some errors and some warnings, but all tests pass.)
.......
r5989 | ben | 2007-08-09 15:26:40 -0700 (Thu, 09 Aug 2007) | 33 lines
Change 20070809-ben-F by ben at slim.local on 2007-08-09 15:24:45 PDT
in /Users/ben/src/svn/openlaszlo/branches/wafflecone
for http://svn.openlaszlo.org/openlaszlo/branches/wafflecone
Summary: Add test case for LPP-4469, Datasets inside a state don't work
New Features:
Bugs Fixed: LPP-4469 (not fixed! just a test case to demonstrate it!)
Technical Reviewer: none
QA Reviewer: (pending)
Doc Reviewer: (pending)
Documentation:
Release Notes:
Details:
Tests:
http://localhost:8080/wafflecone/lps/components/incubator/rich-text/test/test-lzcombobox.lzx?debug=true&lzr=swf8 gives
Tests: 12 Failures: 2 Errors: 3
TestFailure: testStates failed: Equals: expected 0 got ''
TestFailure: testLateData failed: Equals: expected 1 got ''
TestError: testStates failed: reference to undefined property 'fontsize'
TestError: testStates failed: reference to undefined property 'font'
TestError: testStates failed: reference to undefined variable 'combobox_style'
The first two failures are the ones that matter.
.......
r5997 | max | 2007-08-10 08:59:49 -0700 (Fri, 10 Aug 2007) | 24 lines
Change 20070809-maxcarlson-4 by maxcarlson at plastik on 2007-08-09 21:03:28 PDT
in /Users/maxcarlson/openlaszlo/wafflecone
for http://svn.openlaszlo.org/openlaszlo/branches/wafflecone
Summary: Fix view height and width event firing before init
New Features:
Bugs Fixed: LPP-4456 - Idle/wait resource is out of position
Technical Reviewer: promanik
QA Reviewer: ben
Doc Reviewer: (pending)
Documentation:
Release Notes:
Details: Don't reload the same resource or load null resources in setResource(). Remove && this.isinited && this.onwidth/height tests in updateHeight/Width()
Tests: See LPP-4456.
.......
r5999 | max | 2007-08-10 09:24:12 -0700 (Fri, 10 Aug 2007) | 32 lines
Change 20070810-maxcarlson-1 by maxcarlson at plastik on 2007-08-10 09:03:50 PDT
in /Users/maxcarlson/openlaszlo/wafflecone
for http://svn.openlaszlo.org/openlaszlo/branches/wafflecone
Summary: Fix SOLO media loading to be consistent with data in wafflecone
New Features:
Bugs Fixed: LPP-4462 - When running a SOLO SWF in an HTML file located in a different directory than the SWF, data requests are made relative to SWF, not HTML file
Technical Reviewer: hminsky
QA Reviewer: promanik
Doc Reviewer: (pending)
Documentation:
Release Notes:
Details: This change won't affect any of the default wrappers, because all the generated wrappers load the main SWF from the same path as the HTML.
Tests: See LPP-4462. Change loadtest.lzx to use consistent URLS for the media and data loads
<handler name="oninit">
img.setSource("img.jpg");
dsTestData.setSrc("testdata.xml");
dsTestData.doRequest();
</handler>
recompile the SOLO file (http://localhost:8080/trunk/my-apps/kathrynloadtest/loadtest/loadtest.lzx?lzproxied=false) then run the html wrapper (http://localhost:8080/trunk/my-apps/kathrynloadtest/loadtest.html). Notice that the media and data load from a consistent path. Running in the dev console with proxied on and off works as well.
.......
Property changes on: openlaszlo/branches/legals
___________________________________________________________________
Name: svnmerge-integrated
- /openlaszlo/branches/wafflecone:1-5746,5818-5900 /openlaszlo/trunk:1-3892,3894-3952,3954-4393,4395-4461,4463-4467,4469-4471,4473-5085,5087-5171,5173-5203,5205-5209,5211-5331,5333-5334
+ /openlaszlo/branches/wafflecone:1-5746,5818-6000 /openlaszlo/trunk:1-3892,3894-3952,3954-4393,4395-4461,4463-4467,4469-4471,4473-5085,5087-5171,5173-5203,5205-5209,5211-5331,5333-5334
Modified: openlaszlo/branches/legals/WEB-INF/lps/lfc/core/LzNode.lzs
===================================================================
--- openlaszlo/branches/legals/WEB-INF/lps/lfc/core/LzNode.lzs 2007-09-13 21:14:20 UTC (rev 6469)
+++ openlaszlo/branches/legals/WEB-INF/lps/lfc/core/LzNode.lzs 2007-09-13 21:44:23 UTC (rev 6470)
@@ -47,6 +47,7 @@
* @param Boolean instcall
*/
function initialize ( parent , attrs , children , instcall ){
+ this.__LZUID = "__U" + ++LzNode.__UIDs;
this.__LZdeferDelegates = true;
var qpos = LzDelegate.__LZdelegatesQueue.length;
super.initialize.apply(this, arguments);
@@ -180,7 +181,11 @@
this.__LZstyleConstraints = this.__LZapplyStyleMap( styleMap, attrs );
}
- this.constructWithArgs( maskedargs );
+ /**
+ * @todo 2006-05-24 ptw Adam says this is a hack that we should get
+ * rid of.
+ */
+ if (this.constructWithArgs) this.constructWithArgs( maskedargs );
delete this.__LZdeferDelegates;
if (qpos != LzDelegate.__LZdelegatesQueue.length) {
@@ -509,7 +514,10 @@
if (! (k in initialArgs)) {
// A style that is a function is a constraint
if (v instanceof Function) {
- styleConstraints[k] = v;
+ if (this[k] == null) {
+// Debug.warn("setting %w[%w] to %w, was %w", this, k, v, this[k]);
+ styleConstraints[k] = v;
+ }
} else {
// Debug.format("%w[%s] (%#w) %#w -> %#w", this, k, stylemap[k], this.k, v);
if (v != null) this.setAttribute(k, v);
@@ -641,13 +649,6 @@
}
/**
- * @access private
- * @todo 2006-05-24 ptw Adam says this is a hack that we should get
- * rid of.
- */
-function constructWithArgs ( parent , args ){}
-
-/**
* Called at the same time that the node sends its oninit event -- usually
* when the node's siblings are instantiated, and always after the node's
* children are instantiated.
@@ -1068,6 +1069,7 @@
setters.id = "setID"
setters.placement = -1
setters.datapath = "setDatapath"
+setters.data = "setData"
*/
/**
@@ -1476,7 +1478,20 @@
}
}
+ /**
+ * Sets the datacontext for the node to the data element given as an
+ * argument
+ * @access public
+ * @param LzDataElement data: The dataelement to use as the context
+ */
+ function setData(data) {
+ this.data = data;
+ var dp = (this.datapath != null) ? this.datapath : new LzDatapath(this);
+ dp.setPointer(data);
+ if (this.ondata.ready) this.ondata.sendEvent(data);
+ }
+
// hack to create an 'abstract' method to hang the doc off of
if ($debug) {
/**
@@ -1682,18 +1697,16 @@
}while ( sview != canvas );
}
+/**
+ * @access private
+ */
+static var __UIDs = 0;
-static var UIDs = 0;
-
/**
* Returns the unique ID of the node.
* @return String: A string representing a unique ID for the node.
*/
function getUID (){
- if ( this.__LZUID == null ){
- this.__LZUID = "__U" + ++LzNode.UIDs;
- }
-
return this.__LZUID;
}
@@ -1967,10 +1980,4 @@
this.makeChild( dpobj , true);
}
-
-/**
- * @access private
- */
-function constructWithArgs ( parent , args ){}
-
} // End of LzNode
Modified: openlaszlo/branches/legals/WEB-INF/lps/lfc/data/Library.lzs
===================================================================
--- openlaszlo/branches/legals/WEB-INF/lps/lfc/data/Library.lzs 2007-09-13 21:14:20 UTC (rev 6469)
+++ openlaszlo/branches/legals/WEB-INF/lps/lfc/data/Library.lzs 2007-09-13 21:44:23 UTC (rev 6470)
@@ -1,7 +1,7 @@
/**
* Library.lzs
*
- * @copyright Copyright 2001-2006 Laszlo Systems, Inc. All Rights Reserved.
+ * @copyright Copyright 2001-2007 Laszlo Systems, Inc. All Rights Reserved.
* Use is subject to license terms.
*
* @access private
@@ -10,6 +10,12 @@
#include "data/LzDataNode.lzs"
#include "data/LzDataElement.lzs"
#include "data/LzDataText.lzs"
+
+// new DataProvider classes
+#include "data/LzDataRequest.lzs"
+#include "data/LzDataProvider.lzs"
+#include "data/LzHTTPDataProvider.lzs"
+
#include "data/LzDataset.lzs"
#include "data/LzDatapointer.lzs"
#include "data/LzParam.lzs"
@@ -20,6 +26,7 @@
#include "data/LzHTTPDatasource.lzs"
#include "data/LzDataAttrBind.lzs"
+
#include "data/LzLazyReplicationManager.lzs"
#include "data/LzResizeReplicationManager.lzs"
Modified: openlaszlo/branches/legals/WEB-INF/lps/lfc/data/LzDataElement.lzs
===================================================================
--- openlaszlo/branches/legals/WEB-INF/lps/lfc/data/LzDataElement.lzs 2007-09-13 21:14:20 UTC (rev 6469)
+++ openlaszlo/branches/legals/WEB-INF/lps/lfc/data/LzDataElement.lzs 2007-09-13 21:44:23 UTC (rev 6470)
@@ -267,13 +267,6 @@
return [ this , "childNodes" ];
}
-/**
- * Returns the parent of this node
- * @return LzDataNode: the parent of this node
- */
-function getParent () {
- return this.parentNode;
-}
/**
* @access private
@@ -285,17 +278,7 @@
this.__LZcoDirty = false;
}
-/**
- * gets offset of node in parent's childNodes array
- * @return number
- */
-function getOffset (){
- if (!this.parentNode) return 0;
- if (this.parentNode.__LZcoDirty) this.parentNode.__LZupdateCO();
- return this.__LZo;
-}
-
/**
* @access private
*/
@@ -614,20 +597,6 @@
return c;
}
-/**
- * Returns a list of empty nodes, each named 'name'.
- * @param Number count: how many nodes to create.
- * @param String name: the name for each node
- * @return Array: list of new nodes.
- */
-function makeNodeList(count, name) {
- var a = [];
- for (var i=0; i < count; i++) {
- a[i] = new LzDataElement(name, {}, null);
- return a;
- }
-}
-
} // End LzDataElementTrait
/**
@@ -690,5 +659,19 @@
*/
var attributes = null;
+/**
+ * Returns a list of empty nodes, each named 'name'.
+ * @param Number count: how many nodes to create.
+ * @param String name: the name for each node
+ * @return Array: list of new nodes.
+ */
+static function makeNodeList(count, name) {
+ var a = [];
+ for (var i=0; i < count; i++) {
+ a[i] = new LzDataElement(name, {}, null);
+ }
+ return a;
+}
+
static var valueToElement = LzDataElementTrait.valueToElement;
}
Modified: openlaszlo/branches/legals/WEB-INF/lps/lfc/data/LzDataNode.lzs
===================================================================
--- openlaszlo/branches/legals/WEB-INF/lps/lfc/data/LzDataNode.lzs 2007-09-13 21:14:20 UTC (rev 6469)
+++ openlaszlo/branches/legals/WEB-INF/lps/lfc/data/LzDataNode.lzs 2007-09-13 21:44:23 UTC (rev 6470)
@@ -91,6 +91,25 @@
}
/**
+ * Returns the parent of this node
+ * @return LzDataNode: the parent of this node
+ */
+function getParent () {
+ return this.parentNode;
+}
+
+/**
+ * gets offset of node in parent's childNodes array
+ * @return number
+ */
+function getOffset (){
+ if (!this.parentNode) return 0;
+ if (this.parentNode.__LZcoDirty) this.parentNode.__LZupdateCO();
+
+ return this.__LZo;
+}
+
+/**
* @access private
*/
prototype.getPreviousSibling.dependencies = function( who, self ){
Copied: openlaszlo/branches/legals/WEB-INF/lps/lfc/data/LzDataProvider.lzs (from rev 5999, openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/data/LzDataProvider.lzs)
Copied: openlaszlo/branches/legals/WEB-INF/lps/lfc/data/LzDataRequest.lzs (from rev 5999, openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/data/LzDataRequest.lzs)
Modified: openlaszlo/branches/legals/WEB-INF/lps/lfc/data/LzDatapointer.lzs
===================================================================
--- openlaszlo/branches/legals/WEB-INF/lps/lfc/data/LzDatapointer.lzs 2007-09-13 21:14:20 UTC (rev 6469)
+++ openlaszlo/branches/legals/WEB-INF/lps/lfc/data/LzDatapointer.lzs 2007-09-13 21:44:23 UTC (rev 6470)
@@ -629,8 +629,10 @@
var np;
if ( p == null ){
- // FIXME: [2006-09-25 ben] (LPP-2760) Should this return a type-safe null, or undefined?
- return false;
+ if ( $debug ) {
+ Debug.warn("%s: p is null in %s", arguments.callee, this);
+ }
+ return false;
}
if (pathobj.selectors != null) {
@@ -888,8 +890,12 @@
* @return String: The name of the datapointer's node
*/
function getNodeName (){
- // FIXME: [2006-09-25 ben] (LPP-2760) Should this return a type-safe null, or undefined?
- if ( ! this.p ) return;
+ if ( ! this.p ) {
+ if ( $debug ) {
+ Debug.warn("%s: p is null in %s", arguments.callee, this);
+ }
+ return;
+ }
return this.p.nodeName;
}
@@ -898,8 +904,12 @@
* @param String name: The new name for the datapointer's node
*/
function setNodeName (name){
- // FIXME: [2006-09-25 ben] (LPP-2760) Should this return a type-safe null, or undefined?
- if ( ! this.p ) return;
+ if ( ! this.p ) {
+ if ( $debug ) {
+ Debug.warn("%s: p is null in %s", arguments.callee, this);
+ }
+ return;
+ }
this.p.setNodeName( name );
}
@@ -911,8 +921,12 @@
* attributes
*/
function getNodeAttributes (){
- // FIXME: [2006-09-25 ben] (LPP-2760) Should this return a type-safe null, or undefined?
- if ( ! this.p ) return;
+ if ( ! this.p ) {
+ if ( $debug ) {
+ Debug.warn("%s: p is null in %s", arguments.callee, this);
+ }
+ return;
+ }
return this.p.attributes;
}
@@ -922,8 +936,12 @@
* @return String: The value of the attribute.
*/
function getNodeAttribute (name){
- // FIXME: [2006-09-25 ben] (LPP-2760) Should this return a type-safe null, or undefined?
- if ( ! this.p ) return;
+ if ( ! this.p ) {
+ if ( $debug ) {
+ Debug.warn("%s: p is null in %s", arguments.callee, this);
+ }
+ return;
+ }
return this.p.attributes[ name ];
}
@@ -934,8 +952,12 @@
* @param String val: The value for the attribute
*/
function setNodeAttribute (name, val) {
- // FIXME: [2006-09-25 ben] (LPP-2760) Should this return a type-safe null, or undefined?
- if (! this.p) return;
+ if ( ! this.p ) {
+ if ( $debug ) {
+ Debug.warn("%s: p is null in %s", arguments.callee, this);
+ }
+ return;
+ }
this.p.setAttr( name, val );
}
@@ -944,8 +966,12 @@
* @param String name: The name of the attribute to delete.
*/
function deleteNodeAttribute (name) {
- // FIXME: [2006-09-25 ben] (LPP-2760) Should this return a type-safe null, or undefined?
- if ( ! this.p ) return;
+ if ( ! this.p ) {
+ if ( $debug ) {
+ Debug.warn("%s: p is null in %s", arguments.callee, this);
+ }
+ return;
+ }
this.p.removeAttr( name );
}
@@ -957,8 +983,12 @@
* @return String: The text in the node pointed to by the datapointer.
*/
function getNodeText (){
- // FIXME: [2006-09-25 ben] (LPP-2760) Should this return a type-safe null, or undefined?
- if (! this.p) return;
+ if ( ! this.p ) {
+ if ( $debug ) {
+ Debug.warn("%s: p is null in %s", arguments.callee, this);
+ }
+ return;
+ }
return this.p.__LZgetText();
}
@@ -1000,8 +1030,13 @@
* @param String val: The new string for the node's text
*/
function setNodeText (val) {
- // FIXME: [2006-09-25 ben] (LPP-2760) Should this return a type-safe null, or undefined?
- if ( ! this.p ) return;
+ if ( ! this.p ) {
+ if ( $debug ) {
+ Debug.warn("%s: p is null in %s", arguments.callee, this);
+ }
+ return;
+ }
+
// set the first text node you find; otherwise add one
var foundit = false;
for (var i = 0; i < this.p.childNodes.length; i++) {
@@ -1038,9 +1073,12 @@
* @return LzDataElement: the new node
*/
function addNode ( name, text , attrs ){
- // FIXME: [2006-10-04 pbr] (LPP-2760) Should this return a type-safe null, or undefined?
- if ( !this.p )
- return;
+ if ( ! this.p ) {
+ if ( $debug ) {
+ Debug.warn("%s: p is null in %s", arguments.callee, this);
+ }
+ return;
+ }
var nn = new LzDataElement( name , attrs );
if ( text != null ){
@@ -1059,8 +1097,13 @@
* Otherwise the pointer is set to <code>null</code>.
*/
function deleteNode ( ){
- // FIXME: [2006-09-25 ben] (LPP-2760) Should this return a type-safe null, or undefined?
- if ( !this.p ) return;
+ if ( ! this.p ) {
+ if ( $debug ) {
+ Debug.warn("%s: p is null in %s", arguments.callee, this);
+ }
+ return;
+ }
+
var op = this.p
if ( !this.rerunxpath ){
//move the pointer to the next sibling
@@ -1108,9 +1151,14 @@
* @return LzDatapointer: A pointer to the new node
*/
function addNodeFromPointer ( dp ){
- // FIXME: [2006-09-25 ben] (LPP-2760) Should this return a type-safe null, or undefined?
if ( ! dp.p ) return;
- if ( ! this.p ) return;
+ if ( ! this.p ) {
+ if ( $debug ) {
+ Debug.warn("%s: p is null in %s", arguments.callee, this);
+ }
+ return;
+ }
+
var n = dp.p.cloneNode( true );
this.p.appendChild( n );
return new LzDatapointer( null , { pointer : n } );
@@ -1128,10 +1176,13 @@
/** @access private */
function __LZprocessOperator ( p , pp , depends ){
+ if (p == null) {
+ if ( $debug ) {
+ Debug.warn("%s: p is null in %s", arguments.callee, this);
+ }
+ return;
+ }
- // FIXME: [2006-09-25 ben] (LPP-2760) Should this return a type-safe null, or undefined?
- if (p == null) return;
-
if ( pp.operatorArgs != null ){
return p[ pp.operator ] ( pp.operatorArgs );
}
@@ -1215,8 +1266,12 @@
* contents.
*/
function serialize ( ){
- // FIXME: [2006-09-25 ben] (LPP-2760) Should this return a type-safe null, or undefined?
- if (this.p == null) return;
+ if ( this.p == null) {
+ if ( $debug ) {
+ Debug.warn("%s: p is null in %s", arguments.callee, this);
+ }
+ return;
+ }
return this.p.serialize();
}
Modified: openlaszlo/branches/legals/WEB-INF/lps/lfc/data/LzDataset.lzs
===================================================================
--- openlaszlo/branches/legals/WEB-INF/lps/lfc/data/LzDataset.lzs 2007-09-13 21:14:20 UTC (rev 6469)
+++ openlaszlo/branches/legals/WEB-INF/lps/lfc/data/LzDataset.lzs 2007-09-13 21:44:23 UTC (rev 6470)
@@ -97,14 +97,21 @@
*/
static var tagname = 'dataset';
+var dataprovider = defaultdataprovider;
+var multirequest = false;
+var dataRequest = null;
+var dataRequestClass = LzHTTPDataRequest;
+
DeclareEvent(prototype, 'ondata' );
/** Sent when the dataset's request results in an error. */
DeclareEvent(prototype, 'onerror' );
/** Sent when the request made by the dataset times out. */
DeclareEvent(prototype, 'ontimeout' );
-var timeout = 30000;
+var timeout = 60000;
+var postbody = null;
+
/** When true, the server will accept
* encoded responses for this request.
* Encoded responses require more work for the LPS (encoding the
@@ -127,11 +134,17 @@
/** When true, the server will encode and
* send the HTTP response headers along with the data (defaults to false).
- * This does not work for SOLO applications; in SOLO applications the call returns empty.
+ * Due to a lack of a native API to get this information, SOLO SWF applications
+ * will always return an empty set.
* @type Boolean
*/
var getresponseheaders = false;
+
+/** HTTP method */
+var querytype = "GET";
+
+
/** When true, the server will trim
* whitespace in the XML data (defaults to false).
* @type Boolean
@@ -176,9 +189,6 @@
/* var request; */
setters.request = "setRequest";
-static var anonDatasourceNum = 0;
-
-
var autorequest = false;
var headers = null;
var proxied = null;
@@ -191,24 +201,11 @@
function construct ( parent , args ){
this.queuerequests = false; // default to false, to emulate browser default
- this._createdParent = null;
- if (! (parent instanceof LzDatasource)) {
- this.oncanvas = parent == canvas || parent == null;
+ this.oncanvas = parent == canvas || parent == null;
- // Default datasource type is http
- this._dsrc = new LzHTTPDatasource( canvas,
- { name: "anonHTTPDS" +
- LzDataset.anonDatasourceNum++});
- this._dsrc.repset = true;
- this._createdParent = this._dsrc;
- if (this._instanceAttrs['name'] == null) {
- this._instanceAttrs['name'] = 'localdata';
- }
- } else {
- // assume datasource is parent;
- this._dsrc = parent;
- this.oncanvas = true;
+ if (this._instanceAttrs['name'] == null) {
+ this._instanceAttrs['name'] = 'localdata';
}
// bwcompat 1.0 support for port
@@ -223,7 +220,7 @@
if ('src' in args && args.src) {
this.src = args.src;
} else {
- this.src = ('src' in this._dsrc) ? this._dsrc.src : null;
+ this.src = null;
}
this.ownerDocument = this;
@@ -253,8 +250,7 @@
canvas.datasets = {};
}
- //support name is global identifier on canvas behavior, even though
- //datasets create a datasource for themselves if none is given
+ //support "name is global identifier on canvas" behavior
if ( this.oncanvas ){
if ($debug) {
if (global[name] && global[name] !== this) {
@@ -271,9 +267,8 @@
if (null != canvas.datasets[name]) {
if ($debug) {
- Debug.warn("A dataset already exists with the name '%s': %w" +
- " - use explicit datasources in your datapaths.",
- name, canvas.datasets[name]);
+ Debug.warn("A dataset already exists with the name '%s': %w",
+ name, canvas.datasets[name]);
}
}
@@ -301,16 +296,8 @@
if (canvas.datasets[ name ] === this) {
delete canvas.datasets[ name ];
}
- // [2005-08-25 ptw] I believe the various delegates will get
- // cleaned up automagically.
- var loader = this.getOption('dsloader');
- loader.destroy();
super.destroy.apply(this, arguments);
- // Destroy created datasource after you (to avoid unnecessary recursion)
- if (this._createdParent) {
- this._createdParent.destroy(recursiveCall);
- }
}
/**
@@ -361,14 +348,6 @@
}
/**
- * Allows the datasource to determine how the raw data should be interpreted
- * @access private
- */
-function gotRawData( data ) {
- this._dsrc.processRawData( this , data );
-}
-
-/**
* Sets the data for the dataset
* @param data a LzDataElement or list of Elements
* @param headers optional HTTP response headers
@@ -437,24 +416,6 @@
return dp;
}
-
-
-if ( $debug ){
-/** @access private */
-function lockFromUpdate ( who ){
- Debug.warn( 'LzDataset.lockFromUpdate is deprecated.' +
- 'Its use is unnecessary.');
- }
-}
-
-if ( $debug ){
-/** @access private */
-function unlockFromUpdate ( who ){
- Debug.warn( 'LzDataset.unlockFromUpdate is deprecated.' +
- 'Its use is unnecessary.');
- }
-}
-
/**
* Sets the querystring parameter of the dataset to the given
* string. If an object is given instead of a string, the object will be
@@ -486,8 +447,11 @@
}
/**
- * Sets the src attribute of the dataset's datasource.
- * @param String src: A new src for the dataset's datasource.
+ * Sets the src attribute of the data request.
+ * Calling this method will cause any pre-existing query arguments to be discarded.
+ * If a query string is contained in the src argument, it will be used to
+ * set the query arguments of the current request.
+ * @param String src: A new src for data request.
Need to handle these cases
http:foo.html
@@ -504,26 +468,12 @@
this.querystring = url.query;
url.query = null;
this.src = url.toString();
- this._dsrc.setAttribute( 'src' , this.src );
if ( this.autorequest ){
this.doRequest() ;
}
}
/**
- * @deprecated To change the target of a request of at runtime
- * explicitly specify the dataset's <code><datasource></code>
- */
-function setURL( src ) {
- if ($debug){
- Debug.warn( "LzDataset.setURL is deprecated. " +
- "Use LzDataset.setSrc instead." );
- }
- this.setSrc( src );
-}
-
-
-/**
* Sets whether or not the dataset makes its request directly to the target server
* or via the LPS server proxy.
* @param String val: If 'true', the dataset will make its request when it is
@@ -560,7 +510,10 @@
* @return Int: Number of miliseconds it took to load the last request.
*/
function getLoadTime( ) {
- return this._dsrc.getLoadTimeForDataset( this );
+ if ( $debug ){
+ Debug.warn( 'LzDataset.getLoadTime() is deprecated.' +
+ ' Look at dataRequest.loadtime object instead.' );
+ }
}
/**
@@ -611,14 +564,101 @@
}
}
+
/**
+ * Compute the boolean value for 'proxied', using inheritance if needed
+ * @access private
+ * @return boolean
+ */
+function isProxied ( ) {
+ var proxied_p = canvas.proxied;
+ // check if this datasource has a "proxied" attribute which overrides canvas switch
+ if (this.proxied != null && this.proxied != "inherit") {
+ proxied_p = (this.proxied == "true"); // coerce to boolean
+ }
+
+ // Check if the dataset has a "proxied" attribute which overrides dataset's value
+ if (this.proxied != null && this.proxied != "inherit") {
+ proxied_p = (this.proxied == "true");
+ }
+ return proxied_p;
+}
+
+/**
* Does a request immediately using the current values. If autorequest is true,
* this method is called automatically when values change.
*/
function doRequest() {
- this._dsrc.doRequest( this );
+
+ // We try to reuse the old datarequest object, unless
+ // multirequest is true. If multirequest is true, we need
+ // a separate datarequest obj for each request.
+ if (this.multirequest || this.dataRequest == null) {
+ this.dataRequest = new this.dataRequestClass(this);
+ }
+
+ var dreq = this.dataRequest
+
+ dreq.src = this.src;
+ dreq.timeout = this.timeout;
+ dreq.status = dreq.READY;
+ dreq.method = this.querytype;
+
+ // For back compatibility with 'lzpostbody'
+ var lzpostbody = null;
+ if (this.params) {
+ lzpostbody = this.params.getValue('lzpostbody');
+ }
+ if (lzpostbody != null) {
+ dreq.postbody = lzpostbody;
+ }
+
+ dreq.proxied = this.isProxied();
+
+ // TODO [hqm 2007-08] does this interact with 'multirequests' flag?
+ dreq.queuerequests = this.queuerequests;
+
+ dreq.queryparams = this.params;
+
+ // TODO [hqm 2007-08] We didn't put 'querystring' in the dataprovider spec, should
+ // it be merged into queryparams somehow?
+ dreq.querystring = this.querystring;
+
+ dreq.requestheaders = this.headers;
+ dreq.getresponseheaders = this.getresponseheaders;
+
+ dreq.secureport = this.secureport;
+
+ dreq.cacheable = this.cacheable;
+ dreq.clientcacheable = this.clientcacheable;
+ dreq.trimwhitespace = this.trimwhitespace;
+ dreq.nsprefix = this.nsprefix;
+
+ // NB: You had better set the onstatus event handler *before* issuing request
+ this.dsloadDel = new LzDelegate( this , "handleDataResponse" , dreq, "onstatus");
+ this.dataprovider.doRequest( dreq );
+
}
+/**
+ * @access private
+ * Called when data request status changes.
+ * If status is 'success', call setData
+ */
+
+function handleDataResponse (datareq) {
+ if (datareq.status == LzDataRequest.SUCCESS) {
+ this.setData(datareq.xmldata, datareq.responseheaders);
+ } else if (datareq.status == LzDataRequest.ERROR) {
+ this.gotError(datareq.error);
+ } else if (datareq.status == LzDataRequest.TIMEOUT) {
+ this.gotTimeout();
+ }
+
+}
+
+// TODO [hqm 2007-08] Is "request()" an ancient deprecated alias for
+// doRequest? When can we get rid of it?
prototype.request = doRequest;
/**
@@ -673,7 +713,7 @@
* @return String
*/
function getResponseHeader(name) {
- return this.responseheaders.getValueNoCase( name );
+ return this.dataRequest.responseheaders[ name ];
}
/**
@@ -689,22 +729,29 @@
* that has more than one request parameter is undefined.
*/
function setQueryType( reqtype ) {
- this._dsrc.setQueryType( reqtype.toUpperCase() );
+ this.querytype = ( reqtype.toUpperCase() );
}
+/** Sets the raw content of a POST body.
+ * This replaces the old "lzpostbody" convention for passing raw POST data.
+ * @param String str: The string to use as the raw POST body content
+ */
+function setPostBody (str) {
+ this.postbody = str;
+}
+
//-----------------------------------------------------------------------------
// Stops the load of the dataset's current request
//-----------------------------------------------------------------------------
function abort( ) {
- this._dsrc.abortLoadForDataset( this );
+ this.dataprovider.abortLoadForRequest( this.dataRequest );
}
/**
* Returns all response headers as an object of name/value pairs, or false
* if there were none.
*
- * @return LzParam: An LzParam object containing the response headers.
- * This does not work for SOLO swf applications; in SOLO swf applications it returns empty.
+ * @return Object A hash table object containing the response headers.
*/
function getAllResponseHeaders() {
return this.responseheaders;
@@ -725,7 +772,6 @@
/** @access private */
function setInitialData ( d ){
- this.initialdata = d;
if (d != null) {
var e = LzDataNode.stringToLzData(d, this.trimwhitespace, this.nsprefix);
this.setData(e.childNodes);
Copied: openlaszlo/branches/legals/WEB-INF/lps/lfc/data/LzHTTPDataProvider.lzs (from rev 5999, openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/data/LzHTTPDataProvider.lzs)
Modified: openlaszlo/branches/legals/WEB-INF/lps/lfc/data/LzReplicationManager.lzs
===================================================================
--- openlaszlo/branches/legals/WEB-INF/lps/lfc/data/LzReplicationManager.lzs 2007-09-13 21:14:20 UTC (rev 6469)
+++ openlaszlo/branches/legals/WEB-INF/lps/lfc/data/LzReplicationManager.lzs 2007-09-13 21:44:23 UTC (rev 6470)
@@ -234,7 +234,9 @@
this.cloneChildren = [];
}
- this.visible = odp.datacontrolsvisibility || view.visible;
+ this.visible = odp.datacontrolsvisibility ||
+ (!view.isinited &&
+ ('visible' in view._instanceAttrs) ? view._instanceAttrs.visible : view.visible);
if ( args.pooling != null ){
this.pooling = args.pooling;
Modified: openlaszlo/branches/legals/WEB-INF/lps/lfc/events/LaszloEvents.lzs
===================================================================
--- openlaszlo/branches/legals/WEB-INF/lps/lfc/events/LaszloEvents.lzs 2007-09-13 21:14:20 UTC (rev 6469)
+++ openlaszlo/branches/legals/WEB-INF/lps/lfc/events/LaszloEvents.lzs 2007-09-13 21:44:23 UTC (rev 6470)
@@ -215,7 +215,7 @@
}
*/
// d.execute( sd ); inlined
- d.c[d.f]( sd );
+ if (d.c[d.f]) d.c[d.f]( sd );
i+=2;
}
evq.length = pos;
Modified: openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/dhtml/LzHTTPLoader.js
===================================================================
--- openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/dhtml/LzHTTPLoader.js 2007-09-13 21:14:20 UTC (rev 6469)
+++ openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/dhtml/LzHTTPLoader.js 2007-09-13 21:44:23 UTC (rev 6470)
@@ -9,8 +9,7 @@
* @affects lzloader
*/
-var LzHTTPLoader = function (owner, proxied, dataset) {
- this.dataset = dataset;
+var LzHTTPLoader = function (owner, proxied) {
this.owner = owner;
this.options = {parsexml: true};
this.requestheaders = {};
@@ -135,7 +134,7 @@
reqtype: reqtype,
sendheaders: this.options.sendheaders,
trimwhitespace: this.options.trimwhitespace,
- nsprefix: this.options.trimwhitespace,
+ nsprefix: this.options.nsprefix,
url: LzBrowser.toAbsoluteURL(url, this.secure),
timeout: this.timeout,
cache: this.options.cacheable,
@@ -192,8 +191,8 @@
// holds list of outstanding data requests, to handle timeouts
LzHTTPLoader.activeRequests = [];
-// Default 30 second timeout
-LzHTTPLoader.prototype.timeout = (30 * 1000);
+// Default infinite timeout
+LzHTTPLoader.prototype.timeout = Infinity;
LzHTTPLoader.prototype.setTimeout = function (timeout) {
this.timeout = timeout;
Modified: openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/dhtml/LzXMLTranslator.js
===================================================================
--- openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/dhtml/LzXMLTranslator.js 2007-09-13 21:14:20 UTC (rev 6469)
+++ openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/dhtml/LzXMLTranslator.js 2007-09-13 21:44:23 UTC (rev 6470)
@@ -15,7 +15,7 @@
var LzXMLTranslator = new Object;
LzXMLTranslator.copyXML = function (xmldoc, trimwhitespace, nsprefix) {
- var lfcnode = LzXMLTranslator.copyBrowserXML(xmldoc, true, trimwhitespace);
+ var lfcnode = LzXMLTranslator.copyBrowserXML(xmldoc, true, trimwhitespace, nsprefix);
return lfcnode;
}
@@ -24,7 +24,7 @@
LzXMLTranslator.stringTrimPat = new RegExp("(^[\t\n\r ]*|[\t\n\r ]*$)", "g");
LzXMLTranslator.slashPat = new RegExp("/", "g");
-LzXMLTranslator.copyBrowserXML = function (node, ignorewhite, trimwhite) {
+LzXMLTranslator.copyBrowserXML = function (node, ignorewhite, trimwhite, nsprefix) {
if (! node) return node;
var nv = node.nodeValue;
var lfcnode = null;
@@ -58,18 +58,37 @@
if (attrnode) {
var attrname = attrnode.name;
var attrval = attrnode.value;
- cattrs[attrname] = attrval;
+ var nattrname = attrname;
+
+ if (!nsprefix) {
+ // strip namespace prefixes
+ var colpos = attrname.indexOf(':');
+ if (colpos >= 0) {
+ nattrname = attrname.substring(colpos+1);
+ }
+ }
+
+ cattrs[nattrname] = attrval;
}
}
}
+ var nname = node.nodeName;
+ if (nname && !nsprefix) {
+ // strip namespace prefix
+ var npos = nname.indexOf(':');
+ if (npos >= 0) {
+ nname = nname.substring(npos+1);
+ }
+ }
- lfcnode = new LzDataElement(node.nodeName, cattrs);
+
+ lfcnode = new LzDataElement(nname, cattrs);
var children = node.childNodes;
var newchildren = [];
for (var i = 0; i < children.length; i++ ) {
var child = children[i];
- var lfcchild = LzXMLTranslator.copyBrowserXML(child, ignorewhite, trimwhite);
+ var lfcchild = LzXMLTranslator.copyBrowserXML(child, ignorewhite, trimwhite, nsprefix);
//Debug.debug('lfcchild = ', lfcchild);
if (lfcchild != null) {
newchildren.push(lfcchild);
Modified: openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/swf/LzHTTPLoader.as
===================================================================
--- openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/swf/LzHTTPLoader.as 2007-09-13 21:14:20 UTC (rev 6469)
+++ openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/swf/LzHTTPLoader.as 2007-09-13 21:44:23 UTC (rev 6470)
@@ -13,9 +13,8 @@
*/
// We have an internal 'lzloader' property which points to an LzLoader (Flash-7-8-specific)
-var LzHTTPLoader = function (owner, proxied, dataset) {
- this.lzloader = this.makeLzLoader(proxied, dataset.timeout);
- this.dataset = dataset;
+var LzHTTPLoader = function (owner, proxied) {
+ this.lzloader = this.makeLzLoader(proxied);
this.owner = owner;
this.options = {
// enable server (proxy) caching
@@ -34,7 +33,8 @@
}
// Default callback handlers
-LzHTTPLoader.prototype._loadSuccessHandler = function (data) { this.loadSuccess(this,data);}
+
+LzHTTPLoader.prototype._loadSuccessHandler = function (data) {this.loadSuccess(this,data);}
LzHTTPLoader.prototype._loadErrorHandler = function (data) { this.loadError(this,data);}
LzHTTPLoader.prototype._loadTimeoutHandler = function (data) { this.loadTimeout(this,data);}
@@ -48,7 +48,7 @@
/* Returns the response as a string */
LzHTTPLoader.prototype.getResponse = function () {
- // nyi
+ return this.lzloader.rawtext;
}
/* Returns the parsed native XML DOM object, if any */
@@ -75,7 +75,7 @@
}
LzHTTPLoader.prototype.abort = function () {
- // nyi
+ this.lzloader.abort();
}
LzHTTPLoader.prototype.setOption = function (key, val) {
@@ -130,9 +130,7 @@
// Create a Flash XML object, and stuff it in the LzXMLLoader.
var xmlrequestobj = new XML();
-
- this.dataset.errorstring = null;
-
+
xmlrequestobj.cache = this.options.cacheable;
if (typeof(lzloader.timeout) != 'undefined') {
@@ -142,6 +140,7 @@
// trim whitespace from start and end of text node content
//Debug.write("this.options.trimwhitespace" , this.options.trimwhitespace);
xmlrequestobj.trimwhitespace = (this.options.trimwhitespace);
+ xmlrequestobj.nsprefix = (this.options.nsprefix);
// This is a Flash XML Parser flag - says to completely ignore
// text nodes which are all whitespace. If you set this to false,
@@ -149,8 +148,6 @@
xmlrequestobj.ignoreWhite = true;
xmlrequestobj.url = req;
- // create a pointer back to the dataset, so we can update it when data arrives
- xmlrequestobj.dataset = this.dataset;
xmlrequestobj.reqtype = this.requestmethod;
xmlrequestobj.proxied = this.lzloader.proxied;
@@ -221,7 +218,7 @@
}
-LzHTTPLoader.prototype.timeout = (30 * 1000);
+LzHTTPLoader.prototype.timeout = Infinity;
LzHTTPLoader.prototype.setTimeout = function (timeout) {
this.timeout = timeout;
@@ -237,7 +234,7 @@
* @access private
* @return LzLoader
*/
-LzHTTPLoader.prototype.makeLzLoader = function (proxied, timeout){
+LzHTTPLoader.prototype.makeLzLoader = function (proxied){
if ( ! $dataloaders ){
// SWF-specific
_root.attachMovie("empty", "$dataloaders", 4242);
@@ -252,10 +249,8 @@
$dataloaders.dsnum ];
$dataloaders.dsnum++;
- //Debug.write("dataset timeout", this.timeout);
-
return new LzLoader( this, { attachRef : newloadermc ,
- timeout : timeout,
+ timeout : Infinity,
proxied: proxied} );
}
Modified: openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/swf/LzLoadQueue.as
===================================================================
--- openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/swf/LzLoadQueue.as 2007-09-13 21:14:20 UTC (rev 6469)
+++ openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/swf/LzLoadQueue.as 2007-09-13 21:44:23 UTC (rev 6470)
@@ -14,13 +14,9 @@
*/
var LzLoadQueue = new Object;
-if ($profile) {
- // leave a network socket for the profiler to use
- LzLoadQueue.maxOpen = 1;
-} else {
- LzLoadQueue.maxOpen = 2;
-}
+LzLoadQueue.maxOpen = 8;
+
if ($debug) {
/**
* Set to true to monitor loadQueue state changes when debugging
@@ -101,7 +97,7 @@
Debug.warn("LzLoadQueue.XMLOnDataHandler load failed from URL %w, no data received.", this.url);
Debug.warn("Failure to load data in serverless apps may be caused by Flash player security policies. Check your data server crossdomain.xml file");
this.onload(false);
- if (this.dataset.onerror.ready) this.dataset.onerror.sendEvent(this.dataset);
+ if (this.loader.onerror.ready) this.loader.onerror.sendEvent(this.loader);
// cancel the timeout handler
LzLoadQueue.unloadRequest(this);
} else {
@@ -112,7 +108,6 @@
// Stash the raw text on the xml object, in case someone wants it (XMLHTTPRequest, for example)
this.loader.rawtext = src;
this.parseXML(src);
- //Debug.write('XMLOnDataHandler parsing:' , src);
this.onload(true);
// Free up the network connection, so it can be reused, while we do the copy task in background.
// Copy the Flash XML tree into tree of LFC LzData classes
@@ -331,7 +326,7 @@
LzLoadQueue.loadMovieProxiedOrDirect = function (loadobj) {
var reqstr;
if ( !loadobj.proxied ) {
- reqstr = loadobj.reqobj.url;
+ reqstr = LzBrowser.toAbsoluteURL(loadobj.reqobj.url, false);
} else {
delete loadobj.proxied;
@@ -464,7 +459,7 @@
// request methodcases:
// PROXIED: always POST to LPS server
// SOLO: GET, POST, (and lzpostbody special case of POST with raw content)
- if (proxied) {
+ if (loadobj.proxied) {
lvar.sendAndLoad(reqstr , loadobj, "POST" );
} else {
// get request headers from loader
Modified: openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/swf/LzLoader.lzs
===================================================================
--- openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/swf/LzLoader.lzs 2007-09-13 21:14:20 UTC (rev 6469)
+++ openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/swf/LzLoader.lzs 2007-09-13 21:44:23 UTC (rev 6470)
@@ -397,7 +397,7 @@
}
if (loadobj) {
this.unload(loadobj);
- if (this.ontimeout.ready) this.ontimeout.sendEvent( loadobj.reqobj.dataset );
+ if (this.ontimeout.ready) this.ontimeout.sendEvent( loadobj.reqobj);
}
}
@@ -493,9 +493,7 @@
// set up the work queue
this.copyQueue = {ptr: 0, q: queue, xmlobj: xmlnode};
this.trimwhitespace = xmlnode.trimwhitespace;
- var dset = xmlnode.dataset;
- //Debug.write("dset.nsprefix=", dset.nsprefix, "queuedCopyFlashXML, dataset = ", dset);
- this.nsprefix = dset.nsprefix; // preserve namespace prefix
+ this.nsprefix = xmlnode.nsprefix;
this.queuedCopyFlashXML_internal();
this.startCopyTask();
}
@@ -511,6 +509,8 @@
* @access private
*/
function queuedCopyFlashXML_internal () {
+ var nsprefix = this.nsprefix;
+ var trimwhitespace = this.trimwhitespace;
var ptr = this.copyQueue.ptr;
// Debug.write("enter queuedCopyFlashXML_internal", ptr);
var q = this.copyQueue.q;
@@ -537,7 +537,7 @@
// text node?
if (node.nodeType == 3) {
- if (this.trimwhitespace == true) {
+ if (trimwhitespace == true) {
nv = LzDataNode.trim(nv);
}
lfcnode = {__proto__: LzDataText.prototype, data: nv, parentNode: lfcparent};
@@ -546,7 +546,7 @@
// After this works, try bashing the __proto__
// and see if GC still works.
- var stripnsprefix = !this.nsprefix;
+ var stripnsprefix = !nsprefix;
var nattrs = node.attributes;
var cattrs;
if (stripnsprefix) {
@@ -573,7 +573,7 @@
////////
var nodename = node.nodeName;
- if (nodename && !this.nsprefix) {
+ if (nodename && !nsprefix) {
var npos = nodename.indexOf(':');
if (npos >= 0) {
nodename = nodename.substring(npos+1);
Modified: openlaszlo/branches/legals/WEB-INF/lps/lfc/services/LzCSSStyle.js
===================================================================
--- openlaszlo/branches/legals/WEB-INF/lps/lfc/services/LzCSSStyle.js 2007-09-13 21:14:20 UTC (rev 6469)
+++ openlaszlo/branches/legals/WEB-INF/lps/lfc/services/LzCSSStyle.js 2007-09-13 21:44:23 UTC (rev 6470)
@@ -28,7 +28,7 @@
if ( !this.specificity ) {
//need to treat compound selectors differently
- if ( this.parsed.type == LzCSSStyle._selTypes.compound ){
+ if ( this.parsed.type == LzCSSStyle._sel_compound ){
for ( var i = 0; i < this.parsed.length; i++ ){
this.specificity += LzCSSStyle.getSelectorSpecificity( this.parsed[ i ] );
}
@@ -70,7 +70,6 @@
return 1 ;
}
-
var LzCSSStyle = {};
LzCSSStyle.getComputedStyle = function ( node ){
@@ -81,70 +80,99 @@
/** @access private */
LzCSSStyle.__LZRuleCache = {};
+LzCSSStyle.__LZPropertyCache = {};
//LzCSSStyle.time1 = 0;
-LzCSSStyle.getPropertyValueFor = function ( node , pname ){
+LzCSSStyle.getPropertyValueFor = function ( initialnode , pname ){
//Debug.warn("node: %w, pname: %w, rules: %w\n", node, pname, this._rules);
//var t = getTimer();
- if (!node) return;
- var uid = node.getUID();
- var rules = this.__LZRuleCache[ uid ];
- if ( !rules ) {
- rules = new Array();
- var r;
- for ( var i = this._rules.length -1; i >=0; i-- ){
- r = this._rules[ i ];
- if ( this._selectorApplies( r, r.parsed, node ) ){
- rules.push(r);
- }
- }
+ if (!initialnode || !pname) return;
- //now look at any preprocessed rules
- // NOTE:
- // it would be nice to just use (node.name) as the condition, but
- // swf6 does not obey obey the ECMA string->boolean coercion specification.
- // As a workaround, we compare node.name to null, thereby ensuring we get a boolean
- // in swf6 or ECMA-compatible runtimes
- var pprules = (node.name != null) ? this._nameRules[ node.name ] : null;
- if ( pprules ){
- //same code as above, but inline to avoid function call overhead
- for ( var i = pprules.length -1; i >=0; i-- ){
- r = pprules[ i ];
- if ( this._selectorApplies( r, r.parsed, node ) ){
+ var node = initialnode;
+ while (node != canvas) {
+ var uid = node.__LZUID;
+ var val = this.__LZPropertyCache[uid + pname];
+ if (val != null) return val;
+
+ var rules = this.__LZRuleCache[ uid ];
+ if ( !rules ) {
+ rules = new Array();
+ var r;
+ for ( var i = this._rules.length -1; i >=0; i-- ){
+ r = this._rules[ i ];
+ var rp = r.parsed;
+ if ( rp.type == this._sel_star ||
+ (rp.type == this._sel_id && rp.id == node.id) ||
+ (rp.type == this._sel_tag && (((rp.classname in lz) && (node instanceof lz[ rp.classname ])) || ( (rp.classname in global) && (node instanceof global[ rp.classname ])))) ||
+ (rp.type == this._sel_attribute && node[ rp.attrname ] == rp.attrvalue) ||
+ (rp.type == this._sel_tagAndAttr && node[ rp.attrname ] == rp.attrvalue && (((rp.classname in lz) && (node instanceof lz[ rp.classname ])) || ( (rp.classname in global) && (node instanceof global[ rp.classname ])))) ||
+ (rp.type == this._sel_compound && this._selectorApplies( rp, node ))){
rules.push(r);
}
}
+
+ //now look at any preprocessed rules
+ // NOTE:
+ // it would be nice to just use (node.name) as the condition, but
+ // swf6 does not obey obey the ECMA string->boolean coercion specification.
+ // As a workaround, we compare node.name to null, thereby ensuring we get a boolean
+ // in swf6 or ECMA-compatible runtimes
+ var pprules = (node.name != null) ? this._nameRules[ node.name ] : null;
+ if ( pprules ){
+ //same code as above, but inline to avoid function call overhead
+ for ( var i = pprules.length -1; i >=0; i-- ){
+ r = pprules[ i ];
+ var rp = r.parsed;
+ if ( rp.type == this._sel_star ||
+ (rp.type == this._sel_id && rp.id == node.id) ||
+ (rp.type == this._sel_tag && (((rp.classname in lz) && (node instanceof lz[ rp.classname ])) || ( (rp.classname in global) && (node instanceof global[ rp.classname ])))) ||
+ (rp.type == this._sel_attribute && node[ rp.attrname ] == rp.attrvalue) ||
+ (rp.type == this._sel_tagAndAttr && node[ rp.attrname ] == rp.attrvalue && (((rp.classname in lz) && (node instanceof lz[ rp.classname ])) || ( (rp.classname in global) && (node instanceof global[ rp.classname ])))) ||
+ (rp.type == this._sel_compound && this._selectorApplies( rp, node ))){
+ rules.push(r);
+ }
+ }
+ }
+
+ //sort match rules by their specificities
+ //first tell the sort function who this is being sorted for; the sort
+ //depends not only on the rules, but also on the specificity of the
+ //class selector, if one is present
+
+ rules.sort(this.__compareSpecificity);
+
+ this.__LZRuleCache[ uid ] = rules;
}
-
- //sort match rules by their specificities
- //first tell the sort function who this is being sorted for; the sort
- //depends not only on the rules, but also on the specificity of the
- //class selector, if one is present
- rules.sort(this.__compareSpecificity);
+ //Debug.write("About to print rule array.")
+ //LzCSSStyle._printRuleArray( rules );
- this.__LZRuleCache[ uid ] = rules;
- }
+ var l = rules.length;
+ var i = 0;
+ while ( i < l ) {
+ var props = rules[i++].properties;
+ if (pname in props) {
+ val = props[pname];
+ this.__LZPropertyCache[uid + pname] = val;
+ break;
+ }
+ }
+ if (val != null) return val;
- //Debug.write("About to print rule array.")
- //LzCSSStyle._printRuleArray( rules );
-
- var l = rules.length;
- var pv = null;
- var i = 0;
- while ( i < l ) {
- var props = rules[i++].properties;
- if (pname in props) { return props[pname]; }
+ node = node.immediateparent;
+ ////this.time1 += getTimer() - t;
}
- ////this.time1 += getTimer() - t;
- if ( node == canvas ) return null;
- else {
- return this.getPropertyValueFor(node.immediateparent, pname );
+ if ($debug) {
+ // Fix for LPP-3024: if we're in debug mode, warn when CSS lookup
+ // results in a null or undefined value. [bshine 08.03.2007]
+ Debug.warn(
+ "No CSS value found for node %#w for property name %s",
+ initialnode,
+ pname);
}
-
}
LzCSSStyle.getSelectorSpecificity = function ( parsedsel ){
@@ -158,17 +186,17 @@
count the number of element names and pseudo-elements in the selector (= d)
*/
switch ( parsedsel.type ){
- case (this._selTypes.tag ):
- case (this._selTypes.star ):
+ case (this._sel_tag ):
+ case (this._sel_star ):
return 1;
- case (this._selTypes.id ):
+ case (this._sel_id ):
return 100;
- case (this._selTypes.attribute ):
+ case (this._sel_attribute ):
return 10;
- case (this._selTypes.tagAndAttr ):
+ case (this._sel_tagAndAttr ):
return 11;
}
}
@@ -192,8 +220,8 @@
// if *that* matches, then the descendant rule with closer selectors
// wins
- if ( rA.parsed.type == LzCSSStyle._selTypes.compound &&
- rB.parsed.type == LzCSSStyle._selTypes.compound ){
+ if ( rA.parsed.type == LzCSSStyle._sel_compound &&
+ rB.parsed.type == LzCSSStyle._sel_compound ){
//iterate through the compound selector arrays
//assume that the selector arrays are the same length, due to
//specificity. if they don't, or if all the comparisons match, then
@@ -247,66 +275,60 @@
/** @devnote this ideally would be two separate functions, but merging them
* and inlining the cases of the switch statement is a 2x speedup [awolff]
* @access private */
-LzCSSStyle._selectorApplies = function ( rule, rp , node ){
+LzCSSStyle._selectorApplies = function ( rp , node ){
//rp is the parsed selector
- switch ( rp.type ){
- case (this._selTypes.star ):
- return true;
+ var t = rp.type;
+ if ( t == this._sel_star ||
+ (t == this._sel_id && rp.id == node.id) ||
+ (t == this._sel_tag && (((rp.classname in lz) && (node instanceof lz[ rp.classname ])) || ( (rp.classname in global) && (node instanceof global[ rp.classname ])))) ||
+ (t == this._sel_attribute && node[ rp.attrname ] == rp.attrvalue) ||
+ (t == this._sel_tagAndAttr && node[ rp.attrname ] == rp.attrvalue && (((rp.classname in lz) && (node instanceof lz[ rp.classname ])) || ( (rp.classname in global) && (node instanceof global[ rp.classname ]))))) {
+ return true;
+ } else if (t == this._sel_compound) {
+ var curnode = node;
+ var sindex = rp.length -1;
+ var firstone = true;
- case (this._selTypes.id ):
- return node.id == rp.id;
+ while (curnode != canvas){
+ var nrp = rp[sindex]
+ t = nrp.type;
- case (this._selTypes.tag ):
- return ((rp.classname in lz) && (node instanceof lz[ rp.classname ]))
- || ( (rp.classname in global) && (node instanceof global[ rp.classname ]));
-
- case (this._selTypes.compound ):
- var curnode = node;
- var sindex = rp.length -1;
-
- var lc = rp[ sindex ];
- var firstone = true;
- while ( curnode ){
-
- if (this._selectorApplies( rule, rp[ sindex ], curnode )){
- if ( sindex-- == 0 ){
- return true;
- }
- } else if ( firstone ){
- //if the last selector doesn't apply, then bail -- we'll
- //come back for this when we recurse over the parents in
- //getPropertyValueFor
- return false;
+ if ( t == this._sel_star ||
+ (t == this._sel_id && nrp.id == curnode.id) ||
+ (t == this._sel_tag && (((nrp.classname in lz) && (curnode instanceof lz[ nrp.classname ])) || ( (nrp.classname in global) && (curnode instanceof global[ nrp.classname ])))) ||
+ (t == this._sel_attribute && curnode[ nrp.attrname ] == nrp.attrvalue) ||
+ (t == this._sel_tagAndAttr && curnode[ nrp.attrname ] == nrp.attrvalue && (((nrp.classname in lz) && (curnode instanceof lz[ nrp.classname ])) || ( (nrp.classname in global) && (curnode instanceof global[ nrp.classname ])))) ||
+ (t == this._sel_compound && this._selectorApplies( nrp, curnode ))){
+ if ( sindex-- == 0 ){
+ return true;
}
-
- if (curnode == canvas) break;
- curnode = curnode.parent;
- firstone = false;
+ } else if ( firstone ){
+ //if the last selector doesn't apply, then bail -- we'll
+ //come back for this when we recurse over the parents in
+ //getPropertyValueFor
+ return false;
}
- return false;
- case (this._selTypes.attribute ):
- return node[ rp.attrname ] == rp.attrvalue;
-
- case (this._selTypes.tagAndAttr ):
- if (node[ rp.attrname ] == rp.attrvalue) {
- return ((rp.classname in lz) && (node instanceof lz[ rp.classname ]))
- || ( (rp.classname in global) && (node instanceof global[ rp.classname ]));
- }
- return false;
+ curnode = curnode.parent;
+ firstone = false;
+ }
}
}
/** @access private */
-LzCSSStyle._selTypes = {
- "unknown" : 0,
- "star" : 1, // *
- "id" : 2, // #gMyId
- "tag" : 3, // styledbox
- "compound" : 4, // E F
- "attribute" : 5, // [attr="val"]
- "tagAndAttr" : 6 // class[attr="val"]
-}
+LzCSSStyle._sel_unknown = 0;
+/** @access private */
+LzCSSStyle._sel_star = 1;
+/** @access private */
+LzCSSStyle._sel_id = 2;
+/** @access private */
+LzCSSStyle._sel_tag = 3
+/** @access private */
+LzCSSStyle._sel_compound = 4
+/** @access private */
+LzCSSStyle._sel_attribute = 5
+/** @access private */
+LzCSSStyle._sel_tagAndAttr = 6
/** @access private */
LzCSSStyle._rules = new Array();
@@ -328,7 +350,7 @@
var lastsel;
if ( sel instanceof Array ){
r.parsed = [];
- r.parsed.type = this._selTypes.compound;
+ r.parsed.type = this._sel_compound;
for ( var i = 0; i < sel.length; i++ ){
r.parsed.push( this._parseSelector( sel[ i ] ) );
}
@@ -341,8 +363,8 @@
//special treatment for rules that use name=
//we could do this pretty easily for ID if ID rules were common,
//or for other attibute names
- if ( ( lastsel.type == this._selTypes.attribute ||
- lastsel.type == this._selTypes.tagAndAttr )
+ if ( ( lastsel.type == this._sel_attribute ||
+ lastsel.type == this._sel_tagAndAttr )
&& lastsel.attrname == "name" ){
var aval = lastsel.attrvalue;
if ( !this._nameRules[ aval ] ) this._nameRules[ aval ] = [];
@@ -357,10 +379,10 @@
switch ( typeof ( sel ) ){
case "object":
if (sel.simpleselector) {
- sel.type = this._selTypes.tagAndAttr;
+ sel.type = this._sel_tagAndAttr;
sel.classname = this._normalizeClassname( sel.simpleselector );
} else
- sel.type = this._selTypes.attribute;
+ sel.type = this._sel_attribute;
return sel;
break;
case "string":
@@ -373,15 +395,15 @@
LzCSSStyle._parseStringSelector = function ( sel ){
var parsed = { };
if ( sel == "*" ) {
- parsed.type = this._selTypes.star;
+ parsed.type = this._sel_star;
} else {
var index = sel.indexOf("#");
if (index >= 0) {
// Assumption: there should only be one # in a selector
parsed.id = sel.substring(index + 1);
- parsed.type = this._selTypes.id;
+ parsed.type = this._sel_id;
} else {
- parsed.type = this._selTypes.tag;
+ parsed.type = this._sel_tag;
parsed.classname = this._normalizeClassname( sel );
}
Modified: openlaszlo/branches/legals/WEB-INF/lps/lfc/services/platform/dhtml/LzHistory.js
===================================================================
--- openlaszlo/branches/legals/WEB-INF/lps/lfc/services/platform/dhtml/LzHistory.js 2007-09-13 21:14:20 UTC (rev 6469)
+++ openlaszlo/branches/legals/WEB-INF/lps/lfc/services/platform/dhtml/LzHistory.js 2007-09-13 21:44:23 UTC (rev 6470)
@@ -205,4 +205,8 @@
if (this.onoffset.ready) this.onoffset.sendEvent(0);
}
+LzHistory.setPersist = function() {
+ if ($debug) Debug.warn('History persistence is not implemented in DHTML.');
+}
+
Lz.__dhtmlhistoryready = true;
Modified: openlaszlo/branches/legals/WEB-INF/lps/lfc/services/platform/swf/LzHistory.as
===================================================================
--- openlaszlo/branches/legals/WEB-INF/lps/lfc/services/platform/swf/LzHistory.as 2007-09-13 21:14:20 UTC (rev 6469)
+++ openlaszlo/branches/legals/WEB-INF/lps/lfc/services/platform/swf/LzHistory.as 2007-09-13 21:44:23 UTC (rev 6470)
@@ -34,8 +34,8 @@
/**
* @access private
*/
-LzHistory.setHistory = function(s) {
- //Debug.write('setHistory', s);
+LzHistory.__setHistory = function(s) {
+ //Debug.write('__setHistory', s);
LzBrowser._jsreset();
LzBrowser.callJS('Lz._setHash("' + s + '")', false);
this.__lzloading = true;
@@ -48,7 +48,7 @@
return SharedObject.getLocal(n);
}
-LzHistory.persist = true;
+LzHistory.persist = false;
// The current offset (zero-based) in the history value stack.
LzHistory.offset = 0;
@@ -191,6 +191,10 @@
* e.g. scope.setAttribute('attribute_name_to_set', value).
*/
LzHistory.save = function(who, prop, val) {
+ if (typeof who != 'string') {
+ if (who['id']) who = who['id'];
+ if ($debug) Debug.warn('Warning: LzHistory.save() requires a view ID to be passed in as a string for the first argument.');
+ }
// strip off __ so keys can be listed
if (val == null) val = global[who][prop];
if (this.__lzloading) {
@@ -199,9 +203,9 @@
this.__lzloadcache[who] = {c: who, n: prop, v: val};
this.__loadcacheused = true;
} else {
- //Debug.write('set state of ',u,' to ', this.__lzcurrstate);
this.__lzcurrstate[who] = {c: who, n: prop, v: val};
this.__lzdirty = true;
+ //Debug.write('set state of ',who,' to ', this.__lzcurrstate);
}
}
@@ -244,7 +248,7 @@
if (this.__lzhistq.length >= o) {
//Debug.write('move', o, this.__lzhistq.length, this.__lzhistq);
//this.offset = o;
- this.setHistory(o);
+ this.__setHistory(o);
}
}
@@ -284,7 +288,9 @@
//Debug.write('restoring', i, d[i]);
}
}
- }
+ } else {
+ if (this._persistso) this._persistso = null;
+ }
}
LzHistory.clear = function() {
@@ -300,4 +306,9 @@
if (this.onoffset.ready) this.onoffset.sendEvent(0);
}
+LzHistory.setPersist = function(p) {
+ this.persist = p;
+ this.__initPersist();
+}
+
LzHistory.__initPersist();
Modified: openlaszlo/branches/legals/WEB-INF/lps/lfc/views/LaszloView.lzs
===================================================================
--- openlaszlo/branches/legals/WEB-INF/lps/lfc/views/LaszloView.lzs 2007-09-13 21:14:20 UTC (rev 6469)
+++ openlaszlo/branches/legals/WEB-INF/lps/lfc/views/LaszloView.lzs 2007-09-13 21:44:23 UTC (rev 6470)
@@ -893,6 +893,7 @@
* @param String resourceName: a string naming the id of the resource to attach
*/
function setResource ( resourceName ) {
+ if (resourceName == null || resourceName == this._resource) return;
/*if (LzLoader.__LZmonitorState) {
Debug.monitor(this, 'isloaded');
Debug.monitor(this, 'play');
@@ -914,6 +915,8 @@
this.resource = resourceName;
if (this.onresource.ready) this.onresource.sendEvent( resourceName );
+ this._resource = this.resource;
+
// button appears to require this return value!!!
return this.sprite.__LZmovieClipRef;
}
@@ -1708,7 +1711,7 @@
if ( !this.hassetwidth ){
this.width = newsize;
this.sprite.setWidth(newsize);
- if (this.onwidth.ready && this.isinited && this.onwidth) this.onwidth.sendEvent( newsize );
+ if (this.onwidth.ready) this.onwidth.sendEvent( newsize );
if (this.immediateparent.__LZcheckwidth)
this.immediateparent.__LZcheckwidthFunction( this );
@@ -1733,7 +1736,7 @@
if ( !this.hassetheight ){
this.height = newsize;
this.sprite.setHeight(newsize);
- if (this.onheight.ready && this.isinited && this.onheight) this.onheight.sendEvent( newsize );
+ if (this.onheight.ready) this.onheight.sendEvent( newsize );
if (this.immediateparent.__LZcheckheight)
this.immediateparent.__LZcheckheightFunction( this );
Modified: openlaszlo/branches/legals/WEB-INF/lps/misc/lzx-autoincludes.properties
===================================================================
--- openlaszlo/branches/legals/WEB-INF/lps/misc/lzx-autoincludes.properties 2007-09-13 21:14:20 UTC (rev 6469)
+++ openlaszlo/branches/legals/WEB-INF/lps/misc/lzx-autoincludes.properties 2007-09-13 21:44:23 UTC (rev 6470)
@@ -126,8 +126,6 @@
linechart: charts/linechart/linechart.lzx
piechart: charts/piechart/piechart.lzx
-datalistlazyreplicator: utils/replicator/datalistlazyreplicator.lzx
-datalistreplicator: utils/replicator/datalistreplicator.lzx
lazyreplicator: utils/replicator/lazyreplicator.lzx
replicator: utils/replicator/replicator.lzx
replicatorselectionmanager: utils/replicator/replicatorselectionmanager.lzx
Modified: openlaszlo/branches/legals/WEB-INF/lps/schema/lzx.rnc
===================================================================
--- openlaszlo/branches/legals/WEB-INF/lps/schema/lzx.rnc 2007-09-13 21:14:20 UTC (rev 6469)
+++ openlaszlo/branches/legals/WEB-INF/lps/schema/lzx.rnc 2007-09-13 21:44:23 UTC (rev 6470)
@@ -107,6 +107,7 @@
toplevelElements = (
(viewElement | scriptElement | styleSheetElement | asset | font)*
+ & datarequest*
& datasource*
& connectiondatasource*
& dataset*
@@ -277,6 +278,7 @@
attribute ondata {script}?
+
#
# View Content
#
@@ -347,6 +349,7 @@
[a:defaultValue="false"] attribute paused {boolean}? &
attribute target {reference}?
+
#
# View elements
#
@@ -653,6 +656,8 @@
## url from which to load its content, rather than as a static xml file to
## inline.
attribute type {xsd:string}? &
+ ## If true, initial literal XML data is taken from <data> child node
+ attribute datafromchild {boolean}? &
[lza:visibility="private"]
attribute endpoint {xsd:string}? &
[lza:visibility="private"]
@@ -926,6 +931,9 @@
nodeElements =
objectElements
& datapathChildren
+ & element data {
+ datasetAttributes & anyXML
+ }*
& element dataset {
datasetAttributes & anyXML
}*
@@ -938,6 +946,9 @@
element node {nodeContent}
+datarequest =
+ element datarequest {nodeContent}
+
layout =
element layout {
Modified: openlaszlo/branches/legals/WEB-INF/lps/server/src/org/openlaszlo/compiler/DataCompiler.java
===================================================================
--- openlaszlo/branches/legals/WEB-INF/lps/server/src/org/openlaszlo/compiler/DataCompiler.java 2007-09-13 21:14:20 UTC (rev 6469)
+++ openlaszlo/branches/legals/WEB-INF/lps/server/src/org/openlaszlo/compiler/DataCompiler.java 2007-09-13 21:44:23 UTC (rev 6470)
@@ -24,6 +24,16 @@
* @author Oliver Steele
*/
class DataCompiler extends ElementCompiler {
+
+ /* TODO [hqm 2007-07] This is for top level datasets only. The function in the LFC,
+ * lzAddLocalData, creates the dataset
+ * *immediately*, it is not queued for instantiation. This happens to
+ * allow forward references to datasets in LZX code. It also happens to slow
+ * down initialization of an app if it has large static datasets. This could be
+ * made better by queuing the data for quantized lzIdle processing, although it
+ * would mean delaying the "ondata" of the datasets until they were processed.
+ */
+
static final String LOCAL_DATA_FNAME = "lzAddLocalData";
DataCompiler(CompilationEnvironment env) {
Modified: openlaszlo/branches/legals/WEB-INF/lps/server/src/org/openlaszlo/compiler/NodeModel.java
===================================================================
--- openlaszlo/branches/legals/WEB-INF/lps/server/src/org/openlaszlo/compiler/NodeModel.java 2007-09-13 21:14:20 UTC (rev 6469)
+++ openlaszlo/branches/legals/WEB-INF/lps/server/src/org/openlaszlo/compiler/NodeModel.java 2007-09-13 21:44:23 UTC (rev 6470)
@@ -332,9 +332,14 @@
// This emits a local dataset node, so only process
// <dataset> tags that are not top level datasets.
+
if (elt.getName().equals("dataset")) {
- attrs.put("initialdata", getDatasetContent(elt, env));
- includeChildren = false;
+ String datafromchild = elt.getAttributeValue("datafromchild");
+ if (! "true".equals(datafromchild)) {
+ // Default to legacy behavior, treat all children as XML literal data.
+ attrs.put("initialdata", getDatasetContent(elt, env));
+ includeChildren = false;
+ }
}
if (includeChildren) {
@@ -747,7 +752,7 @@
nsprefix = true;
}
- Element content = new Element("datacontent");
+ Element content = new Element("data");
String src = element.getAttributeValue("src");
// If 'src' attribute is a URL or null, don't try to expand it now,
@@ -849,7 +854,10 @@
for (Iterator iter = element.getChildren().iterator(); iter.hasNext(); ) {
ElementWithLocationInfo child = (ElementWithLocationInfo) iter.next();
try {
- if (isPropertyElement(child)) {
+ if (child.getName().equals("data")) {
+ // literal data
+ addLiteralDataElement(child);
+ } else if (isPropertyElement(child)) {
addPropertyElement(child);
} else if (schema.isHTMLElement(child)) {
; // ignore; the text compiler wiil handle this
@@ -1177,6 +1185,8 @@
if (when.equals("")) {
when = WHEN_ALWAYS;
}
+ } else if (type == ViewSchema.XML_LITERAL) {
+ value = "LzDataNode.stringToLzData("+value+")";
} else if (type == ViewSchema.COLOR_TYPE) {
if (when.equals(WHEN_IMMEDIATELY)) {
try {
@@ -1517,6 +1527,34 @@
}
}
+ /* Handle a <data> tag.
+ * If there is more than one immediate child data node at the top level, signal a warning.
+ */
+
+ void addLiteralDataElement(Element element) {
+ String name = element.getAttributeValue("name");
+
+ if (name == null) {
+ name = "initialdata";
+ }
+
+ boolean trimWhitespace = "true".equals(element.getAttributeValue("trimwhitespace"));
+
+ String xmlcontent = getDatasetContent(element, env, trimWhitespace);
+
+ Element parent = element.getParentElement();
+
+ CompiledAttribute cattr = compileAttribute(element,
+ name,
+ xmlcontent,
+ ViewSchema.XML_LITERAL,
+ WHEN_IMMEDIATELY);
+
+ addAttribute(cattr, name, attrs, events, references, paths, styles);
+ }
+
+
+
boolean hasAttribute(String name) {
return attrs.containsKey(name);
}
Modified: openlaszlo/branches/legals/WEB-INF/lps/server/src/org/openlaszlo/compiler/ViewSchema.java
===================================================================
--- openlaszlo/branches/legals/WEB-INF/lps/server/src/org/openlaszlo/compiler/ViewSchema.java 2007-09-13 21:14:20 UTC (rev 6469)
+++ openlaszlo/branches/legals/WEB-INF/lps/server/src/org/openlaszlo/compiler/ViewSchema.java 2007-09-13 21:44:23 UTC (rev 6470)
@@ -70,6 +70,7 @@
public static final Type SIZE_EXPRESSION_TYPE = newType("sizeExpression");
public static final Type CSS_TYPE = newType("css");
public static final Type INHERITABLE_BOOLEAN_TYPE = newType("inheritableBoolean");
+ public static final Type XML_LITERAL = newType("xmlLiteral");
static {
sHTMLContentElements.add("text");
Modified: openlaszlo/branches/legals/WEB-INF/lps/server/src/org/openlaszlo/sc/CodeGenerator.java
===================================================================
--- openlaszlo/branches/legals/WEB-INF/lps/server/src/org/openlaszlo/sc/CodeGenerator.java 2007-09-13 21:14:20 UTC (rev 6469)
+++ openlaszlo/branches/legals/WEB-INF/lps/server/src/org/openlaszlo/sc/CodeGenerator.java 2007-09-13 21:44:23 UTC (rev 6470)
@@ -2013,7 +2013,7 @@
SimpleNode args = children[2];
String name;
String ca = null;
- String pattern = "this.nextMethod(arguments.callee, _1).call(this, _2)";
+ String pattern = "(arguments.callee.superclass?arguments.callee.superclass.prototype[_1]:this.nextMethod(arguments.callee, _1)).call(this, _2)";
if (fname instanceof ASTEmptyExpression) {
name = "constructor";
} else {
@@ -2035,9 +2035,9 @@
if (ca == null) {
;
} else if ("call".equals(ca)) {
- pattern = "this.nextMethod(arguments.callee, _1).call(_2)";
+ pattern = "(arguments.callee.superclass?arguments.callee.superclass.prototype[_1]:this.nextMethod(arguments.callee, _1)).call(_2)";
} else if ("apply".equals(ca)) {
- pattern = "this.nextMethod(arguments.callee, _1).apply(_2)";
+ pattern = "(arguments.callee.superclass?arguments.callee.superclass.prototype[_1]:this.nextMethod(arguments.callee, _1)).apply(_2)";
} else {
assert false: "Unhandled super call " + ca;
}
Modified: openlaszlo/branches/legals/WEB-INF/lps/server/src/org/openlaszlo/sc/JavascriptGenerator.java
===================================================================
--- openlaszlo/branches/legals/WEB-INF/lps/server/src/org/openlaszlo/sc/JavascriptGenerator.java 2007-09-13 21:14:20 UTC (rev 6469)
+++ openlaszlo/branches/legals/WEB-INF/lps/server/src/org/openlaszlo/sc/JavascriptGenerator.java 2007-09-13 21:44:23 UTC (rev 6470)
@@ -1431,7 +1431,7 @@
SimpleNode args = children[2];
String name;
String ca = null;
- String pattern = "this.nextMethod(arguments.callee, _1).call(this, _2)";
+ String pattern = "(arguments.callee.superclass?arguments.callee.superclass.prototype[_1]:this.nextMethod(arguments.callee, _1)).call(this, _2)";
if (fname instanceof ASTEmptyExpression) {
name = "constructor";
} else {
@@ -1446,9 +1446,9 @@
if (ca == null) {
;
} else if ("call".equals(ca)) {
- pattern = "this.nextMethod(arguments.callee, _1).call(_2)";
+ pattern = "(arguments.callee.superclass?arguments.callee.superclass.prototype[_1]:this.nextMethod(arguments.callee, _1)).call(_2)";
} else if ("apply".equals(ca)) {
- pattern = "this.nextMethod(arguments.callee, _1).apply(_2)";
+ pattern = "(arguments.callee.superclass?arguments.callee.superclass.prototype[_1]:this.nextMethod(arguments.callee, _1)).apply(_2)";
} else {
assert false: "Unhandled super call " + ca;
}
Modified: openlaszlo/branches/legals/demos/chat/chatlib.lzx
===================================================================
--- openlaszlo/branches/legals/demos/chat/chatlib.lzx 2007-09-13 21:14:20 UTC (rev 6469)
+++ openlaszlo/branches/legals/demos/chat/chatlib.lzx 2007-09-13 21:44:23 UTC (rev 6470)
@@ -262,13 +262,13 @@
<method event="onkeyup" reference="LzKeys" args="k">
if ( k == 13 ) {
- bSend.handler();
+ bSend.inputhandler();
}
</method>
</library>
<!-- * X_LZ_COPYRIGHT_BEGIN ***************************************************
-* Copyright 2001-2006 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 ****************************************************** -->
<!-- @LZX_VERSION@ -->
Modified: openlaszlo/branches/legals/lps/components/incubator/rich-text/formatfontcolor.lzx
===================================================================
--- openlaszlo/branches/legals/lps/components/incubator/rich-text/formatfontcolor.lzx 2007-09-13 21:14:20 UTC (rev 6469)
+++ openlaszlo/branches/legals/lps/components/incubator/rich-text/formatfontcolor.lzx 2007-09-13 21:44:23 UTC (rev 6470)
@@ -10,7 +10,6 @@
<!-- Data: Font Color
inside of a state because datasets get instantiated upon application init
the state delays instantiation until the RTE is used. -->
- <state name="fontColorData">
<dataset name="fontcolors">
<clr value="0x000000"/>
<clr value="0x555555"/>
@@ -21,7 +20,6 @@
<clr value="0xcc9933"/>
<clr value="0xcc3300"/>
</dataset>
- </state>
<!---
A class which is used as a combobox item
-->
@@ -54,7 +52,6 @@
apply state for late instantiation of local data -->
<method name="construct" args="parent, args">
super.construct(parent, args);
- fontColorData.apply();
</method>
<!--- When the user selects an item from the combo box,
create an object representing just the change in format.
Modified: openlaszlo/branches/legals/lps/components/incubator/rich-text/richtexteditarea.lzx
===================================================================
--- openlaszlo/branches/legals/lps/components/incubator/rich-text/richtexteditarea.lzx 2007-09-13 21:14:20 UTC (rev 6469)
+++ openlaszlo/branches/legals/lps/components/incubator/rich-text/richtexteditarea.lzx 2007-09-13 21:44:23 UTC (rev 6470)
@@ -209,17 +209,11 @@
@param view s: the view which is gaining the selection
-->
<method event="onblur" args="s">
+ var start = this._field.getSelectionPosition();
+ var size = this._field.getSelectionSize();
+ this._ssel = start;
+ this._esel = start + size;
this._fieldhasfocus = false;
- // If we're blurring and the focus is going to anything *but* the toolbar
- // widgets, set _ssel and _esel to nothing.
- // Semantically, we want to get rid of the selection if we lose focus.
- if (s != null) {
- // We're really giving focus to something else, so, forget
- // about whatever was selected while this component still had focus.
- // It seems to "feel" right to me to move the cursor to the end of
- // the text.
- this._ssel = this._esel = this.getText().length;
- }
</method>
@@ -251,44 +245,56 @@
is there a mousedown/mouseup pair in progress?
@param view who: the current mousedown element (ben shine)
-->
- <method event="onmouseup" reference="LzGlobalMouse" args="who">
+ <method event="onmouseup" reference="LzGlobalMouse" args="who"><![CDATA[
if (this._fieldhasfocus) {
// Debug.write("onmouseup, field has focus, who is ", who);
- // [bshine 07.28.2007] the next block is a new patch from diamond
- this._caretmove();
if (this._mousedownorigin != null) {
// We have focus, and there _is_ a mousedown/mouseup pair in progress.
- if (this._mousedownorigin == this) {
+ if (this._mousedownorigin == this || this._mousedownorigin == this.inp) {
// The mouse click started on the richtext editor.
- // If the mouse click didn't end on the rich text editor,
- // handle that.
- if (!inp.containsPt(this.getMouse("x"), this.getMouse("y"))) {
- this._handleLostMouseDown();
+
+ // If the mouse click also ended on the rich text editor,
+ // it's just a caret move.
+ if (inp.containsPt(this.getMouse("x"), this.getMouse("y"))) {
+ this._caretmove();
+ } else {
+ // Debug.write("handleLostMouseDown");
+ // If the mouseclick ended anywhere but the rich text editor,
+ // it's a lost mousedown.
+ this._handleLostMouseDown();
}
- }
+ } else {
+ // We have focus, and there's a mousedown/mouseup pair in progress,
+ // and it started on one of the subviews of the RTE.
+ // Debug.write("lost mousedown, origin was ", this._mousedownorigin);
+ }
+
+ } else {
+ // We have focus, but there's no mousedown/mouseup pair in progress.
+ // Therefore, do nothing.
+ // Debug.write("No mousedown origin. The mousedown didn't start on an RTE component.");
}
}
-
// Clear the mousedown attribute; a mouseup means that whatever
// the mousedown was, it's gone now.
this._mousedownorigin = null;
- </method>
+ ]]></method>
<!--- Save selected region. -->
<method name="saveSelectionRegion"><![CDATA[
- // [bshine 07.28.2007] See LPP-4015. Does this need to change now that LPP-4015 has been changed?
if (LzFocus.getFocus() == this._field) {
var selpos = this._field.getSelectionPosition();
var selsize = this._field.getSelectionSize();
if( selpos >= 0 && selsize >= 0){
this.setAttribute('_ssel', selpos);
this.setAttribute('_esel', selpos + selsize );
+ // Debug.write("fascinating, storing selection of %d-%d", this._ssel, this._esel);
}
- }
+ }
]]>
</method>
@@ -373,7 +379,6 @@
if (! this['_selectiondel']) {
this._selectiondel = new LzDelegate(this, '_restoreSelection');
}
-
// After the formatting has been completed, need to wait a frame to
// restore the selection.
LzIdle.callOnIdle(this._selectiondel);
@@ -385,7 +390,6 @@
if (! this['_focusseldel']) {
this._focusseldel = new LzDelegate(this, '_focussel');
}
-
LzIdle.callOnIdle(this._focusseldel);
</method>
@@ -402,7 +406,6 @@
@access private
-->
<method name="_caretmove">
- // Debug.write("caret");
// Don't do any of this if this field isn't already rich-text!
if (!this.isHTML) return;
@@ -418,7 +421,6 @@
// mouseout then mouseup not over richinputtext.
//------------------------------------------------------------
-
var selstart = this._field.getSelectionPosition();
var sellen = this._field.getSelectionSize();
var text = this.getText();
@@ -535,6 +537,7 @@
this._shouldresettoolbar = false;
this.setSelection(this._ssel, this._esel);
this._shouldresettoolbar = true;
+
</method>
<!--- Helper method to set an textformat to its default for this
Modified: openlaszlo/branches/legals/lps/components/incubator/rich-text/test/linkdialog-driver.lzx
===================================================================
--- openlaszlo/branches/legals/lps/components/incubator/rich-text/test/linkdialog-driver.lzx 2007-09-13 21:14:20 UTC (rev 6469)
+++ openlaszlo/branches/legals/lps/components/incubator/rich-text/test/linkdialog-driver.lzx 2007-09-13 21:44:23 UTC (rev 6470)
@@ -39,6 +39,9 @@
defaultfontcolor="0x336699"
border="10" text="For reasons which many persons thought ridiculous, Mrs. Lightfoot Lee decided to pass the winter in Washington. She was in excellent health, but she said that the climate would do her good. In New York she had troops of friends, but she suddenly became eager to see again the very small number of those who lived on the Potomac. It was only to her closest intimates that she honestly acknowledged herself to be tortured by ennui. Since her husband's death, five years before, she had lost her taste for New York society; she had felt no interest in the price of stocks, and very little in the men who dealt in them; she had become serious. What was it all worth, this wilderness of men and women as monotonous as the brown stone houses they lived in? In her despair she had resorted to desperate measures. She had read philosophy in the original German, and the more she read, the more she was disheartened that so much culture should lead to nothing... nothing.">
+ <method event="oninit">
+ this.setLinkPanel(ldlg);
+ </method>
</richtexteditarea>
</view>
</view>
Modified: openlaszlo/branches/legals/lps/components/incubator/rich-text/test/linkdialog-test.lzx
===================================================================
--- openlaszlo/branches/legals/lps/components/incubator/rich-text/test/linkdialog-test.lzx 2007-09-13 21:14:20 UTC (rev 6469)
+++ openlaszlo/branches/legals/lps/components/incubator/rich-text/test/linkdialog-test.lzx 2007-09-13 21:44:23 UTC (rev 6470)
@@ -18,7 +18,7 @@
<view x="20" y="80" width="${canvas.width-40}" height="${canvas.height-80}">
<!-- A very boring toolbar which only contains a link button -->
- <richtexttoolbar name="toolbar" editor="${grte}" height="30" width="${parent.width-5}" x="2" y="0" bgcolor="0xD4D7E5">
+ <richtexttoolbar name="toolbar" height="30" width="${parent.width-5}" x="2" y="0" bgcolor="0xD4D7E5">
<formatbtn name="linkbtn" id="linkbtn" format="link" iconname="link" icony="3" y="2">
link
<method name="doClick">
@@ -40,11 +40,16 @@
defaultfontcolor="0x336699"
border="10" text="For reasons which many persons thought ridiculous, Mrs. Lightfoot Lee decided to pass the winter in Washington. She was in excellent health, but she said that the climate would do her good. In New York she had troops of friends, but she suddenly became eager to see again the very small number of those who lived on the Potomac. It was only to her closest intimates that she honestly acknowledged herself to be tortured by ennui. Since her husband's death, five years before, she had lost her taste for New York society; she had felt no interest in the price of stocks, and very little in the men who dealt in them; she had become serious. What was it all worth, this wilderness of men and women as monotonous as the brown stone houses they lived in? In her despair she had resorted to desperate measures. She had read philosophy in the original German, and the more she read, the more she was disheartened that so much culture should lead to nothing... nothing.">
+ <method event="oninit">
+ this.setLinkPanel(ldlg);
+ linkbtn.setAttribute("editor", this);
+ </method>
+
</richtexteditarea>
</view>
</view>
-<TestSuite>
+<TestSuite name="linkdialog-test">
<TestCase>
<method name="testTextIsPresent">
assertNotNull(grte.getText());
@@ -71,6 +76,7 @@
assertFalse(fmt.url == "http://del.icio.us");
</method>
<method name="testShowingLinkDialog"><![CDATA[
+ Debug.write("linkbtn is... %w and linkbtn.editor is %w", linkbtn, linkbtn.editor);
linkbtn.doClick();
Debug.write("height: ", ldlg.height);
assertTrue(ldlg.height > 0);
@@ -113,7 +119,7 @@
</canvas>
<!-- * X_LZ_COPYRIGHT_BEGIN ***************************************************
- * Copyright 2006 Laszlo Systems, Inc. All Rights Reserved. *
+ * Copyright 2006-2007 Laszlo Systems, Inc. All Rights Reserved. *
* Use is subject to license terms. *
* X_LZ_COPYRIGHT_END ****************************************************** -->
<!-- @LZX_VERSION@ -->
Modified: openlaszlo/branches/legals/lps/components/rpc/library/swf/rpc.js
===================================================================
--- openlaszlo/branches/legals/lps/components/rpc/library/swf/rpc.js 2007-09-13 21:14:20 UTC (rev 6469)
+++ openlaszlo/branches/legals/lps/components/rpc/library/swf/rpc.js 2007-09-13 21:44:23 UTC (rev 6470)
@@ -135,11 +135,11 @@
if (delegate['dataobject'] != null) {
if ( delegate.dataobject instanceof LzDataset ) {
- var element = LzDataElement.prototype.valueToElement(data);
+ var element = LzDataElement.valueToElement(data);
// the child nodes of element will be placed in datasets childNodes
delegate.dataobject.setData( element.childNodes );
} else if ( delegate.dataobject instanceof LzDataElement ) {
- var element = LzDataElement.prototype.valueToElement(data);
+ var element = LzDataElement.valueToElement(data);
// xpath: element/value
delegate.dataobject.appendChild( element );
} else {
Deleted: openlaszlo/branches/legals/lps/components/utils/replicator/datalistlazyreplicator.lzx
Deleted: openlaszlo/branches/legals/lps/components/utils/replicator/datalistreplicator.lzx
Modified: openlaszlo/branches/legals/lps/components/utils/replicator/lazyreplicator.lzx
===================================================================
--- openlaszlo/branches/legals/lps/components/utils/replicator/lazyreplicator.lzx 2007-09-13 21:14:20 UTC (rev 6469)
+++ openlaszlo/branches/legals/lps/components/utils/replicator/lazyreplicator.lzx 2007-09-13 21:44:23 UTC (rev 6470)
@@ -28,19 +28,21 @@
var replicatedsize = null;
// @keywords private
var clonedel = null;
-
+
// @keywords private
function construct (p,a) {
super.construct( p, a );
this.__emptyArray = [];
this.clonedel = new LzDelegate( this, '__adjustVisibleClones');
+ this.mask = this.parent.parent;
+ this.container = this.parent;
}
// @keywords private
function init () {
this.clonedel.register( this.mask , "on" + this._sizes[ this.axis ] );
- this.clonedel.register( this , "on" + this.axis );
+ this.clonedel.register( this.container , "on" + this.axis );
super.init();
}
@@ -57,24 +59,25 @@
if ( !this.replicatedsize ) this._setSize();
- var sax =this._sizes[ this.axis ];
+ var sizeAxis = this._sizes[ this.axis ];
if ( this.nodes.length != null ){
this._lastNodesLength = this.nodes.length;
- }
+ }
var s = this._lastNodesLength * this.replicatedsize;
- if ( this[ sax ] != s ){
- //Debug.write( sax, s, this[ sax ] );
- this.setAttribute( sax, s );
+ if ( this.container[ sizeAxis ] != s ){
+ //Debug.write( sizeAxis, s, this.container[ sizeAxis ] );
+ this.container.setAttribute( sizeAxis, s );
}
+ if (! this.mask) {
+ Debug.warn("%w: cannot find clipping parent", this);
+ return;
+ }
- if (! this.mask )
- Debug.warn("lazyreplicator _adjustVisibleClones: cannot find clipping parent");
+ if (! this.mask[ "hasset" + sizeAxis ] )
+ return;
- if (! this.mask[ "hasset" + sax ] )
- return;
-
//Here's the idea. Coming in, we have an old list of clones that
//represents some window into the dataset. Let's say the nodes are
//labelled alphabetically so to start, we have
@@ -82,14 +85,14 @@
//When the situation changes, we end up with a situation where we
//want the window to be like
//this.clones=[ l , m , n , o ]
-
+
//This algorithm moves the old list of clones to a temporary
//identifier and then constructs a new array for the clones going
//through one by one It keeps an offset, which represents the
//difference in position of the old new data windows. In the case
//above, the offset would be -2.
- var newstart = Math.floor( -this[ this.axis ] /
+ var newstart = Math.floor( -this.container[ this.axis ] /
this.replicatedsize );
if ( 0 > newstart ) newstart = 0;
@@ -98,12 +101,12 @@
var oldlength = this.clones.length;
var offset = newstart - this.clonesoffset;
- var remainder = ( newstart * this.replicatedsize ) +
- this[ this.axis ];
+ var remainder = ( newstart * this.replicatedsize ) +
+ this.container[ this.axis ];
- var newlength= Math.ceil(
- Math.min( (this.mask[ sax ] - remainder )/this.replicatedsize ,
- this[ sax ] /this.replicatedsize ) );
+ var newlength= Math.ceil(
+ Math.min( (this.mask[ sizeAxis ] - remainder )/this.replicatedsize ,
+ this.container[ sizeAxis ] /this.replicatedsize ) );
//newstart is the new absolute lowerbound of the data window
//newlength is the new length of the data window
@@ -143,7 +146,7 @@
if ( cl ){
this.clones[ i ] = cl;
- cl.setAttribute( this.axis ,
+ cl.setAttribute( this.axis ,
( i + newstart ) * this.replicatedsize );
this.unbind( cl );
this.bind( cl, newstart + i );
Modified: openlaszlo/branches/legals/lps/components/utils/replicator/library.lzx
===================================================================
--- openlaszlo/branches/legals/lps/components/utils/replicator/library.lzx 2007-09-13 21:14:20 UTC (rev 6469)
+++ openlaszlo/branches/legals/lps/components/utils/replicator/library.lzx 2007-09-13 21:44:23 UTC (rev 6470)
@@ -3,6 +3,4 @@
<include href="replicator.lzx"/>
<include href="lazyreplicator.lzx"/>
<include href="replicatorselectionmanager.lzx"/>
- <include href="datalistreplicator.lzx"/>
- <include href="datalistlazyreplicator.lzx"/>
</library>
Modified: openlaszlo/branches/legals/lps/components/utils/replicator/replicator.lzx
===================================================================
--- openlaszlo/branches/legals/lps/components/utils/replicator/replicator.lzx 2007-09-13 21:14:20 UTC (rev 6469)
+++ openlaszlo/branches/legals/lps/components/utils/replicator/replicator.lzx 2007-09-13 21:44:23 UTC (rev 6470)
@@ -2,10 +2,10 @@
<library>
<!--- This is a declared replicator for visual elements. Unlike
OpenLaszlo''s data-replication feature, a replicator can take an
- arbitrary node set that may be passed in as an array.
- Non-replicating elements may be used inside a replicator; only
- the last child inside the replicator is replicated.
-
+ arbitrary node set that may be passed in as an array.
+ Non-replicating elements may be used inside a replicator; only
+ the last child inside the replicator is replicated.
+
The data attribute of the replicated (cloned) view is set by the
setData method with data from the nodes array when the clone is
bound. -->
@@ -13,34 +13,42 @@
<!--- If true, then instances of the replicated instance are reused
when possible -->
<attribute name="pool" value="true" type="boolean"/>
-
+
<!--- The size (width or height) in the replication axis of the view
being replicated. Assumes all subviews have same replicated size.
-->
<attribute name="replicatedsize" value="null" />
-
+
<!--- The axis in which to replicate-->
<attribute name="axis" value="y" type="string"/>
-
+
+ <!--- A pixel amount to use between each replicated view -->
+ <attribute name="spacing" value="0" />
+
<!--- The list of elements controlled by this repliator -->
<attribute name="clones" />
-
+
<!--- The list of nodes over which this replictor acts -->
<attribute name="nodes" value="null" setter="this.setNodes(nodes)"/>
-
+
<event name="onnodes"/>
- <!--- Replicate over the given list of elements
+ <!--- Replicate over the given list of elements
@param Array n: The list of elements over which to replicate -->
<method name="setNodes" args="n" />
-
-
+
+
+ <!--- Compute nodes from this dataset -->
+ <attribute name="dataset" />
+ <!--- Compute nodes from this xpath query against the specified dataset -->
+ <attribute name="xpath" />
+
<!--- Insert a node in existing list of elements.
@param Number idx: index to insert element
@param Object n: node to insert -->
<method name="insertNode" args="idx, n" />
-
-
+
+
<!--- Called internally, but may be overriden. This is the method
which binds a given clone to an element in the nodes array.
@param LzView v: The clone being bound
@@ -48,62 +56,30 @@
bound to.
-->
<method name="bind" args="v , n" />
-
-
- <!--- @keywords private -->
- <method name="setCloneProperty" args="v , prop, val" />
-
-
- <!--- @keywords private -->
- <method name="setClonePropertyByCN" args="n , prop, val" />
-
-
- <!--- @keywords private -->
- <method name="update" args="v , n" />
-
-
+
+
<!-- TODO: defaults for clone attributes -->
<!--- Called internally, but may be overriden. This method is called
when a given clone is about to be pooled or destroyed -->
<method name="unbind" args="v" />
-
-
- <!--- @keywords private -->
- <method name="getClone" />
-
-
- <!--- @keywords private -->
- <method name="_makeClone" />
-
-
- <!--- @keywords private -->
- <method name="poolClone" args="c" />
-
-
- <!--- @keywords private -->
- <method name="getCloneIfVisible" args="n" />
-
-
+
+
<!--- Called internally, but may be overriden. This is the method is
- called to set the data of a clone to an element in the nodes
+ called to set the data of a clone to an element in the nodes
array.
-
+
@param LzView v: The clone whose data is being set.
- @param n: The node to which it is being set.
+ @param n: The node to which it is being set.
-->
<method name="setData" args="v, n" />
-
-
- <!--- @keywords private -->
- <method name="__adjustVisibleClones" />
-
-
+
+
<!--- Gets the clone for the given offset, scrolling it into view first
if necessary.
@param Number n: The offset of the clone to get-->
<method name="getCloneForOffset" args="n" />
-
-
+
+
<!--- Ensures that the clone at the given offset is visible under
the mask
@param Number n: The offset of the clone to scroll in view-->
@@ -114,7 +90,7 @@
<script when="immediate">
<![CDATA[
-class replicator extends LzView {
+class replicator extends LzNode {
static var tagname = 'replicator';
@@ -123,11 +99,13 @@
// The size (width or height) in the replication axis of the view
// being replicated. Assumes all subviews have same replicated size.
var replicatedsize = null;
-
+
// The axis in which to replicate
var axis = "y";
-
- // The list of elements controlled by this replicator
+ // Spacing between replications
+ var spacing = 0;
+
+ // The list of elements controlled by this replicator
var clones = null;
var nodes = null;
var _sizes = { x : 'width', y: 'height' };
@@ -135,20 +113,35 @@
var _clonepool = null;
- // @keywords private
+ // @keywords private
function construct (p,a) {
- super.construct( p, a );
this.clones = [];
this._cloneprops = [];
this._clonepool = [];
+ super.construct.apply(this, arguments);
}
- // @keywords private
+ // @keywords private
+ function init() {
+ super.init.apply(this, arguments);
+ // Set the layout in the view that will hold the replicated views
+// this.immediateparent.setAttribute('layout', {axis: this.axis, spacing: this.spacing});
+ if (this.dataset && this.xpath) {
+ this.setNodes(this.dataset.getPointer().xpathQuery(this.xpath))
+ }
+ }
+
+
+ // @keywords private
function createChildren (c) {
this.replicated = c.pop();
//Debug.write( 'replicated', replicated );
- if ( c.length ) super.createChildren( c );
- else this.__LZinstantiationDone();
+ if ( c.length ) {
+ Debug.warn("%s: only a single child view is replicated", this);
+ this.immediateparent.createChildren( c );
+ } else {
+ this.__LZinstantiationDone();
+ }
}
DeclareEvent(prototype, 'onnodes');
@@ -158,24 +151,24 @@
*/
setters.nodes = "setNodes";
-
- // Replicate over the given list of elements
- // @param Array n: The list of elements over which to replicate
+ // Replicate over the given list of elements
+ // @param Array n: The list of elements over which to replicate
+ // TODO: [2007-07-27 ptw] `function set nodes () {` when the compiler supports it
function setNodes (n) {
this.nodes = n;
this.__adjustVisibleClones();
- this.setAttribute("replicatedsize", this.subviews.length == 0
+ this.setAttribute("replicatedsize", this.clones.length == 0
? 0
- : this.subviews[this.subviews.length-1][this._sizes[this.axis]]);
+ : this.clones[this.clones.length-1][this._sizes[this.axis]]);
this.onnodes.sendEvent();
}
// Insert a node in existing list of elements.
// @param Number idx: index to insert element
- // @param Object n: node to insert
+ // @param Object n: node to insert
function insertNode (idx, n) {
this.nodes.splice(idx, 0, n);
- this._cloneprops.splice(idx,0, undefined); // maintain cloneprops indices
+ this._cloneprops.splice(idx,0, undefined); // maintain cloneprops indices
this.__adjustVisibleClones();
}
@@ -184,7 +177,7 @@
// @param LzView v: The clone being bound
// @param Number n: The number of the element the clone is being
// bound to.
-
+
function bind (v , n) {
v.setAttribute( "clonenumber" , n );
this.setData( v , n );
@@ -197,12 +190,12 @@
}
}
- // @keywords private
+ // @keywords private
function setCloneProperty (v , prop, val) {
this.setClonePropertyByCN( v.clonenumber, prop ,val );
}
- // @keywords private
+ // @keywords private
function setClonePropertyByCN (n , prop, val) {
if ( !this._cloneprops[ n ] ) this._cloneprops[ n ] = {};
this._cloneprops[ n ][ prop ] = val;
@@ -210,14 +203,14 @@
if ( v ) v.setAttribute( prop , val );
}
- // @keywords private
+ // @keywords private
function update (v , n) {
if ( v[ "update" ] ) v.update( v.data , n );
}
- // TODO: defaults for clone attributes
+ // TODO: defaults for clone attributes
// Called internally, but may be overriden. This method is called
- // when a given clone is about to be pooled or destroyed
+ // when a given clone is about to be pooled or destroyed
function unbind (v) {
var n = v.clonenumber;
v.setAttribute( "clonenumber", null );
@@ -230,7 +223,7 @@
}
}
- // @keywords private
+ // @keywords private
function getClone () {
var v;
if ( this._clonepool.length ) {
@@ -242,38 +235,38 @@
return v;
}
- // @keywords private
+ // @keywords private
function _makeClone () {
- var v = this.makeChild( this.replicated );
+ var v = this.immediateparent.makeChild( this.replicated );
v.setAttribute( "clonenumber", null );
return v;
}
- // @keywords private
+ // @keywords private
function poolClone (c) {
if ( c.clonenumber ) this.unbind( c );
c.setVisible( false );
this._clonepool.push( c );
}
- // @keywords private
+ // @keywords private
function getCloneIfVisible (n) {
return this.clones[ n ];
}
// Called internally, but may be overriden. This is the method is
- // called to set the data of a clone to an element in the nodes
+ // called to set the data of a clone to an element in the nodes
// array.
// @param LzView v: The clone whose data is being set.
- // @param n: The node to which it is being set.
-
+ // @param n: The node to which it is being set.
+
function setData (v, n) {
- v.setAttribute( "data" , this.nodes[ n ] );
+ v.setData( this.nodes[ n ] );
v.applyData(this.nodes[n]);
}
- // @keywords private
+ // @keywords private
function __adjustVisibleClones () {
while( this.clones.length ) this.poolClone( this.clones.pop() );
if (this.nodes != null) {
Modified: openlaszlo/branches/legals/lps/components/utils/replicator/replicatorselectionmanager.lzx
===================================================================
--- openlaszlo/branches/legals/lps/components/utils/replicator/replicatorselectionmanager.lzx 2007-09-13 21:14:20 UTC (rev 6469)
+++ openlaszlo/branches/legals/lps/components/utils/replicator/replicatorselectionmanager.lzx 2007-09-13 21:44:23 UTC (rev 6470)
@@ -3,6 +3,27 @@
<!--- A selection manager, similar to OpenLaszlo's LzSelectionManager
designed to work with replicators -->
<class name="replicatorselectionmanager" extends="node">
+ <!--- The replicator to manage -->
+ <attribute name="replicator" value="null" />
+
+ <method name="init">
+ <![CDATA[
+ super.init.apply(this, arguments);
+ // If replicator is not specified, search siblings for a replicator
+ if (! this.replicator) {
+ var s = parent.subnodes;
+ if (s == null) return;
+ for (var i = s.length-1; i >= 0; i-- ) {
+ var si = s[ i ];
+ if (si instanceof lz.replicator) {
+ this.replicator = si;
+ return;
+ }
+ }
+ }
+ ]]>
+ </method>
+
<!--- If true, selecting a given clone again will deselect it -->
<attribute name="toggle" value="false"/>
@@ -89,7 +110,7 @@
if ( _selected[ vc ] ) return;
_selected[ vc ] = true;
this._lastsel = vc;
- parent.setClonePropertyByCN( vc, _selectedProp, true );
+ replicator.setClonePropertyByCN( vc, _selectedProp, true );
</method>
<!--- @keywords private -->
@@ -104,7 +125,7 @@
break;
}
}
- parent.setClonePropertyByCN( vc, _selectedProp, false );
+ replicator.setClonePropertyByCN( vc, _selectedProp, false );
</method>
Modified: openlaszlo/branches/legals/lps/includes/source/embednew.js
===================================================================
--- openlaszlo/branches/legals/lps/includes/source/embednew.js 2007-09-13 21:14:20 UTC (rev 6469)
+++ openlaszlo/branches/legals/lps/includes/source/embednew.js 2007-09-13 21:44:23 UTC (rev 6470)
@@ -577,6 +577,8 @@
,/** @access private */
_checklocationhash: function() {
var h = window.top.location.hash;
+ // Make sure initial history event is sent even if the hash is empty
+ if (h == '') h = '#0';
if (h != this.__lasthash && h.length > 1) {
if (h.indexOf('_lz') != -1) {
this.__lasthash = h;
Copied: openlaszlo/branches/legals/test/data/datatag-1.lzx (from rev 5999, openlaszlo/branches/wafflecone/test/data/datatag-1.lzx)
Copied: openlaszlo/branches/legals/test/explicit-replicators (from rev 5999, openlaszlo/branches/wafflecone/test/explicit-replicators)
Deleted: openlaszlo/branches/legals/test/explicit-replicators/lazy-replicator.lzx
Copied: openlaszlo/branches/legals/test/explicit-replicators/lazy-replicator.lzx (from rev 5999, openlaszlo/branches/wafflecone/test/explicit-replicators/lazy-replicator.lzx)
Deleted: openlaszlo/branches/legals/test/explicit-replicators/replicator.lzx
Copied: openlaszlo/branches/legals/test/explicit-replicators/replicator.lzx (from rev 5999, openlaszlo/branches/wafflecone/test/explicit-replicators/replicator.lzx)
Deleted: openlaszlo/branches/legals/test/explicit-replicators/test-replicator.lzx
Copied: openlaszlo/branches/legals/test/explicit-replicators/test-replicator.lzx (from rev 5999, openlaszlo/branches/wafflecone/test/explicit-replicators/test-replicator.lzx)
Modified: openlaszlo/branches/legals/test/history/history.lzx
===================================================================
--- openlaszlo/branches/legals/test/history/history.lzx 2007-09-13 21:14:20 UTC (rev 6469)
+++ openlaszlo/branches/legals/test/history/history.lzx 2007-09-13 21:44:23 UTC (rev 6470)
@@ -6,6 +6,9 @@
<method event="onfoo" args="f">
Debug.write('external call', f);
</method>
+ <method event="oninit">
+ LzHistory.setPersist(true);
+ </method>
<class name="histinputtext" extends="inputtext">
<method event="onblur">
Modified: openlaszlo/branches/legals/test/lfc/data/dollarpath.lzx
===================================================================
--- openlaszlo/branches/legals/test/lfc/data/dollarpath.lzx 2007-09-13 21:14:20 UTC (rev 6469)
+++ openlaszlo/branches/legals/test/lfc/data/dollarpath.lzx 2007-09-13 21:44:23 UTC (rev 6470)
@@ -2,6 +2,56 @@
<debug x="200" width="500" height="500"/>
<include href="lzunit/lzunit.lzx" />
+ <dataset name="somedat">
+ <data>
+ <record show="true">
+ <name>Boo</name>
+ <phone home="155-1212" work="122-1515"/>
+ <options>
+ <hairy color="red"/>
+ <glasses type="tortoise"/>
+ </options>
+ </record>
+ <record>
+ <name>Coo</name>
+ <phone home="255-1212" work="222-1515"/>
+ <options>
+ <hairy />
+ <glasses type="blue"/>
+ </options>
+ </record>
+ <record show="true">
+ <name>Doo</name>
+ <phone home="355-1212" work="322-1515"/>
+ <options>
+ <hairy color="blue"/>
+ <glasses type="tortoise"/>
+ </options>
+ </record>
+ <record>
+ <name>Foo</name>
+ <phone home="455-1212" work="422-1515"/>
+ <options>
+ <hairy />
+ </options>
+ </record>
+ <record show="true">
+ <name>Goo</name>
+ <phone home="555-1212" work="522-1515"/>
+ <options>
+ <hairy color="green"/>
+ </options>
+ </record>
+ <record show="true">
+ <name>Hoo</name>
+ <phone home="655-1212" work="622-1515"/>
+ <options>
+ <glasses type="contacts"/>
+ </options>
+ </record>
+ </data>
+ </dataset>
+
<view y="200" name="rpar">
<attribute name="repcnt" value="0"/>
<view datapath="somedat:/data/record[3]/">
@@ -51,55 +101,7 @@
<simplelayout/>
</view>
- <dataset name="somedat">
- <data>
- <record show="true">
- <name>Boo</name>
- <phone home="155-1212" work="122-1515"/>
- <options>
- <hairy color="red"/>
- <glasses type="tortoise"/>
- </options>
- </record>
- <record>
- <name>Coo</name>
- <phone home="255-1212" work="222-1515"/>
- <options>
- <hairy />
- <glasses type="blue"/>
- </options>
- </record>
- <record show="true">
- <name>Doo</name>
- <phone home="355-1212" work="322-1515"/>
- <options>
- <hairy color="blue"/>
- <glasses type="tortoise"/>
- </options>
- </record>
- <record>
- <name>Foo</name>
- <phone home="455-1212" work="422-1515"/>
- <options>
- <hairy />
- </options>
- </record>
- <record show="true">
- <name>Goo</name>
- <phone home="555-1212" work="522-1515"/>
- <options>
- <hairy color="green"/>
- </options>
- </record>
- <record show="true">
- <name>Hoo</name>
- <phone home="655-1212" work="622-1515"/>
- <options>
- <glasses type="contacts"/>
- </options>
- </record>
- </data>
- </dataset>
+
<TestSuite>
<TestCase>
<method name="test1">
Copied: openlaszlo/branches/legals/test/lztest/lztest-lzdatapointer.lzx (from rev 5999, openlaszlo/branches/wafflecone/test/lztest/lztest-lzdatapointer.lzx)
Modified: openlaszlo/branches/legals/test/lztest/lztest-textheight.lzx
===================================================================
--- openlaszlo/branches/legals/test/lztest/lztest-textheight.lzx 2007-09-13 21:14:20 UTC (rev 6469)
+++ openlaszlo/branches/legals/test/lztest/lztest-textheight.lzx 2007-09-13 21:44:23 UTC (rev 6470)
@@ -100,8 +100,8 @@
LzTestManager.assertEquals(48, it3.height, "inputtext4.height");
LzTestManager.assertEquals(38, it4.getAttribute("height"), "inputtext4 height");
LzTestManager.assertEquals(38, it4.height, "inputtext4.height");
- LzTestManager.assertEquals(52, it5.getAttribute("height"), "inputtext5 height");
- LzTestManager.assertEquals(52, it5.height, "inputtext5.height");
+ LzTestManager.assertEquals(52, it5.getAttribute("height"), "multiline inputtext5 height");
+ LzTestManager.assertEquals(52, it5.height, "multiline inputtext5.height");
LzTestManager.assertEquals(38, it6.getAttribute("height"), "inputtext6 height");
LzTestManager.assertEquals(38, it6.height, "inputtext6.height");
LzTestManager.assertEquals(56, it7.getAttribute("height"), "multiline7 inputtext height");
@@ -141,8 +141,8 @@
LzTestManager.assertEquals(200, it3.width, "inputtext3.width");
LzTestManager.assertEquals(26, it4.getAttribute("width"), "inputtext4 width");
LzTestManager.assertEquals(26, it4.width, "inputtext4.width");
- LzTestManager.assertEquals(it5.parent.width, it5.getAttribute("width"), "inputtext5 width");
- LzTestManager.assertEquals(it5.parent.width, it5.width, "inputtext5.width");
+ LzTestManager.assertEquals(it5.parent.width, it5.getAttribute("width"), "multiline inputtext5 width");
+ LzTestManager.assertEquals(it5.parent.width, it5.width, "multiline inputtext5.width");
LzTestManager.assertEquals(26, it6.getAttribute("width"), "inputtext6 width");
LzTestManager.assertEquals(26, it6.width, "inputtext6.width");
Copied: openlaszlo/branches/legals/test/performance/getTimer-vs-newDate.lzx (from rev 5999, openlaszlo/branches/wafflecone/test/performance/getTimer-vs-newDate.lzx)
Copied: openlaszlo/branches/legals/test/style/constraints/contention.lzx (from rev 5999, openlaszlo/branches/wafflecone/test/style/constraints/contention.lzx)
Modified: openlaszlo/branches/legals/test/style/constraints/main.lzx
===================================================================
--- openlaszlo/branches/legals/test/style/constraints/main.lzx 2007-09-13 21:14:20 UTC (rev 6469)
+++ openlaszlo/branches/legals/test/style/constraints/main.lzx 2007-09-13 21:44:23 UTC (rev 6470)
@@ -5,11 +5,13 @@
Debug.write("This test file exercises compiler and runtime support for $style constraints");
</script>
<debug/>
+ <include href="contention.lzx" />
<include href="constraint-test.lzx" />
<include href="speedtest.lzx" />
<include href="subclassing.lzx" />
<TestSuite>
+ <ContentionTestCase />
<StyleConstraintTestCase />
<ConstraintSpeedTestCase />
<CSSSubclassingTestCase />
Modified: openlaszlo/branches/legals/test/style/constraints/speedtest.lzx
===================================================================
--- openlaszlo/branches/legals/test/style/constraints/speedtest.lzx 2007-09-13 21:14:20 UTC (rev 6469)
+++ openlaszlo/branches/legals/test/style/constraints/speedtest.lzx 2007-09-13 21:44:23 UTC (rev 6470)
@@ -67,7 +67,7 @@
</method>
<!-- Descendant selectors test -->
- <method name="testLookupTimes">
+ <method name="testLookupTimes"><![CDATA[
var t = getTimer();
for ( var i = iter; i >= 0; i-- ){
assertEquals( 10, this.getCSSProp( subsubID, "prop1" ));
@@ -80,9 +80,9 @@
assertEquals( 70, this.getCSSProp( subsubID, "prop8" ) );
}
var tt = getTimer() - t ;
- assertTrue(2000 > tt );
+ assertTrue(1 < tt );
Debug.write( 'Lookup test took: ' + tt );
- </method>
+ ]]></method>
<method name="makeSomeNodes">
for ( var i = iter; i > 0; i-- ){
Modified: openlaszlo/branches/legals/test/style/constraints/subclassing.lzx
===================================================================
--- openlaszlo/branches/legals/test/style/constraints/subclassing.lzx 2007-09-13 21:14:20 UTC (rev 6469)
+++ openlaszlo/branches/legals/test/style/constraints/subclassing.lzx 2007-09-13 21:44:23 UTC (rev 6470)
@@ -10,6 +10,7 @@
<stylesheet>
happystyledbox {
stylebgcolor : purple;
+ stylewidth : 999;
styleinnercolor : attr(myInnerColor);
}
</stylesheet>
@@ -40,20 +41,24 @@
</class>
<!-- This box should be green with an inner view of lime. -->
- <class name="otherlassbox" extends="happystyledbox" bgcolor="green">
+ <class name="otherlassbox" extends="happystyledbox" bgcolor="green" width="88">
<attribute name="innerColor" value="lime" />
</class>
+ <class name="lpp_4451" extends="happystyledbox" width="${parent.width/2}" />
+
<happystyledbox id="sb0" />
<!-- This box is maroon with an inner view of red -->
<happystyledbox id="sb1" bgcolor="maroon" innerColor="red" />
<subclassbox id="sb2" />
- <otherlassbox id="sb3" />
-
- <subclassbox id="sb4" />
+ <otherlassbox id="sb3" width="$style{'stylewidth'}"/>
+ <subclassbox id="sb4" />
+
+ <lpp_4451 id="sb5" width="$style{'stylewidth'}"/>
+
<class name="CSSSubclassingTestCase" extends="TestCase" >
<method name="testClassConstraint">
@@ -67,11 +72,16 @@
</method>
<method name="testSubclassOverrideConstraint">
+ <![CDATA[
this.assertEquals("150", sb2.getAttribute("width"));
- this.assertEquals(17337, sb2.getAttribute("bgcolor")); // fails! [2007.05.28 bshine]
+ this.assertEquals(navy, sb2.getAttribute("bgcolor")); // fails! [2007.05.28 bshine]
this.assertEquals(blue, sb2.inner.getAttribute("bgcolor"));
this.assertEquals(green, sb3.getAttribute("bgcolor")); // fails! [2007.05.28 bshine]
+ this.assertEquals(999, sb3.getAttribute("width"));
this.assertEquals(lime, sb3.inner.getAttribute("bgcolor"));
+ // FIXME: [2007-08-08 ptw] (LPP-4451) Uncomment when fixed
+ // this.assertEquals(999, sb5.width, "LPP-4451");
+ ]]>
</method>
</class>
</library>
Modified: openlaszlo/branches/legals/test/style/metasuite.lzx
===================================================================
--- openlaszlo/branches/legals/test/style/metasuite.lzx 2007-09-13 21:14:20 UTC (rev 6469)
+++ openlaszlo/branches/legals/test/style/metasuite.lzx 2007-09-13 21:44:23 UTC (rev 6470)
@@ -5,7 +5,7 @@
We expect these warnings;
resource/resource-not-found.lzx:34:44: Can't import /resource: /Users/ben/src/svn/openlaszlo/trunk/test/style/resource (No such file or directory)
resource/resource-not-found.lzx:44:50: The resource named 'sillyresource' has not been declared
--->
+-->
<canvas title="css metasuite" width="100%" height="100%">
<include href="designerview.lzx" />
@@ -23,11 +23,11 @@
<include href="elementselector/elementselector-test.lzx" />
<include href="elementselector/specialclassnames-test.lzx" />
<include href="resource/resource-not-found.lzx" />
+ <include href="simple/simple.lzx" />
+ <include href="simple/undefineds.lzx" />
<include href="specificity/applicability.lzx" />
<include href="specificity/newspecificity.lzx" />
- <!-- <include href="trait/cssable-test.lzx" /> -->
-
<include href="neighborhood/neighborhoodclasses.lzx" />
<include href="neighborhood/kennedyfamily.lzx" />
<include href="neighborhood/thestreet.lzx" />
@@ -45,11 +45,11 @@
<ElementTestCase />
<SpecialClassNamesTestCase />
<ResourceTestCase />
- <!-- TraitsTestCase -->
<ConstraintSpeedTestCase />
<ApplicabilityTestCase />
<NewSpecificityTestCase />
-
+ <UndefinedsTestCase />
+ <SimpleTestCase />
</TestSuite>
</canvas>
\ No newline at end of file
Modified: openlaszlo/branches/legals/test/style/resource/resource-not-found.lzx
===================================================================
--- openlaszlo/branches/legals/test/style/resource/resource-not-found.lzx 2007-09-13 21:14:20 UTC (rev 6469)
+++ openlaszlo/branches/legals/test/style/resource/resource-not-found.lzx 2007-09-13 21:44:23 UTC (rev 6470)
@@ -6,7 +6,7 @@
[name="monkresource"] {
cssimage: "monk.jpg";
- }
+ }
</stylesheet>
@@ -20,7 +20,8 @@
<view id="gBonk" source="$style{'styledresource'}" />
- <!-- this should give a warning -->
+ <!-- BUG LPP-3024 this should give a warning, but does not
+ [bshine 08.03.2007] -->
<view id="gMissing" source="$style{'nostyledefined'}" />
<resource name="niceresource" src="test.png" />
Copied: openlaszlo/branches/legals/test/style/simple/main.lzx (from rev 5999, openlaszlo/branches/wafflecone/test/style/simple/main.lzx)
Modified: openlaszlo/branches/legals/test/style/simple/simple.lzx
===================================================================
--- openlaszlo/branches/legals/test/style/simple/simple.lzx 2007-09-13 21:14:20 UTC (rev 6469)
+++ openlaszlo/branches/legals/test/style/simple/simple.lzx 2007-09-13 21:44:23 UTC (rev 6470)
@@ -1,14 +1,12 @@
<!-- Copyright 2007 Laszlo Systems -->
-<canvas>
+<library>
-
-<include href="lzunit" />
<include href="../designerview.lzx" />
<stylesheet>
#gSimple {
bgcolor: #0000FA;
- }
+ }
</stylesheet>
<simplelayout axis="y" spacing="5" />
@@ -26,7 +24,7 @@
</view>
<view width="50" height="50" bgcolor="0x00B300" />
-
+
<stylesheet>
#gTravis { innercolor: #6ab5e6; }
</stylesheet>
@@ -37,16 +35,14 @@
<designerview id="gTravis" />
</view>
-<TestSuite>
- <TestCase>
+
+ <class name="SimpleTestCase" extends="TestCase">
<method name="testBasics">
- assertEquals(50, gSoy.width);
+ assertEquals(50, gSoy.width); // KNOWN TO FAIL by bshine as of 08.01.2007
assertEquals(75, gAngelica.width);
</method>
<method name="testColors">
assertEquals(0x6ab5e6, gTravis.innercolor);
</method>
- </TestCase>
-</TestSuite>
-
-</canvas>
\ No newline at end of file
+ </class>
+</library>
\ No newline at end of file
Copied: openlaszlo/branches/legals/test/style/simple/undefineds.lzx (from rev 5999, openlaszlo/branches/wafflecone/test/style/simple/undefineds.lzx)
More information about the Laszlo-checkins
mailing list