Skip to:
Content

BuddyPress.org

Ticket #2587: buy-me-toys.diff

File buy-me-toys.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                        }, 600 );
     443
     444                        return false;
     445                }
    433446        });
    434447
    435448        /* Escape Key Press for cancelling comment forms */
     
    11801193        }, 'json' );
    11811194}
    11821195
    1183 /* Hide long lists of activity comments, only show the latest five root comments. */
    11841196function bp_dtheme_hide_comments() {
     1197
     1198        // Set thresholds for when 'More' clickables will appear'
     1199        var large_threshold = 10;
     1200        var small_threshold = 1;
     1201
     1202        // Check for activity comments
     1203        var comments_divs   = jq('div.activity-comments');
     1204
     1205        // Loop through each div.activity-comments
     1206        comments_divs.each( function(i) {
     1207
     1208                // The top-most parent activity div in a hierarchy
     1209                var comments_div  = jq(this);
     1210
     1211                // Recursive replies within the current top-most activity item
     1212                //var comment_replies       = comments_div.children('li');
     1213                var comment_replies       = comments_div.children('ul.acomment-container').children('li');
     1214               
     1215                var comment_replies_count = comment_replies.size();
     1216                var comment_replies_total = comment_replies.find('ul.acomment-container li').size();
     1217               
     1218                // There are enough immediate replies to hide some
     1219                comment_replies.each( function() {
     1220                        var this_reply = jq(this);
     1221
     1222                        var comment_nested_replies       = this_reply.children('ul.acomment-container').children('li');
     1223                        var comment_nested_replies_count = this_reply.find('ul.acomment-container li').size();
     1224
     1225                        comment_nested_replies.before( '<div class="show-hidden"><a href="#' + comment_replies.parent( 'li' ).attr( 'id' ) + '/show-all/" title="' + BP_DTheme.show_all_comments + '">' + BP_DTheme.show_all + ' ' + comment_nested_replies_count + ' ' + BP_DTheme.comments + '</a></div>' );
     1226
     1227                        comment_nested_replies.each( function() {
     1228                                var nested_reply = jq(this);
     1229
     1230                                nested_reply.addClass('hidden');
     1231                                nested_reply.toggle();
     1232                        });
     1233                });
     1234        });
     1235}
     1236
     1237/* Hide long lists of activity comments, only show the latest five root comments. */
     1238function bp_dtheme_hide_comments_old() {
    11851239        var comments_divs = jq('div.activity-comments');
    11861240
    11871241        if ( !comments_divs.length )
     
    12051259                                jq(this).toggle();
    12061260
    12071261                                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>' );
     1262                                        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>' );
    12091263                        }
    12101264                });
    12111265
  • 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'          => __( 'more', '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);