<!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" />
<title>[BuddyPress][12255] trunk/src/bp-templates/bp-legacy: bp-legacy: Disable cookie-based directory filter "preferences" for logged-out users.</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { 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 { white-space: pre-line; overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#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>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="http://buddypress.trac.wordpress.org/changeset/12255">12255</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"http://buddypress.trac.wordpress.org/changeset/12255","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>boonebgorges</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2018-10-20 14:38:18 +0000 (Sat, 20 Oct 2018)</dd>
</dl>
<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>bp-legacy: Disable cookie-based directory filter "preferences" for logged-out users.
Logged-out users who refresh the page will see the filters reset to their
default values, rather than the last-used value. Logged-in users continue
to have their preferences saved in a cookie.
This behavior is configurable with the `'bp_legacy_store_filter_settings'`
filter.
See <a href="http://buddypress.trac.wordpress.org/ticket/7856">#7856</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcbptemplatesbplegacybuddypressfunctionsphp">trunk/src/bp-templates/bp-legacy/buddypress-functions.php</a></li>
<li><a href="#trunksrcbptemplatesbplegacyjsbuddypressjs">trunk/src/bp-templates/bp-legacy/js/buddypress.js</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcbptemplatesbplegacybuddypressfunctionsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/bp-templates/bp-legacy/buddypress-functions.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/bp-templates/bp-legacy/buddypress-functions.php 2018-10-15 20:39:16 UTC (rev 12254)
+++ trunk/src/bp-templates/bp-legacy/buddypress-functions.php 2018-10-20 14:38:18 UTC (rev 12255)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -283,6 +283,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Filters whether directory filter settings ('scope', etc) should be stored in a persistent cookie.
+ *
+ * @since 4.0.0
+ *
+ * @param bool $store_filter_settings Whether to store settings. Defaults to true for logged-in users.
+ */
+ $store_filter_settings = apply_filters( 'bp_legacy_store_filter_settings', is_user_logged_in() );
+
+ /**
</ins><span class="cx" style="display: block; padding: 0 10px"> * Filters core JavaScript strings for internationalization before AJAX usage.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.0.0
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -290,6 +299,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param array $value Array of key/value pairs for AJAX usage.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> $params = apply_filters( 'bp_core_get_js_strings', array(
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Strings for display.
</ins><span class="cx" style="display: block; padding: 0 10px"> 'accepted' => __( 'Accepted', 'buddypress' ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'close' => __( 'Close', 'buddypress' ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'comments' => __( 'comments', 'buddypress' ),
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -303,6 +313,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'show_x_comments' => __( 'Show all comments (%d)', 'buddypress' ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'unsaved_changes' => __( 'Your profile has unsaved changes. If you leave the page, the changes will be lost.', 'buddypress' ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'view' => __( 'View', 'buddypress' ),
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ // Settings.
+ 'store_filter_settings' => $store_filter_settings,
</ins><span class="cx" style="display: block; padding: 0 10px"> ) );
</span><span class="cx" style="display: block; padding: 0 10px"> wp_localize_script( $asset['handle'], 'BP_DTheme', $params );
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunksrcbptemplatesbplegacyjsbuddypressjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/bp-templates/bp-legacy/js/buddypress.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/bp-templates/bp-legacy/js/buddypress.js 2018-10-15 20:39:16 UTC (rev 12254)
+++ trunk/src/bp-templates/bp-legacy/js/buddypress.js 2018-10-20 14:38:18 UTC (rev 12255)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -10,6 +10,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> var newest_activities = '';
</span><span class="cx" style="display: block; padding: 0 10px"> var activity_last_recorded = 0;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+var directoryPreferences = {}
+
</ins><span class="cx" style="display: block; padding: 0 10px"> jq(document).ready( function() {
</span><span class="cx" style="display: block; padding: 0 10px"> var activity_oldestpage = 1;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -848,8 +850,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> template = 'groups/single/members';
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- bp_filter_request( object, jq.cookie('bp-' + object + '-filter'), jq.cookie('bp-' + object + '-scope') , 'div.' + object, search_terms, 1, jq.cookie('bp-' + object + '-extras'), null, template );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var scope = bp_get_directory_preference( object, 'scope' );
+ var filter = bp_get_directory_preference( object, 'filter' );
+ var extras = bp_get_directory_preference( object, 'extras' );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ bp_filter_request( object, filter, scope, 'div.' + object, search_terms, 1, extras, null, template );
+
</ins><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> });
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -883,8 +889,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> filter = jq('#' + object + '-order-select select').val();
</span><span class="cx" style="display: block; padding: 0 10px"> search_terms = jq('#' + object + '_search').val();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- bp_filter_request( object, filter, scope, 'div.' + object, search_terms, 1, jq.cookie('bp-' + object + '-extras') );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var extras = bp_get_directory_preference( object, 'extras' );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ bp_filter_request( object, filter, scope, 'div.' + object, search_terms, 1, extras );
+
</ins><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> });
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -931,8 +939,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> object = 'members';
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- bp_filter_request( object, filter, scope, 'div.' + object, search_terms, 1, jq.cookie('bp-' + object + '-extras'), null, template );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var extras = bp_get_directory_preference( object, 'extras' );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ bp_filter_request( object, filter, scope, 'div.' + object, search_terms, 1, extras, null, template );
+
</ins><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="cx" style="display: block; padding: 0 10px"> });
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1019,8 +1029,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> caller = null;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- bp_filter_request( object, jq.cookie('bp-' + object + '-filter'), jq.cookie('bp-' + object + '-scope'), 'div.' + object, search_terms, page_number, jq.cookie('bp-' + object + '-extras'), caller, template );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var scope = bp_get_directory_preference( object, 'scope' );
+ var filter = bp_get_directory_preference( object, 'filter' );
+ var extras = bp_get_directory_preference( object, 'extras' );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ bp_filter_request( object, filter, scope, 'div.' + object, search_terms, page_number, extras, caller, template );
+
</ins><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1387,13 +1401,17 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( target.attr('type') === 'submit' || target.attr('type') === 'button' ) {
</span><span class="cx" style="display: block; padding: 0 10px"> object = 'messages';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var scope = bp_get_directory_preference( object, 'scope' );
+ var filter = bp_get_directory_preference( object, 'filter' );
+ var extras = bp_get_directory_preference( object, 'extras' );
+
</ins><span class="cx" style="display: block; padding: 0 10px"> bp_filter_request(
</span><span class="cx" style="display: block; padding: 0 10px"> object,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- jq.cookie('bp-' + object + '-filter'),
- jq.cookie('bp-' + object + '-scope'),
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ filter,
+ scope,
</ins><span class="cx" style="display: block; padding: 0 10px"> 'div.' + object, jq('#messages_search').val(),
</span><span class="cx" style="display: block; padding: 0 10px"> 1,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- jq.cookie('bp-' + object + '-extras')
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ extras
</ins><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1723,18 +1741,78 @@
</span><span class="cx" style="display: block; padding: 0 10px"> });
</span><span class="cx" style="display: block; padding: 0 10px"> });
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/**
+ * Gets the user's current preference for a directory option.
+ */
+function bp_get_directory_preference( directoryType, pref ) {
+ var defaultPrefs = {
+ filter: '',
+ scope: '',
+ extras: ''
+ }
+
+ if ( ! directoryPreferences.hasOwnProperty( directoryType ) ) {
+ var newPreferences = {};
+ for ( var prefName in defaultPrefs ) {
+ if ( defaultPrefs.hasOwnProperty( prefName ) ) {
+ newPreferences[ prefName ] = defaultPrefs[ prefName ];
+ }
+ }
+ directoryPreferences[ directoryType ] = newPreferences;
+ }
+
+ if ( BP_DTheme.store_filter_settings ) {
+ directoryPreferences[ directoryType ][ pref ] = jq.cookie( 'bp-' + directoryType + '-' + pref );
+ }
+
+ return directoryPreferences[ directoryType ][ pref ];
+}
+
+/**
+ * Sets the user's current preference for a directory option.
+ */
+function bp_set_directory_preference( directoryType, pref, value ) {
+ var defaultPrefs = {
+ filter: '',
+ scope: '',
+ extras: ''
+ }
+
+ if ( ! directoryPreferences.hasOwnProperty( directoryType ) ) {
+ var newPreferences = {};
+ for ( var prefName in defaultPrefs ) {
+ if ( defaultPrefs.hasOwnProperty( prefName ) ) {
+ newPreferences[ prefName ] = defaultPrefs[ prefName ];
+ }
+ }
+ directoryPreferences[ directoryType ] = newPreferences;
+ }
+
+ if ( BP_DTheme.store_filter_settings ) {
+ jq.cookie( 'bp-' + directoryType + '-' + pref, value, {
+ path: '/',
+ secure: ( 'https:' === window.location.protocol )
+ } );
+ }
+
+ directoryPreferences[ directoryType ][ pref ] = value
+}
+
</ins><span class="cx" style="display: block; padding: 0 10px"> /* Setup activity scope and filter based on the current cookie settings. */
</span><span class="cx" style="display: block; padding: 0 10px"> function bp_init_activity() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( undefined !== jq.cookie('bp-activity-filter') && jq('#activity-filter-select').length ) {
- jq('#activity-filter-select select option[value="' + jq.cookie('bp-activity-filter') + '"]').prop( 'selected', true );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var scope = bp_get_directory_preference( 'activity', 'scope' );
+ var filter = bp_get_directory_preference( 'activity', 'filter' );
+
+ if ( undefined !== filter && jq('#activity-filter-select').length ) {
+ jq('#activity-filter-select select option[value="' + filter + '"]').prop( 'selected', true );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /* Activity Tab Set */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( undefined !== jq.cookie('bp-activity-scope') && jq('.activity-type-tabs').length ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( undefined !== scope && jq('.activity-type-tabs').length ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> jq('.activity-type-tabs li').each( function() {
</span><span class="cx" style="display: block; padding: 0 10px"> jq(this).removeClass('selected');
</span><span class="cx" style="display: block; padding: 0 10px"> });
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- jq('#activity-' + jq.cookie('bp-activity-scope') + ', .item-list-tabs li.current').addClass('selected');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ jq('#activity-' + scope + ', .item-list-tabs li.current').addClass('selected');
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1741,15 +1819,18 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /* Setup object scope and filter based on the current cookie settings for the object. */
</span><span class="cx" style="display: block; padding: 0 10px"> function bp_init_objects(objects) {
</span><span class="cx" style="display: block; padding: 0 10px"> jq(objects).each( function(i) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( undefined !== jq.cookie('bp-' + objects[i] + '-filter') && jq('#' + objects[i] + '-order-select select').length ) {
- jq('#' + objects[i] + '-order-select select option[value="' + jq.cookie('bp-' + objects[i] + '-filter') + '"]').prop( 'selected', true );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var scope = bp_get_directory_preference( objects[i], 'scope' );
+ var filter = bp_get_directory_preference( objects[i], 'filter' );
+
+ if ( undefined !== filter && jq('#' + objects[i] + '-order-select select').length ) {
+ jq('#' + objects[i] + '-order-select select option[value="' + filter + '"]').prop( 'selected', true );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( undefined !== jq.cookie('bp-' + objects[i] + '-scope') && jq('div.' + objects[i]).length ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( undefined !== scope && jq('div.' + objects[i]).length ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> jq('.item-list-tabs li').each( function() {
</span><span class="cx" style="display: block; padding: 0 10px"> jq(this).removeClass('selected');
</span><span class="cx" style="display: block; padding: 0 10px"> });
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- jq('#' + objects[i] + '-' + jq.cookie('bp-' + objects[i] + '-scope') + ', #object-nav li.current').addClass('selected');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ jq('#' + objects[i] + '-' + scope + ', #object-nav li.current').addClass('selected');
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> });
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1764,19 +1845,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> scope = 'all';
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- /* Save the settings we want to remain persistent to a cookie */
- jq.cookie( 'bp-' + object + '-scope', scope, {
- path: '/',
- secure: ( 'https:' === window.location.protocol )
- } );
- jq.cookie( 'bp-' + object + '-filter', filter, {
- path: '/',
- secure: ( 'https:' === window.location.protocol )
- } );
- jq.cookie( 'bp-' + object + '-extras', extras, {
- path: '/',
- secure: ( 'https:' === window.location.protocol )
- } );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /* Save the settings we want to remain persistent */
+ bp_set_directory_preference( object, 'scope', scope );
+ bp_set_directory_preference( object, 'filter', filter );
+ bp_set_directory_preference( object, 'extras', extras );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /* Set the correct selected nav and filter */
</span><span class="cx" style="display: block; padding: 0 10px"> jq('.item-list-tabs li').each( function() {
</span></span></pre>
</div>
</div>
</body>
</html>