[Laszlo-dev] For Review: Change 20071101-maxcarlson-S Summary: Fix lzhistory behavior when another page is visited and the back-button is used.

Max Carlson max at openlaszlo.org
Thu Nov 1 19:45:41 PDT 2007


Change 20071101-maxcarlson-S by maxcarlson at Plastik on 2007-11-01  
19:38:19 PDT
     in /Users/maxcarlson/openlaszlo/wafflecone
     for http://svn.openlaszlo.org/openlaszlo/branches/wafflecone

Summary: Fix lzhistory behavior when another page is visited and the  
back-button is used.

New Features:

Bugs Fixed: LPP-4999 - IE resets history to #0 after visiting another  
site and pressing the back button, LPP-5016 - _parse gets called  
before canvas is initialized

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

Documentation:

Release Notes:

Details: LzSprite.as - Delay DojoExternalInterface initialization 'til  
canvas init time.

LaszloLibrary.lzs - Delay DojoExternalInterface initialization 'til  
canvas   init time.

embednew.js - Add dojo.flash.addLoadedListener(Lz.history.init)  
instead of using window.onload.  Check for presence of  
dojo.flash.comm.callMethod() before calling.

lzhistory.js - _parse() only sets canvas attribute when Lz.loaded ==  
true.  Add
window.onunload=function () {} to fix back button behavior in Firefox.


Tests: Test a SOLO compile of this application:
<canvas width="100%" height="100%" debug="true" proxied="false">
   <attribute name="stateValue" type="string" value="null"/>

   <simplelayout axis="x"/>
   <button text="Next">
     <handler name="onclick">
       var cur = Number(canvas.stateValue);
       if(isNaN(cur)) { cur = 0; }
       cur++;
       LzBrowser.loadJS("Lz.setCanvasAttribute('stateValue', '" +  
escape(cur) + "', true)");
     </handler>
   </button>
   <button text="Google">
     <handler name="onclick">
       LzBrowser.loadURL('http://google.com/');
     </handler>
   </button>

   <text text="${canvas.stateValue}" resize="true" x="100" y="100"/>
</canvas>

Run the SOLO compile, step forward a few times, then click the  
'google' button.  Pressing the back button after google loads should  
work in ie7, firefox and google.

Files:
M      WEB-INF/lps/lfc/kernel/swf/LzSprite.as
M      WEB-INF/lps/lfc/LaszloLibrary.lzs
M      lps/includes/source/embednew.js
M      lps/includes/source/lzhistory.js

Changeset: http://svn.openlaszlo.org/openlaszlo/patches/20071101-maxcarlson-S.tar


More information about the Laszlo-dev mailing list