Author: max
Date: 2007-11-05 12:03:56 -0800 (Mon, 05 Nov 2007)
New Revision: 7133
Modified:
openlaszlo/trunk/
openlaszlo/trunk/WEB-INF/lps/lfc/LaszloLibrary.lzs
openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf/LzSprite.as
openlaszlo/trunk/lps/includes/source/embednew.js
openlaszlo/trunk/lps/includes/source/lzhistory.js
Log:
Change 20071102-maxcarlson-v by [EMAIL PROTECTED] on 2007-11-02 17:35:12 PDT
in /Users/maxcarlson/openlaszlo/trunk-clean
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: Merge wafflecone r7097 to trunk
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:
Plastik:trunk-clean maxcarlson$ ~/openlaszlo/tools/svn/svnmerge.py merge -r 709
7 -S ../wafflecone
U WEB-INF/lps/lfc/kernel/swf/LzSprite.as
U WEB-INF/lps/lfc/LaszloLibrary.lzs
U lps/includes/source/embednew.js
U lps/includes/source/lzhistory.js
property 'svnmerge-integrated' set on '.'
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.
Property changes on: openlaszlo/trunk
___________________________________________________________________
Name: svnmerge-integrated
- /openlaszlo/branches/paperpie:1-6504,6506-6574,6576-7013
/openlaszlo/branches/wafflecone:1-5746,5818-6068,6070-6205,6207-6213,6216-6265,6267-6368,6370-6431,6433-6450,6497,6509,6661
/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/paperpie:1-6504,6506-6574,6576-7013
/openlaszlo/branches/wafflecone:1-5746,5818-6068,6070-6205,6207-6213,6216-6265,6267-6368,6370-6431,6433-6450,6497,6509,6661,7097
/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/trunk/WEB-INF/lps/lfc/LaszloLibrary.lzs
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/LaszloLibrary.lzs 2007-11-05 20:00:28 UTC
(rev 7132)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/LaszloLibrary.lzs 2007-11-05 20:03:56 UTC
(rev 7133)
@@ -47,15 +47,6 @@
if ($as2) {
// Initialize the DojoExternalInterface class
DojoExternalInterface = new DojoExternalInterfaceClass();
-
- // Expose your methods
- DojoExternalInterface.addCallback("getCanvasAttribute", LzHistory,
LzHistory.getCanvasAttribute);
- DojoExternalInterface.addCallback("setCanvasAttribute", LzHistory,
LzHistory.setCanvasAttribute);
- DojoExternalInterface.addCallback("callMethod", LzHistory,
LzHistory.callMethod);
- DojoExternalInterface.addCallback("receiveHistory", LzHistory,
LzHistory.receiveHistory);
-
- // Tell JavaScript that you are ready to have method calls
- DojoExternalInterface.loaded();
}
if ($debug) {
Modified: openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf/LzSprite.as
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf/LzSprite.as 2007-11-05
20:00:28 UTC (rev 7132)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf/LzSprite.as 2007-11-05
20:03:56 UTC (rev 7133)
@@ -15,6 +15,7 @@
if (isroot) {
+ this.isroot = true;
var is = _root.spriteroot;
if (! is) {
var is = _root.attachMovie('empty', 'spriteroot', 1000);
@@ -218,6 +219,16 @@
LzSprite.prototype.init = function( ) {
this.__LZmovieClipRef._visible = this.visible;
this.__LZbgRef._visible = this.visible;
+ if (this.isroot) {
+ // Expose your methods
+ DojoExternalInterface.addCallback("getCanvasAttribute", LzHistory,
LzHistory.getCanvasAttribute);
+ DojoExternalInterface.addCallback("setCanvasAttribute", LzHistory,
LzHistory.setCanvasAttribute);
+ DojoExternalInterface.addCallback("callMethod", LzHistory,
LzHistory.callMethod);
+ DojoExternalInterface.addCallback("receiveHistory", LzHistory,
LzHistory.receiveHistory);
+
+ // Tell JavaScript that you are ready to have method calls
+ DojoExternalInterface.loaded();
+ }
}
Modified: openlaszlo/trunk/lps/includes/source/embednew.js
===================================================================
--- openlaszlo/trunk/lps/includes/source/embednew.js 2007-11-05 20:00:28 UTC
(rev 7132)
+++ openlaszlo/trunk/lps/includes/source/embednew.js 2007-11-05 20:03:56 UTC
(rev 7133)
@@ -118,6 +118,7 @@
// for callbacks onload
Lz._swfid = properties.id;
dojo.flash.addLoadedListener(Lz._loaded);
+ dojo.flash.addLoadedListener(Lz.history.init)
if (! Lz['setCanvasAttribute']) {
Lz.setCanvasAttribute = Lz[properties.id].setCanvasAttribute;
}
@@ -348,7 +349,7 @@
* @param hist:Boolean value - if true, add a history event.
*/
_setCanvasAttributeSWF: function (name, value, hist) {
- if (this.loaded) {
+ if (this.loaded && dojo.flash.comm['callMethod']) {
if (hist) {
Lz.history._store(name, value);
} else {
Modified: openlaszlo/trunk/lps/includes/source/lzhistory.js
===================================================================
--- openlaszlo/trunk/lps/includes/source/lzhistory.js 2007-11-05 20:00:28 UTC
(rev 7132)
+++ openlaszlo/trunk/lps/includes/source/lzhistory.js 2007-11-05 20:03:56 UTC
(rev 7133)
@@ -170,7 +170,7 @@
var _this = Lz.history;
// TODO: send events to all apps
if (h.length == 0 || h == _this._lasthash) return;
- if (h.indexOf('_lz') != -1) {
+ if (Lz.loaded && h.indexOf('_lz') != -1) {
// TODO: use rison
_this._lasthash = h;
h = h.substring(3);
@@ -229,4 +229,7 @@
}
}
};
-window.onload = Lz.history.init;
+if (Lz.__BrowserDetect.isFirefox) {
+ // If this is present, then Firefox does not do its Javascript caching and
onload will get fired when coming back to the page. Thanks Jes!
+ window.onunload = function() {};
+}
_______________________________________________
Laszlo-checkins mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-checkins