[Catalyst] javascript in Catalyst using Template Toolkit

2008-07-18 Thread kakimoto
hi there,, Did this work? I have actually tried this and yes, like Emily,my JS stuff is store in myapp/root/lib/site . script src=[% Catalyst.uri_for('/multifile.js') %]/script Does not work. Did I miss anything out? thank you On 20/12/2007, Emily Heureux emily at burnham.org

Re: [Catalyst] javascript in Catalyst using Template Toolkit

2008-07-18 Thread Peter Karman
Jonathan Rockway wrote on 7/18/08 8:17 PM: Someone else suggested linking to '/lib/site/multifile.js'. I don't think that will work either. Jon is correct. I broke an ankle jumping to the conclusion that '/lib/site' was in the Static::Simple config include path. -- Peter Karman .

Re: [Catalyst] javascript in Catalyst using Template Toolkit

2008-07-18 Thread kakimoto
Hello, Jonathan and Peter, Thanks for that :) i got the issue fixed up by add root/static to lib/myApp/View/TT.pm and yes, 'Static::Simple' was used. Here's an extract... __PACKAGE__-config({ CATALYST_VAR = 'Catalyst', INCLUDE_PATH = [ myApp-path_to( 'root', 'src' ),

Re: [Catalyst] javascript in Catalyst using Template Toolkit

2007-12-23 Thread Matt S Trout
On Fri, Dec 21, 2007 at 11:06:33PM +0100, Daniel McBrearty wrote: My experience is that every time I think I -can- make that assumption, later I end up really wishing I could deploy my app to a sub-URL for testing or similar. You may not have such bad luck, but I don't like to take

Re: [Catalyst] javascript in Catalyst using Template Toolkit

2007-12-21 Thread Matt S Trout
On Thu, Dec 20, 2007 at 02:11:50PM -0500, John Romkey wrote: Two recommendations, assuming the Javascript file isn't meant to be modified at runtime: First, use an absolute path to the file in your script tag, ie: script src='/static/clock.js' or use $c-uri_for() to compute the path.

Re: [Catalyst] javascript in Catalyst using Template Toolkit

2007-12-21 Thread Daniel McBrearty
My experience is that every time I think I -can- make that assumption, later I end up really wishing I could deploy my app to a sub-URL for testing or similar. You may not have such bad luck, but I don't like to take that chance these days :) If I hit that one (needing to test code on the

Re: [Catalyst] javascript in Catalyst using Template Toolkit

2007-12-21 Thread John Romkey
On Dec 21, 2007, at 1:51 PM, Matt S Trout wrote: On Thu, Dec 20, 2007 at 02:11:50PM -0500, John Romkey wrote: Two recommendations, assuming the Javascript file isn't meant to be modified at runtime: First, use an absolute path to the file in your script tag, ie: script src='/static/clock.js'

Re: [Catalyst] javascript in Catalyst using Template Toolkit

2007-12-21 Thread Kieren Diment
On 22 Dec 2007, at 16:25, John Romkey wrote: Since uri_for() won't help with static file paths, is there any convention for storing the path for static files in the config, or getting access to it in some other way? Actually I've wanted a relative_uri_for() for a while. Not that badly

Re: [Catalyst] javascript in Catalyst using Template Toolkit

2007-12-21 Thread Andreas Marienborg
On 22. des.. 2007, at 06.37, Kieren Diment wrote: On 22 Dec 2007, at 16:25, John Romkey wrote: Since uri_for() won't help with static file paths, is there any convention for storing the path for static files in the config, or getting access to it in some other way? Actually I've wanted

[Catalyst] javascript in Catalyst using Template Toolkit

2007-12-20 Thread Emily Heureux
I am trying to execute a bit of external javascript code, but I don't believe I am setting it up correctly in Catalyst. I have a clock.js file, and then inside a menu file in myapp/root/lib/site I have the script tag: script src=clock.js./script. If I put the clock.js code directly into the

Re: [Catalyst] javascript in Catalyst using Template Toolkit

2007-12-20 Thread John Romkey
Two recommendations, assuming the Javascript file isn't meant to be modified at runtime: First, use an absolute path to the file in your script tag, ie: script src='/static/clock.js' or use $c-uri_for() to compute the path. Second, serve the Javascript file from your static directory so