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/02/25 09:08:20 UTC

svn commit: r1074433 - in /esme/trunk/server/src/main/webapp: ./ info_view/ scripts/ templates-hidden/

Author: rhirsch
Date: Fri Feb 25 08:08:19 2011
New Revision: 1074433

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

Modified:
    esme/trunk/server/src/main/webapp/index.html
    esme/trunk/server/src/main/webapp/info_view/messages.html
    esme/trunk/server/src/main/webapp/info_view/public.html
    esme/trunk/server/src/main/webapp/info_view/streams.html
    esme/trunk/server/src/main/webapp/scripts/display_messages_top.js
    esme/trunk/server/src/main/webapp/scripts/display_single_message.js
    esme/trunk/server/src/main/webapp/templates-hidden/base.html
    esme/trunk/server/src/main/webapp/templates-hidden/message_core.html
    esme/trunk/server/src/main/webapp/templates-hidden/timeline_conversation.html
    esme/trunk/server/src/main/webapp/templates-hidden/timeline_personal.html
    esme/trunk/server/src/main/webapp/templates-hidden/timeline_stream.html
    esme/trunk/server/src/main/webapp/templates-hidden/timeline_tag.html
    esme/trunk/server/src/main/webapp/templates-hidden/timeline_user_messages.html

Modified: esme/trunk/server/src/main/webapp/index.html
URL: http://svn.apache.org/viewvc/esme/trunk/server/src/main/webapp/index.html?rev=1074433&r1=1074432&r2=1074433&view=diff
==============================================================================
--- esme/trunk/server/src/main/webapp/index.html (original)
+++ esme/trunk/server/src/main/webapp/index.html Fri Feb 25 08:08:19 2011
@@ -34,6 +34,7 @@
 			<head>
 			<script id="jquery" src="/classpath/jquery.js" type="text/javascript"/>
 			<script id="json" src="/classpath/json.js" type="text/javascript"/>
+			<script src="scripts/rel_path_flat.js" type="text/javascript"/>
 			<script src="scripts/display_single_message.js" type="text/javascript"/>
 			<script src="scripts/pretty.js" type="text/javascript"/>
 			<link rel="stylesheet" href="style/style.css" type="text/css" media="screen" />

Modified: esme/trunk/server/src/main/webapp/info_view/messages.html
URL: http://svn.apache.org/viewvc/esme/trunk/server/src/main/webapp/info_view/messages.html?rev=1074433&r1=1074432&r2=1074433&view=diff
==============================================================================
--- esme/trunk/server/src/main/webapp/info_view/messages.html (original)
+++ esme/trunk/server/src/main/webapp/info_view/messages.html Fri Feb 25 08:08:19 2011
@@ -19,7 +19,11 @@
 
 
 
-<lift:surround with="base_top" at="left">              
+<lift:surround with="base_top" at="left"> 
+
+         <head>
+	      <script src="scripts/rel_path_flat.js" type="text/javascript"/>
+        </head>             
 	<div id="back-header"> 
 	  <lift:embed what="templates-hidden/message_update_box"/>  
 	</div>  

Modified: esme/trunk/server/src/main/webapp/info_view/public.html
URL: http://svn.apache.org/viewvc/esme/trunk/server/src/main/webapp/info_view/public.html?rev=1074433&r1=1074432&r2=1074433&view=diff
==============================================================================
--- esme/trunk/server/src/main/webapp/info_view/public.html (original)
+++ esme/trunk/server/src/main/webapp/info_view/public.html Fri Feb 25 08:08:19 2011
@@ -23,7 +23,10 @@
 	  <lift:embed what="templates-hidden/message_update_box"/>   
 	</div>
   <div class="container-aux"> 
-    <div id="public_timeline_messages">  
+    <div id="public_timeline_messages"> 
+        <head> 
+           <script src="/scripts/rel_path_two_level.js" type="text/javascript" />                          
+        </head>  
   		<!--updates-box -->
   		<lift:comet type="PublicTimeline"/>
   		<lift:embed what="templates-hidden/message_core"/>   

Modified: esme/trunk/server/src/main/webapp/info_view/streams.html
URL: http://svn.apache.org/viewvc/esme/trunk/server/src/main/webapp/info_view/streams.html?rev=1074433&r1=1074432&r2=1074433&view=diff
==============================================================================
--- esme/trunk/server/src/main/webapp/info_view/streams.html (original)
+++ esme/trunk/server/src/main/webapp/info_view/streams.html Fri Feb 25 08:08:19 2011
@@ -46,9 +46,8 @@
 				</table>
   	  </div>        
   	  <div id="stream_timeline_messages">                           
-        <head>                        
-          <script src="/scripts/display_messages_top.js" type="text/javascript"/>  
-          <script src="/scripts/pretty.js" type="text/javascript"/> 
+        <head> 
+           <script src="/scripts/rel_path_two_level.js" type="text/javascript" />                          
         </head>                         
         <stream:cometTimeline />    
         <lift:embed what="templates-hidden/message_core"/>

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=1074433&r1=1074432&r2=1074433&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 Fri Feb 25 08:08:19 2011
@@ -136,6 +136,23 @@ function parseXml(xml) {
   return xml;
 }
 
+function pathAdjust (targetPath) {
+	
+   var targetPathTemp = targetPath;
+   
+    if (window.location.pathname == "/") 
+      	  targetPathTemp = targetPath;
+      else {
+      	 if (relative_root_path== "./")
+      	   targetPathTemp = window.location.pathname + "/"  + targetPath; 
+      	else 
+      	    targetPathTemp = window.location.pathname + "/" +  relative_root_path  + targetPath; 
+      } 
+   
+   return targetPathTemp;
+	
+}
+
 
 function displayMessages(msgArray, elementId)
 {
@@ -215,21 +232,15 @@ function displayMessages(msgArray, eleme
       var newMsg = msgTemplate.clone(true).attr('id',msgId);
 
       
-      newMsg.find('.author').text(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 );    
+      newMsg.find('.author').text(msgAuthor.nickname);     
+            
+     newMsg.find('.author').attr('href',pathAdjust("user/" + msgAuthor.nickname) );
      
      
-           // Dealing with users with no avatars
+   
+      // Dealing with users with no avatars
       if (!msgAuthor.imageUrl) {
-      	if (top.location.pathName == "/") 
-      	 msgAuthor.imageUrl= "images/avatar.jpg"
-      	else
-      	msgAuthor.imageUrl= "../images/avatar.jpg" 
+      	 msgAuthor.imageUrl= pathAdjust( "images/avatar.jpg"); 
      }
      
      	
@@ -246,7 +257,7 @@ function displayMessages(msgArray, eleme
       else {
       	 newMsg.find('.supp_data').text(msgPool + " " + msgDateStr  + " via "  +   msgSource);
       }
-      var id = cometMsg.id;
+      var id = cometMsg.id; 
 
       var resendButton = newMsg.find('.resend');    
       
@@ -278,5 +289,4 @@ function displayMessages(msgArray, eleme
       jQuery('#msgsep').clone().show();
     }
   }
-}
-// ]]
\ No newline at end of file
+}
\ No newline at end of file

Modified: esme/trunk/server/src/main/webapp/scripts/display_single_message.js
URL: http://svn.apache.org/viewvc/esme/trunk/server/src/main/webapp/scripts/display_single_message.js?rev=1074433&r1=1074432&r2=1074433&view=diff
==============================================================================
--- esme/trunk/server/src/main/webapp/scripts/display_single_message.js (original)
+++ esme/trunk/server/src/main/webapp/scripts/display_single_message.js Fri Feb 25 08:08:19 2011
@@ -52,6 +52,23 @@ function parseXml(xml) {
            xml = xmlDoc;    
       }       
   return xml;
+} 
+
+function pathAdjust (targetPath) {
+	
+   var targetPathTemp = targetPath;
+   
+    if (window.location.pathname == "/") 
+      	  targetPathTemp = targetPath;
+      else {
+      	 if (relative_root_path== "./")
+      	   targetPathTemp = window.location.pathname + "/"  + targetPath; 
+      	else 
+      	    targetPathTemp = window.location.pathname + "/" +  relative_root_path  + targetPath; 
+      } 
+   
+   return targetPathTemp;
+	
 }
  
 
@@ -147,7 +164,8 @@ function displayMessages(msgArray, eleme
      
       // Dealing with users with no avatars
       if (!msgAuthor.imageurl)
-      	msgAuthor.imageurl="images/avatar.jpg"
+      	msgAuthor.imageurl=pathAdjust( "images/avatar.jpg");
+      	
       	
      if (!msgPool)
       	msgPool="public"

Modified: esme/trunk/server/src/main/webapp/templates-hidden/base.html
URL: http://svn.apache.org/viewvc/esme/trunk/server/src/main/webapp/templates-hidden/base.html?rev=1074433&r1=1074432&r2=1074433&view=diff
==============================================================================
--- esme/trunk/server/src/main/webapp/templates-hidden/base.html (original)
+++ esme/trunk/server/src/main/webapp/templates-hidden/base.html Fri Feb 25 08:08:19 2011
@@ -73,7 +73,7 @@
                 <!--left-->
                 <div id="right">
                     <div class="box-right-back">
-                        <div class="avatar">
+                        <div class="user-avatar">
                             <img lift:snippet="UserSnip.image" alt="" width="80%"/>
                         </div><strong><lift:loc>ui_messages_message_label_welcome</lift:loc></strong>
                         <div class="info4">

Modified: esme/trunk/server/src/main/webapp/templates-hidden/message_core.html
URL: http://svn.apache.org/viewvc/esme/trunk/server/src/main/webapp/templates-hidden/message_core.html?rev=1074433&r1=1074432&r2=1074433&view=diff
==============================================================================
--- esme/trunk/server/src/main/webapp/templates-hidden/message_core.html (original)
+++ esme/trunk/server/src/main/webapp/templates-hidden/message_core.html Fri Feb 25 08:08:19 2011
@@ -19,7 +19,7 @@
 
 <div class="updates-box" id="message"> 
   <head>
-      <script src="/scripts/display_messages_top.js" type="text/javascript" />
+      <script src="/scripts/display_messages_top.js" type="text/javascript" />     
       <script src="/scripts/pretty.js" type="text/javascript" /> 
       <lift:UserSnip.resendScript/>           
   </head>

Modified: esme/trunk/server/src/main/webapp/templates-hidden/timeline_conversation.html
URL: http://svn.apache.org/viewvc/esme/trunk/server/src/main/webapp/templates-hidden/timeline_conversation.html?rev=1074433&r1=1074432&r2=1074433&view=diff
==============================================================================
--- esme/trunk/server/src/main/webapp/templates-hidden/timeline_conversation.html (original)
+++ esme/trunk/server/src/main/webapp/templates-hidden/timeline_conversation.html Fri Feb 25 08:08:19 2011
@@ -19,7 +19,8 @@
                    
 <div id="conversation_timeline_messages">                           
   <head>                        
-    <script src="/scripts/display_messages_top.js" type="text/javascript"/>  
+    <script src="/scripts/display_messages_top.js" type="text/javascript"/> 
+    <script src="/scripts/rel_path_two_level.js" type="text/javascript" />      
     <script src="/scripts/pretty.js" type="text/javascript"/> 
   </head>          
   <lift:conv_info>           

Modified: esme/trunk/server/src/main/webapp/templates-hidden/timeline_personal.html
URL: http://svn.apache.org/viewvc/esme/trunk/server/src/main/webapp/templates-hidden/timeline_personal.html?rev=1074433&r1=1074432&r2=1074433&view=diff
==============================================================================
--- esme/trunk/server/src/main/webapp/templates-hidden/timeline_personal.html (original)
+++ esme/trunk/server/src/main/webapp/templates-hidden/timeline_personal.html Fri Feb 25 08:08:19 2011
@@ -18,7 +18,7 @@
 -->
    
 <div id="personal_timeline_messages">   
-  <head>                
+  <head>           
     <script src="/scripts/display_messages_top.js" type="text/javascript"/>  
     <script src="/scripts/pretty.js" type="text/javascript"/>  
     <script type="text/javascript">

Modified: esme/trunk/server/src/main/webapp/templates-hidden/timeline_stream.html
URL: http://svn.apache.org/viewvc/esme/trunk/server/src/main/webapp/templates-hidden/timeline_stream.html?rev=1074433&r1=1074432&r2=1074433&view=diff
==============================================================================
--- esme/trunk/server/src/main/webapp/templates-hidden/timeline_stream.html (original)
+++ esme/trunk/server/src/main/webapp/templates-hidden/timeline_stream.html Fri Feb 25 08:08:19 2011
@@ -18,9 +18,8 @@
 -->
                    
 <div id="stream_timeline_messages">                           
-  <head>                        
-    <script src="/scripts/display_messages_top.js" type="text/javascript"/>  
-    <script src="/scripts/pretty.js" type="text/javascript"/> 
+  <head>
+    <script src="/scripts/rel_path_two_level.js" type="text/javascript" />                           
     <script type="text/javascript">
       var postPostCallback = function() {
         clearReplyTo();

Modified: esme/trunk/server/src/main/webapp/templates-hidden/timeline_tag.html
URL: http://svn.apache.org/viewvc/esme/trunk/server/src/main/webapp/templates-hidden/timeline_tag.html?rev=1074433&r1=1074432&r2=1074433&view=diff
==============================================================================
--- esme/trunk/server/src/main/webapp/templates-hidden/timeline_tag.html (original)
+++ esme/trunk/server/src/main/webapp/templates-hidden/timeline_tag.html Fri Feb 25 08:08:19 2011
@@ -18,9 +18,8 @@
 -->
                    
 <div id="tag_timeline_messages">                           
-  <head>                        
-    <script src="/scripts/display_messages_top.js" type="text/javascript"/>  
-    <script src="/scripts/pretty.js" type="text/javascript"/>   
+  <head>
+    <script src="/scripts/rel_path_two_level.js" type="text/javascript" />                           
     <script type="text/javascript">
       var postPostCallback = function() {
         clearReplyTo();

Modified: esme/trunk/server/src/main/webapp/templates-hidden/timeline_user_messages.html
URL: http://svn.apache.org/viewvc/esme/trunk/server/src/main/webapp/templates-hidden/timeline_user_messages.html?rev=1074433&r1=1074432&r2=1074433&view=diff
==============================================================================
--- esme/trunk/server/src/main/webapp/templates-hidden/timeline_user_messages.html (original)
+++ esme/trunk/server/src/main/webapp/templates-hidden/timeline_user_messages.html Fri Feb 25 08:08:19 2011
@@ -18,7 +18,8 @@
 -->
    
 <div id="user_messages_timeline_messages">   
-  <head>                
+  <head> 
+    <script src="/scripts/rel_path_two_level.js" type="text/javascript" />                  
     <script src="/scripts/display_messages_top.js" type="text/javascript"/>  
     <script src="/scripts/pretty.js" type="text/javascript"/>  
     <lift:user_info>