[Laszlo-checkins] r3984 - in openlaszlo/branches/legals: WEB-INF/lps/lfc/core WEB-INF/lps/lfc/data WEB-INF/lps/lfc/events WEB-INF/lps/lfc/kernel WEB-INF/lps/lfc/kernel/dhtml WEB-INF/lps/lfc/services WEB-INF/lps/lfc/views lps/includes/source test/history test/lfc/legals/testjscomm

max@openlaszlo.org max at openlaszlo.org
Wed Feb 28 15:23:58 PST 2007


Author: max
Date: 2007-02-28 15:22:27 -0800 (Wed, 28 Feb 2007)
New Revision: 3984

Added:
   openlaszlo/branches/legals/WEB-INF/lps/lfc/services/LzCursor.lzs
   openlaszlo/branches/legals/WEB-INF/lps/lfc/services/LzHistory.js
Removed:
   openlaszlo/branches/legals/WEB-INF/lps/lfc/services/LzCursor.as
Modified:
   openlaszlo/branches/legals/WEB-INF/lps/lfc/core/Class.lzs
   openlaszlo/branches/legals/WEB-INF/lps/lfc/core/LzNode.lzs
   openlaszlo/branches/legals/WEB-INF/lps/lfc/data/LzDataElement.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/LzParsedPath.lzs
   openlaszlo/branches/legals/WEB-INF/lps/lfc/events/LaszloEvents.lzs
   openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/Library.lzs
   openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/dhtml/Library.lzs
   openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/dhtml/LzHTTPLoader.js
   openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/dhtml/LzTextSprite.js
   openlaszlo/branches/legals/WEB-INF/lps/lfc/services/Library.lzs
   openlaszlo/branches/legals/WEB-INF/lps/lfc/services/LzHistory.as
   openlaszlo/branches/legals/WEB-INF/lps/lfc/services/LzKeys.js
   openlaszlo/branches/legals/WEB-INF/lps/lfc/views/LaszloCanvas.lzs
   openlaszlo/branches/legals/WEB-INF/lps/lfc/views/LaszloView.lzs
   openlaszlo/branches/legals/lps/includes/source/embednew.js
   openlaszlo/branches/legals/test/history/history.lzx
   openlaszlo/branches/legals/test/history/index.jsp
   openlaszlo/branches/legals/test/lfc/legals/testjscomm/copy-of-hello.lzx
   openlaszlo/branches/legals/test/lfc/legals/testjscomm/test6.jsp
   openlaszlo/branches/legals/test/lfc/legals/testjscomm/test8.jsp
Log:
Change 20070228-maxcarlson-g by maxcarlson at max-carlsons-computer.local on 2007-02-28 11:00:43 PST
    in /Users/maxcarlson/openlaszlo/legals

Summary: LFC cleanup, add history for dhtml

New Features:

Bugs Fixed:

Technical Reviewer: promanik
QA Reviewer: jcrowley
Doc Reviewer: (pending)

Documentation:

Release Notes:

Details: index.jsp - include both dhtml and swf versions of the history example.

history.lzx - Turn off debugger, add text fields to show setCanvasAttribute values

test6.jsp - Show return value of Lz.callMethod()

test8.jsp - Show return value of Lz.callMethod().  Use lzr=swf8 instead of lzOptions.forceFlashComm to set flash commversion to 8.

copy-of-hello.lzx - Return value for Lz.callMethod() test

kernel/dhtml/Library.lzs - Comment out unused LzRequires.

LzTextSprite.js - Transform 'null' -> '' now that LzText.setText() coerces to string value.

kernel/Library.lzs - Comment out unused LzRequires.

LzHistory.js - Add dhtml implementation of lzhistory

LzCursor - Rename .as -> .lzs, since this is now shared code

LzKeys.js - Add if ($debug) around Debug call.

LzHistory.as - Return result of LzHistory.callMethod() for Lz.callMethod().

services/Library.lzs - Include LzCursor.lzs, include LzHistory.js

LzNode.lzs - Remove __LZhenryWasRight (he was), add if ($debug) around Debug calls.

Class.lzs - Add if ($debug) around Debug calls.

LaszloView.lzs - Add if ($debug) around Debug calls.

LaszloCanvas.lzs - Remove __LZhenryWasRight (he was), add if ($debug) around Debug calls.

LaszloEvents.lzs - Add if ($debug) around Debug call, comment out 'deferring... ' debug message.

LzDatapointer.lzs - Add if ($debug) around Debug calls.

LzDataElement.lzs - Comment out spurious debugger warning.

LzDataset.lzs - Add if ($debug) around Debug calls.

LzParsedPath.lzs - Add if ($debug) around Debug calls.

embednew.js - Add support for dhtml setCanvasAttribute calls, and multiple simultaneous setCanvasAttribute calls via history (for all runtimes).

Tests: http://localhost:8080/legals/test/history/ now shows swf and dhtml apps alongside one another, and both can receive history events.  Added buttons for testing simultaneous setCanvasAttribute with history.  http://localhost:8080/legals/test/lfc/legals/testjscomm/test6/8.jsp now alert the result when clicking the 'Test method arg casting' button.  Eliminated '__LZhenryWasRight' related debugger messages. No more calls to Debug.* in lpp/includes/lfc/LFCdhtml.js.  Everything else runs as before.


Files:
M      test/history/index.jsp
M      test/history/history.lzx
M      test/lfc/legals/testjscomm/test6.jsp
M      test/lfc/legals/testjscomm/test8.jsp
M      test/lfc/legals/testjscomm/copy-of-hello.lzx
M      WEB-INF/lps/lfc/kernel/dhtml/Library.lzs
M      WEB-INF/lps/lfc/kernel/dhtml/LzTextSprite.js
M      WEB-INF/lps/lfc/kernel/Library.lzs
A      WEB-INF/lps/lfc/services/LzHistory.js
D      WEB-INF/lps/lfc/services/LzCursor.as
A  +   WEB-INF/lps/lfc/services/LzCursor.lzs
M      WEB-INF/lps/lfc/services/LzKeys.js
M      WEB-INF/lps/lfc/services/LzHistory.as
M      WEB-INF/lps/lfc/services/Library.lzs
M      WEB-INF/lps/lfc/core/LzNode.lzs
M      WEB-INF/lps/lfc/core/Class.lzs
M      WEB-INF/lps/lfc/views/LaszloView.lzs
M      WEB-INF/lps/lfc/views/LaszloCanvas.lzs
M      WEB-INF/lps/lfc/events/LaszloEvents.lzs
M      WEB-INF/lps/lfc/data/LzDatapointer.lzs
M      WEB-INF/lps/lfc/data/LzDataElement.lzs
M      WEB-INF/lps/lfc/data/LzDataset.lzs
M      WEB-INF/lps/lfc/data/LzParsedPath.lzs
M      lps/includes/source/embednew.js

Changeset: http://svn.openlaszlo.org/openlaszlo/patches/20070228-maxcarlson-g.tar

Modified: openlaszlo/branches/legals/WEB-INF/lps/lfc/core/Class.lzs
===================================================================
--- openlaszlo/branches/legals/WEB-INF/lps/lfc/core/Class.lzs	2007-02-28 23:19:46 UTC (rev 3983)
+++ openlaszlo/branches/legals/WEB-INF/lps/lfc/core/Class.lzs	2007-02-28 23:22:27 UTC (rev 3984)
@@ -185,18 +185,24 @@
             }
             if (! found) {
               value.superclasses.push(constructor);
-              Debug.debug('Shim %s.%s [3+]', this, k)
+              if ($debug) {
+                Debug.debug('Shim %s.%s [3+]', this, k)
+              }
             }
           } else if (value.hasOwnProperty('superclass')) {
             var o = value.superclass;
             if (o !== constructor) {
               delete value.superclass;
               value.superclasses = [ o, constructor ];
-              Debug.debug('Shim %s.%s [2]', this, k);
+              if ($debug) {
+                Debug.debug('Shim %s.%s [2]', this, k);
+              }
             }
           } else {
             value.superclass = constructor;
-            Debug.debug('Shim %s.%s [1]', this, k);
+            if ($debug) {
+              Debug.debug('Shim %s.%s [1]', this, k);
+            }
           }
         }
       }

Modified: openlaszlo/branches/legals/WEB-INF/lps/lfc/core/LzNode.lzs
===================================================================
--- openlaszlo/branches/legals/WEB-INF/lps/lfc/core/LzNode.lzs	2007-02-28 23:19:46 UTC (rev 3983)
+++ openlaszlo/branches/legals/WEB-INF/lps/lfc/core/LzNode.lzs	2007-02-28 23:22:27 UTC (rev 3984)
@@ -33,8 +33,6 @@
   */
 class LzNode {
 
-static var __LZhenryWasRight = true;
-
 /** @access private
   * @modifiers override 
   */
@@ -47,10 +45,8 @@
   * this node
   */
 function initialize ( parent , attrs , children , instcall ){
-        if (LzNode.__LZhenryWasRight == true) {
-            this.__LZdeferDelegates = true;
-            var qpos = LzDelegate.__LZdelegatesQueue.length;
-        }
+        this.__LZdeferDelegates = true;
+        var qpos = LzDelegate.__LZdelegatesQueue.length;
         super.initialize.apply(this, arguments);
 
         // Node node start
@@ -184,12 +180,10 @@
 
         this.constructWithArgs( maskedargs );
 
-        if (LzNode.__LZhenryWasRight == true) {
-            delete this.__LZdeferDelegates;
-            if (qpos != LzDelegate.__LZdelegatesQueue.length) {
-                // Drain the events queue back to where we started
-                LzDelegate.__LZdrainDelegatesQueue(qpos);
-            }
+        delete this.__LZdeferDelegates;
+        if (qpos != LzDelegate.__LZdelegatesQueue.length) {
+            // Drain the events queue back to where we started
+            LzDelegate.__LZdrainDelegatesQueue(qpos);
         }
 
         this.onconstruct.sendEvent( this );
@@ -885,7 +879,9 @@
         this[s[prop]](val);
     } else {
         if (s == null) {
-            Debug.write('null setters on', this, prop, val);
+            if ($debug) {
+                Debug.warn('null setters on', this, prop, val);
+            }
         }
         this[ prop ] = val;
         var evt = ("on" + prop);
@@ -1912,7 +1908,9 @@
   */
 function __LZmakeDatapath( dpobj ){
   if (! (dpobj instanceof Object)) {
-    Debug.debug('__LZmakeDatapath on non-object %w?', dpobj)
+    if ($debug) {
+        Debug.debug('__LZmakeDatapath on non-object %w?', dpobj)
+    }
   }
     this.makeChild( dpobj , true);
 }

Modified: openlaszlo/branches/legals/WEB-INF/lps/lfc/data/LzDataElement.lzs
===================================================================
--- openlaszlo/branches/legals/WEB-INF/lps/lfc/data/LzDataElement.lzs	2007-02-28 23:19:46 UTC (rev 3983)
+++ openlaszlo/branches/legals/WEB-INF/lps/lfc/data/LzDataElement.lzs	2007-02-28 23:22:27 UTC (rev 3984)
@@ -337,7 +337,7 @@
   * @param String name: The new name for this node
   */
 function setNodeName ( name ){
-    Debug.write('setting node name from "',this.nodeName, '" to "', name, '"');
+    //Debug.write('setting node name from "',this.nodeName, '" to "', name, '"');
     this.nodeName = name;
     //since this can affect xpaths, send onchildNodes event
     this.onnodeName.sendEvent( name );

Modified: openlaszlo/branches/legals/WEB-INF/lps/lfc/data/LzDatapointer.lzs
===================================================================
--- openlaszlo/branches/legals/WEB-INF/lps/lfc/data/LzDatapointer.lzs	2007-02-28 23:19:46 UTC (rev 3983)
+++ openlaszlo/branches/legals/WEB-INF/lps/lfc/data/LzDatapointer.lzs	2007-02-28 23:22:27 UTC (rev 3984)
@@ -435,12 +435,14 @@
     if ( this.__LZspecialOndata ){
         if ( n.childNodes.length ){
             if ( this.ondata && !this.__LZoldOndataWarn ){
+                if ($debug) {
                 Debug.warn( "Datapointer pointing to %w," + 
                     ' relies on the ondata event from' +
                     " a datapointer bound to the root node of a dataset."+
                     " \n    This behavior is deprecated." +
                     " Point the dataponter the first child " +
                     " of the dataset, or use the dataset's ondata event.", this.context);
+                }
                 this.__LZoldOndataWarn = true;
             }
 
@@ -605,7 +607,9 @@
         //Debug.write('found local dataset', n);
         return n;
     } else {
-        Debug.warn('local dataset "%w" not found in %w', pp, this.parent);
+        if ($debug) {
+            Debug.warn('local dataset "%w" not found in %w', pp, this.parent);
+        }
         /* Could register for node creation if datapath is created before dataset
         */
     }

Modified: openlaszlo/branches/legals/WEB-INF/lps/lfc/data/LzDataset.lzs
===================================================================
--- openlaszlo/branches/legals/WEB-INF/lps/lfc/data/LzDataset.lzs	2007-02-28 23:19:46 UTC (rev 3983)
+++ openlaszlo/branches/legals/WEB-INF/lps/lfc/data/LzDataset.lzs	2007-02-28 23:22:27 UTC (rev 3984)
@@ -262,9 +262,11 @@
     }
 
     if (null != canvas.datasets[name]) {
-        Debug.warn("A dataset already exists with the name '%s': %w" +
-                         " - use explicit datasources in your datapaths.", 
-                         name, 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]);
+        }
     }
 
     canvas.datasets[name] = this;
@@ -510,7 +512,9 @@
 
 function setProxyRequests( val ) {
     if (typeof(val) != 'string') {
-        Debug.warn("arg '%w' to setProxyRequests must be a string with value 'inherit', 'true', or 'false'", val);
+        if ($debug) {
+            Debug.warn("arg '%w' to setProxyRequests must be a string with value 'inherit', 'true', or 'false'", val);
+        }
     } else {
         this.proxied = val;
     }

Modified: openlaszlo/branches/legals/WEB-INF/lps/lfc/data/LzParsedPath.lzs
===================================================================
--- openlaszlo/branches/legals/WEB-INF/lps/lfc/data/LzParsedPath.lzs	2007-02-28 23:19:46 UTC (rev 3983)
+++ openlaszlo/branches/legals/WEB-INF/lps/lfc/data/LzParsedPath.lzs	2007-02-28 23:22:27 UTC (rev 3984)
@@ -52,7 +52,9 @@
             }
         }
         if ( this.context == null && nowarn != true){
-            Debug.error( "couldn't find dataset for %w", pa );
+            if ($debug) {
+                Debug.error( "couldn't find dataset for %w", pa );
+            }
         }
 
         var rest = pa.substring( sourceindex + 2 );
@@ -238,11 +240,13 @@
   * @access private
   */
 function debugWrite (  ){
-    Debug.write( this );
-    Debug.write( "  c:" + this.context + "|");
-    Debug.write( "  n:" + this.selectors.join('|') + "|");
-    Debug.write( "  d:" + this.operator + "|");
-    Debug.write( "  " );
+    if ($debug) {
+        Debug.write( this );
+        Debug.write( "  c:" + this.context + "|");
+        Debug.write( "  n:" + this.selectors.join('|') + "|");
+        Debug.write( "  d:" + this.operator + "|");
+        Debug.write( "  " );
+    }
 }
 
 } // End of LzParsedPath

Modified: openlaszlo/branches/legals/WEB-INF/lps/lfc/events/LaszloEvents.lzs
===================================================================
--- openlaszlo/branches/legals/WEB-INF/lps/lfc/events/LaszloEvents.lzs	2007-02-28 23:19:46 UTC (rev 3983)
+++ openlaszlo/branches/legals/WEB-INF/lps/lfc/events/LaszloEvents.lzs	2007-02-28 23:22:27 UTC (rev 3984)
@@ -105,7 +105,9 @@
   */
 function register ( eventSender , eventName){
     if (! eventSender) {
-        Debug.error('No eventSender (%w) for %s', eventSender, eventName);
+        if ($debug) {
+            Debug.error('No eventSender (%w) for %s', eventSender, eventName);
+        }
         return;
     }
 
@@ -204,9 +206,11 @@
     while (i < n) {
       var d = evq[i];
       var sd = evq[i+1];
+      /*
       if ($debug) {
         Debug.debug("Deferred %w.execute(%w)", d, sd);
       }
+      */
       // d.execute( sd ); inlined
       d.c[d.f]( sd );
       i+=2;

Modified: openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/Library.lzs
===================================================================
--- openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/Library.lzs	2007-02-28 23:19:46 UTC (rev 3983)
+++ openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/Library.lzs	2007-02-28 23:22:27 UTC (rev 3984)
@@ -1,14 +1,14 @@
 /**
   * 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
   */
 
 #include "kernel/LzIdleKernel.lzs"
-#include "kernel/LzRequires.lzs"
+//#include "kernel/LzRequires.lzs"
 if ($dhtml) {
     #include "kernel/dhtml/Library.lzs"
 } else if ($svg) {
@@ -19,7 +19,9 @@
     Debug.error('kernel/Library.lzs unsupported runtime %s', $runtime);
 }
 
+/*
 if ($debug) {
     // Check requires against provides
     $modules.runtime.__warnRequires();
 }
+*/

Modified: openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/dhtml/Library.lzs
===================================================================
--- openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/dhtml/Library.lzs	2007-02-28 23:19:46 UTC (rev 3983)
+++ openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/dhtml/Library.lzs	2007-02-28 23:22:27 UTC (rev 3984)
@@ -7,7 +7,7 @@
   */
 
 #include "kernel/dhtml/LFC.js"
-#include "kernel/dhtml/LzRequires.js"
+//#include "kernel/dhtml/LzRequires.js"
 #include "kernel/dhtml/LzPool.js"
 #include "kernel/dhtml/LzKeyboardKernel.js"
 #include "kernel/dhtml/LzMouseKernel.js"

Modified: openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/dhtml/LzHTTPLoader.js
===================================================================
--- openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/dhtml/LzHTTPLoader.js	2007-02-28 23:19:46 UTC (rev 3983)
+++ openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/dhtml/LzHTTPLoader.js	2007-02-28 23:22:27 UTC (rev 3984)
@@ -283,6 +283,11 @@
             }
         };
         this.req.open(method, url, true);
+        // If you're POST'ing, the LPS server really wants to see
+        // content-type = application/x-www-form-urlencoded 
+        if (method == "POST") {
+            this.requestheaders['content-type'] = 'application/x-www-form-urlencoded';
+        }
         this.__setRequestHeaders(this.req, headers);
         this.req.send(postbody);
     }

Modified: openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/dhtml/LzTextSprite.js
===================================================================
--- openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/dhtml/LzTextSprite.js	2007-02-28 23:19:46 UTC (rev 3983)
+++ openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/dhtml/LzTextSprite.js	2007-02-28 23:22:27 UTC (rev 3984)
@@ -94,6 +94,7 @@
 LzTextSprite.prototype.setTextColor = LzSprite.prototype.setColor;
 
 LzTextSprite.prototype.setText = function(t, force) {
+    if (t == 'null') t = '';
     if (force != true && this.text == t) return;
     //Debug.write('LzTextSprite.setText', t);
 

Modified: openlaszlo/branches/legals/WEB-INF/lps/lfc/services/Library.lzs
===================================================================
--- openlaszlo/branches/legals/WEB-INF/lps/lfc/services/Library.lzs	2007-02-28 23:19:46 UTC (rev 3983)
+++ openlaszlo/branches/legals/WEB-INF/lps/lfc/services/Library.lzs	2007-02-28 23:22:27 UTC (rev 3984)
@@ -10,12 +10,13 @@
 #include "services/LzInstantiator.lzs"
 #include "services/LzGlobalMouse.lzs"
 #include "services/LzModeManager.lzs"
-#include "services/LzCursor.as"
+#include "services/LzCursor.lzs"
 if ($js1) {
     #include "services/platform/dhtml/LzModeManager.js"
     #include "services/LzBrowser.js"
     #include "services/LzKeys.js"
     #include "services/LzTrack.js"
+    #include "services/LzHistory.js"
 } else if ($as2) {
     #include "services/platform/swf/LzModeManager.as"
     #include "services/LzKeys.as"

Deleted: openlaszlo/branches/legals/WEB-INF/lps/lfc/services/LzCursor.as

Copied: openlaszlo/branches/legals/WEB-INF/lps/lfc/services/LzCursor.lzs (from rev 3954, openlaszlo/branches/legals/WEB-INF/lps/lfc/services/LzCursor.as)

Modified: openlaszlo/branches/legals/WEB-INF/lps/lfc/services/LzHistory.as
===================================================================
--- openlaszlo/branches/legals/WEB-INF/lps/lfc/services/LzHistory.as	2007-02-28 23:19:46 UTC (rev 3983)
+++ openlaszlo/branches/legals/WEB-INF/lps/lfc/services/LzHistory.as	2007-02-28 23:22:27 UTC (rev 3984)
@@ -166,7 +166,7 @@
     }
 
     //Debug.write('found scope', scope, 'args', args, 'for path', path);  
-    scope.apply(lastscope, args);
+    return scope.apply(lastscope, args);
 }
 
 /**

Added: openlaszlo/branches/legals/WEB-INF/lps/lfc/services/LzHistory.js


Property changes on: openlaszlo/branches/legals/WEB-INF/lps/lfc/services/LzHistory.js
___________________________________________________________________
Name: svn:mime-type
   + text/plain
Name: svn:eol-style
   + native

Modified: openlaszlo/branches/legals/WEB-INF/lps/lfc/services/LzKeys.js
===================================================================
--- openlaszlo/branches/legals/WEB-INF/lps/lfc/services/LzKeys.js	2007-02-28 23:19:46 UTC (rev 3983)
+++ openlaszlo/branches/legals/WEB-INF/lps/lfc/services/LzKeys.js	2007-02-28 23:22:27 UTC (rev 3984)
@@ -44,7 +44,9 @@
 
 LzKeys.callOnKeyCombo = function(who, k) {
     //TODO: implement
-    Debug.warn("LzKeys.callOnKeyCombo is currently unimplemented");
+    if ($debug) {
+        Debug.warn("LzKeys.callOnKeyCombo is currently unimplemented");
+    }
 }    
 
 LzKeyboardKernel.setCallback(LzKeys, '__keyboardEvent');

Modified: openlaszlo/branches/legals/WEB-INF/lps/lfc/views/LaszloCanvas.lzs
===================================================================
--- openlaszlo/branches/legals/WEB-INF/lps/lfc/views/LaszloCanvas.lzs	2007-02-28 23:19:46 UTC (rev 3983)
+++ openlaszlo/branches/legals/WEB-INF/lps/lfc/views/LaszloCanvas.lzs	2007-02-28 23:22:27 UTC (rev 3984)
@@ -37,16 +37,6 @@
   */
 class LzCanvas extends LzView {
 
-  // TODO: [2007-01-10 ptw] Remove this if Henry was right.
-  static function make (args) {
-    if  ('__LZhenryWasRight' in args) {
-      LzNode.__LZhenryWasRight = args.__LZhenryWasRight;
-      delete args.__LZhenryWasRight;
-    }
-    Debug.debug('LzNode.__LZhenryWasRight = %#w', LzNode.__LZhenryWasRight);
-    return LzCanvas.prototype.constructor.make.apply(this, arguments);
-  }
-
 /**
   * @access private
   * @modifiers override
@@ -212,8 +202,9 @@
   */
 function __makeSprite(args) {
     this.sprite = new LzSprite(this, true, args);
-    Debug.write("making canvas sprite", this.sprite);
-
+    if ($debug) {
+        Debug.write("making canvas sprite", this.sprite);
+    }
 }
 
 var initdelay = 0;

Modified: openlaszlo/branches/legals/WEB-INF/lps/lfc/views/LaszloView.lzs
===================================================================
--- openlaszlo/branches/legals/WEB-INF/lps/lfc/views/LaszloView.lzs	2007-02-28 23:19:46 UTC (rev 3983)
+++ openlaszlo/branches/legals/WEB-INF/lps/lfc/views/LaszloView.lzs	2007-02-28 23:22:27 UTC (rev 3984)
@@ -2250,7 +2250,9 @@
   * @param Boolean s: If true, activate the current view and all of its children
   */
 function setAAActive ( s, mc ){
-    Debug.warn('setAAActive is not implemented yet.');
+    if ($debug) {
+        Debug.warn('setAAActive is not implemented yet.');
+    }
     /*
     if (mc == null || mc == 'aaactive') mc = this.getMCRef();
     //Debug.write('setAAActive ', s + ' ' + mc);
@@ -2273,7 +2275,9 @@
   * @param string s: Sets the accessibility name for this view
   */
 function setAAName ( s, mc ){
-    Debug.warn('setAAName is not implemented yet.');
+    if ($debug) {
+        Debug.warn('setAAName is not implemented yet.');
+    }
     /*
     if (mc == null || mc == 'aaname') mc = this.getMCRef();
     //Debug.write('setAAName ', s + ' ' + mc);
@@ -2293,7 +2297,9 @@
   * @param string s: Sets the accessibility name for this view
   */
 function setAADescription ( s, mc ){
-    Debug.warn('setAADescription is not implemented yet.');
+    if ($debug) {
+        Debug.warn('setAADescription is not implemented yet.');
+    }
     /*
     if (mc == null || mc == 'aadescription') mc = this.getMCRef();
     //Debug.write('setAADescription ', s + ' ' + mc);
@@ -2313,7 +2319,9 @@
   * @param number s: The tab order index for this view.  Must be a unique number.
   */
 function setAATabIndex ( s, mc ){
-    Debug.warn('setAATabIndex is not implemented yet.');
+    if ($debug) {
+        Debug.warn('setAATabIndex is not implemented yet.');
+    }
     /*
     if (mc == null || mc == 'aatabindex') mc = this.getMCRef();
     //Debug.write('setAATabIndex ', mc);
@@ -2328,7 +2336,9 @@
   * If false, it is active to the screen reader.
   */
 function setAASilent ( s, mc ){
-    Debug.warn('setAASilent is not implemented yet.');
+    if ($debug) {
+        Debug.warn('setAASilent is not implemented yet.');
+    }
     /*
     if (mc == null || mc == 'aasilent') mc = this.getMCRef();
     //Debug.write('setAASilent ', s + ' ' + mc);

Modified: openlaszlo/branches/legals/lps/includes/source/embednew.js
===================================================================
--- openlaszlo/branches/legals/lps/includes/source/embednew.js	2007-02-28 23:19:46 UTC (rev 3983)
+++ openlaszlo/branches/legals/lps/includes/source/embednew.js	2007-02-28 23:22:27 UTC (rev 3984)
@@ -23,6 +23,7 @@
  */
 
 Lz = {
+    __dhtmlhistoryready: false,
     /**
      * Writes the necessary HTML to embed a swf file in the document where the 
      * function is called.  
@@ -263,7 +264,16 @@
     setCanvasAttribute: function (name, value, hist) {
         if (dojo.flash.ready) {
             if (hist) {
-                window.top.location.hash = '_lz' + escape(name) + '&' + escape(value) +'';
+                if (name instanceof Array) {
+                    var o = '';
+                    for (var i = 0; i < name.length; i = i + 2) {
+                        o += escape(name[i]) + '=' + escape(name[i + 1]) +'';
+                        if (i < name.length - 2) o += ',';
+                    }
+                } else {
+                    var o = escape(name) + '=' + escape(value) +'';
+                }
+                window.top.location.hash = '_lz' + o;
                 //window.frames['_lzhist'].location = newurl;
             } else {
                 dojo.flash.comm.setCanvasAttribute(name, value + '');
@@ -426,20 +436,30 @@
 
     ,_checklocationhash: function() {
         var h = window.top.location.hash;
-        if (h != this.__lasthash) {
+        if (h != this.__lasthash && h.length > 1) {
             if (h.indexOf('_lz') != -1) {
-                var i = h.indexOf('&');
-                var name = unescape(h.substring(4, i));
-                var val = unescape(h.substring(i + 1));
-                this.setCanvasAttribute(name, val);
                 this.__lasthash = h;
+                h = h.substring(4);
+                var a = h.split(',');
+                for (var j = 0; j < a.length; j++) {
+                    var v = a[j];
+                    var i = v.indexOf('=');
+                    var name = unescape(v.substring(0, i));
+                    var val = unescape(v.substring(i + 1));
+                    this.setCanvasAttribute(name, val);
+                    if (Lz.__dhtmlhistoryready) canvas.setAttribute(name, val);
+                }
             } else {
                 //history id
                 var ev = h.substring(1);
-                if (ev.length > 0 && Lz._historyEvent(ev)) {
+                if (Lz._historyEvent(ev)) {
                     // if successful, don't send again 
                     Lz.__lasthash = h;
                 }
+                if (Lz.__dhtmlhistoryready) {
+                    LzHistory.receiveHistory(ev + '');
+                    Lz.__lasthash = h;
+                }
             }
         }
     }

Modified: openlaszlo/branches/legals/test/history/history.lzx
===================================================================
--- openlaszlo/branches/legals/test/history/history.lzx	2007-02-28 23:19:46 UTC (rev 3983)
+++ openlaszlo/branches/legals/test/history/history.lzx	2007-02-28 23:22:27 UTC (rev 3984)
@@ -1,7 +1,8 @@
-<canvas debug="true">
+<canvas>
     <simplelayout/>
     <text text="${LzHistory.offset}"/>
     <attribute name="foo" value="null"/>
+    <attribute name="bar" value="null"/>
     <method event="onfoo" args="f">
         Debug.write('external call', f); 
     </method>
@@ -13,6 +14,8 @@
     </class>
     <histinputtext id="hist1">A value</histinputtext>
     <histinputtext id="hist2">Another value</histinputtext>
+    <text text="${canvas.foo}"/>
+    <text text="${canvas.bar}"/>
     
     <view layout="axis: x">
         <button onclick="LzHistory.prev()">Prev</button>

Modified: openlaszlo/branches/legals/test/history/index.jsp
===================================================================
--- openlaszlo/branches/legals/test/history/index.jsp	2007-02-28 23:19:46 UTC (rev 3983)
+++ openlaszlo/branches/legals/test/history/index.jsp	2007-02-28 23:22:27 UTC (rev 3984)
@@ -31,7 +31,10 @@
           }
         </script><script type="text/javascript">
             lzOptions = { ServerRoot: '<%= request.getContextPath() %>'};
-        </script><script type="text/javascript" src="/legals/lps/includes/embed-compressed.js"></script><style type="text/css">
+        </script><script type="text/javascript" src="<%= request.getContextPath() %>/lps/includes/embed-compressed.js"></script>
+<script type="text/javascript">
+Lz.dhtmlEmbedLFC('<%= request.getContextPath() %>/lps/includes/lfc/LFCdhtml.js');
+</script><style type="text/css">
         	html, body
         	{
         		/* http://www.quirksmode.org/css/100percheight.html */
@@ -47,18 +50,25 @@
             }
         	
         	img { border: 0 none; }
-        </style></head><body><script type="text/javascript">
-              Lz.swfEmbed({url: 'history.lzx?lzt=swf', bgcolor: '#ffffff', width: '100%', height: '200', id: 'lzapp', accessible: 'false'});
-            </script><noscript>
-            Please enable JavaScript in order to use this application.
-        </noscript>
+        </style></head><body><div style="top: 150px; position: absolute; ">
 <form>
     <input type="button" value="0" onclick="Lz.setCanvasAttribute('foo', 0)">
     <input type="button" value="1" onclick="Lz.setCanvasAttribute('foo', 1)">
     <input type="button" value="0 hist" onclick="Lz.setCanvasAttribute('foo', 0, true)">
     <input type="button" value="1 hist" onclick="Lz.setCanvasAttribute('foo', 1, true)">
+    <input type="button" value="foo and bar" onclick="Lz.setCanvasAttribute(['foo', 'foo', 'bar', 'bar'], true, true)">
 </form>
+</div> 
+        <script type="text/javascript">
+              Lz.swfEmbed({url: 'history.lzx?lzt=swf', bgcolor: '#ffffff', width: '100%', height: '200', id: 'lzapp', accessible: 'false'});
+            </script>
+            <script type="text/javascript">
+              Lz.dhtmlEmbed({url: 'history.lzx?lzt=object&lzr=dhtml', bgcolor: '#ffffff', width: '100%', height: '200', id: 'lzapp'});
+</script><noscript>
+            Please enable JavaScript in order to use this application.
+        </noscript>
 
+
 </body>
 </html>
 <!-- * X_LZ_COPYRIGHT_BEGIN ***************************************************

Modified: openlaszlo/branches/legals/test/lfc/legals/testjscomm/copy-of-hello.lzx
===================================================================
--- openlaszlo/branches/legals/test/lfc/legals/testjscomm/copy-of-hello.lzx	2007-02-28 23:19:46 UTC (rev 3983)
+++ openlaszlo/branches/legals/test/lfc/legals/testjscomm/copy-of-hello.lzx	2007-02-28 23:22:27 UTC (rev 3984)
@@ -33,6 +33,7 @@
         <![CDATA[
             if (str == 'foo' && bool1 ==true && bool2 == false && num1 == 1 && num2 == 0 && prop1 == 20 && prop2 == 30) {
                 this.setBGColor(0x00ff00);
+                return true;
             } 
         ]]>
         </method>

Modified: openlaszlo/branches/legals/test/lfc/legals/testjscomm/test6.jsp
===================================================================
--- openlaszlo/branches/legals/test/lfc/legals/testjscomm/test6.jsp	2007-02-28 23:19:46 UTC (rev 3983)
+++ openlaszlo/branches/legals/test/lfc/legals/testjscomm/test6.jsp	2007-02-28 23:22:27 UTC (rev 3984)
@@ -78,7 +78,7 @@
         <input type="button" onclick="alert(Lz.getCanvasAttribute('width'))" value="Get Canvas Width"/>
         <input type="button" onclick="alert(Lz.getCanvasAttribute('height'))" value="Get Canvas Height"/>
         <input type="button" onclick="Lz.setCanvasAttribute('foo', 'bar'); Lz.setCanvasAttribute('farb', 'baz')" value="set canvas attributes"/>
-        <input type="button" onclick="Lz.callMethod('aview.testMethod(\'foo\', true, false, 1, 0, width, height)')" value="Test method arg casting"/>
+        <input type="button" onclick="alert(Lz.callMethod('aview.testMethod(\'foo\', true, false, 1, 0, width, height)'))" value="Test method arg casting"/>
       </form>
    </body>
 </html>

Modified: openlaszlo/branches/legals/test/lfc/legals/testjscomm/test8.jsp
===================================================================
--- openlaszlo/branches/legals/test/lfc/legals/testjscomm/test8.jsp	2007-02-28 23:19:46 UTC (rev 3983)
+++ openlaszlo/branches/legals/test/lfc/legals/testjscomm/test8.jsp	2007-02-28 23:22:27 UTC (rev 3984)
@@ -35,7 +35,7 @@
               }
             })(null, 700);
           }
-        lzOptions = { ServerRoot: '<%= request.getContextPath() %>', forceFlashComm: 8 };
+        lzOptions = { ServerRoot: '<%= request.getContextPath() %>'};
         </script><script type="text/javascript" src="<%= request.getContextPath() %>/lps/includes/embed-compressed.js"></script><style type="text/css">
         	html, body
         	{
@@ -58,7 +58,7 @@
         	img { border: 0 none; }
         </style></head>
    <body><script type="text/javascript">
-              Lz.swfEmbed({url: 'copy-of-hello.lzx?lzt=swf', bgcolor: '#ffffff', width: '100%', height: '200', id: 'lzapp', accessible: 'false'});
+              Lz.swfEmbed({url: 'copy-of-hello.lzx?lzt=swf&lzr=swf8', bgcolor: '#ffffff', width: '100%', height: '200', id: 'lzapp', accessible: 'false'});
               function getUserAgent() {
                 return navigator.userAgent + ', flash comm: ' + dojo.flash.info.commVersion;
               }  
@@ -78,7 +78,7 @@
         <input type="button" onclick="alert(Lz.getCanvasAttribute('width'))" value="Get Canvas Width"/>
         <input type="button" onclick="alert(Lz.getCanvasAttribute('height'))" value="Get Canvas Height"/>
         <input type="button" onclick="Lz.setCanvasAttribute('foo', 'bar'); Lz.setCanvasAttribute('farb', 'baz')" value="set canvas attributes"/>
-        <input type="button" onclick="Lz.callMethod('aview.testMethod(\'foo\', true, false, 1, 0, width, height)')" value="Test method arg casting"/>
+        <input type="button" onclick="alert(Lz.callMethod('aview.testMethod(\'foo\', true, false, 1, 0, width, height)'))" value="Test method arg casting"/>
       </form>
    </body>
 </html>



More information about the Laszlo-checkins mailing list