includes/clientside/static/comments.js
changeset 86 c162ca39db8f
parent 85 7c68a18a27be
child 102 d807dcd7aed7
--- a/includes/clientside/static/comments.js	Thu Aug 09 12:26:16 2007 -0400
+++ b/includes/clientside/static/comments.js	Fri Aug 10 15:57:22 2007 -0400
@@ -34,7 +34,7 @@
       switch(response.mode)
       {
         case 'fetch':
-          document.getElementById('ajaxEditContainer').innerHTML = 'Rendering response...';
+          document.getElementById('ajaxEditContainer').innerHTML = '<div class="wait-box">Rendering '+response.count_total+' comments...</div>';
           if(response.template)
             comment_template = response.template;
           setAjaxLoading();
@@ -53,7 +53,7 @@
           materializeComment(response);
           break;
         case 'error':
-          alert(response.error);
+          new messagebox(MB_OK|MB_ICONSTOP, ( response.title ? response.title : 'Error fetching comment data' ), response.error);
           break;
         default:
           alert(ajax.responseText);
@@ -183,12 +183,12 @@
   if ( this_comment.user_level >= data.user_level.member ) tplvars.USER_LEVEL = 'Member';
   if ( this_comment.user_level >= data.user_level.mod ) tplvars.USER_LEVEL = 'Moderator';
   if ( this_comment.user_level >= data.user_level.admin ) tplvars.USER_LEVEL = 'Administrator';
-  
+                              
   // Send PM link
-  tplvars.SEND_PM_LINK=(this_comment.user_id>1)?'<a onclick="window.open(this.href); return false;" href="'+ makeUrlNS('Special', 'PrivateMessages/Compose/To/' + ( this_comment.name.replace(/ /g, '_') )) +'">Send private message</a><br />':'';
+  tplvars.SEND_PM_LINK=(this_comment.user_id>1 && data.logged_in)?'<a onclick="window.open(this.href); return false;" href="'+ makeUrlNS('Special', 'PrivateMessages/Compose/To/' + ( this_comment.name.replace(/ /g, '_') )) +'">Send private message</a><br />':'';
   
   // Add buddy link
-  tplvars.ADD_BUDDY_LINK=(this_comment.user_id>1)?'<a onclick="window.open(this.href); return false;" href="'+ makeUrlNS('Special', 'PrivateMessages/FriendList/Add/' + ( this_comment.name.replace(/ /g, '_') )) +'">Add to buddy list</a><br />':'';
+  tplvars.ADD_BUDDY_LINK=(this_comment.user_id>1 && data.logged_in)?'<a onclick="window.open(this.href); return false;" href="'+ makeUrlNS('Special', 'PrivateMessages/FriendList/Add/' + ( this_comment.name.replace(/ /g, '_') )) +'">Add to buddy list</a><br />':'';
   
   // Edit link
   tplvars.EDIT_LINK='<a href="#edit_'+i+'" onclick="editComment(\''+i+'\', this); return false;" id="cmteditlink_'+i+'">edit</a>';