You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@esme.apache.org by vd...@apache.org on 2011/02/27 23:04:08 UTC

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

Author: vdichev
Date: Sun Feb 27 22:04:08 2011
New Revision: 1075157

URL: http://svn.apache.org/viewvc?rev=1075157&view=rev
Log:
Revert pure JavaScript URL path solution

Removed:
    esme/trunk/server/src/main/webapp/scripts/rel_path_flat.js
    esme/trunk/server/src/main/webapp/scripts/rel_path_one_level.js
    esme/trunk/server/src/main/webapp/scripts/rel_path_two_level.js
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=1075157&r1=1075156&r2=1075157&view=diff
==============================================================================
--- esme/trunk/server/src/main/webapp/index.html (original)
+++ esme/trunk/server/src/main/webapp/index.html Sun Feb 27 22:04:08 2011
@@ -34,7 +34,6 @@
 			<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=1075157&r1=1075156&r2=1075157&view=diff
==============================================================================
--- esme/trunk/server/src/main/webapp/info_view/messages.html (original)
+++ esme/trunk/server/src/main/webapp/info_view/messages.html Sun Feb 27 22:04:08 2011
@@ -19,11 +19,7 @@
 
 
 
-<lift:surround with="base_top" at="left"> 
-
-         <head>
-	      <script src="scripts/rel_path_flat.js" type="text/javascript"/>
-        </head>             
+<lift:surround with="base_top" at="left">              
 	<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=1075157&r1=1075156&r2=1075157&view=diff
==============================================================================
--- esme/trunk/server/src/main/webapp/info_view/public.html (original)
+++ esme/trunk/server/src/main/webapp/info_view/public.html Sun Feb 27 22:04:08 2011
@@ -23,10 +23,7 @@
 	  <lift:embed what="templates-hidden/message_update_box"/>   
 	</div>
   <div class="container-aux"> 
-    <div id="public_timeline_messages"> 
-        <head> 
-           <script src="/scripts/rel_path_two_level.js" type="text/javascript" />                          
-        </head>  
+    <div id="public_timeline_messages">  
   		<!--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=1075157&r1=1075156&r2=1075157&view=diff
==============================================================================
--- esme/trunk/server/src/main/webapp/info_view/streams.html (original)
+++ esme/trunk/server/src/main/webapp/info_view/streams.html Sun Feb 27 22:04:08 2011
@@ -46,8 +46,9 @@
 				</table>
   	  </div>        
   	  <div id="stream_timeline_messages">                           
-        <head> 
-           <script src="/scripts/rel_path_two_level.js" type="text/javascript" />                          
+        <head>                        
+          <script src="/scripts/display_messages_top.js" type="text/javascript"/>  
+          <script src="/scripts/pretty.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=1075157&r1=1075156&r2=1075157&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 Sun Feb 27 22:04:08 2011
@@ -136,23 +136,6 @@ 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)
 {
@@ -232,15 +215,21 @@ function displayMessages(msgArray, eleme
       var newMsg = msgTemplate.clone(true).attr('id',msgId);
 
       
-      newMsg.find('.author').text(msgAuthor.nickname);     
-            
-     newMsg.find('.author').attr('href',pathAdjust("user/" + msgAuthor.nickname) );
+      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 );    
      
      
-   
-      // Dealing with users with no avatars
+           // Dealing with users with no avatars
       if (!msgAuthor.imageUrl) {
-      	 msgAuthor.imageUrl= pathAdjust( "images/avatar.jpg"); 
+      	if (top.location.pathName == "/") 
+      	 msgAuthor.imageUrl= "images/avatar.jpg"
+      	else
+      	msgAuthor.imageUrl= "../images/avatar.jpg" 
      }
      
      	
@@ -257,7 +246,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');    
       
@@ -289,4 +278,5 @@ 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=1075157&r1=1075156&r2=1075157&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 Sun Feb 27 22:04:08 2011
@@ -52,23 +52,6 @@ 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;
-	
 }
  
 
@@ -164,8 +147,7 @@ function displayMessages(msgArray, eleme
      
       // Dealing with users with no avatars
       if (!msgAuthor.imageurl)
-      	msgAuthor.imageurl=pathAdjust( "images/avatar.jpg");
-      	
+      	msgAuthor.imageurl="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=1075157&r1=1075156&r2=1075157&view=diff
==============================================================================
--- esme/trunk/server/src/main/webapp/templates-hidden/base.html (original)
+++ esme/trunk/server/src/main/webapp/templates-hidden/base.html Sun Feb 27 22:04:08 2011
@@ -73,7 +73,7 @@
                 <!--left-->
                 <div id="right">
                     <div class="box-right-back">
-                        <div class="user-avatar">
+                        <div class="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=1075157&r1=1075156&r2=1075157&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 Sun Feb 27 22:04:08 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=1075157&r1=1075156&r2=1075157&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 Sun Feb 27 22:04:08 2011
@@ -19,8 +19,7 @@
                    
 <div id="conversation_timeline_messages">                           
   <head>                        
-    <script src="/scripts/display_messages_top.js" type="text/javascript"/> 
-    <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"/> 
   </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=1075157&r1=1075156&r2=1075157&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 Sun Feb 27 22:04:08 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=1075157&r1=1075156&r2=1075157&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 Sun Feb 27 22:04:08 2011
@@ -18,8 +18,9 @@
 -->
                    
 <div id="stream_timeline_messages">                           
-  <head>
-    <script src="/scripts/rel_path_two_level.js" type="text/javascript" />                           
+  <head>                        
+    <script src="/scripts/display_messages_top.js" type="text/javascript"/>  
+    <script src="/scripts/pretty.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=1075157&r1=1075156&r2=1075157&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 Sun Feb 27 22:04:08 2011
@@ -18,8 +18,9 @@
 -->
                    
 <div id="tag_timeline_messages">                           
-  <head>
-    <script src="/scripts/rel_path_two_level.js" type="text/javascript" />                           
+  <head>                        
+    <script src="/scripts/display_messages_top.js" type="text/javascript"/>  
+    <script src="/scripts/pretty.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=1075157&r1=1075156&r2=1075157&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 Sun Feb 27 22:04:08 2011
@@ -18,8 +18,7 @@
 -->
    
 <div id="user_messages_timeline_messages">   
-  <head> 
-    <script src="/scripts/rel_path_two_level.js" type="text/javascript" />                  
+  <head>                
     <script src="/scripts/display_messages_top.js" type="text/javascript"/>  
     <script src="/scripts/pretty.js" type="text/javascript"/>  
     <lift:user_info>