<!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] [2477] trunk/bp-themes/bp-default: JS fixes for extensibility.</title>
</head>
<body>
<div id="msg">
<dl>
<dt>Revision</dt> <dd>2477</dd>
<dt>Author</dt> <dd>apeatling</dd>
<dt>Date</dt> <dd>2010-01-29 15:56:45 +0000 (Fri, 29 Jan 2010)</dd>
</dl>
<h3>Log Message</h3>
<pre>JS fixes for extensibility.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkbpthemesbpdefault_incglobaljs">trunk/bp-themes/bp-default/_inc/global.js</a></li>
<li><a href="#trunkbpthemesbpdefaultfunctionsphp">trunk/bp-themes/bp-default/functions.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkbpthemesbpdefault_incglobaljs"></a>
<div class="modfile"><h4>Modified: trunk/bp-themes/bp-default/_inc/global.js (2476 => 2477)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-themes/bp-default/_inc/global.js        2010-01-29 14:56:12 UTC (rev 2476)
+++ trunk/bp-themes/bp-default/_inc/global.js        2010-01-29 15:56:45 UTC (rev 2477)
</span><span class="lines">@@ -17,20 +17,20 @@
</span><span class="cx">
</span><span class="cx">         /* Members */
</span><span class="cx">         if ( j('div.members').length )
</span><del>-                bp_filter_request( 'members', j.cookie('bp-members-filter'), j.cookie('bp-members-scope'), 'div.members' );
</del><ins>+                bp_filter_request( 'members', j.cookie('bp-members-filter'), j.cookie('bp-members-scope'), 'div.members', false, 1, j.cookie('bp-members-extras') );
</ins><span class="cx">
</span><span class="cx">         /* Groups */
</span><span class="cx">         if ( j('div.groups').length )
</span><del>-                bp_filter_request( 'groups', j.cookie('bp-groups-filter'), j.cookie('bp-groups-scope'), 'div.groups' );
</del><ins>+                bp_filter_request( 'groups', j.cookie('bp-groups-filter'), j.cookie('bp-groups-scope'), 'div.groups', false, 1, j.cookie('bp-groups-extras') );
</ins><span class="cx">
</span><span class="cx">         /* Blogs */
</span><span class="cx">         if ( j('div.blogs').length )
</span><del>-                bp_filter_request( 'blogs', j.cookie('bp-blogs-filter'), j.cookie('bp-blogs-scope'), 'div.blogs' );
</del><ins>+                bp_filter_request( 'blogs', j.cookie('bp-blogs-filter'), j.cookie('bp-blogs-scope'), 'div.blogs', false, 1, j.cookie('bp-blogs-extras') );
</ins><span class="cx">
</span><span class="cx">         /* Forums */
</span><span class="cx">         if ( j('div.forums').length ) {
</span><span class="cx">                 j('div#new-topic-post').hide();
</span><del>-                bp_filter_request( 'forums', j.cookie('bp-forums-filter'), j.cookie('bp-forums-scope'), 'div.forums' );
</del><ins>+                bp_filter_request( 'forums', j.cookie('bp-forums-filter'), j.cookie('bp-forums-scope'), 'div.forums', false, 1, j.cookie('bp-forums-extras') );
</ins><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         /* @mention Compose Scrolling */
</span><span class="lines">@@ -452,22 +452,28 @@
</span><span class="cx">         /**** @mention username help tooltip **************************************/
</span><span class="cx">
</span><span class="cx">         j('span.highlight span').click( function() {
</span><del>-                j('div.help').remove();
-                j(this).parent().after( '<div id="message" class="info help"><p>' + bp_mention_explain + '</p></div>' );
-                j('div.help').hide().slideDown(200);
</del><ins>+                if ( !j('div.help').length ) {
+                        j(this).parent().after( '<div id="message" class="info help"><p>' + bp_terms_mention_explain + '</p></div>' );
+                        j('div.help').hide().slideDown(200);
+                } else {
+                        j('div.help').hide().remove();
+                }
</ins><span class="cx">         })
</span><span class="cx">
</span><span class="cx">         /**** Directory Search ****************************************************/
</span><span class="cx">
</span><span class="cx">         /* The search form on all directory pages */
</span><span class="cx">         j('div.dir-search').click( function(event) {
</span><ins>+                if ( j(this).hasClass('no-ajax') )
+                        return false;
+
</ins><span class="cx">                 var target = j(event.target);
</span><span class="cx">
</span><span class="cx">                 if ( target.attr('type') == 'submit' ) {
</span><span class="cx">                         var css_id = j('div.item-list-tabs li.selected').attr('id').split( '-' );
</span><span class="cx">                         var object = css_id[0];
</span><span class="cx">
</span><del>-                        bp_filter_request( object, j.cookie('bp-' + object + '-filter'), j.cookie('bp-' + object + '-scope') , 'div.' + object, target.parent().children('label').children('input').val(), 1 );
</del><ins>+                        bp_filter_request( object, j.cookie('bp-' + object + '-filter'), j.cookie('bp-' + object + '-scope') , 'div.' + object, target.parent().children('label').children('input').val(), 1, j.cookie('bp-' + object + '-extras') );
</ins><span class="cx">                 }
</span><span class="cx">
</span><span class="cx">                 return false;
</span><span class="lines">@@ -499,7 +505,7 @@
</span><span class="cx">                         });
</span><span class="cx">                         j('li#' + object + '-' + filter).addClass('selected');
</span><span class="cx">
</span><del>-                        bp_filter_request( object, filter, scope, 'div.' + object, search_terms, 1 );
</del><ins>+                        bp_filter_request( object, filter, scope, 'div.' + object, search_terms, 1, j.cookie('bp-' + object + '-extras') );
</ins><span class="cx">
</span><span class="cx">                         return false;
</span><span class="cx">                 }
</span><span class="lines">@@ -518,7 +524,7 @@
</span><span class="cx">                 var filter = j(this).val();
</span><span class="cx">                 var search_terms = j("#" + object + "_search").val();
</span><span class="cx">
</span><del>-                bp_filter_request( object, filter, scope, 'div.' + object, search_terms, 1 );
</del><ins>+                bp_filter_request( object, filter, scope, 'div.' + object, search_terms, 1, j.cookie('bp-' + object + '-extras') );
</ins><span class="cx">
</span><span class="cx">                 return false;
</span><span class="cx">         });
</span><span class="lines">@@ -547,7 +553,7 @@
</span><span class="cx">                         else
</span><span class="cx">                                 var page_number = Number( j(target).html() );
</span><span class="cx">
</span><del>-                        bp_filter_request( object, j.cookie('bp-' + object + '-filter'), j.cookie('bp-' + object + '-scope'), 'div.' + object, j.cookie('bp-' + object + '-search-terms'), page_number );
</del><ins>+                        bp_filter_request( object, j.cookie('bp-' + object + '-filter'), j.cookie('bp-' + object + '-scope'), 'div.' + object, j.cookie('bp-' + object + '-search-terms'), page_number, j.cookie('bp-' + object + '-extras') );
</ins><span class="cx">
</span><span class="cx">                         return false;
</span><span class="cx">                 }
</span><span class="lines">@@ -580,7 +586,7 @@
</span><span class="cx">
</span><span class="cx">         /* Clicking a forum tag */
</span><span class="cx">         j('div#forum-directory-tags a').click( function() {
</span><del>-                bp_filter_request( 'forums', 'tags', j.cookie('bp-forums-scope'), 'div.forums', j(this).html(), 1 );
</del><ins>+                bp_filter_request( 'forums', 'tags', j.cookie('bp-forums-scope'), 'div.forums', j(this).html(), 1, j.cookie('bp-forums-extras') );
</ins><span class="cx">                 return false;
</span><span class="cx">         });
</span><span class="cx">
</span><span class="lines">@@ -994,6 +1000,7 @@
</span><span class="cx">         j.cookie( 'bp-' + object + '-filter', filter, null );
</span><span class="cx">         j.cookie( 'bp-' + object + '-page', page, null );
</span><span class="cx">         j.cookie( 'bp-' + object + '-search-terms', search_terms, null );
</span><ins>+        j.cookie( 'bp-' + object + '-extras', extras, null );
</ins><span class="cx">
</span><span class="cx">         /* Set the correct selected nav and filter */
</span><span class="cx">         j('div.item-list-tabs li').each( function() {
</span></span></pre></div>
<a id="trunkbpthemesbpdefaultfunctionsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-themes/bp-default/functions.php (2476 => 2477)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-themes/bp-default/functions.php        2010-01-29 14:56:12 UTC (rev 2476)
+++ trunk/bp-themes/bp-default/functions.php        2010-01-29 15:56:45 UTC (rev 2477)
</span><span class="lines">@@ -209,7 +209,8 @@
</span><span class="cx">         var bp_terms_show_all_comments = '<?php _e( "Show all comments for this thread", "buddypress" ) ?>';
</span><span class="cx">         var bp_terms_show_all = '<?php _e( "Show all", "buddypress" ) ?>';
</span><span class="cx">         var bp_terms_comments = '<?php _e( "comments", "buddypress" ) ?>';
</span><del>-        var bp_mention_explain = '<?php printf( __( "%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_dtheme_firstname(bp_get_displayed_user_fullname()), bp_dtheme_firstname(bp_get_displayed_user_fullname()) ); ?>';
</del><ins>+        var bp_terms_close = '<?php _e( "Close", "buddypress" ) ?>';
+        var bp_terms_mention_explain = '<?php printf( __( "%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_dtheme_firstname(bp_get_displayed_user_fullname()), bp_dtheme_firstname(bp_get_displayed_user_fullname()) ); ?>';
</ins><span class="cx">         </script>
</span><span class="cx"> <?php
</span><span class="cx"> }
</span></span></pre>
</div>
</div>
</body>
</html>