Skip to:
Content

BuddyPress.org

Ticket #2587: buy-me-toys.2.diff

File buy-me-toys.2.diff, 4.5 KB (added by johnjamesjacoby, 15 years ago)
  • _inc/css/default.css

     
    10211021/* > Activity Stream Listing
    10221022-------------------------------------------------------------- */
    10231023
     1024div.show-hidden a {
     1025        position: absolute;
     1026        right: 0;
     1027        top: 7px;
     1028        font-size: .9em;
     1029        background-color: #eee;
     1030        text-decoration: none;
     1031        padding: 3px 6px;
     1032}
     1033
    10241034ul.activity-list li {
    10251035        padding: 20px 0 0 0;
    10261036        overflow: hidden;
  • _inc/global.js

     
    430430
    431431                        return false;
    432432                }
     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').slideDown(200, function() {
     440                                        target.parent().parent().find('.show-hidden').fadeOut( 200 );
     441                                });
     442                                jq.scrollTo( target.parent().parent().parent(), 500, { offset: -40, easing: 'easeout' } );
     443                        }, 600 );
     444
     445                        return false;
     446                }
    433447        });
    434448
    435449        /* Escape Key Press for cancelling comment forms */
     
    11801194        }, 'json' );
    11811195}
    11821196
    1183 /* Hide long lists of activity comments, only show the latest five root comments. */
    11841197function bp_dtheme_hide_comments() {
     1198
     1199        // Set thresholds for when 'More' clickables will appear'
     1200        var large_threshold = 10;
     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                // Recursive replies within the current top-most activity item
     1213                //var comment_replies       = comments_div.children('li');
     1214                var comment_replies       = comments_div.children('ul.acomment-container').children('li');
     1215               
     1216                var comment_replies_count = comment_replies.size();
     1217                var comment_replies_total = comment_replies.find('ul.acomment-container li').size();
     1218               
     1219                // There are enough immediate replies to hide some
     1220                comment_replies.each( function() {
     1221                        var this_reply = jq(this);
     1222
     1223                        var comment_nested_replies       = this_reply.children('ul.acomment-container').children('li');
     1224                        var comment_nested_replies_count = this_reply.find('ul.acomment-container li').size();
     1225
     1226                        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>' );
     1227
     1228                        comment_nested_replies.each( function() {
     1229                                var nested_reply = jq(this);
     1230
     1231                                nested_reply.addClass('hidden');
     1232                                nested_reply.toggle();
     1233                        });
     1234                });
     1235        });
     1236}
     1237
     1238/* Hide long lists of activity comments, only show the latest five root comments. */
     1239function bp_dtheme_hide_comments_old() {
    11851240        var comments_divs = jq('div.activity-comments');
    11861241
    11871242        if ( !comments_divs.length )
     
    12051260                                jq(this).toggle();
    12061261
    12071262                                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>' );
     1263                                        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>' );
    12091264                        }
    12101265                });
    12111266
  • functions.php

     
    2727        'accepted'          => __( 'Accepted', 'buddypress' ),
    2828        'rejected'          => __( 'Rejected', 'buddypress' ),
    2929        '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' ),
    3232        'close'             => __( 'Close', 'buddypress' ),
    3333        '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() ) )
    3434);