Candide Kemmler wrote: > > > On 9/16/06, *Max Carlson* <[EMAIL PROTECTED] > <mailto:[EMAIL PROTECTED]>> wrote: > > (cc-ing laszlo-dev) > > Hi Candide, > > There are three different file extensions - .as, .js and .lzs. All > three are essentially Java/ECMAScript, but .as designates Actionscript > for Flash, .js is JavaScript for the browser, and .lzs is Javascript > with our own extensions (compiler pragmas, including #include and > the like). > > One of the design goals for Legals is to use as much common code as > possible. All runtime-specific code will be confined to the kernel - > see the kernel directories for this. > > If you do a build, you'll see how the files get combined into a > runtime-specific version of the LFC. You can check out the Library.lzs > files to see runtime-specific includes, e.g. > > if ($dhtml) { > ... > } else { > ... > } > > There's a lot there, and we're working hard to get it in shape for Beta. > After looking a little closer, it seems like LzBrowser.loadJS() is > in pretty good shape. > > lzSetCanvasAttribute() currently lives in the javascript used to embed > Flash applications in HTML - see $LPS_HOME/lps/includes/embed.js. We'll > need an implementation of this API for DHTML. The current mechanism is > pretty byzantine in Flash, but the end result of calling > lzSetCanvasAttribute(name, value) is a call to > LzHistory.receiveEvent(name, value). > > If we could get this API working in JavaScript we should have all the > ingredients for bidirectional communication - loadJS() can call out of > an application, and lzSetCanvasAttribute(name, value) can call in by > setting a canvas attribute and firing an event. > > Let me know if you have questions as you look closer. A few good first > steps would be trying LzBrowser.loadJS() and LzText.setText() to see how > well setting a text field to contain arbitrary HTML works. Thanks! > > Regards, > Max Carlson > OpenLaszlo.org > > > Right, I finally got the time to investigate this. Here's a little .zip > patch that you can expand at $LPS_HOME that basically does what is > expected from lzSetCanvasAttribute. I've included a "test case" in the > form of a simple .lzx placed in the /my-apps folder and which can be > reached with:
This is great! By the way, we have a system for packaging up changes that we use for formal reviews, described here: http://wiki.openlaszlo.org/Code_Review_Process > http://localhost:8080/legals/my-apps/ > and > http://localhost:8080/legals/my-apps/indexswf.html > > ...for the DHTML and swf versions respectively. Both log output on > Firebug's console (since I didn't figure out how to log things under DHTML). > > The original lzSetCanvasAttribute apparently supports some weird things > with the history which I obviously didn't implement (I don't even know > what it is...). The history argument causes browser back-button adds history placeholder to be added. It does this by loading code into a hidden iframe that then sets the canvas attribute. Then, when the back button is used, the attribute is set to the last value loaded in the hidden iframe. > The code is 5 lines so it's very naïve. Please tell me what I can do to > improve this mechanism. I'll look at it as soon as I get a chance! Regards, Max Carlson OpenLaszlo.org _______________________________________________ Laszlo-dev mailing list [email protected] http://www.openlaszlo.org/mailman/listinfo/laszlo-dev
