I'm checking this in ahead of review:
Change 20100522-maxcarlson-f by maxcarl...@friendly on 2010-05-22 12:37:07 PDT
in /Users/maxcarlson/openlaszlo/trunk-clean
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: Update LzBrowser.getInitArg() to address Andre's nits
Bugs Fixed: lpp-9023 - Want a way to get all query parameters at once
Technical Reviewer: [email protected]
QA Reviewer: hminsky
Details:
> - 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.
Fixed.
> + var newargs = LzBrowserKernel.callJS('eval', null,
> 'lz.embed.applications.' + _root.id + ".initargs");
1) consistent quotes for strings are nice ;-)
Fixed.
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.
Fixed.
> + 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)?
Hmmm - it won't work because lz.embed.applications isn't there, but it should
fall back to the default (global scope for swf8, parameters for swf9/10) so I
think that's okay.
Tests: See LPP-9023
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
Changeset:
http://svn.openlaszlo.org/openlaszlo/patches/20100522-maxcarlson-f.tar