Skip to:
Content

BuddyPress.org

Changeset 2423


Ignore:
Timestamp:
01/24/2010 02:38:08 PM (16 years ago)
Author:
apeatling
Message:

Ajax loader and activity stream ajax minor fixes.

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-core/bp-core-templatetags.php

    r2422 r2423  
    485485                        $link = $bp->displayed_user->domain . $user_nav_item['link'];
    486486
    487                 echo apply_filters( 'bp_get_displayed_user_nav_' . $user_nav_item['css_id'], '<li id="' . $user_nav_item['css_id'] . '-personal" ' . $selected . '><a id="user-' . $user_nav_item['css_id'] . '" href="' . $link . '">' . $user_nav_item['name'] . '</a></li>', &$user_nav_item );
     487                echo apply_filters( 'bp_get_displayed_user_nav_' . $user_nav_item['css_id'], '<li id="' . $user_nav_item['css_id'] . '-personal-li" ' . $selected . '><a id="user-' . $user_nav_item['css_id'] . '" href="' . $link . '">' . $user_nav_item['name'] . '</a></li>', &$user_nav_item );
    488488        }
    489489}
  • trunk/bp-themes/bp-default/_inc/ajax.php

    r2422 r2423  
    166166add_action( 'wp_ajax_delete_activity', 'bp_dtheme_delete_activity' );
    167167
    168 function bp_dtheme_activity_loop( $type = 'all', $filter = false, $query_string = false, $per_page = 20, $page = 1 ) {
     168function bp_dtheme_activity_loop( $scope = 'all', $filter = false, $query_string = false, $per_page = 20, $page = 1 ) {
    169169        global $bp;
    170170
     
    174174                        $query_string = 'user_id=' . $bp->displayed_user->id;
    175175                } else {
    176                         /* Make sure a type is set. */
    177                         if ( empty($type) )
     176                        /* Make sure a scope is set. */
     177                        if ( empty($scope) )
    178178                                $type = 'all';
    179179
    180180                        $feed_url = site_url( BP_ACTIVITY_SLUG . '/feed/' );
    181181
    182                         switch ( $type ) {
     182                        switch ( $scope ) {
    183183                                case 'friends':
    184184                                        $friend_ids = implode( ',', friends_get_friend_user_ids( $bp->loggedin_user->id ) );
     
    229229
    230230                /* Add the comments param */
    231                 if ( $bp->displayed_user->id || 'atme' == $type )
     231                if ( $bp->displayed_user->id || 'atme' == $scope )
    232232                        $query_string .= '&display_comments=stream';
    233233                else
     
    243243        $query_string = implode( '&', $new_args ) . '&page=' . $page;
    244244
    245         $bp->ajax_querystring = apply_filters( 'bp_dtheme_ajax_querystring_activity_filter', $query_string, $type );
     245        $bp->ajax_querystring = apply_filters( 'bp_dtheme_ajax_querystring_activity_filter', $query_string, $scope );
    246246        $result['query_string'] = $bp->ajax_querystring;
    247247        $result['feed_url'] = apply_filters( 'bp_dtheme_ajax_feed_url', $feed_url );
     
    257257
    258258function bp_dtheme_ajax_widget_filter() {
    259         bp_dtheme_activity_loop( $_POST['type'], $_POST['filter'] );
     259        bp_dtheme_activity_loop( $_POST['scope'], $_POST['filter'] );
    260260}
    261261add_action( 'wp_ajax_activity_widget_filter', 'bp_dtheme_ajax_widget_filter' );
  • trunk/bp-themes/bp-default/_inc/css/default.css

    r2412 r2423  
    604604}
    605605
    606 /* > AJAX Loaders
    607 -------------------------------------------------------------- */
    608 
    609 .ajax-loader {
    610         background: url( ../images/ajax-loader.gif ) center left no-repeat !important;
    611         padding: 8px;
    612         display: none;
    613 }
    614 
    615 a.loading {
    616         background-image: url( ../images/ajax-loader.gif );
    617         background-position: 95% 50%;
    618         padding-right: 25px;
    619         background-repeat: no-repeat;
    620 }
    621 
    622606/* > Buttons
    623607-------------------------------------------------------------- */
     
    666650        }
    667651
     652/* > AJAX Loaders
     653-------------------------------------------------------------- */
     654
     655.ajax-loader {
     656        background: url( ../images/ajax-loader.gif ) center left no-repeat !important;
     657        padding: 8px;
     658        display: none;
     659}
     660
     661a.loading {
     662        background-image: url( ../images/ajax-loader.gif ) !important;
     663        background-position: 95% 50% !important;
     664        background-repeat: no-repeat !important;
     665        padding-right: 25px !important;
     666}
     667
    668668/* > Input Forms
    669669-------------------------------------------------------------- */
  • trunk/bp-themes/bp-default/_inc/global.js

    r2422 r2423  
    88        /* Activity */
    99        if ( j('div.activity').length && !j('div.activity').hasClass('no-ajax') )
    10                 bp_activity_request( j.cookie('bp-activity-type'), j.cookie('bp-activity-filter') );
     10                bp_activity_request( j.cookie('bp-activity-scope'), j.cookie('bp-activity-filter') );
    1111
    1212        /* Members */
     
    104104
    105105                /* Activity Stream Tabs */
    106                 var type = target.attr('id').substr( 9, target.attr('id').length );
     106                var scope = target.attr('id').substr( 9, target.attr('id').length );
    107107                var filter = j("#activity-filter-select select").val();
    108108
    109                 if ( type == 'atme' )
     109                if ( scope == 'atme' )
    110110                        j( 'li#' + target.attr('id') + ' a strong' ).remove();
    111111
    112                 bp_activity_request(type, filter, target);
     112                bp_activity_request(scope, filter, target);
    113113
    114114                return false;
     
    120120
    121121                if ( !selected_tab.length )
    122                         var type = 'all';
     122                        var scope = 'all';
    123123                else
    124                         var type = selected_tab.attr('id').substr( 9, selected_tab.attr('id').length );
     124                        var scope = selected_tab.attr('id').substr( 9, selected_tab.attr('id').length );
    125125
    126126                var filter = j(this).val();
    127127
    128                 bp_activity_request(type, filter);
     128                bp_activity_request(scope, filter);
    129129
    130130                return false;
     
    245245
    246246        /* Activity Loop Requesting */
    247         function bp_activity_request(type, filter) {
    248                 if ( null == type )
    249                         var type = 'all';
     247        function bp_activity_request(scope, filter) {
     248                if ( null == scope )
     249                        var scope = 'all';
    250250
    251251                if ( null == filter )
     
    253253
    254254                /* Save the type and filter to a session cookie */
    255                 j.cookie( 'bp-activity-type', type, null );
     255                j.cookie( 'bp-activity-scope', scope, null );
    256256                j.cookie( 'bp-activity-filter', filter, null );
    257257                j.cookie( 'bp-activity-oldestpage', 1 );
     
    261261                        j(this).removeClass('selected');
    262262                });
    263                 j('li#activity-' + type + ', div.item-list-tabs li.current').addClass('selected');
     263                j('li#activity-' + scope + ', div.item-list-tabs li.current').addClass('selected');
    264264                j('div.item-list-tabs li.selected').addClass('loading');
    265265                j('#activity-filter-select select option[value=' + filter + ']').attr( 'selected', 'selected' );
     
    272272                        'cookie': encodeURIComponent(document.cookie),
    273273                        '_wpnonce_activity_filter': j("input#_wpnonce_activity_filter").val(),
    274                         'type': type,
     274                        'scope': scope,
    275275                        'filter': filter
    276276                },
Note: See TracChangeset for help on using the changeset viewer.