On 04/17/2010 03:04 AM, Jean-Noël Rivasseau wrote:
> Hi,
> 
> What would be the best way to add some custom code in the loader?
> Actually I just need to add a few lines of JS code before the loading of
> Qooxdoo begins.

In fact, there is a config key ("compile-options/loader-template"[1])
that allows you to specify a custom loader template.

[1]
http://qooxdoo.org/documentation/1.0/tool/generator_config_ref#compile-options

> So far the only way I have found is using a custom template for the
> loader. However this has the disadvantage that I now have to maintain in
> parallel with the official one (if you guys change it for a new Qx
> release, I have to update mine to match yours).

Yes, but that cannot be avoided, can it?!

> Besides I have found 3
> samples templates:
> 
> file:///usr/local/opt/qooxdoo/tool/data/generator/loader-build.tmpl.js
> file:///usr/local/opt/qooxdoo/tool/data/generator/loader-source.tmpl.js
> file:///usr/local/opt/qooxdoo/tool/data/generator/loader.tmpl.js

These are not sample templates, but the actual templates which are used
to generate the applications.

> So which one should I use?

This depends on the qooxdoo version you are running.

> I have to maintain two different ones for
> source and build? and what is the one without -source or -build in the name?

The unified template is newer, the build-specific ones are older.

> Is there an easier way? I'd just like to point to a custom JS file that
> the generator would just prepend to the loader, is that implemented yet?

Prepend to the loader - no. If you need code to be run before the
qooxdoo loader add another <script> tag in your index.html before the
one the fetches the loader. There is a hook to load JS code *after* the
loader ("add-script"). This ususally suffices if you just want some
additional JS code being available for your class code. If you want to
modify the way URIs are computed in the ResourceManager during run time,
there is the "compile-options/decode-uris-plug". If you need to tweak
the loader in any other way, you have to create your own loader template.

T.

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to