|
|
|
Same result with windows browsers : Not working on FF2.0.0.7 and IE 6.0.2800
Author: max
Date: 2007-10-02 16:03:03 -0700 (Tue, 02 Oct 2007) New Revision: 6715 Modified: openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf/dojo/Library.lzs openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf/dojo/flash6/DojoExternalInterface.as openlaszlo/trunk/WEB-INF/lps/lfc/services/platform/swf/LzHistory.as openlaszlo/trunk/WEB-INF/lps/lfc/views/LaszloCanvas.lzs openlaszlo/trunk/lps/admin/dev-console.lzx.swf openlaszlo/trunk/lps/components/extensions/html.lzx openlaszlo/trunk/lps/components/extensions/test/html-swf.jsp openlaszlo/trunk/lps/components/extensions/test/html.lzx openlaszlo/trunk/lps/includes/source/embednew.js openlaszlo/trunk/lps/includes/source/iframemanager.js openlaszlo/trunk/lps/includes/source/lzhistory.js Log: ehange 20071002-maxcarlson-a by maxcarlson@plastik on 2007-10-02 11:15:45 PDT in /Users/maxcarlson/openlaszlo/trunk-clean for http://svn.openlaszlo.org/openlaszlo/trunk Summary: Fix html tag New Features: Bugs Fixed: Technical Reviewer: promanik QA Reviewer: jcrowley Doc Reviewer: (pending) Documentation: Release Notes: Details: DojoExternalInterface.as - Better debugging info, make sure resultsChecker function is named, clear out _root._callbackID when done looking for results. Library.lzs - Add default values for _root._currenthistory and _root._callbackID to prevent exceptions in IE. LzHistory.as - Use _root._currenthistory to communicate current history state in swf7 to prevent concurrency issues calling into/out of flash simultaneously. LaszloCanvas.lzs - Set canvas id passed in to init arguments. test/html.lzx - Use w3.org as default URL to prevent runtime exceptions - openlaszlo.org fails to run some javascript when laoded in an iframe. html-swf.js - Update to new wrapper format. html.lzx - Pass in canvas id for callbacks. Add support for sendToBack(). Always update position when iframeid is set. embednew.js - Pass id into flashargs to set canvas.id. lzhistory.js - Watch _currenthistory for history state changes for swf7 in _checklocationhash(). __setFlash() only sets history state if _callbackID is null. Otherwise it waits 10ms. iframemanager.js - Reorder init(). Add support for sendToBack(). dev-console.lzx.swf - Rebuild with default values for _root._currenthistory and _root. _callbackID to prevent exceptions in IE. Tests: http://localhost:8080/trunk-clean/lps/components/extensions/test/html-swf.jsp and http://localhost:8080/trunk-clean/lps/components/extensions/test/html.zlx run in swf7, swf8 and dhtml. http://localhost:8080/trunk-clean/test/history/history.lzx passes in swf7, swf8 and dhtml. Tested under IE 6, 7 and Firefox 2 OS X. Modified: openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf/dojo/Library.lzs =================================================================== --- openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf/dojo/Library.lzs 2007-10-02 19:35:15 UTC (rev 6714) +++ openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf/dojo/Library.lzs 2007-10-02 23:03:03 UTC (rev 6715) @@ -1,5 +1,5 @@ //* A_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. * //* A_LZ_COPYRIGHT_END ******************************************************** @@ -9,3 +9,7 @@ } else { #include "kernel/swf/dojo/flash6/DojoExternalInterface.as" } + +// required for GetVariable to not fail in IE/ActiveX +_root._currenthistory = null; +_root._callbackID = null; Modified: openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf/dojo/flash6/DojoExternalInterface.as =================================================================== --- openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf/dojo/flash6/DojoExternalInterface.as 2007-10-02 19:35:15 UTC (rev 6714) +++ openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf/dojo/flash6/DojoExternalInterface.as 2007-10-02 23:03:03 UTC (rev 6715) @@ -93,7 +93,7 @@ _root._returnResult = undefined; fscommand("call", methodName); - //getURL("javascript:alert('FLASH:call " + methodName + "')"); + //Debug.write("call", methodName, resultsCallback); // immediately return if the caller is not waiting for return results if(resultsCallback == undefined || resultsCallback == null){ @@ -101,10 +101,12 @@ } // check at regular intervals for return results - var resultsChecker = function(){ + var resultsChecker = function resultsChecker(){ if((typeof _root._returnResult != "undefined")&& (_root._returnResult != "undefined")){ clearInterval(_root._callbackID); + _root._callbackID = null; + //Debug.write('resultsChecker clear', _root._callbackID); resultsCallback.call(null, _root._returnResult); } }; Modified: openlaszlo/trunk/WEB-INF/lps/lfc/services/platform/swf/LzHistory.as =================================================================== --- openlaszlo/trunk/WEB-INF/lps/lfc/services/platform/swf/LzHistory.as 2007-10-02 19:35:15 UTC (rev 6714) +++ openlaszlo/trunk/WEB-INF/lps/lfc/services/platform/swf/LzHistory.as 2007-10-02 23:03:03 UTC (rev 6715) @@ -85,7 +85,12 @@ this.offset = o; //Debug.write('onhistory ', o, this.__lzhistq); if (this.onoffset.ready) this.onoffset.sendEvent(o); - LzBrowser.callJS('Lz.history.__receivedhistory', false, o + ''); + if ($swf7) { + _root._currenthistory = o + ''; + } else { + LzBrowser.callJS('Lz.history.__receivedhistory', false, o + ''); + } + return true; } /** Modified: openlaszlo/trunk/WEB-INF/lps/lfc/views/LaszloCanvas.lzs =================================================================== --- openlaszlo/trunk/WEB-INF/lps/lfc/views/LaszloCanvas.lzs 2007-10-02 19:35:15 UTC (rev 6714) +++ openlaszlo/trunk/WEB-INF/lps/lfc/views/LaszloCanvas.lzs 2007-10-02 23:03:03 UTC (rev 6715) @@ -203,6 +203,7 @@ LzPlatform.initCanvas(this); + this.id = LzBrowser.getInitArg('id') } /** Modified: openlaszlo/trunk/lps/admin/dev-console.lzx.swf =================================================================== (Binary files differ) Modified: openlaszlo/trunk/lps/components/extensions/html.lzx =================================================================== --- openlaszlo/trunk/lps/components/extensions/html.lzx 2007-10-02 19:35:15 UTC (rev 6714) +++ openlaszlo/trunk/lps/components/extensions/html.lzx 2007-10-02 23:03:03 UTC (rev 6715) @@ -17,7 +17,7 @@ LzBrowser.callJS('Lz.iframemanager.create', function (id) { Lz.iframemanager.owners[id] = owner; owner.setiframeid(id); - }, "", name, appendto); + }, canvas.id, name, appendto); } ,setPosition: function(id, x, y, width, height, v) { LzBrowser.callJS('Lz.iframemanager.setPosition', false, id, x, y, width, height, v); @@ -31,6 +31,9 @@ ,bringToFront: function(id) { LzBrowser.callJS('Lz.iframemanager.bringToFront', null, id); } + ,sendToBack: function(id) { + LzBrowser.callJS('Lz.iframemanager.sendToBack', null, id); + } ,__gotload: function(id) { if (Lz.iframemanager.owners[id]) Lz.iframemanager.owners[id].__gotload(); } @@ -109,15 +112,13 @@ var height = this.target.getAttributeRelative("height", canvas) + this.heightoffset; if (this['iframeid']) { Lz.iframemanager.setPosition(this.iframeid, x, y, width, height, this.visible); - } else { - this.cachepos = true; } </method> <!--- @access private --> <method name="setiframeid" args="id"> //Debug.write('setiframeid', id, this) this.iframeid = id; - if (this['cachepos']) this.__updatepos(); + this.__updatepos(); if (this['isfront']) this.bringToFront(); if (this['srcset']) Lz.iframemanager.setSrc(id, this.srcset); this.setAttribute('ready', true); @@ -128,8 +129,14 @@ this.onload.sendEvent(); </method> <method name="bringToFront"> + if (this['isfront'] == true) return; this.isfront = true; if (this['iframeid']) Lz.iframemanager.bringToFront(this.iframeid); </method> + <method name="sendToBack"> + if (this['isfront'] == false) return; + this.isfront = false; + if (this['iframeid']) Lz.iframemanager.sendToBack(this.iframeid); + </method> </class> </library> Modified: openlaszlo/trunk/lps/components/extensions/test/html-swf.jsp =================================================================== --- openlaszlo/trunk/lps/components/extensions/test/html-swf.jsp 2007-10-02 19:35:15 UTC (rev 6714) +++ openlaszlo/trunk/lps/components/extensions/test/html-swf.jsp 2007-10-02 23:03:03 UTC (rev 6715) @@ -47,14 +47,10 @@ border: 0 none; overflow: hidden; } + body { + background-color: #ffffff; + } - body - { - height: 100%; - width: 100%; - background-color: #ffffff; - } - img { border: 0 none; } </style></head> <body><script type="text/javascript"> Modified: openlaszlo/trunk/lps/components/extensions/test/html.lzx =================================================================== --- openlaszlo/trunk/lps/components/extensions/test/html.lzx 2007-10-02 19:35:15 UTC (rev 6714) +++ openlaszlo/trunk/lps/components/extensions/test/html.lzx 2007-10-02 23:03:03 UTC (rev 6715) @@ -7,7 +7,7 @@ <class name="browser" extends="window" resizable="true" bgcolor="silver"> <simplelayout axis="x"/> - <edittext name="txt" text="http://openlaszlo.org/" width="300"/> + <edittext name="txt" text="http://w3.org/" width="300"/> <button>Load <method event="onclick"> parent.main.setAttribute('src', parent.txt.getText()); Modified: openlaszlo/trunk/lps/includes/source/embednew.js =================================================================== --- openlaszlo/trunk/lps/includes/source/embednew.js 2007-10-02 19:35:15 UTC (rev 6714) +++ openlaszlo/trunk/lps/includes/source/embednew.js 2007-10-02 23:03:03 UTC (rev 6715) @@ -87,6 +87,7 @@ if (properties.accessible == 'true') { queryvals.flashvars += '&accessible=true'; } + queryvals.flashvars += '&id=' + properties.id; var url = queryvals.url + '?' + queryvals.query; Modified: openlaszlo/trunk/lps/includes/source/iframemanager.js =================================================================== --- openlaszlo/trunk/lps/includes/source/iframemanager.js 2007-10-02 19:35:15 UTC (rev 6714) +++ openlaszlo/trunk/lps/includes/source/iframemanager.js 2007-10-02 23:03:03 UTC (rev 6715) @@ -13,27 +13,29 @@ var id = '__lz' + Lz.iframemanager.__highestz++; Lz.iframemanager.__frames[id] = i; - Lz.__setAttr(i, 'id', id); if (name == null) name = ''; if (name != "") Lz.__setAttr(i, 'name', name); - i.__gotload = Lz.iframemanager.__gotload; - Lz.__setAttr(i, 'onload', 'Lz.iframemanager.__gotload("' + id + '")'); if (appendto == null || appendto == "undefined") { appendto = document.body; } appendto.appendChild(i); + Lz.__setAttr(i, 'id', id); var iframe = Lz.iframemanager.getFrame(id); + Lz.__setAttr(iframe, 'onload', 'Lz.iframemanager.__gotload("' + id + '")'); + iframe.__gotload = Lz.iframemanager.__gotload; + iframe._defaultz = 99900 + Lz.iframemanager.__highestz; + iframe.style.zIndex = iframe._defaultz; if (document.getElementById && !(document.all) ) { iframe.style.border = '0'; } else if (document.all) { - Lz.__setAttr(iframe, 'frameborder', '0'); + Lz.__setAttr(iframe, 'border', '0'); Lz.__setAttr(iframe, 'allowtransparency', 'true'); } iframe.style.position = 'absolute'; - return id; + return id + ''; } ,getFrame: function(id) { return Lz.iframemanager.__frames[id]; @@ -83,10 +85,18 @@ iframe.style.zIndex = 100000 + Lz.iframemanager.__highestz; return true; } + ,sendToBack: function(id) { + //console.log('sendToBack', id) + //Debug.write('bringToFront', id); + var iframe = Lz.iframemanager.getFrame(id); + if (! iframe) return; + iframe.style.zIndex = iframe._defaultz; + return true; + } ,__gotload: function(id) { //Debug.write('__gotload', id); - //console.log('__gotload', id); var iframe = Lz.iframemanager.getFrame(id); + //console.log('__gotload', iframe, iframe.skiponload); if (! iframe) return; if (iframe.skiponload) { iframe.skiponload = false; @@ -97,7 +107,7 @@ iframe.owner.__gotload(); } else { //console.log('calling method', 'Lz.iframemanager.__gotload(\'' + id + '\')'); - Lz.callMethod('Lz.iframemanager.__gotload(\'' + id + '\')'); + Lz[iframe.owner].callMethod('Lz.iframemanager.__gotload(\'' + id + '\')'); } } } Modified: openlaszlo/trunk/lps/includes/source/lzhistory.js =================================================================== --- openlaszlo/trunk/lps/includes/source/lzhistory.js 2007-10-02 19:35:15 UTC (rev 6714) +++ openlaszlo/trunk/lps/includes/source/lzhistory.js 2007-10-02 23:03:03 UTC (rev 6715) @@ -53,7 +53,6 @@ if (currstate != '') { doc.location.hash = '#' + currstate; _this._parse(currstate) - _this._currentstate = currstate; } } else { if (currstate != '') { @@ -101,6 +100,18 @@ this._parse(h); } } + if (dojo.flash.obj && Lz.loaded) { + var p = dojo.flash.obj.get(); + if (p) { + var cid = p.GetVariable("_callbackID"); + if (cid != 'null') return; + var val = p.GetVariable("_currenthistory"); + if (val && val != 'null' && val != Lz.history._lasthash) { + //alert('val ' + val); + Lz.history._lasthash = val; + } + } + } } ,/** */ set: function(s) { @@ -171,7 +182,9 @@ } else { //alert('_parse test' + h + ', ' + _this._lasthash); //history id - if (Lz.callMethod && h != Lz.history._lasthash) Lz.callMethod("LzHistory.receiveHistory(" + h + ")"); + if (Lz.loaded && Lz.callMethod && h != Lz.history._lasthash) { + _this.__setFlash(h); + } if (Lz.__dhtmlhistoryready && LzHistory && LzHistory['receiveHistory']) { //alert('dhtml ' + h); LzHistory.receiveHistory(h); @@ -198,5 +211,18 @@ Lz.history._lasthash = h + ''; //alert('__receivedhistory '+ Lz.history._lasthash); } + ,/** @access private called from flash */ + __setFlash: function(h) { + var p = dojo.flash.obj.get(); + if (p) { + var cid = p.GetVariable("_callbackID") + ''; + if (cid == 'null') { + Lz.callMethod("LzHistory.receiveHistory(" + h + ")"); + } else { + setTimeout('Lz.history.__setFlash(' + h + ')', 10); + //alert('busy'); + } + } + } }; window.onload = Lz.history.init; _______________________________________________ Laszlo-checkins mailing list Laszlo-checkins@openlaszlo.org http://www.openlaszlo.org/mailman/listinfo/laszlo-checkins Author: max
Date: 2007-10-18 11:00:19 -0700 (Thu, 18 Oct 2007) New Revision: 6904 Modified: openlaszlo/branches/wafflecone/ openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/kernel/swf/dojo/Library.lzs openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/kernel/swf/dojo/flash6/DojoExternalInterface.as openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/services/platform/swf/LzHistory.as openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/views/LaszloCanvas.lzs openlaszlo/branches/wafflecone/lps/admin/dev-console.lzx.swf openlaszlo/branches/wafflecone/lps/components/extensions/html.lzx openlaszlo/branches/wafflecone/lps/components/extensions/test/html-swf.jsp openlaszlo/branches/wafflecone/lps/components/extensions/test/html.lzx openlaszlo/branches/wafflecone/lps/includes/source/embednew.js openlaszlo/branches/wafflecone/lps/includes/source/iframemanager.js openlaszlo/branches/wafflecone/lps/includes/source/lzhistory.js Log: Change 20071017-maxcarlson-F by maxcarlson@plastik on 2007-10-17 17:03:38 PDT in /Users/maxcarlson/openlaszlo/waffleconeclean for http://svn.openlaszlo.org/openlaszlo/branches/wafflecone Summary: Move html tag fixes to wafflecone New Features: Bugs Fixed: Technical Reviewer: promanik QA Reviewer: jcrowley Doc Reviewer: (pending) Documentation: Release Notes: Details: plastik:~/openlaszlo/waffleconeclean maxcarlson$ svnmerge.py merge -r 6531,6683,6715 -S ../trunk C WEB-INF/lps/lfc/services/platform/swf/LzHistory.as C lps/includes/source/embednew.js C lps/includes/source/lzhistory.js C WEB-INF/lps/lfc/services/platform/swf/LzHistory.as C lps/includes/source/embednew.js C lps/includes/source/lzhistory.js U WEB-INF/lps/lfc/kernel/swf/dojo/flash6/DojoExternalInterface.as U WEB-INF/lps/lfc/kernel/swf/dojo/Library.lzs C WEB-INF/lps/lfc/services/platform/swf/LzHistory.as U WEB-INF/lps/lfc/views/LaszloCanvas.lzs U lps/components/extensions/test/html.lzx U lps/components/extensions/test/html-swf.jsp C lps/components/extensions/html.lzx G lps/includes/source/embednew.js C lps/includes/source/lzhistory.js U lps/includes/source/iframemanager.js U lps/admin/dev-console.lzx.swf property 'svnmerge-integrated' set on '.' Cleaned up conflicts in WEB-INF/lps/lfc/services/platform/swf/LzHistory.as, lps/includes/source/embednew.js, lps/includes/source/lzhistory.js and lps/components/extensions/html.lzx. Diffed against trunk to verify all changes made it. Tests: http://localhost:8080/trunk-clean/lps/components/extensions/test/html-swf.jsp and http://localhost:8080/trunk-clean/lps/components/extensions/test/html.zlx run in swf7, swf8 and dhtml. http://localhost:8080/trunk-clean/test/history/history.lzx passes in swf7, swf8 and dhtml. Tested under IE 6, 7 and Firefox 2 OS X. Property changes on: openlaszlo/branches/wafflecone ___________________________________________________________________ Name: svnmerge-integrated - /openlaszlo/branches/legals:1-5746,5748-5756,5758-5770,5772-5819,5821-5860,5862-5890,5892-6065,6068-6177,6179-6228,6230-6236,6241-6266 /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,6595-6602,6676 + /openlaszlo/branches/legals:1-5746,5748-5756,5758-5770,5772-5819,5821-5860,5862-5890,5892-6065,6068-6177,6179-6228,6230-6236,6241-6266 /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,6531-6532,6534-6538,6540-6547,6549,6551-6558,6560-6567,6569-6581,6583-6586,6588,6590-6603,6605-6607,6610-6611,6613-6622,6624-6629,6632-6636,6638-6639,6641-6642,6646-6648,6653,6656-6663,6665-6669,6671-6683,6685-6686,6688-6706,6708-6715 Modified: openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/kernel/swf/dojo/Library.lzs =================================================================== --- openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/kernel/swf/dojo/Library.lzs 2007-10-18 15:37:44 UTC (rev 6903) +++ openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/kernel/swf/dojo/Library.lzs 2007-10-18 18:00:19 UTC (rev 6904) @@ -1,5 +1,5 @@ //* A_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. * //* A_LZ_COPYRIGHT_END ******************************************************** @@ -9,3 +9,7 @@ } else { #include "kernel/swf/dojo/flash6/DojoExternalInterface.as" } + +// required for GetVariable to not fail in IE/ActiveX +_root._currenthistory = null; +_root._callbackID = null; Modified: openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/kernel/swf/dojo/flash6/DojoExternalInterface.as =================================================================== --- openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/kernel/swf/dojo/flash6/DojoExternalInterface.as 2007-10-18 15:37:44 UTC (rev 6903) +++ openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/kernel/swf/dojo/flash6/DojoExternalInterface.as 2007-10-18 18:00:19 UTC (rev 6904) @@ -93,7 +93,7 @@ _root._returnResult = undefined; fscommand("call", methodName); - //getURL("javascript:alert('FLASH:call " + methodName + "')"); + //Debug.write("call", methodName, resultsCallback); // immediately return if the caller is not waiting for return results if(resultsCallback == undefined || resultsCallback == null){ @@ -101,10 +101,12 @@ } // check at regular intervals for return results - var resultsChecker = function(){ + var resultsChecker = function resultsChecker(){ if((typeof _root._returnResult != "undefined")&& (_root._returnResult != "undefined")){ clearInterval(_root._callbackID); + _root._callbackID = null; + //Debug.write('resultsChecker clear', _root._callbackID); resultsCallback.call(null, _root._returnResult); } }; Modified: openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/services/platform/swf/LzHistory.as =================================================================== --- openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/services/platform/swf/LzHistory.as 2007-10-18 15:37:44 UTC (rev 6903) +++ openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/services/platform/swf/LzHistory.as 2007-10-18 18:00:19 UTC (rev 6904) @@ -37,7 +37,8 @@ LzHistory.__setHistory = function(s) { //Debug.write('__setHistory', s); LzBrowser._jsreset(); - LzBrowser.callJS('Lz.history.set', null, s); + LzBrowser.callJS('Lz.history.set', false, s); + this.__lzloading = true; } /** @@ -64,6 +65,9 @@ * @access private */ LzHistory.receiveHistory = function(o){ + if (this.persist && ! this._persistso) { + this.__initPersist(); + } var l = this.__lzhistq.length; o *= 1; if (! o) { @@ -82,6 +86,12 @@ this.offset = o; //Debug.write('onhistory ', o, this.__lzhistq); if (this.onoffset.ready) this.onoffset.sendEvent(o); + if ($swf7) { + _root._currenthistory = o + ''; + } else { + LzBrowser.callJS('Lz.history.__receivedhistory', false, o + ''); + } + return true; } /** @@ -197,7 +207,7 @@ if (this.persist) { if (! this._persistso) { - this._persistso = this.getPersist('historystate'); + this.__initPersist(); } //Debug.write('_persistso: ', this._persistso); this._persistso.data[this.offset] = this.__lzcurrstate; Modified: openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/views/LaszloCanvas.lzs =================================================================== --- openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/views/LaszloCanvas.lzs 2007-10-18 15:37:44 UTC (rev 6903) +++ openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/views/LaszloCanvas.lzs 2007-10-18 18:00:19 UTC (rev 6904) @@ -188,6 +188,7 @@ LzPlatform.initCanvas(this); + this.id = LzBrowser.getInitArg('id') } /** Modified: openlaszlo/branches/wafflecone/lps/admin/dev-console.lzx.swf =================================================================== (Binary files differ) Modified: openlaszlo/branches/wafflecone/lps/components/extensions/html.lzx =================================================================== --- openlaszlo/branches/wafflecone/lps/components/extensions/html.lzx 2007-10-18 15:37:44 UTC (rev 6903) +++ openlaszlo/branches/wafflecone/lps/components/extensions/html.lzx 2007-10-18 18:00:19 UTC (rev 6904) @@ -17,7 +17,7 @@ LzBrowser.callJS('Lz.iframemanager.create', function (id) { Lz.iframemanager.owners[id] = owner; owner.setiframeid(id); - }, "", name, appendto); + }, canvas.id, name, appendto); } ,setPosition: function(id, x, y, width, height, v) { LzBrowser.callJS('Lz.iframemanager.setPosition', false, id, x, y, width, height, v); @@ -31,6 +31,9 @@ ,bringToFront: function(id) { LzBrowser.callJS('Lz.iframemanager.bringToFront', null, id); } + ,sendToBack: function(id) { + LzBrowser.callJS('Lz.iframemanager.sendToBack', null, id); + } ,__gotload: function(id) { if (Lz.iframemanager.owners[id]) Lz.iframemanager.owners[id].__gotload(); } @@ -105,18 +108,16 @@ var height = this.target.getAttributeRelative("height", canvas) + this.heightoffset; if (this['iframeid']) { Lz.iframemanager.setPosition(this.iframeid, x, y, width, height, this.visible); - } else { - this.cachepos = true; } </method> <!--- @access private --> <method name="setiframeid" args="id"> //Debug.write('setiframeid', id, this) this.iframeid = id; - if (this.cachepos) { - this.__updatepos(); - if (this['isfront']) this.bringToFront(); - } + this.__updatepos(); + if (this['isfront']) this.bringToFront(); + if (this['srcset']) Lz.iframemanager.setSrc(id, this.srcset); + this.setAttribute('ready', true); </method> <method name="__gotload"> this.setAttribute('loading', false); @@ -124,8 +125,14 @@ this.onload.sendEvent(); </method> <method name="bringToFront"> + if (this['isfront'] == true) return; this.isfront = true; if (this['iframeid']) Lz.iframemanager.bringToFront(this.iframeid); </method> + <method name="sendToBack"> + if (this['isfront'] == false) return; + this.isfront = false; + if (this['iframeid']) Lz.iframemanager.sendToBack(this.iframeid); + </method> </class> </library> Modified: openlaszlo/branches/wafflecone/lps/components/extensions/test/html-swf.jsp =================================================================== --- openlaszlo/branches/wafflecone/lps/components/extensions/test/html-swf.jsp 2007-10-18 15:37:44 UTC (rev 6903) +++ openlaszlo/branches/wafflecone/lps/components/extensions/test/html-swf.jsp 2007-10-18 18:00:19 UTC (rev 6904) @@ -47,14 +47,10 @@ border: 0 none; overflow: hidden; } + body { + background-color: #ffffff; + } - body - { - height: 100%; - width: 100%; - background-color: #ffffff; - } - img { border: 0 none; } </style></head> <body><script type="text/javascript"> Modified: openlaszlo/branches/wafflecone/lps/components/extensions/test/html.lzx =================================================================== --- openlaszlo/branches/wafflecone/lps/components/extensions/test/html.lzx 2007-10-18 15:37:44 UTC (rev 6903) +++ openlaszlo/branches/wafflecone/lps/components/extensions/test/html.lzx 2007-10-18 18:00:19 UTC (rev 6904) @@ -7,7 +7,7 @@ <class name="browser" extends="window" resizable="true" bgcolor="silver"> <simplelayout axis="x"/> - <edittext name="txt" text="http://openlaszlo.org/" width="300"/> + <edittext name="txt" text="http://w3.org/" width="300"/> <button>Load <method event="onclick"> parent.main.setAttribute('src', parent.txt.getText()); Modified: openlaszlo/branches/wafflecone/lps/includes/source/embednew.js =================================================================== --- openlaszlo/branches/wafflecone/lps/includes/source/embednew.js 2007-10-18 15:37:44 UTC (rev 6903) +++ openlaszlo/branches/wafflecone/lps/includes/source/embednew.js 2007-10-18 18:00:19 UTC (rev 6904) @@ -87,6 +87,7 @@ if (properties.accessible == 'true') { queryvals.flashvars += '&accessible=true'; } + queryvals.flashvars += '&id=' + properties.id; var url = queryvals.url + '?' + queryvals.query; @@ -546,10 +547,10 @@ if (this.loaded) { return dojo.flash.comm.callMethod(js); } else { - this._lastjs = function() { + var f = function() { dojo.flash.comm.callMethod(js); }; - dojo.flash.addLoadedListener(this._lastjs); + dojo.flash.addLoadedListener(f); } } ,/** @access private */ Modified: openlaszlo/branches/wafflecone/lps/includes/source/iframemanager.js =================================================================== --- openlaszlo/branches/wafflecone/lps/includes/source/iframemanager.js 2007-10-18 15:37:44 UTC (rev 6903) +++ openlaszlo/branches/wafflecone/lps/includes/source/iframemanager.js 2007-10-18 18:00:19 UTC (rev 6904) @@ -13,27 +13,29 @@ var id = '__lz' + Lz.iframemanager.__highestz++; Lz.iframemanager.__frames[id] = i; - Lz.__setAttr(i, 'id', id); if (name == null) name = ''; if (name != "") Lz.__setAttr(i, 'name', name); - i.__gotload = Lz.iframemanager.__gotload; - Lz.__setAttr(i, 'onload', 'Lz.iframemanager.__gotload("' + id + '")'); if (appendto == null || appendto == "undefined") { appendto = document.body; } appendto.appendChild(i); + Lz.__setAttr(i, 'id', id); var iframe = Lz.iframemanager.getFrame(id); + Lz.__setAttr(iframe, 'onload', 'Lz.iframemanager.__gotload("' + id + '")'); + iframe.__gotload = Lz.iframemanager.__gotload; + iframe._defaultz = 99900 + Lz.iframemanager.__highestz; + iframe.style.zIndex = iframe._defaultz; if (document.getElementById && !(document.all) ) { iframe.style.border = '0'; } else if (document.all) { - Lz.__setAttr(iframe, 'frameborder', '0'); + Lz.__setAttr(iframe, 'border', '0'); Lz.__setAttr(iframe, 'allowtransparency', 'true'); } iframe.style.position = 'absolute'; - return id; + return id + ''; } ,getFrame: function(id) { return Lz.iframemanager.__frames[id]; @@ -83,10 +85,18 @@ iframe.style.zIndex = 100000 + Lz.iframemanager.__highestz; return true; } + ,sendToBack: function(id) { + //console.log('sendToBack', id) + //Debug.write('bringToFront', id); + var iframe = Lz.iframemanager.getFrame(id); + if (! iframe) return; + iframe.style.zIndex = iframe._defaultz; + return true; + } ,__gotload: function(id) { //Debug.write('__gotload', id); - //console.log('__gotload', id); var iframe = Lz.iframemanager.getFrame(id); + //console.log('__gotload', iframe, iframe.skiponload); if (! iframe) return; if (iframe.skiponload) { iframe.skiponload = false; @@ -97,7 +107,7 @@ iframe.owner.__gotload(); } else { //console.log('calling method', 'Lz.iframemanager.__gotload(\'' + id + '\')'); - Lz.callMethod('Lz.iframemanager.__gotload(\'' + id + '\')'); + Lz[iframe.owner].callMethod('Lz.iframemanager.__gotload(\'' + id + '\')'); } } } Modified: openlaszlo/branches/wafflecone/lps/includes/source/lzhistory.js =================================================================== --- openlaszlo/branches/wafflecone/lps/includes/source/lzhistory.js 2007-10-18 15:37:44 UTC (rev 6903) +++ openlaszlo/branches/wafflecone/lps/includes/source/lzhistory.js 2007-10-18 18:00:19 UTC (rev 6904) @@ -12,7 +12,7 @@ var _this = Lz.history; _this._title = top.document.title; Lz.__BrowserDetect.init(); - _this._currentstate = _this.get(); + var currstate = _this.get(); if (Lz.__BrowserDetect.isSafari) { // must track state ourselves... _this._historylength = history.length; @@ -20,7 +20,7 @@ for (var i = 1; i < _this._historylength; i++) { _this._history.push(''); } - _this._history.push(_this._currentstate); + _this._history.push(currstate); var form = document.createElement('form'); form.method = 'get'; document.body.appendChild(form); @@ -31,7 +31,12 @@ if (top.document.location.lzaddr.history) { _this._history = top.document.location.lzaddr.history.split(','); } + if (currstate != '') { + _this.set(currstate) + } } else if (Lz.__BrowserDetect.isIE) { + var currstate = top.location.hash; + if (currstate) currstate = currstate.substring(1); // use an iframe; var i = document.createElement('iframe'); Lz.__setAttr(i, 'id', 'lzHistory'); @@ -48,23 +53,22 @@ var doc = i.contentDocument || i.contentWindow.document; doc.open(); doc.close(); - if (_this._currentstate != '') doc.location.hash = '#' + _this._currentstate; + //alert('currstate ' + currstate); + if (currstate != '') { + doc.location.hash = '#' + currstate; + _this._parse(currstate) + } + } else { + if (currstate != '') { + _this._parse(currstate) + _this._currentstate = currstate; + } } - if (_this._currentstate != '') _this._parse(_this._currentstate) - //alert('init'); + //alert('init ' + currstate); setInterval('Lz.history._checklocationhash()', 100) } ,/** @access private */ - _historyEvent: function (value) { - if (Lz.loaded && dojo.flash.comm) { - //alert(value); - dojo.flash.comm.receiveHistory(value + ''); - return true; - } - } - - ,/** @access private */ _checklocationhash: function() { if (dojo.flash && dojo.flash.info && dojo.flash.info.installing) return; if (Lz.__BrowserDetect.isSafari) { @@ -88,7 +92,7 @@ if (Lz.__BrowserDetect.isIE) { if (h != this._currentstate) { - top.location.hash = '#' + h; + top.location.hash = h == '0' ? '' : '#' + h; this._currentstate = h; this._parse(h); } @@ -100,34 +104,46 @@ this._parse(h); } } + if (dojo.flash.obj && Lz.loaded) { + var p = dojo.flash.obj.get(); + if (p) { + var cid = p.GetVariable("_callbackID"); + if (cid != 'null') return; + var val = p.GetVariable("_currenthistory"); + if (val && val != 'null' && val != Lz.history._lasthash) { + //alert('val ' + val); + Lz.history._lasthash = val; + } + } + } } ,/** */ set: function(s) { if (s == null) s = ''; - if (this._currentstate == s) return; - this._currentstate = s; + if (Lz.history._currentstate == s) return; + Lz.history._currentstate = s; var hash = '#' + s; if (Lz.__BrowserDetect.isIE) { - top.location.hash = hash; - var doc = Lz.history._iframe.contentWindow.document; + top.location.hash = hash == '#0' ? '' : hash; + var doc = Lz.history._iframe.contentDocument || Lz.history._iframe.contentWindow.document; doc.open(); doc.close(); doc.location.hash = hash; - this._parse(s + ''); + Lz.history._parse(s + ''); } else if (Lz.__BrowserDetect.isSafari) { // can't preserve query strings :( - this._form.action = hash; - top.document.location.lzaddr.history = this._history.toString(); - this._skip = true; - this._history[history.length] = hash; - this._historylength = history.length + 1; - this._form.submit() - this._skip = false; + Lz.history._form.action = hash; + top.document.location.lzaddr.history = Lz.history._history.toString(); + Lz.history._skip = true; + Lz.history._history[history.length] = hash; + Lz.history._historylength = history.length + 1; + Lz.history._form.submit() + Lz.history._skip = false; } else { top.location.hash = hash; - this._parse(s + ''); + Lz.history._parse(s + ''); } return true; } @@ -168,14 +184,13 @@ if (window['canvas']) canvas.setAttribute(name, val); } } else { + //alert('_parse test' + h + ', ' + _this._lasthash); //history id - if (_this._historyEvent(h)) { - // if successful, don't send again - _this._lasthash = h; - //alert('_parse '+ h + ', ' + _this._lasthash); + if (Lz.loaded && Lz.callMethod && h != Lz.history._lasthash) { + _this.__setFlash(h); } if (Lz.__dhtmlhistoryready && LzHistory && LzHistory['receiveHistory']) { - //alert(h); + //alert('dhtml ' + h); LzHistory.receiveHistory(h); _this._lasthash = h; } @@ -195,5 +210,23 @@ this.set('_lz' + o); //window.frames['_lzhist'].location = newurl; } + ,/** @access private called from flash */ + __receivedhistory: function(h) { + Lz.history._lasthash = h + ''; + //alert('__receivedhistory '+ Lz.history._lasthash); + } + ,/** @access private called from flash */ + __setFlash: function(h) { + var p = dojo.flash.obj.get(); + if (p) { + var cid = p.GetVariable("_callbackID") + ''; + if (cid == 'null') { + Lz.callMethod("LzHistory.receiveHistory(" + h + ")"); + } else { + setTimeout('Lz.history.__setFlash(' + h + ')', 10); + //alert('busy'); + } + } + } }; window.onload = Lz.history.init; _______________________________________________ Laszlo-checkins mailing list Laszlo-checkins@openlaszlo.org http://www.openlaszlo.org/mailman/listinfo/laszlo-checkins | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
«LzWarning#0| WARNING @../html.lzx#18: reference to undefined property '[]'» {
file: '../html.lzx'
line: 18
message: "reference to undefined property '[]'"
}