Changeset 9248
- Timestamp:
- 12/21/2014 11:55:47 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/deprecated/js/autocomplete/jquery.autocomplete.js
r6264 r9248 327 327 limit: options.max, 328 328 action: 'messages_autocomplete_results', 329 'cookie': encodeURIComponent(document.cookie)329 'cookie': getAutocompleteCookies() 330 330 }, extraParams), 331 331 success: function(data) { … … 362 362 }; 363 363 364 /* Returns a querystring of BP cookies (cookies beginning with 'bp-') */ 365 function getAutocompleteCookies() { 366 var allCookies = document.cookie.split(';'), // get all cookies and split into an array 367 bpCookies = {}, 368 cookiePrefix = 'bp-', 369 i, cookie, delimiter, name, value; 370 371 // loop through cookies 372 for (i = 0; i < allCookies.length; i++) { 373 cookie = allCookies[i]; 374 delimiter = cookie.indexOf('='); 375 name = jq.trim( unescape( cookie.slice(0, delimiter) ) ); 376 value = unescape( cookie.slice(delimiter + 1) ); 377 378 // if BP cookie, store it 379 if ( name.indexOf(cookiePrefix) === 0 ) { 380 bpCookies[name] = value; 381 } 382 } 383 384 // returns BP cookies as querystring 385 return encodeURIComponent( jq.param(bpCookies) ); 386 } 364 387 }; 365 388
Note: See TracChangeset
for help on using the changeset viewer.