[Laszlo-checkins] r10592 - in openlaszlo/trunk: WEB-INF/lps/lfc/data WEB-INF/lps/lfc/views lps/components/base lps/components/charts/common lps/components/charts/styles lps/components/incubator/rich-text lps/components/incubator/rich-text/test lps/components/lz lps/components/utils/replicator

pbr@openlaszlo.org pbr at openlaszlo.org
Tue Aug 5 11:37:15 PDT 2008


Author: pbr
Date: 2008-08-05 11:37:07 -0700 (Tue, 05 Aug 2008)
New Revision: 10592

Modified:
   openlaszlo/trunk/WEB-INF/lps/lfc/data/LzHTTPDataProvider.lzs
   openlaszlo/trunk/WEB-INF/lps/lfc/views/LaszloCanvas.lzs
   openlaszlo/trunk/WEB-INF/lps/lfc/views/LaszloView.lzs
   openlaszlo/trunk/lps/components/base/basescrollbar.lzx
   openlaszlo/trunk/lps/components/charts/common/valueregion.lzx
   openlaszlo/trunk/lps/components/charts/styles/chartstyle.lzx
   openlaszlo/trunk/lps/components/incubator/rich-text/richtexteditarea.lzx
   openlaszlo/trunk/lps/components/incubator/rich-text/test/formatfontsize.lzx
   openlaszlo/trunk/lps/components/lz/tabs.lzx
   openlaszlo/trunk/lps/components/utils/replicator/replicator.lzx
Log:
>From Tucker's review:

You will also have to fix the cases where the idiom was to `delete` an attribute (e.g., basescrollbar) as you are not permitted to delete a fixture.  The `delete` idiom should be replaced with setting the attribute to `null` (or whatever the initial sentinel value was).

If you make this fix, then approved.

=================================

Change 20080804-Philip-4 by Philip at Philip-DC on 2008-08-04 13:42:23 EDT
     in /cygdrive/f/laszlo/svn/src/svn/openlaszlo/trunk
     for http://svn.openlaszlo.org/openlaszlo/trunk

Summary: Fix (a in b) in LFC and components

New Features:

Bugs Fixed: LPP-6670 (partial)

Technical Reviewer: ptw
QA Reviewer: (pending)
Doc Reviewer: (pending)

Documentation:

Release Notes:

Details:
Most uses of 'in' are correct as they refer to keys in hashes. I removed 'in' in the LFC and components, with the exception of debugging which will be a separate changeset.

In most cases the fix was to make sure the class defines the value and then remove the 'in' check.

/data/LzHTTPDataProvider.lzs - secure is always defined

/views/LaszloCanvas.lzs - default version to null and remove check

/views/LaszloView.lzs - onremovesubview exists, removed check

/base/basescrollbar.lzx - Added attributes to remove 'in' checks

/charts/common/valueregion.lzx - Moved stretches into an attribute

/lz/tabs.lzx  background check not necessary.

/utils/replicator/replicator.lzx - All views (and all nodes) have
setSelected() method.

/incubator/rich-test/richtexteditarea.lzx - default toolbar and linkpanel to null and removed checks

/incubator/rich-text/test/formatfontsize.lzx - same as above


Tests:
lzpix in swf/dhtml (problems in swf8: see lpp-6753) smoketest in swf/dhtml component_sampler.lzx in swf/dhtml/swf9

Files:
M      WEB-INF/lps/lfc/views/LaszloView.lzs
M      WEB-INF/lps/lfc/views/LaszloCanvas.lzs
M      WEB-INF/lps/lfc/data/LzHTTPDataProvider.lzs
M      lps/components/charts/styles/chartstyle.lzx
M      lps/components/charts/common/valueregion.lzx
M      lps/components/lz/tabs.lzx
M      lps/components/incubator/rich-text/test/formatfontsize.lzx
M      lps/components/incubator/rich-text/richtexteditarea.lzx
M      lps/components/utils/replicator/replicator.lzx
M      lps/components/base/basescrollbar.lzx

Changeset: http://svn.openlaszlo.org/openlaszlo/patches/20080804-Philip-4.tar



Modified: openlaszlo/trunk/WEB-INF/lps/lfc/data/LzHTTPDataProvider.lzs
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/data/LzHTTPDataProvider.lzs	2008-08-05 13:55:49 UTC (rev 10591)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/data/LzHTTPDataProvider.lzs	2008-08-05 18:37:07 UTC (rev 10592)
@@ -55,7 +55,8 @@
          * I need to undersatnd what is the behavior of "secureport"
          */
         /*************/
-        var secure = ('secure' in dreq) ? dreq.secure : null;
+        // TODO [pbr 2008-08-04] dreq.secure will never be null
+        var secure = dreq.secure;
         if (secure == null) {
             if (dreq.src.substring(0, 5) == "https") {
                 secure = true;

Modified: openlaszlo/trunk/WEB-INF/lps/lfc/views/LaszloCanvas.lzs
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/views/LaszloCanvas.lzs	2008-08-05 13:55:49 UTC (rev 10591)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/views/LaszloCanvas.lzs	2008-08-05 18:37:07 UTC (rev 10592)
@@ -324,7 +324,7 @@
         this.__LZdelayedSetters = LzView.__LZdelayedSetters;
         this.earlySetters = LzView.earlySetters;
 
-        if (!('version' in this && this.version)){
+        if (!this.version){
             this.version = this.lpsversion;
         }
 
@@ -429,7 +429,7 @@
   * @lzxdefault "1.1"
   * @modifiers deprecated final
   */
-var version;
+var version = null;
 
 /** @access private */
 var __LZlfcversion = "0";

Modified: openlaszlo/trunk/WEB-INF/lps/lfc/views/LaszloView.lzs
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/views/LaszloView.lzs	2008-08-05 13:55:49 UTC (rev 10591)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/views/LaszloView.lzs	2008-08-05 18:37:07 UTC (rev 10592)
@@ -1370,11 +1370,7 @@
             vip.__LZoutlieheight=null;
         }
 
-        if ('onremovesubview' in vip) {
-            if (vip.onremovesubview.ready) {
-                vip.onremovesubview.sendEvent( this );
-            }
-        }
+        if (vip.onremovesubview.ready) vip.onremovesubview.sendEvent( this );
     }
 }
 

Modified: openlaszlo/trunk/lps/components/base/basescrollbar.lzx
===================================================================
--- openlaszlo/trunk/lps/components/base/basescrollbar.lzx	2008-08-05 13:55:49 UTC (rev 10591)
+++ openlaszlo/trunk/lps/components/base/basescrollbar.lzx	2008-08-05 18:37:07 UTC (rev 10592)
@@ -92,6 +92,21 @@
         <!--- @keywords private -->
         <attribute name="thumb" value="null" />
 
+        <!--- @keywords private -->
+        <attribute name="_mwActivateDel" value="null" />
+        <!--- @keywords private -->
+        <attribute name="_mwDeactivateDel" value="null" />
+        <!--- @keywords private -->
+        <attribute name="_mwUpdateDel" value="null" />
+        <!--- @keywords private -->
+        <attribute name="clipSizeDel" value="null" />
+        <!--- @keywords private -->
+        <attribute name="targetHeightDel" value="null" />
+        <!--- @keywords private -->
+        <attribute name="targetPosDel" value="null" />
+        <!--- @keywords private -->
+        <attribute name="heightDel" value="null" />
+
         <!-- if the scrollbar is vertical and the developer has not set a height
              then the scrollbar should be its parent's height, see oninit -->
         <state name="heightConstraint">
@@ -222,39 +237,39 @@
 
         <!--- @keywords private -->
         <method name="destroy" ><![CDATA[
-            if ('_mwActivateDel' in this) {
+            if (this._mwActivateDel) {
                 this._mwActivateDel.unregisterAll();
-                delete this._mwActivateDel;
+                this._mwActivateDel = null;
             }
 
-            if ('_mwDeactivateDel' in this) {
+            if (this._mwDeactivateDel) {
                 this._mwDeactivateDel.unregisterAll();
-                delete this._mwDeactivateDel;
+                this._mwDeactivateDel = null;
             }
 
-            if ('_mwUpdateDel' in this) {
+            if (this._mwUpdateDel) {
                 this._mwUpdateDel.unregisterAll();
-                delete this._mwUpdateDel;
+                this._mwUpdateDel = null;
             }
 
-            if ('clipSizeDel' in this) {
+            if (this.clipSizeDel) {
                 this.clipSizeDel.unregisterAll();
-                delete this.clipSizeDel;
+                this.clipSizeDel = null;
             }
 
-            if ('targetHeightDel' in this) {
+            if (this.targetHeightDel) {
                 this.targetHeightDel.unregisterAll();
-                delete this.targetHeightDel;
+                this.targetHeightDel = null;
             }
 
-            if ('targetPosDel' in this) {
+            if (this.targetPosDel) {
                 this.targetPosDel.unregisterAll();
-                delete this.targetPosDel;
+                this.targetPosDel = null;
             }
 
-            if ('heightDel' in this) {
+            if (this.heightDel) {
                 this.heightDel.unregisterAll();
-                delete this.heightDel;
+                this.heightDel = null;
             }
 
             delete this.scrolltarget;

Modified: openlaszlo/trunk/lps/components/charts/common/valueregion.lzx
===================================================================
--- openlaszlo/trunk/lps/components/charts/common/valueregion.lzx	2008-08-05 13:55:49 UTC (rev 10591)
+++ openlaszlo/trunk/lps/components/charts/common/valueregion.lzx	2008-08-05 18:37:07 UTC (rev 10592)
@@ -129,7 +129,7 @@
 
                    if( this.style.region.image != null ) {
                        this.setSource( this.style.region.image );
-                       if ('stretches' in this.style.region)
+                       if (this.style.region.stretches)
                            this.setAttribute( "stretches", this.style.region.stretches );
                    }
                }

Modified: openlaszlo/trunk/lps/components/charts/styles/chartstyle.lzx
===================================================================
--- openlaszlo/trunk/lps/components/charts/styles/chartstyle.lzx	2008-08-05 13:55:49 UTC (rev 10591)
+++ openlaszlo/trunk/lps/components/charts/styles/chartstyle.lzx	2008-08-05 18:37:07 UTC (rev 10592)
@@ -131,7 +131,7 @@
 <!--- style for a region
       @access public
       -->
-<class name="regionstyle" extends="basestyle"  stretches="both">
+<class name="regionstyle" extends="basestyle">
     <doc>
       <text>
         <warning>This component is of Beta quality and is subject to change.</warning>
@@ -145,7 +145,10 @@
     <attribute name="gradient" type="string" value="none" /> 
     <!--- image path -->
     <attribute name="image" type="string" value="${null}"/>
+    <!-- stretches -->
+    <attribute name="stretches" type="string" value="both"/>
 
+
 </class>
 
 <!--- style object used for anything that contains a label within the chart.

Modified: openlaszlo/trunk/lps/components/incubator/rich-text/richtexteditarea.lzx
===================================================================
--- openlaszlo/trunk/lps/components/incubator/rich-text/richtexteditarea.lzx	2008-08-05 13:55:49 UTC (rev 10591)
+++ openlaszlo/trunk/lps/components/incubator/rich-text/richtexteditarea.lzx	2008-08-05 18:37:07 UTC (rev 10592)
@@ -17,12 +17,12 @@
         <!--- Reference to the toolbar associated with this editor. 
             For the toolbar to show the correct format when the insertion
             point moves, this attribute must be set by users. -->
-        <attribute name="toolbar"  />
+        <attribute name="toolbar" value="null"/>
         
         <!--- Reference to the hyperlink creation dialog.
             This attribute should be set by users, if there is 
             an associated link panel --> 
-        <attribute name="linkpanel"/>
+        <attribute name="linkpanel" value="null"/>
         
         <!-- The defaultfontsize, defaultfontname, and defaultfontcolor
              determine the initial configuration of the toolbar, and thus, the
@@ -108,8 +108,8 @@
             this.inp.setDefaultFormat(this.currentformat);
             this.rollback();
             
-            if ("linkpanel" in this && this.linkpanel) this.linkpanel.hide();
-            if ("toolbar" in this && this.toolbar) this.toolbar.reset();
+            if (this.linkpanel) this.linkpanel.hide();
+            if (this.toolbar) this.toolbar.reset();
             
             this.isHTML = false;
             this._shouldresettoolbar = true;

Modified: openlaszlo/trunk/lps/components/incubator/rich-text/test/formatfontsize.lzx
===================================================================
--- openlaszlo/trunk/lps/components/incubator/rich-text/test/formatfontsize.lzx	2008-08-05 13:55:49 UTC (rev 10591)
+++ openlaszlo/trunk/lps/components/incubator/rich-text/test/formatfontsize.lzx	2008-08-05 18:37:07 UTC (rev 10592)
@@ -48,7 +48,7 @@
 
          
 
-         <attribute name="editor" />
+         <attribute name="editor" value="null"/>
 
          <attribute name="toolbar" value="$once{this.parent}" />
 
@@ -97,7 +97,7 @@
                 //------------------------------------------------------------
 
                 if (this.changed && this.toolbar._passthruchanges) {                   
-                    if ("editor" in this) {
+                    if (this.editor) {
                         this.editor.setFormatAttribute("size", this.getValue()); 
                         this.editor.delegateRestoreSelection(); 
                     }

Modified: openlaszlo/trunk/lps/components/lz/tabs.lzx
===================================================================
--- openlaszlo/trunk/lps/components/lz/tabs.lzx	2008-08-05 13:55:49 UTC (rev 10591)
+++ openlaszlo/trunk/lps/components/lz/tabs.lzx	2008-08-05 18:37:07 UTC (rev 10592)
@@ -291,7 +291,7 @@
 
         <!--- @keywords private -->
         <method name="_applystyle" args="s"><![CDATA[
-            if (this.style != null && ('background' in this)) {
+            if (this.style != null) {
                 setTint(background, s.basecolor);
             }
         ]]></method>

Modified: openlaszlo/trunk/lps/components/utils/replicator/replicator.lzx
===================================================================
--- openlaszlo/trunk/lps/components/utils/replicator/replicator.lzx	2008-08-05 13:55:49 UTC (rev 10591)
+++ openlaszlo/trunk/lps/components/utils/replicator/replicator.lzx	2008-08-05 18:37:07 UTC (rev 10592)
@@ -139,14 +139,12 @@
             this.setData( v , n );
             this.update( v , n );
             // Cooperate with dataselectionmanager, but take care
-            if ('setSelected' in v) {
-              var datanode = this.nodes[n];
-              var datapath = v.datapath;
-              var isSelected = (datanode && datanode['sel']) || false;
-              var wasSelected = (datapath && datapath['sel']) || false;
-              if (isSelected != wasSelected) {
-                v.setSelected(datapath['sel'] = isSelected);
-              }
+            var datanode = this.nodes[n];
+            var datapath = v.datapath;
+            var isSelected = (datanode && datanode['sel']) || false;
+            var wasSelected = (datapath && datapath['sel']) || false;
+            if (isSelected != wasSelected) {
+              v.setSelected(datapath['sel'] = isSelected);
             }
             if ( this._cloneprops[ n ] ) {
                 var p = this._cloneprops[ n ];



More information about the Laszlo-checkins mailing list