I've been trying to figure out how best to use javascript with
TurboGears. tgadmin quickstart creates a "static/javascript"
directory. I'm guessing this is where custom javascripts should go. I
found in the wiki these lines need to be inserted into a kid template
to be able to have javascript links.
<link py:strip="1" py:for="css in tg_css">${css.insert()}</link>
<link py:strip="1" py:for="js in tg_js_head">${js.insert()}</link>
And there is MochiKit. I've looked at the intro video, but not much
more yet.
So I'm creating a widget label that will display a hyperlink that opens
a new window. I created a javascript file called openwin.js and put it
in static/javascript. I think I need to do something like this:
widget.javascript.append(JSLink(?, "openwin.js"))
I don't know what goes in place of ?. I'm not even sure this is a good
approach. Is MochiKit of any use here?
I haven't found much in the docs, wiki, or mailing list on this
subject. Once I learn this stuff, I'll be glad to write a wiki entry.
Randall