- function getInitArg (name:String) :String {
+ function getInitArg (name=null) :* {
Why not function "getInitArg (name:String = null) :*", the "name"
parameter can stay to be of String type.
+ var newargs = LzBrowserKernel.callJS('eval', null,
'lz.embed.applications.' + _root.id + ".initargs");
1) consistent quotes for strings are nice ;-)
2) it might be safer to use 'lz.embed.applications["' + _root.id +
'"].initargs', just in case "id" contains "-" or other invalid
characters for an identifier name in a member expression.
+ if (! LzBrowserKernel.__initargs) {
+ var newargs = LzBrowserKernel.callJS('eval', null,
'lz.embed.applications.' + _root.id + ".initargs");
+
+ if (newargs) {
+ // cache callJS results
+ LzBrowserKernel.__initargs = newargs;
+ }
+ }
How well does this caching work for plain swf-application (by using the
lzt=swf query parameter)?
On 5/21/2010 10:33 PM, Max Carlson wrote:
Change 20100520-maxcarlson-M by maxcarl...@friendly on 2010-05-20 17:27:32 PDT
in /Users/maxcarlson/openlaszlo/trunk-clean
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: UPDATED: Add lz.Browser.getInitArg(null) to retrieve object containing
all init args
Bugs Fixed: lpp-9023 - Want a way to get all query parameters at once, LPP-7934
- DHTML: don't store initial args in global object, LPP-8685 - using
embed.dhtml more than one time cause script blocking (partial)
Release Notes: Use lz.Browser.getInitArg() to retrieve browser initialization
arguments instead of looking them up in canvas/global.
Technical Reviewer: ptw
QA Reviewer: dwheeler
Details: LzBrowserKernel - Update getInitArg() to pull attributes from
lz.embed.applications.id.initargs when possible. Reduce function calls for
getAppID().
LzBrowser - Update signature of getInitArg() to
embednew - Generate an application id if one wasn't provided. Explicitly
disallow embedding more than one DHTML application. Store parsed application
init arguments in lz.embed.applications.id.initargs. Don't set global based on
args in DHTML.
dev-console.html - Add explicit ID for DHTML app, excanvas include, clean up
include paths.
dev-console.lzx - Explicitly look up lzr init arg.
dev-console* - Recompile dev console
Tests: See testcase at lpp-9023, dev console in all runtimes
Files:
M WEB-INF/lps/lfc/kernel/swf/LzBrowserKernel.lzs
M WEB-INF/lps/lfc/kernel/dhtml/LzBrowserKernel.lzs
M WEB-INF/lps/lfc/kernel/swf9/LzBrowserKernel.lzs
M WEB-INF/lps/lfc/services/LzBrowser.lzs
M lps/includes/source/embednew.js
M lps/admin/dev-console.html
M lps/admin/dev-console.lzx.js
M lps/admin/dev-console.sprite.png
M lps/admin/dev-console.lzx.swf
M lps/admin/dev-console.lzx
M lps/admin/lps/includes/lfc/LFCdhtml.js
Changeset:
http://svn.openlaszlo.org/openlaszlo/patches/20100520-maxcarlson-M.tar