Ticket #2587: activity.diff
File activity.diff, 5.9 KB (added by , 15 years ago) |
---|
-
bp-activity/bp-activity-templatetags.php
650 650 if ( !$comment->children ) 651 651 return false; 652 652 653 $content .= '<ul >';653 $content .= '<ul class="acomment-container">'; 654 654 foreach ( (array)$comment->children as $comment ) { 655 655 if ( !$comment->user_fullname ) 656 656 $comment->user_fullname = $comment->display_name; -
bp-themes/bp-default/_inc/css/default.css
1021 1021 /* > Activity Stream Listing 1022 1022 -------------------------------------------------------------- */ 1023 1023 1024 div.show-hidden a { 1025 position: absolute; 1026 right: 0; 1027 top: 7px; 1028 background-color: #eee; 1029 text-decoration: none; 1030 padding: 3px 6px; 1031 font-size: 11px; 1032 color: #999; 1033 text-decoration: none; 1034 -moz-border-radius: 6px; 1035 -webkit-border-radius: 6px; 1036 border-radius: 6px; 1037 } 1038 div.show-hidden a:active, 1039 div.show-hidden a:hover { 1040 color: #666; 1041 } 1042 div.show-hidden.loading a { 1043 background-image: url( ../images/ajax-loader.gif ); 1044 background-position: 2% 50%; 1045 background-repeat: no-repeat; 1046 padding-left: 20px; 1047 } 1048 1024 1049 ul.activity-list li { 1025 1050 padding: 20px 0 0 0; 1026 1051 overflow: hidden; -
bp-themes/bp-default/_inc/global.js
430 430 431 431 return false; 432 432 } 433 434 /* Showing hidden comments - pause for half a second */ 435 if ( target.parent().hasClass('show-hidden') ) { 436 target.parent().addClass('loading'); 437 438 setTimeout( function() { 439 target.parent().parent().parent().find('ul.acomment-container li').fadeIn(600, function() { 440 target.parent().parent().find('.show-hidden').fadeOut( 200 ); 441 }); 442 jq.scrollTo( target.parent().parent().parent(), 1000, { offset: -40, easing: 'easeout' } ); 443 }, 1000 ); 444 445 return false; 446 } 433 447 }); 434 448 435 449 /* Escape Key Press for cancelling comment forms */ … … 1180 1194 }, 'json' ); 1181 1195 } 1182 1196 1183 /* Hide long lists of activity comments, only show the latest five root comments. */1184 1197 function bp_dtheme_hide_comments() { 1198 1199 // Set thresholds for when 'More' clickables will appear' 1200 var large_threshold = 5; 1201 var small_threshold = 1; 1202 1203 // Check for activity comments 1204 var comments_divs = jq('div.activity-comments'); 1205 1206 // Loop through each div.activity-comments 1207 comments_divs.each( function(i) { 1208 1209 // The top-most parent activity div in a hierarchy 1210 var comments_div = jq(this); 1211 1212 // Total number of replies to this activity item 1213 var comment_replies_total = comments_div.find('ul.acomment-container li').size(); 1214 1215 // Recursive replies within the current top-most activity item 1216 var comment_replies = comments_div.children('ul.acomment-container').children('li'); 1217 1218 // If the total number of replies is greater than the large threshold, start the hiding process 1219 if ( comment_replies_total > large_threshold ) { 1220 1221 // Loop through each top level reply and possibly hide the children 1222 comment_replies.each( function() { 1223 var this_reply = jq(this); 1224 1225 // Get the replies objects and the count of them 1226 var comment_nested_replies = this_reply.children('ul.acomment-container').children('li'); 1227 var comment_nested_replies_count = this_reply.find('ul.acomment-container li').size(); 1228 1229 // There are enough immediate replies to hide some 1230 if ( comment_nested_replies_count > small_threshold ) { 1231 1232 // Inject a 'Show X replies' link in the top level reply 1233 comment_nested_replies.before( '<div class="show-hidden"><a href="/show-all/#' + comment_replies.attr( 'id' ) + '" title="' + BP_DTheme.show_all_comments + '">' + BP_DTheme.show_all + ' ' + comment_nested_replies_count + ' ' + BP_DTheme.comments + '</a></div>' ); 1234 1235 // Loop through nested replies and hide them 1236 comment_nested_replies.each( function() { 1237 var nested_reply = jq(this); 1238 1239 nested_reply.addClass('hidden'); 1240 nested_reply.toggle(); 1241 }); 1242 } 1243 }); 1244 } 1245 }); 1246 } 1247 1248 /* Hide long lists of activity comments, only show the latest five root comments. */ 1249 function bp_dtheme_hide_comments_old() { 1185 1250 var comments_divs = jq('div.activity-comments'); 1186 1251 1187 1252 if ( !comments_divs.length ) … … 1205 1270 jq(this).toggle(); 1206 1271 1207 1272 if ( !i ) 1208 jq(this).before( '<li class="show- all"><a href="#' + parent_li.attr('id') + '/show-all/" title="' + BP_DTheme.show_all_comments + '">' + BP_DTheme.show_all + ' ' + comment_count + ' ' + BP_DTheme.comments + '</a></li>' );1273 jq(this).before( '<li class="show-hidden"><a href="#' + parent_li.attr('id') + '/show-all/" title="' + BP_DTheme.show_all_comments + '">' + BP_DTheme.show_all + ' ' + comment_count + ' ' + BP_DTheme.comments + '</a></li>' ); 1209 1274 } 1210 1275 }); 1211 1276 -
bp-themes/bp-default/functions.php
27 27 'accepted' => __( 'Accepted', 'buddypress' ), 28 28 'rejected' => __( 'Rejected', 'buddypress' ), 29 29 'show_all_comments' => __( 'Show all comments for this thread', 'buddypress' ), 30 'show_all' => __( 'Show all', 'buddypress' ),31 'comments' => __( ' comments', 'buddypress' ),30 'show_all' => __( 'Show', 'buddypress' ), 31 'comments' => __( 'replies', 'buddypress' ), 32 32 'close' => __( 'Close', 'buddypress' ), 33 33 'mention_explain' => sprintf( __( "%s is a unique identifier for %s that you can type into any message on this site. %s will be sent a notification and a link to your message any time you use it.", 'buddypress' ), '@' . bp_get_displayed_user_username(), bp_get_user_firstname( bp_get_displayed_user_fullname() ), bp_get_user_firstname( bp_get_displayed_user_fullname() ) ) 34 34 );