esme-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhir...@apache.org
Subject svn commit: r958862 - in /incubator/esme/trunk/server/src/main/webapp: scripts/display_messages.js scripts/display_messages_top.js scripts/display_single_message.js templates-hidden/base_top.html templates-hidden/message.html
Date Tue, 29 Jun 2010 08:04:14 GMT
Author: rhirsch
Date: Tue Jun 29 08:04:14 2010
New Revision: 958862

URL: http://svn.apache.org/viewvc?rev=958862&view=rev
Log:
[ESME-237] Script paths are wrong in Tomcat 

Added:
    incubator/esme/trunk/server/src/main/webapp/scripts/display_messages_top.js
    incubator/esme/trunk/server/src/main/webapp/templates-hidden/base_top.html
Modified:
    incubator/esme/trunk/server/src/main/webapp/scripts/display_messages.js
    incubator/esme/trunk/server/src/main/webapp/scripts/display_single_message.js
    incubator/esme/trunk/server/src/main/webapp/templates-hidden/message.html

Modified: incubator/esme/trunk/server/src/main/webapp/scripts/display_messages.js
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/webapp/scripts/display_messages.js?rev=958862&r1=958861&r2=958862&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/webapp/scripts/display_messages.js (original)
+++ incubator/esme/trunk/server/src/main/webapp/scripts/display_messages.js Tue Jun 29 08:04:14
2010
@@ -99,9 +99,14 @@ function displayMessages(msgArray, eleme
      
      
       // Dealing with users with no avatars
-      if (!msgAuthor.imageUrl)
-      	msgAuthor.imageUrl="/images/avatar.jpg"
-      	
+      if (!msgAuthor.imageUrl) {
+      	if (top.location.pathName == "/") 
+      	 msgAuthor.imageUrl= "images/avatar.jpg"
+      	else
+      	msgAuthor.imageUrl= "../images/avatar.jpg" 
+     }
+     
+     	
      if (!msgPool)
       	msgPool="public"
       	

Added: incubator/esme/trunk/server/src/main/webapp/scripts/display_messages_top.js
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/webapp/scripts/display_messages_top.js?rev=958862&view=auto
==============================================================================
--- incubator/esme/trunk/server/src/main/webapp/scripts/display_messages_top.js (added)
+++ incubator/esme/trunk/server/src/main/webapp/scripts/display_messages_top.js Tue Jun 29
08:04:14 2010
@@ -0,0 +1,156 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one   *
+ or more contributor license agreements.  See the NOTICE file *
+ distributed with this work for additional information        *
+ regarding copyright ownership.  The ASF licenses this file   *
+ to you under the Apache License, Version 2.0 (the            *
+ "License"); you may not use this file except in compliance   *
+ with the License.  You may obtain a copy of the License at   *
+                                                              *
+   http://www.apache.org/licenses/LICENSE-2.0                 *
+                                                              *
+ Unless required by applicable law or agreed to in writing,   *
+ software distributed under the License is distributed on an  *
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ KIND, either express or implied.  See the License for the    *
+ specific language governing permissions and limitations      *
+ under the License.                                           * 
+*/
+
+// <![CDATA[
+/*
+ * displayMessages called by lift:comet, type="Timeline" and type="PublicTimeline"
+ */
+
+function msgDateCompare(msg1, msg2)
+{
+  return parseInt(msg1.message.when) - parseInt(msg2.message.when);
+}
+
+
+function displayMessages(msgArray, elementId)
+{
+	
+
+	
+ // Select the first element in table id="timeline_messages"
+  //  with id="message" as the message template
+  if (msgTemplate == null) {
+    //                                    var msgTemplate = jQuery('span.'+spanId+' message:first');
+    var msgTemplate = jQuery('#'+elementId+' #message:first');
+    var tagTemplate = msgTemplate.find('#tag:first');
+    var msgInsertPt = jQuery('#'+elementId);
+
+    // Now we have the template, make the existing instances invisible
+    jQuery('#'+elementId+' *[id=message]').hide();
+  }
+
+  // Sort the messages into date order
+  msgArray.sort(msgDateCompare);
+
+  for (var msgIndex in msgArray)
+  {
+    // Marshall the data from the Comet-supplied message
+    var cometMsg = msgArray[msgIndex].message;
+    var cometReason = msgArray[msgIndex].reason;
+    var cometResent = msgArray[msgIndex].resent;
+    var msgId = "message_"+cometMsg.id;
+
+    // Only do this if the message is not already in the table
+    if (jQuery('#'+elementId+' #'+msgId).size() == 0)
+    {
+      var msgAuthor = cometMsg.author;
+      var msgBody = jQuery(cometMsg.text).find('body').html();
+      var msgDateObj = new Date(parseInt(cometMsg.when));
+      
+      if (!msgBody)
+      	msgBody = cometMsg.text;
+      
+      var msgDateStr = prettyDate(msgDateObj);
+      
+
+      
+      var msgPool = '';
+      if (cometMsg.pool) msgPool = 'in pool ' + cometMsg.pool.name; 
+      var msgPoolId = 0;
+      if (cometMsg.pool) msgPoolId = cometMsg.pool.id; 
+      var msgSource = cometMsg.source;
+      var msgConversation = cometMsg.conversation;
+      var msgReason = ""
+      for (r in cometReason) {
+      	msgSource = ""
+        if (r == "resent_from")
+          msgReason = "resent by " + cometReason[r].nickname;
+        else
+          msgReason = "caused by " + r;
+        break
+      }
+      var msgTags = jQuery(cometMsg.text).find('tags > tag').get();
+      for (var tagIndex=0; tagIndex < msgTags.length; tagIndex++) {
+        // Replace each tag element with the plain tag text
+        msgTags[tagIndex] = jQuery(msgTags[tagIndex]).attr('name');
+      }
+
+      // Put the marshalled data into a copy of the template
+      var newMsg = msgTemplate.clone(true).attr('id',msgId);
+
+      newMsg.find('#author').text(msgAuthor.nickname);
+      newMsg.find('#author').attr('href', "/user/" + msgAuthor.nickname );
+     
+     
+      // Dealing with users with no avatars
+      if (!msgAuthor.imageUrl) {
+      	 msgAuthor.imageUrl= "images/avatar.jpg"
+     }
+     
+     	
+     if (!msgPool)
+      	msgPool="public"
+      	
+      var avatar = newMsg.find('#avatar')
+      .attr('src', msgAuthor.imageUrl)
+      .attr('alt',msgAuthor.firstname + ' ' + msgAuthor.lastname);
+      
+      newMsg.find('#body').html(msgBody);
+      newMsg.find('#supp_data').text(msgPool + " " + msgDateStr  + " " +  msgReason  + "
" +   msgSource);
+      newMsg.find('#msgPool').text(msgPool);
+      //newMsg.find('#reason').text(msgReason);
+      //newMsg.find('#when').text(msgDateStr);
+      var id = cometMsg.id;
+
+      var resendButton = newMsg.find('#resend');
+      if (cometResent) {
+        resendButton.css("display", "none");
+      } else {
+        resendButton.attr('id', 'resend_' + id).
+          attr('onclick', 'javascript:resend_msg(' + id + ');' +
+                                     'clearResend("resend_' + id + '")');
+      }
+      
+      
+      newMsg.find('#reply').attr('href',
+        "javascript:setReplyTo(" + id + ", '"+ escape(msgBody) + "'," + msgPoolId + ", '"
+ msgAuthor.nickname + "')");
+      var conversation = newMsg.find('#conversation');
+      if (msgConversation != 0) {
+        conversation.attr('href', 
+          '/conversation/' + msgConversation);
+      } else {
+        conversation.css("display", "none");
+      }
+      for (var tagIndex=0; tagIndex < msgTags.length; tagIndex++) {
+        var newTag = tagTemplate.clone(true).attr('id',msgTags[tagIndex]);
+        newTag.find('a')
+        .attr('href','tag/'+msgTags[tagIndex])
+        .text(msgTags[tagIndex]);
+        newTag.insertBefore(newMsg.find('#tag:first'));
+      }
+
+      // Remove any old tags from the template
+      newMsg.find('*[id=tag]').remove();
+
+      // Insert the updated copy of the message into the page
+      newMsg.prependTo(msgInsertPt).show();
+    }
+  }
+}
+// ]]>
\ No newline at end of file

Modified: incubator/esme/trunk/server/src/main/webapp/scripts/display_single_message.js
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/webapp/scripts/display_single_message.js?rev=958862&r1=958861&r2=958862&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/webapp/scripts/display_single_message.js (original)
+++ incubator/esme/trunk/server/src/main/webapp/scripts/display_single_message.js Tue Jun
29 08:04:14 2010
@@ -104,7 +104,7 @@ function displayMessages(msgArray, eleme
      
       // Dealing with users with no avatars
       if (!msgAuthor.imageurl)
-      	msgAuthor.imageurl="/images/avatar.jpg"
+      	msgAuthor.imageurl="images/avatar.jpg"
       	
      if (!msgPool)
       	msgPool="public"

Added: incubator/esme/trunk/server/src/main/webapp/templates-hidden/base_top.html
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/webapp/templates-hidden/base_top.html?rev=958862&view=auto
==============================================================================
--- incubator/esme/trunk/server/src/main/webapp/templates-hidden/base_top.html (added)
+++ incubator/esme/trunk/server/src/main/webapp/templates-hidden/base_top.html Tue Jun 29
08:04:14 2010
@@ -0,0 +1,160 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one   *
+ or more contributor license agreements.  See the NOTICE file *
+ distributed with this work for additional information        *
+ regarding copyright ownership.  The ASF licenses this file   *
+ to you under the Apache License, Version 2.0 (the            *
+ "License"); you may not use this file except in compliance   *
+ with the License.  You may obtain a copy of the License at   *
+                                                              *
+   http://www.apache.org/licenses/LICENSE-2.0                 *
+                                                              *
+ Unless required by applicable law or agreed to in writing,   *
+ software distributed under the License is distributed on an  *
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ KIND, either express or implied.  See the License for the    *
+ specific language governing permissions and limitations      *
+ under the License.                                           *
+-->
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+    <head>
+        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+        <title><lift:loc>ui_default_title</lift:loc></title>
+        <meta http-equiv="Content-Language" content="en-US" />
+        <meta http-equiv="Content-Script-Type" content="text/javascript" />
+        <meta http-equiv="Content-Style-Type" content="text/css" />
+        <meta http-equiv="imagetoolbar" content="no" />
+        <meta name="keywords" content="ESME" lang="en-US" />
+        <meta name="description" content="ESME" lang="en-US" />
+        <meta name="copyright" content="ESME" lang="en-US" />
+        <meta name="generator" content="" lang="en-US" />
+        <meta name="author" content="ESME Designed by Joy Reyes" lang="en-US" />
+        <meta name="Robots" content="index,follow,noodp" />
+        <link rel="stylesheet" href="style/style.css" type="text/css" media="screen" />
+        <link rel="stylesheet" href="style/tipTip.css" type="text/css" media="screen"
/>
+        <script id="jquery" src="/classpath/jquery.js" type="text/javascript"/>
+        <script id="json" src="/classpath/json.js" type="text/javascript"/>
+        <script src="scripts/jquery.TipTip.js" type="text/javascript"/> 
+        <script src="scripts/esme_tool_tip.js" type="text/javascript"/> 
+        <script src="scripts/jquery.validate.js" type="text/javascript"/> 
+        <script src="scripts/esme_validate.js" type="text/javascript"/> 
+    </head>
+    <body id="back">
+     <div id="messages" class="esme_message_bar" style="display: none"></div>
+        <div id="container-bg">
+            <div id="container">
+                <div id="header">
+                    <div id="logo">
+                        <h1><a href="/">ESME</a></h1>
+                    </div>
+                    <div id="top-menu">
+                        <ul>
+                            <li>
+                                 <lift:Menu.item donthide="true" name="public" a:class="tipelement"
a:title="The public timeline includes messages from all users not only those you are following.
"/>  |  
+                            </li>
+                            <li>
+                              <lift:Menu.item donthide="true" name="list_users" a:class="tipelement"
a:title="Users are listed along with their details. "/>  | 
+                            </li>
+                             <li>
+                               <lift:Menu.item donthide="true" name="streams" a:class="tipelement"
a:title="Streams allow you to view pools or the messages sent by particular users. "/>
+                            </li>
+                        </ul>
+
+                        <lift:Menu.item name="logout">
+                           <img src="images/btn-signout.gif" alt="" class="tipelement"
title="Log out of ESME." />
+                         </lift:Menu.item>
+                    </div>
+                </div><!--// ENDS HEADER -->
+                <div id="left">
+                     <lift:bind name="left" />
+                </div>
+                <!--left-->
+                <div id="right">
+                    <div class="box-right-back">
+                        <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">
+                            <a lift:snippet="UserSnip.userDetailshref"><span class="name"><lift:UserSnip.name/></span></a>
+                        </div>
+                        <ul class="main-links">
+                           <li>
+                                <lift:Menu.item donthide="true" name="Home" a:class="tipelement"
a:title="This is the your timeline."/>
+                            </li>
+                            <li>
+                                <lift:Menu.item donthide="true" name="profile" a:class="tipelement"
a:title="You can change your profile."/>     
+                            </li>
+                            <li>
+                                <lift:Menu.item donthide="true" name="trackMgt" a:class="tipelement"
a:title="You can track words."/>
+                            </li>
+                            <li>
+                                <lift:Menu.item donthide="true" name="actionMgt" a:class="tipelement"
a:title="You can create actions to fire when certain events occur"/>
+                            </li>
+                            <li>
+                                <lift:Menu.item donthide="true" name="authToken" a:class="tipelement"
a:title="You can create tokens to use when accessing ESME via other clients."/>
+                            </li>
+                            <li>
+                                <lift:Menu.item donthide="true" name="accessPools" a:class="tipelement"
a:title="You can create access pools to restrict access top certain messages."/>
+                            </li>
+                            <li>
+                                <lift:Menu.item donthide="true" name="contacts" a:class="tipelement"
a:title="You can manage your followers and those you follow."/>
+                            </li>
+
+                        </ul><!--search form-->
+                        <form action="/info_view/search" method="post" id = "validateForm">
+                            <div id="search">
+                                <div class="searchBox">
+                                    <input type="text" class="inputBox required alphanumeric
nowhitespace" name="term" value=""/>
+                                </div>
+                                <div class="searchButton">
+                                    <input type="image" onclick="javascript:form.submit();"
src="images/btn-search.gif" style="padding:0;"/>
+                                </div>
+                            </div>
+                        </form><!--search form--><h3><a href=""  class
="tipelement" title="These are tags that appear often in your timeline."><lift:loc>ui_messages_message_label_tag_cloud</lift:loc></a></h3>
+                       <div class="right-content">
+                             <lift:comet type="TagCloud"/>
+                        </div>
+                        <h3><a href="" class ="tipelement" title="These are popular
messages that users have resent often"><lift:loc>ui_messages_message_label_popular</lift:loc></a></h3>
+                        <div class="right-content">
+                                        <lift:UserSnip.popular>
+                                        <ul>
+                                            <disp:item>
+                                                <li>
+	                                                <item:author/>: <item:text/><!--<item:date/>-->

+                                                </li>
+                                            </disp:item>
+                                        </ul>
+                                    </lift:UserSnip.popular> 
+                                     </div>
+                        <h3><a href="" class ="tipelement" title="These are popular
links that users have clicked often."><lift:loc>ui_messages_message_label_popular_links</lift:loc></a></h3>
+                        <div class="right-content">
+                                  <lift:UserSnip.links>
+                                        <ul>
+                                            <disp:item>
+                                                <li>
+	                                                <item:url/>
+                                                </li>
+                                            </disp:item>
+                                        </ul>
+                                    </lift:UserSnip.links>                        
+                       </div>
+                    </div>
+                </div>
+            </div>
+            <!--// ENDS CONTAINER -->
+        </div>
+        <!--// ENDS CONTAINER-BG -->
+        <div id="footer">
+                <div class="ftr-links">			
+				<a href="http://cwiki.apache.org/confluence/display/ESME/Index"><lift:loc>custom_text_link1</lift:loc></a>
|
+				<a href="http://cwiki.apache.org/confluence/display/ESME/Index#Index-GettingStarted"><lift:loc>custom_text_link2</lift:loc></a>
|
+				<a href="http://blog.esme.us/"><lift:loc>custom_text_link3</lift:loc></a>
|
+				<br />
+                <lift:loc>ui_default_footer</lift:loc>
+          <br />
+         </div> 
+         </div> 
+    </body>
+</html>
\ No newline at end of file

Modified: incubator/esme/trunk/server/src/main/webapp/templates-hidden/message.html
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/webapp/templates-hidden/message.html?rev=958862&r1=958861&r2=958862&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/webapp/templates-hidden/message.html (original)
+++ incubator/esme/trunk/server/src/main/webapp/templates-hidden/message.html Tue Jun 29 08:04:14
2010
@@ -19,9 +19,9 @@
 
 
 
-<lift:surround with="base" at="left">
+<lift:surround with="base_top" at="left">
 <head>
-        <script src="scripts/display_messages.js" type="text/javascript"/> 
+        <script src="scripts/display_messages_top.js" type="text/javascript"/> 
         <script src="scripts/pretty.js" type="text/javascript"/> 
 </head>
 



Mime
View raw message