On Wed, Jan 26, 2011 at 4:35 PM, Richard Hirsch <[email protected]> wrote: > On Wed, Jan 26, 2011 at 2:30 PM, Ethan Jewett <[email protected]> wrote: >> 1. Use only relative paths, which would probably involve having each >> page set a JS variable to the value of the relative base path from its >> location (e.g. "../..") > > That would be perfect but do you have ideas how to do this? Any ideas? > > The current code committed to JIRA is still a work around and doesn't > really work. Shall I do a rollback to the old code - at least it > worked in jetty.
In each snippet that uses a comet timeline, manually enter a script element in the template that contains the javascript: var relative_root_path = "../" This is an example for a snippet that is "one level deep", like tag page at http://esmecloudserverapache.dickhirsch.staxapps.net/tag/Mailer The main snippet would just have "/" and some other snippets might have "../../". Then in the main javascript file, don't use any if statements. Just have the line: newMsg.find('#author').attr('href', relative_root_path + "user/" + msgAuthor.nickname ); Something along those lines. It is really ugly (global variables like that are a no-no and there are better ways to do it), but I think it'll get the job done for now. Ethan
