Changeset 2555
- Timestamp:
- 02/03/2010 10:13:54 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-themes/bp-default/_inc/global.js
r2552 r2555 6 6 7 7 /* Activity Filter Select Set */ 8 if ( null != j.cookie('bp-activity-filter') && j('#activity-filter-select').length ) 9 j('#activity-filter-select select option[value=' + j.cookie('bp-activity-filter') + ']').attr( 'selected', 'selected' ); 10 11 /* Activity Tab Set */ 12 if ( null != j.cookie('bp-activity-scope') && j('div.item-list-tabs').length ) { 13 j('div.item-list-tabs li').each( function() { 14 j(this).removeClass('selected'); 15 }); 16 j('li#activity-' + j.cookie('bp-activity-scope') + ', div.item-list-tabs li.current').addClass('selected'); 17 } 8 bp_init_activity(); 18 9 19 10 /* Object filter and scope set. */ … … 115 106 return false; 116 107 108 /* Reset the page */ 109 j.cookie( 'bp-activity-oldestpage', 1, {path: '/'} ); 110 j.cookie( 'bp-activity-querystring', null, {path: '/'} ); 111 117 112 /* Activity Stream Tabs */ 118 113 var scope = target.attr('id').substr( 9, target.attr('id').length ); … … 244 239 j("li.load-more").removeClass('loading'); 245 240 246 j.cookie( 'bp-activity-querystring', response.query_string );247 j.cookie( 'bp-activity-oldestpage', oldest_page );241 j.cookie( 'bp-activity-querystring', response.query_string, {path: '/'} ); 242 j.cookie( 'bp-activity-oldestpage', oldest_page, {path: '/'} ); 248 243 249 244 j("ul.activity-list").append(response.contents); … … 1010 1005 /* Clear BP cookies on logout */ 1011 1006 j('a.logout').click( function() { 1012 j.cookie('bp-activity-scope', null );1013 j.cookie('bp-activity-filter', null );1014 j.cookie('bp-activity-querystring', null );1007 j.cookie('bp-activity-scope', null, {path: '/'}); 1008 j.cookie('bp-activity-filter', null, {path: '/'}); 1009 j.cookie('bp-activity-querystring', null, {path: '/'}); 1015 1010 1016 1011 var objects = [ 'members', 'groups', 'blogs', 'forums' ]; 1017 1012 j(objects).each( function(i) { 1018 j.cookie('bp-' + objects[i] + '-scope', null );1019 j.cookie('bp-' + objects[i] + '-filter', null );1020 j.cookie('bp-' + objects[i] + '-search-terms', null );1021 j.cookie('bp-' + objects[i] + '-page', null );1022 j.cookie('bp-' + objects[i] + '-extras', null );1013 j.cookie('bp-' + objects[i] + '-scope', null, {path: '/'} ); 1014 j.cookie('bp-' + objects[i] + '-filter', null, {path: '/'} ); 1015 j.cookie('bp-' + objects[i] + '-search-terms', null, {path: '/'} ); 1016 j.cookie('bp-' + objects[i] + '-page', null, {path: '/'} ); 1017 j.cookie('bp-' + objects[i] + '-extras', null, {path: '/'} ); 1023 1018 }); 1024 1019 }); 1025 1020 }); 1021 1022 /* Setup activity scope and filter based on the current cookie settings. */ 1023 function bp_init_activity() { 1024 /* Reset the page */ 1025 j.cookie( 'bp-activity-oldestpage', 1, {path: '/'} ); 1026 j.cookie( 'bp-activity-querystring', null, {path: '/'} ); 1027 1028 if ( null != j.cookie('bp-activity-filter') && j('#activity-filter-select').length ) 1029 j('#activity-filter-select select option[value=' + j.cookie('bp-activity-filter') + ']').attr( 'selected', 'selected' ); 1030 1031 /* Activity Tab Set */ 1032 if ( null != j.cookie('bp-activity-scope') && j('div.item-list-tabs').length ) { 1033 j('div.item-list-tabs li').each( function() { 1034 j(this).removeClass('selected'); 1035 }); 1036 j('li#activity-' + j.cookie('bp-activity-scope') + ', div.item-list-tabs li.current').addClass('selected'); 1037 } 1038 } 1026 1039 1027 1040 /* Setup object scope and filter based on the current cookie settings for the object. */ … … 1039 1052 1040 1053 /* Reset the page cookie on reload */ 1041 j.cookie('bp-' + objects[i] + '-page', null );1054 j.cookie('bp-' + objects[i] + '-page', null, {path: '/'}); 1042 1055 }); 1043 1056 } … … 1067 1080 1068 1081 /* Save the type and filter to a session cookie */ 1069 j.cookie( 'bp-' + object + '-scope', scope, null );1070 j.cookie( 'bp-' + object + '-filter', filter, null );1071 j.cookie( 'bp-' + object + '-page', page, null );1072 j.cookie( 'bp-' + object + '-search-terms', search_terms, null );1073 j.cookie( 'bp-' + object + '-extras', extras, null );1082 j.cookie( 'bp-' + object + '-scope', scope, null, {path: '/'} ); 1083 j.cookie( 'bp-' + object + '-filter', filter, null, {path: '/'} ); 1084 j.cookie( 'bp-' + object + '-page', page, null, {path: '/'} ); 1085 j.cookie( 'bp-' + object + '-search-terms', search_terms, null, {path: '/'} ); 1086 j.cookie( 'bp-' + object + '-extras', extras, null, {path: '/'} ); 1074 1087 1075 1088 /* Set the correct selected nav and filter */ … … 1113 1126 1114 1127 /* Save the type and filter to a session cookie */ 1115 j.cookie( 'bp-activity-scope', scope, null );1116 j.cookie( 'bp-activity-filter', filter, null );1117 j.cookie( 'bp-activity-oldestpage', 1 );1128 j.cookie( 'bp-activity-scope', scope, null, {path: '/'} ); 1129 j.cookie( 'bp-activity-filter', filter, null, {path: '/'} ); 1130 j.cookie( 'bp-activity-oldestpage', 1, {path: '/'} ); 1118 1131 1119 1132 /* Set the correct selected nav and filter */ … … 1138 1151 { 1139 1152 j('.widget_bp_activity_widget h2 span.ajax-loader').hide(); 1140 j.cookie( 'bp-activity-querystring', response.query_string );1153 j.cookie( 'bp-activity-querystring', response.query_string, {path: '/'} ); 1141 1154 1142 1155 j('div.activity').fadeOut( 100, function() {
Note: See TracChangeset
for help on using the changeset viewer.