<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" /><style type="text/css"><!--
#msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fc0 solid; padding: 6px; }
#msg ul, pre { overflow: auto; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<title>[BuddyPress] [2423] trunk: Ajax loader and activity stream ajax minor fixes
.</title>
</head>
<body>
<div id="msg">
<dl>
<dt>Revision</dt> <dd>2423</dd>
<dt>Author</dt> <dd>apeatling</dd>
<dt>Date</dt> <dd>2010-01-24 14:38:08 +0000 (Sun, 24 Jan 2010)</dd>
</dl>
<h3>Log Message</h3>
<pre>Ajax loader and activity stream ajax minor fixes.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkbpcorebpcoretemplatetagsphp">trunk/bp-core/bp-core-templatetags.php</a></li>
<li><a href="#trunkbpthemesbpdefault_incajaxphp">trunk/bp-themes/bp-default/_inc/ajax.php</a></li>
<li><a href="#trunkbpthemesbpdefault_inccssdefaultcss">trunk/bp-themes/bp-default/_inc/css/default.css</a></li>
<li><a href="#trunkbpthemesbpdefault_incglobaljs">trunk/bp-themes/bp-default/_inc/global.js</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkbpcorebpcoretemplatetagsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-core/bp-core-templatetags.php (2422 => 2423)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-core/bp-core-templatetags.php        2010-01-24 14:29:57 UTC (rev 2422)
+++ trunk/bp-core/bp-core-templatetags.php        2010-01-24 14:38:08 UTC (rev 2423)
</span><span class="lines">@@ -484,7 +484,7 @@
</span><span class="cx">                 else
</span><span class="cx">                         $link = $bp->displayed_user->domain . $user_nav_item['link'];
</span><span class="cx">
</span><del>-                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 );
</del><ins>+                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 );
</ins><span class="cx">         }
</span><span class="cx"> }
</span><span class="cx">         /* DEPRECATED - use bp_get_displayed_user_nav() */
</span></span></pre></div>
<a id="trunkbpthemesbpdefault_incajaxphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-themes/bp-default/_inc/ajax.php (2422 => 2423)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-themes/bp-default/_inc/ajax.php        2010-01-24 14:29:57 UTC (rev 2422)
+++ trunk/bp-themes/bp-default/_inc/ajax.php        2010-01-24 14:38:08 UTC (rev 2423)
</span><span class="lines">@@ -165,7 +165,7 @@
</span><span class="cx"> add_action( 'wp_ajax_delete_activity_comment', 'bp_dtheme_delete_activity' );
</span><span class="cx"> add_action( 'wp_ajax_delete_activity', 'bp_dtheme_delete_activity' );
</span><span class="cx">
</span><del>-function bp_dtheme_activity_loop( $type = 'all', $filter = false, $query_string = false, $per_page = 20, $page = 1 ) {
</del><ins>+function bp_dtheme_activity_loop( $scope = 'all', $filter = false, $query_string = false, $per_page = 20, $page = 1 ) {
</ins><span class="cx">         global $bp;
</span><span class="cx">
</span><span class="cx">         if ( !$query_string ) {
</span><span class="lines">@@ -173,13 +173,13 @@
</span><span class="cx">                 if ( $bp->displayed_user->id ) {
</span><span class="cx">                         $query_string = 'user_id=' . $bp->displayed_user->id;
</span><span class="cx">                 } else {
</span><del>-                        /* Make sure a type is set. */
-                        if ( empty($type) )
</del><ins>+                        /* Make sure a scope is set. */
+                        if ( empty($scope) )
</ins><span class="cx">                                 $type = 'all';
</span><span class="cx">
</span><span class="cx">                         $feed_url = site_url( BP_ACTIVITY_SLUG . '/feed/' );
</span><span class="cx">
</span><del>-                        switch ( $type ) {
</del><ins>+                        switch ( $scope ) {
</ins><span class="cx">                                 case 'friends':
</span><span class="cx">                                         $friend_ids = implode( ',', friends_get_friend_user_ids( $bp->loggedin_user->id ) );
</span><span class="cx">                                         $query_string = 'user_id=' . $friend_ids;
</span><span class="lines">@@ -228,7 +228,7 @@
</span><span class="cx">                 $query_string .= '&per_page=' . $per_page;
</span><span class="cx">
</span><span class="cx">                 /* Add the comments param */
</span><del>-                if ( $bp->displayed_user->id || 'atme' == $type )
</del><ins>+                if ( $bp->displayed_user->id || 'atme' == $scope )
</ins><span class="cx">                         $query_string .= '&display_comments=stream';
</span><span class="cx">                 else
</span><span class="cx">                         $query_string .= '&display_comments=threaded';
</span><span class="lines">@@ -242,7 +242,7 @@
</span><span class="cx">         }
</span><span class="cx">         $query_string = implode( '&', $new_args ) . '&page=' . $page;
</span><span class="cx">
</span><del>-        $bp->ajax_querystring = apply_filters( 'bp_dtheme_ajax_querystring_activity_filter', $query_string, $type );
</del><ins>+        $bp->ajax_querystring = apply_filters( 'bp_dtheme_ajax_querystring_activity_filter', $query_string, $scope );
</ins><span class="cx">         $result['query_string'] = $bp->ajax_querystring;
</span><span class="cx">         $result['feed_url'] = apply_filters( 'bp_dtheme_ajax_feed_url', $feed_url );
</span><span class="cx">
</span><span class="lines">@@ -256,7 +256,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> function bp_dtheme_ajax_widget_filter() {
</span><del>-        bp_dtheme_activity_loop( $_POST['type'], $_POST['filter'] );
</del><ins>+        bp_dtheme_activity_loop( $_POST['scope'], $_POST['filter'] );
</ins><span class="cx"> }
</span><span class="cx"> add_action( 'wp_ajax_activity_widget_filter', 'bp_dtheme_ajax_widget_filter' );
</span><span class="cx">
</span></span></pre></div>
<a id="trunkbpthemesbpdefault_inccssdefaultcss"></a>
<div class="modfile"><h4>Modified: trunk/bp-themes/bp-default/_inc/css/default.css (2422 => 2423)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-themes/bp-default/_inc/css/default.css        2010-01-24 14:29:57 UTC (rev 2422)
+++ trunk/bp-themes/bp-default/_inc/css/default.css        2010-01-24 14:38:08 UTC (rev 2423)
</span><span class="lines">@@ -603,22 +603,6 @@
</span><span class="cx">         margin: 0 0 10px 0;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-/* > AJAX Loaders
--------------------------------------------------------------- */
-
-.ajax-loader {
-        background: url( ../images/ajax-loader.gif ) center left no-repeat !important;
-        padding: 8px;
-        display: none;
-}
-
-a.loading {
-        background-image: url( ../images/ajax-loader.gif );
-        background-position: 95% 50%;
-        padding-right: 25px;
-        background-repeat: no-repeat;
-}
-
</del><span class="cx"> /* > Buttons
</span><span class="cx"> -------------------------------------------------------------- */
</span><span class="cx">
</span><span class="lines">@@ -665,6 +649,22 @@
</span><span class="cx">                 font-weight: bold;
</span><span class="cx">         }
</span><span class="cx">
</span><ins>+/* > AJAX Loaders
+-------------------------------------------------------------- */
+
+.ajax-loader {
+        background: url( ../images/ajax-loader.gif ) center left no-repeat !important;
+        padding: 8px;
+        display: none;
+}
+
+a.loading {
+        background-image: url( ../images/ajax-loader.gif ) !important;
+        background-position: 95% 50% !important;
+        background-repeat: no-repeat !important;
+        padding-right: 25px !important;
+}
+
</ins><span class="cx"> /* > Input Forms
</span><span class="cx"> -------------------------------------------------------------- */
</span><span class="cx">
</span></span></pre></div>
<a id="trunkbpthemesbpdefault_incglobaljs"></a>
<div class="modfile"><h4>Modified: trunk/bp-themes/bp-default/_inc/global.js (2422 => 2423)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-themes/bp-default/_inc/global.js        2010-01-24 14:29:57 UTC (rev 2422)
+++ trunk/bp-themes/bp-default/_inc/global.js        2010-01-24 14:38:08 UTC (rev 2423)
</span><span class="lines">@@ -7,7 +7,7 @@
</span><span class="cx">
</span><span class="cx">         /* Activity */
</span><span class="cx">         if ( j('div.activity').length && !j('div.activity').hasClass('no-ajax') )
</span><del>-                bp_activity_request( j.cookie('bp-activity-type'), j.cookie('bp-activity-filter') );
</del><ins>+                bp_activity_request( j.cookie('bp-activity-scope'), j.cookie('bp-activity-filter') );
</ins><span class="cx">
</span><span class="cx">         /* Members */
</span><span class="cx">         if ( j('div.members').length )
</span><span class="lines">@@ -103,13 +103,13 @@
</span><span class="cx">                         return false;
</span><span class="cx">
</span><span class="cx">                 /* Activity Stream Tabs */
</span><del>-                var type = target.attr('id').substr( 9, target.attr('id').length );
</del><ins>+                var scope = target.attr('id').substr( 9, target.attr('id').length );
</ins><span class="cx">                 var filter = j("#activity-filter-select select").val();
</span><span class="cx">
</span><del>-                if ( type == 'atme' )
</del><ins>+                if ( scope == 'atme' )
</ins><span class="cx">                         j( 'li#' + target.attr('id') + ' a strong' ).remove();
</span><span class="cx">
</span><del>-                bp_activity_request(type, filter, target);
</del><ins>+                bp_activity_request(scope, filter, target);
</ins><span class="cx">
</span><span class="cx">                 return false;
</span><span class="cx">         });
</span><span class="lines">@@ -119,13 +119,13 @@
</span><span class="cx">                 var selected_tab = j( 'div.activity-type-tabs li.selected' );
</span><span class="cx">
</span><span class="cx">                 if ( !selected_tab.length )
</span><del>-                        var type = 'all';
</del><ins>+                        var scope = 'all';
</ins><span class="cx">                 else
</span><del>-                        var type = selected_tab.attr('id').substr( 9, selected_tab.attr('id').length );
</del><ins>+                        var scope = selected_tab.attr('id').substr( 9, selected_tab.attr('id').length );
</ins><span class="cx">
</span><span class="cx">                 var filter = j(this).val();
</span><span class="cx">
</span><del>-                bp_activity_request(type, filter);
</del><ins>+                bp_activity_request(scope, filter);
</ins><span class="cx">
</span><span class="cx">                 return false;
</span><span class="cx">         });
</span><span class="lines">@@ -244,15 +244,15 @@
</span><span class="cx">         });
</span><span class="cx">
</span><span class="cx">         /* Activity Loop Requesting */
</span><del>-        function bp_activity_request(type, filter) {
-                if ( null == type )
-                        var type = 'all';
</del><ins>+        function bp_activity_request(scope, filter) {
+                if ( null == scope )
+                        var scope = 'all';
</ins><span class="cx">
</span><span class="cx">                 if ( null == filter )
</span><span class="cx">                         var filter = '-1';
</span><span class="cx">
</span><span class="cx">                 /* Save the type and filter to a session cookie */
</span><del>-                j.cookie( 'bp-activity-type', type, null );
</del><ins>+                j.cookie( 'bp-activity-scope', scope, null );
</ins><span class="cx">                 j.cookie( 'bp-activity-filter', filter, null );
</span><span class="cx">                 j.cookie( 'bp-activity-oldestpage', 1 );
</span><span class="cx">
</span><span class="lines">@@ -260,7 +260,7 @@
</span><span class="cx">                 j('div.item-list-tabs li').each( function() {
</span><span class="cx">                         j(this).removeClass('selected');
</span><span class="cx">                 });
</span><del>-                j('li#activity-' + type + ', div.item-list-tabs li.current').addClass('selected');
</del><ins>+                j('li#activity-' + scope + ', div.item-list-tabs li.current').addClass('selected');
</ins><span class="cx">                 j('div.item-list-tabs li.selected').addClass('loading');
</span><span class="cx">                 j('#activity-filter-select select option[value=' + filter + ']').attr( 'selected', 'selected' );
</span><span class="cx">
</span><span class="lines">@@ -271,7 +271,7 @@
</span><span class="cx">                         action: 'activity_widget_filter',
</span><span class="cx">                         'cookie': encodeURIComponent(document.cookie),
</span><span class="cx">                         '_wpnonce_activity_filter': j("input#_wpnonce_activity_filter").val(),
</span><del>-                        'type': type,
</del><ins>+                        'scope': scope,
</ins><span class="cx">                         'filter': filter
</span><span class="cx">                 },
</span><span class="cx">                 function(response)
</span></span></pre>
</div>
</div>
</body>
</html>