You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@esme.apache.org by rh...@apache.org on 2011/01/26 08:22:45 UTC

svn commit: r1063618 - /esme/trunk/server/src/main/webapp/scripts/display_messages_top.js

Author: rhirsch
Date: Wed Jan 26 07:22:44 2011
New Revision: 1063618

URL: http://svn.apache.org/viewvc?rev=1063618&view=rev
Log:
[ESME-327] URL path problems

Modified:
    esme/trunk/server/src/main/webapp/scripts/display_messages_top.js

Modified: esme/trunk/server/src/main/webapp/scripts/display_messages_top.js
URL: http://svn.apache.org/viewvc/esme/trunk/server/src/main/webapp/scripts/display_messages_top.js?rev=1063618&r1=1063617&r2=1063618&view=diff
==============================================================================
--- esme/trunk/server/src/main/webapp/scripts/display_messages_top.js (original)
+++ esme/trunk/server/src/main/webapp/scripts/display_messages_top.js Wed Jan 26 07:22:44 2011
@@ -195,7 +195,13 @@ function displayMessages(msgArray, eleme
 
       
       newMsg.find('#author').text(msgAuthor.nickname);
-      newMsg.find('#author').attr('href', "/user/" + msgAuthor.nickname );
+      
+      // Dealing with tomcat
+      if (top.location.pathName == "/") 
+      	  newMsg.find('#author').attr('href',"/user/" + msgAuthor.nickname );
+     else
+      	 newMsg.find('#author').attr('href', window.location.pathname + "user/" + msgAuthor.nickname ); 
+     
      
      
            // Dealing with users with no avatars



Re: svn commit: r1063618 - /esme/trunk/server/src/main/webapp/scripts/display_messages_top.js

Posted by Ethan Jewett <es...@gmail.com>.
On Wed, Jan 26, 2011 at 7:45 PM, Richard Hirsch <hi...@gmail.com> wrote:
> On Wed, Jan 26, 2011 at 5:19 PM, ejc <er...@gmail.com> wrote:
>> This sounds like a good solution for now.  I was starting to think
>> about what it would take to rewrite the comet timeline.  Like you
>> indicated before, it's not trivial.  I suspect that more recent
>> versions of lift have some additions to make this easier.  The other
>> day I was looking through JIRA to find unassigned bugs to work on and
>> found this one:
>>
>> https://issues.apache.org/jira/browse/ESME-268
>>
>> I seems this bug could be fixed with a rewrite.  How does it sound to
>> plan this for 1.3 or something?  I'd be willing to look through bugs
>> and try to identify ones that could be fixed in this manner.
>
> That would be great.

Agreed, sounds perfect.

Ethan

Re: svn commit: r1063618 - /esme/trunk/server/src/main/webapp/scripts/display_messages_top.js

Posted by Ethan Jewett <es...@gmail.com>.
I'm working on redoing the timelines to use the same comet actors (or
inherited classes) and javascript for all timelines, but I wasn't
undertaking a complete rewrite of the timeline actors. 289 and 287 are
more of a step towards being able to rewrite. Now that things have
been refactored I think that rewrite will actually be a lot easier.

So, yes, I think a new ticket with the 5 bugs you've found as
dependencies would be great and yes, I think that 1.3 is a reasonable
target. Hopefully the inheritance tree of the comet actors is more or
less clear, but if you have any questions as you look at it, just ask
here and I'll try to tell you want I was thinking at the time. No
guarantees that what I was thinking at the time actually makes any
sense though ;-)

Ethan

On Wed, Jan 26, 2011 at 8:06 PM, ejc <er...@gmail.com> wrote:
> It appears that Ethan is already working on some of this:
>
> https://issues.apache.org/jira/browse/ESME-289
> and
> https://issues.apache.org/jira/browse/ESME-287
>
> appear related.  After a quick search, I found 5 others.  I plan to
> create a task with these bugs as dependencies, but I'll wait for Ethan
> to comment.
>
> Thanks,
> Eric
>
> On Wed, Jan 26, 2011 at 10:45 AM, Richard Hirsch <hi...@gmail.com> wrote:
>> On Wed, Jan 26, 2011 at 5:19 PM, ejc <er...@gmail.com> wrote:
>>> This sounds like a good solution for now.  I was starting to think
>>> about what it would take to rewrite the comet timeline.  Like you
>>> indicated before, it's not trivial.  I suspect that more recent
>>> versions of lift have some additions to make this easier.  The other
>>> day I was looking through JIRA to find unassigned bugs to work on and
>>> found this one:
>>>
>>> https://issues.apache.org/jira/browse/ESME-268
>>>
>>> I seems this bug could be fixed with a rewrite.  How does it sound to
>>> plan this for 1.3 or something?  I'd be willing to look through bugs
>>> and try to identify ones that could be fixed in this manner.
>>
>> That would be great.
>>>
>>> Comments?
>>>
>>> Thanks,
>>> Eric
>>>
>>>
>>> On Wed, Jan 26, 2011 at 7:45 AM, Ethan Jewett <es...@gmail.com> wrote:
>>>> On Wed, Jan 26, 2011 at 4:35 PM, Richard Hirsch <hi...@gmail.com> wrote:
>>>>> On Wed, Jan 26, 2011 at 2:30 PM, Ethan Jewett <es...@gmail.com> 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
>>>>
>>>
>>
>

Re: svn commit: r1063618 - /esme/trunk/server/src/main/webapp/scripts/display_messages_top.js

Posted by ejc <er...@gmail.com>.
It appears that Ethan is already working on some of this:

https://issues.apache.org/jira/browse/ESME-289
and
https://issues.apache.org/jira/browse/ESME-287

appear related.  After a quick search, I found 5 others.  I plan to
create a task with these bugs as dependencies, but I'll wait for Ethan
to comment.

Thanks,
Eric

On Wed, Jan 26, 2011 at 10:45 AM, Richard Hirsch <hi...@gmail.com> wrote:
> On Wed, Jan 26, 2011 at 5:19 PM, ejc <er...@gmail.com> wrote:
>> This sounds like a good solution for now.  I was starting to think
>> about what it would take to rewrite the comet timeline.  Like you
>> indicated before, it's not trivial.  I suspect that more recent
>> versions of lift have some additions to make this easier.  The other
>> day I was looking through JIRA to find unassigned bugs to work on and
>> found this one:
>>
>> https://issues.apache.org/jira/browse/ESME-268
>>
>> I seems this bug could be fixed with a rewrite.  How does it sound to
>> plan this for 1.3 or something?  I'd be willing to look through bugs
>> and try to identify ones that could be fixed in this manner.
>
> That would be great.
>>
>> Comments?
>>
>> Thanks,
>> Eric
>>
>>
>> On Wed, Jan 26, 2011 at 7:45 AM, Ethan Jewett <es...@gmail.com> wrote:
>>> On Wed, Jan 26, 2011 at 4:35 PM, Richard Hirsch <hi...@gmail.com> wrote:
>>>> On Wed, Jan 26, 2011 at 2:30 PM, Ethan Jewett <es...@gmail.com> 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
>>>
>>
>

Re: svn commit: r1063618 - /esme/trunk/server/src/main/webapp/scripts/display_messages_top.js

Posted by Richard Hirsch <hi...@gmail.com>.
On Wed, Jan 26, 2011 at 5:19 PM, ejc <er...@gmail.com> wrote:
> This sounds like a good solution for now.  I was starting to think
> about what it would take to rewrite the comet timeline.  Like you
> indicated before, it's not trivial.  I suspect that more recent
> versions of lift have some additions to make this easier.  The other
> day I was looking through JIRA to find unassigned bugs to work on and
> found this one:
>
> https://issues.apache.org/jira/browse/ESME-268
>
> I seems this bug could be fixed with a rewrite.  How does it sound to
> plan this for 1.3 or something?  I'd be willing to look through bugs
> and try to identify ones that could be fixed in this manner.

That would be great.
>
> Comments?
>
> Thanks,
> Eric
>
>
> On Wed, Jan 26, 2011 at 7:45 AM, Ethan Jewett <es...@gmail.com> wrote:
>> On Wed, Jan 26, 2011 at 4:35 PM, Richard Hirsch <hi...@gmail.com> wrote:
>>> On Wed, Jan 26, 2011 at 2:30 PM, Ethan Jewett <es...@gmail.com> 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
>>
>

Re: svn commit: r1063618 - /esme/trunk/server/src/main/webapp/scripts/display_messages_top.js

Posted by ejc <er...@gmail.com>.
This sounds like a good solution for now.  I was starting to think
about what it would take to rewrite the comet timeline.  Like you
indicated before, it's not trivial.  I suspect that more recent
versions of lift have some additions to make this easier.  The other
day I was looking through JIRA to find unassigned bugs to work on and
found this one:

https://issues.apache.org/jira/browse/ESME-268

I seems this bug could be fixed with a rewrite.  How does it sound to
plan this for 1.3 or something?  I'd be willing to look through bugs
and try to identify ones that could be fixed in this manner.

Comments?

Thanks,
Eric


On Wed, Jan 26, 2011 at 7:45 AM, Ethan Jewett <es...@gmail.com> wrote:
> On Wed, Jan 26, 2011 at 4:35 PM, Richard Hirsch <hi...@gmail.com> wrote:
>> On Wed, Jan 26, 2011 at 2:30 PM, Ethan Jewett <es...@gmail.com> 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
>

Re: svn commit: r1063618 - /esme/trunk/server/src/main/webapp/scripts/display_messages_top.js

Posted by Ethan Jewett <es...@gmail.com>.
On Wed, Jan 26, 2011 at 4:35 PM, Richard Hirsch <hi...@gmail.com> wrote:
> On Wed, Jan 26, 2011 at 2:30 PM, Ethan Jewett <es...@gmail.com> 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

Re: svn commit: r1063618 - /esme/trunk/server/src/main/webapp/scripts/display_messages_top.js

Posted by Richard Hirsch <hi...@gmail.com>.
On Wed, Jan 26, 2011 at 2:30 PM, Ethan Jewett <es...@gmail.com> wrote:
> Yeah, I agree with your colloquialism :-) I think we need to step back
> a little bit and figure out how to do one of two things:
>
> 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.

>
> 2. Using paths provided by the snippets (which know "where" they are).
>
> Truthfully, we could probably stand to do a complete rewrite of the
> comet timeline to use incremental updates instead of slinging JSON all
> over the place and then having the page manage its own updates. (The
> page would still manage it's own updates, but that would be managed by
> Lift, not by our custom JS.) I think that would make this problem go
> away. I looked at this a while ago, kind of shuddered, and looked
> away,

ROFL - I know the feeling - I'm not a Javascript or UI expert either.


>but maybe it is time to look at it again.


>
> Ethan
>
> On Wed, Jan 26, 2011 at 4:17 PM, Richard Hirsch <hi...@gmail.com> wrote:
>> Still working on this problem - it's a little bit of a bitch. I
>> couldn't get Tomcat and Jetty working correctly. It was always one or
>> the other.
>>
>> D.
>>
>> On Wed, Jan 26, 2011 at 8:31 AM, Richard Hirsch <hi...@gmail.com> wrote:
>>> Oops - you are right.
>>>
>>> That's what happens with those quick changes....
>>>
>>> Let me take another look...
>>>
>>> D.
>>>
>>> On Wed, Jan 26, 2011 at 8:27 AM, Ethan Jewett <es...@gmail.com> wrote:
>>>> Unfortunately, this change is going to break the links on all the
>>>> pages except the main page. We need to find another way to do this.
>>>> :-(
>>>>
>>>> Ethan
>>>>
>>>> On Wed, Jan 26, 2011 at 10:22 AM,  <rh...@apache.org> wrote:
>>>>> Author: rhirsch
>>>>> Date: Wed Jan 26 07:22:44 2011
>>>>> New Revision: 1063618
>>>>>
>>>>> URL: http://svn.apache.org/viewvc?rev=1063618&view=rev
>>>>> Log:
>>>>> [ESME-327] URL path problems
>>>>>
>>>>> Modified:
>>>>>    esme/trunk/server/src/main/webapp/scripts/display_messages_top.js
>>>>>
>>>>> Modified: esme/trunk/server/src/main/webapp/scripts/display_messages_top.js
>>>>> URL: http://svn.apache.org/viewvc/esme/trunk/server/src/main/webapp/scripts/display_messages_top.js?rev=1063618&r1=1063617&r2=1063618&view=diff
>>>>> ==============================================================================
>>>>> --- esme/trunk/server/src/main/webapp/scripts/display_messages_top.js (original)
>>>>> +++ esme/trunk/server/src/main/webapp/scripts/display_messages_top.js Wed Jan 26 07:22:44 2011
>>>>> @@ -195,7 +195,13 @@ function displayMessages(msgArray, eleme
>>>>>
>>>>>
>>>>>       newMsg.find('#author').text(msgAuthor.nickname);
>>>>> -      newMsg.find('#author').attr('href', "/user/" + msgAuthor.nickname );
>>>>> +
>>>>> +      // Dealing with tomcat
>>>>> +      if (top.location.pathName == "/")
>>>>> +         newMsg.find('#author').attr('href',"/user/" + msgAuthor.nickname );
>>>>> +     else
>>>>> +        newMsg.find('#author').attr('href', window.location.pathname + "user/" + msgAuthor.nickname );
>>>>> +
>>>>>
>>>>>
>>>>>            // Dealing with users with no avatars
>>>>>
>>>>>
>>>>>
>>>>
>>>
>>
>

Re: svn commit: r1063618 - /esme/trunk/server/src/main/webapp/scripts/display_messages_top.js

Posted by Ethan Jewett <es...@gmail.com>.
Yeah, I agree with your colloquialism :-) I think we need to step back
a little bit and figure out how to do one of two things:

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. "../..")

2. Using paths provided by the snippets (which know "where" they are).

Truthfully, we could probably stand to do a complete rewrite of the
comet timeline to use incremental updates instead of slinging JSON all
over the place and then having the page manage its own updates. (The
page would still manage it's own updates, but that would be managed by
Lift, not by our custom JS.) I think that would make this problem go
away. I looked at this a while ago, kind of shuddered, and looked
away, but maybe it is time to look at it again.

Ethan

On Wed, Jan 26, 2011 at 4:17 PM, Richard Hirsch <hi...@gmail.com> wrote:
> Still working on this problem - it's a little bit of a bitch. I
> couldn't get Tomcat and Jetty working correctly. It was always one or
> the other.
>
> D.
>
> On Wed, Jan 26, 2011 at 8:31 AM, Richard Hirsch <hi...@gmail.com> wrote:
>> Oops - you are right.
>>
>> That's what happens with those quick changes....
>>
>> Let me take another look...
>>
>> D.
>>
>> On Wed, Jan 26, 2011 at 8:27 AM, Ethan Jewett <es...@gmail.com> wrote:
>>> Unfortunately, this change is going to break the links on all the
>>> pages except the main page. We need to find another way to do this.
>>> :-(
>>>
>>> Ethan
>>>
>>> On Wed, Jan 26, 2011 at 10:22 AM,  <rh...@apache.org> wrote:
>>>> Author: rhirsch
>>>> Date: Wed Jan 26 07:22:44 2011
>>>> New Revision: 1063618
>>>>
>>>> URL: http://svn.apache.org/viewvc?rev=1063618&view=rev
>>>> Log:
>>>> [ESME-327] URL path problems
>>>>
>>>> Modified:
>>>>    esme/trunk/server/src/main/webapp/scripts/display_messages_top.js
>>>>
>>>> Modified: esme/trunk/server/src/main/webapp/scripts/display_messages_top.js
>>>> URL: http://svn.apache.org/viewvc/esme/trunk/server/src/main/webapp/scripts/display_messages_top.js?rev=1063618&r1=1063617&r2=1063618&view=diff
>>>> ==============================================================================
>>>> --- esme/trunk/server/src/main/webapp/scripts/display_messages_top.js (original)
>>>> +++ esme/trunk/server/src/main/webapp/scripts/display_messages_top.js Wed Jan 26 07:22:44 2011
>>>> @@ -195,7 +195,13 @@ function displayMessages(msgArray, eleme
>>>>
>>>>
>>>>       newMsg.find('#author').text(msgAuthor.nickname);
>>>> -      newMsg.find('#author').attr('href', "/user/" + msgAuthor.nickname );
>>>> +
>>>> +      // Dealing with tomcat
>>>> +      if (top.location.pathName == "/")
>>>> +         newMsg.find('#author').attr('href',"/user/" + msgAuthor.nickname );
>>>> +     else
>>>> +        newMsg.find('#author').attr('href', window.location.pathname + "user/" + msgAuthor.nickname );
>>>> +
>>>>
>>>>
>>>>            // Dealing with users with no avatars
>>>>
>>>>
>>>>
>>>
>>
>

Re: svn commit: r1063618 - /esme/trunk/server/src/main/webapp/scripts/display_messages_top.js

Posted by Richard Hirsch <hi...@gmail.com>.
Still working on this problem - it's a little bit of a bitch. I
couldn't get Tomcat and Jetty working correctly. It was always one or
the other.

D.

On Wed, Jan 26, 2011 at 8:31 AM, Richard Hirsch <hi...@gmail.com> wrote:
> Oops - you are right.
>
> That's what happens with those quick changes....
>
> Let me take another look...
>
> D.
>
> On Wed, Jan 26, 2011 at 8:27 AM, Ethan Jewett <es...@gmail.com> wrote:
>> Unfortunately, this change is going to break the links on all the
>> pages except the main page. We need to find another way to do this.
>> :-(
>>
>> Ethan
>>
>> On Wed, Jan 26, 2011 at 10:22 AM,  <rh...@apache.org> wrote:
>>> Author: rhirsch
>>> Date: Wed Jan 26 07:22:44 2011
>>> New Revision: 1063618
>>>
>>> URL: http://svn.apache.org/viewvc?rev=1063618&view=rev
>>> Log:
>>> [ESME-327] URL path problems
>>>
>>> Modified:
>>>    esme/trunk/server/src/main/webapp/scripts/display_messages_top.js
>>>
>>> Modified: esme/trunk/server/src/main/webapp/scripts/display_messages_top.js
>>> URL: http://svn.apache.org/viewvc/esme/trunk/server/src/main/webapp/scripts/display_messages_top.js?rev=1063618&r1=1063617&r2=1063618&view=diff
>>> ==============================================================================
>>> --- esme/trunk/server/src/main/webapp/scripts/display_messages_top.js (original)
>>> +++ esme/trunk/server/src/main/webapp/scripts/display_messages_top.js Wed Jan 26 07:22:44 2011
>>> @@ -195,7 +195,13 @@ function displayMessages(msgArray, eleme
>>>
>>>
>>>       newMsg.find('#author').text(msgAuthor.nickname);
>>> -      newMsg.find('#author').attr('href', "/user/" + msgAuthor.nickname );
>>> +
>>> +      // Dealing with tomcat
>>> +      if (top.location.pathName == "/")
>>> +         newMsg.find('#author').attr('href',"/user/" + msgAuthor.nickname );
>>> +     else
>>> +        newMsg.find('#author').attr('href', window.location.pathname + "user/" + msgAuthor.nickname );
>>> +
>>>
>>>
>>>            // Dealing with users with no avatars
>>>
>>>
>>>
>>
>

Re: svn commit: r1063618 - /esme/trunk/server/src/main/webapp/scripts/display_messages_top.js

Posted by Richard Hirsch <hi...@gmail.com>.
Oops - you are right.

That's what happens with those quick changes....

Let me take another look...

D.

On Wed, Jan 26, 2011 at 8:27 AM, Ethan Jewett <es...@gmail.com> wrote:
> Unfortunately, this change is going to break the links on all the
> pages except the main page. We need to find another way to do this.
> :-(
>
> Ethan
>
> On Wed, Jan 26, 2011 at 10:22 AM,  <rh...@apache.org> wrote:
>> Author: rhirsch
>> Date: Wed Jan 26 07:22:44 2011
>> New Revision: 1063618
>>
>> URL: http://svn.apache.org/viewvc?rev=1063618&view=rev
>> Log:
>> [ESME-327] URL path problems
>>
>> Modified:
>>    esme/trunk/server/src/main/webapp/scripts/display_messages_top.js
>>
>> Modified: esme/trunk/server/src/main/webapp/scripts/display_messages_top.js
>> URL: http://svn.apache.org/viewvc/esme/trunk/server/src/main/webapp/scripts/display_messages_top.js?rev=1063618&r1=1063617&r2=1063618&view=diff
>> ==============================================================================
>> --- esme/trunk/server/src/main/webapp/scripts/display_messages_top.js (original)
>> +++ esme/trunk/server/src/main/webapp/scripts/display_messages_top.js Wed Jan 26 07:22:44 2011
>> @@ -195,7 +195,13 @@ function displayMessages(msgArray, eleme
>>
>>
>>       newMsg.find('#author').text(msgAuthor.nickname);
>> -      newMsg.find('#author').attr('href', "/user/" + msgAuthor.nickname );
>> +
>> +      // Dealing with tomcat
>> +      if (top.location.pathName == "/")
>> +         newMsg.find('#author').attr('href',"/user/" + msgAuthor.nickname );
>> +     else
>> +        newMsg.find('#author').attr('href', window.location.pathname + "user/" + msgAuthor.nickname );
>> +
>>
>>
>>            // Dealing with users with no avatars
>>
>>
>>
>

Re: svn commit: r1063618 - /esme/trunk/server/src/main/webapp/scripts/display_messages_top.js

Posted by Ethan Jewett <es...@gmail.com>.
Unfortunately, this change is going to break the links on all the
pages except the main page. We need to find another way to do this.
:-(

Ethan

On Wed, Jan 26, 2011 at 10:22 AM,  <rh...@apache.org> wrote:
> Author: rhirsch
> Date: Wed Jan 26 07:22:44 2011
> New Revision: 1063618
>
> URL: http://svn.apache.org/viewvc?rev=1063618&view=rev
> Log:
> [ESME-327] URL path problems
>
> Modified:
>    esme/trunk/server/src/main/webapp/scripts/display_messages_top.js
>
> Modified: esme/trunk/server/src/main/webapp/scripts/display_messages_top.js
> URL: http://svn.apache.org/viewvc/esme/trunk/server/src/main/webapp/scripts/display_messages_top.js?rev=1063618&r1=1063617&r2=1063618&view=diff
> ==============================================================================
> --- esme/trunk/server/src/main/webapp/scripts/display_messages_top.js (original)
> +++ esme/trunk/server/src/main/webapp/scripts/display_messages_top.js Wed Jan 26 07:22:44 2011
> @@ -195,7 +195,13 @@ function displayMessages(msgArray, eleme
>
>
>       newMsg.find('#author').text(msgAuthor.nickname);
> -      newMsg.find('#author').attr('href', "/user/" + msgAuthor.nickname );
> +
> +      // Dealing with tomcat
> +      if (top.location.pathName == "/")
> +         newMsg.find('#author').attr('href',"/user/" + msgAuthor.nickname );
> +     else
> +        newMsg.find('#author').attr('href', window.location.pathname + "user/" + msgAuthor.nickname );
> +
>
>
>            // Dealing with users with no avatars
>
>
>