Re: Automatically include javascript companion

2010-02-06 Thread Inge Solvoll
There you go, did it for fun :) One thing remaining: how to find out if asset exists without an exception being thrown? public class IncludeJavascriptLibraryWithSameNameWorker extends AbstractIncludeAssetWorker { private final RenderSupport renderSupport; private final AssetSource assetSourc

Re: Automatically include javascript companion

2010-02-05 Thread Josh Canfield
> But in the end, i realized that it's a silly idea that only leads to other > people having even more problems finding out what's going on in my code :) If you organize things so that your js lives right next to your tml then it shouldn't be so hard to handle. If you're looking at the folder you

Re: Automatically include javascript companion

2010-02-05 Thread Inge Solvoll
Thanks! I looked into this and it wasn't too hard to figure out (as usual). But in the end, i realized that it's a silly idea that only leads to other people having even more problems finding out what's going on in my code :) I can afford the typing required to include the javascript companion fo

Re: Automatically include javascript companion

2010-02-05 Thread cordenier christophe
Hi, Your worker should use AssetSource and RenderSupport to automatically add the js file if it exists, have a look at IncludeJavaScriptLibraryWorker source file to see an exemple of script injection. BTW in my experience, the multiplication of JS/CSS files is not really appreciated by IE, so if y

Automatically include javascript companion

2010-02-05 Thread Inge Solvoll
Hi! I find myself repeating myself. Quite often when creating a page or a component, I create a companion javascript file with the same name as my component class. I got the idea today to try to create some kind of worker or service that automatically includes a javascript that has the same name a