On Fri, Sep 12, 2008 at 12:59 PM, Jeff Hammel <[EMAIL PROTECTED]> wrote:
>     I'm working on a plugin (which I also intend to propose as a patch) that
>     will autocomplete users on ticket fields (assign to, CC) via AJAX.  I've
>     created a request handler for '/users' which returns user information in
>     the format that I need.  But I'm not sure if there is a good way to
>     specify this URL in JS.  For '/newticket' I can use 'users', but for
>     '/ticket/1' I have to use '../users', which leads to the necessity of
>     either having two JS files with similar contents (maybe not horrible) or
>     generating the JS dynamically.

Yeah, I've solved this in a few different ways.  Usually I include two
JavaScript files:  One that contains all the static JS, and one that
just contains any variables that need to be filled in dynamically.
This takes the form of a Genshi text template that's filled in by a
Trac request handler.  This usually works fine.  Sometimes I'll also
include those variables directly in a <script> block in the HTML
template.  Whatever makes sense.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Trac 
Development" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/trac-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to