Hi,
I just commited r3871, which makes parsing properties even more
convenient. Instead of saying
this.foo = Mapbuilder.getProperty(widgetNode, "mb:foo", "default");
we can now say
this.foo = this.getProperty("mb:foo", "default");
in all widgets, models and tools that inherit from
(Widget|Model|Tool)Base.js.
Regards,
Andreas.
Cameron Shorter wrote:
> Some time ago, I remember there being some code which I can't find now.
> I think it was in Config.js, but might have been in WidgetBase.js
> and/or ModelBase.js
>
> It went something like:
>
> foreach property for a widget or model in the config file {
> this.configAttributes.`propertyName`=
> node.selectSingleNode("mb:propertyName").firstChild.nodeValue;
> }
>
> The advantage is that in one small block of code, we initialized all
> config.xml variables.
> The downside is that we don't need to declare variables in JS, which
> means the variables are not included in jsdocs. So we could do
> something in between:
>
> In each widget/model, declare all variables and assign default values
> to them.
>
> In WidgetBase/ModelBase assign all parameters in the config file if
> the variable has already been defined in the Widget/Model. (I haven't
> checked to see if this is achievable yet)
>
> Is this worth considering?
>
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
mapbuilder-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mapbuilder-devel