Ticket #4606: 4606.02.patch
File 4606.02.patch, 14.3 KB (added by , 12 years ago) |
---|
-
bp-templates/bp-legacy/js/buddypress.js
jq(document).ready( function() { 75 75 76 76 jq.post( ajaxurl, { 77 77 action: 'post_update', 78 'cookie': encodeURIComponent(document.cookie),78 'cookie': bp_get_cookies(), 79 79 '_wpnonce_post_update': jq("#_wpnonce_post_update").val(), 80 80 'content': content, 81 81 'object': object, … … jq(document).ready( function() { 195 195 196 196 jq.post( ajaxurl, { 197 197 action: 'activity_mark_' + type, 198 'cookie': encodeURIComponent(document.cookie),198 'cookie': bp_get_cookies(), 199 199 'id': parent_id 200 200 }, 201 201 function(response) { … … jq(document).ready( function() { 249 249 250 250 jq.post( ajaxurl, { 251 251 action: 'delete_activity', 252 'cookie': encodeURIComponent(document.cookie),252 'cookie': bp_get_cookies(), 253 253 'id': id, 254 254 '_wpnonce': nonce 255 255 }, … … jq(document).ready( function() { 303 303 304 304 jq.post( ajaxurl, { 305 305 action: 'activity_get_older_updates', 306 'cookie': encodeURIComponent(document.cookie),306 'cookie': bp_get_cookies(), 307 307 'page': oldest_page 308 308 }, 309 309 function(response) … … jq(document).ready( function() { 419 419 420 420 var ajaxdata = { 421 421 action: 'new_activity_comment', 422 'cookie': encodeURIComponent(document.cookie),422 'cookie': bp_get_cookies(), 423 423 '_wpnonce_new_activity_comment': jq("#_wpnonce_new_activity_comment").val(), 424 424 'comment_id': comment_id, 425 425 'form_id': form_id[2], … … jq(document).ready( function() { 492 492 493 493 jq.post( ajaxurl, { 494 494 action: 'delete_activity_comment', 495 'cookie': encodeURIComponent(document.cookie),495 'cookie': bp_get_cookies(), 496 496 '_wpnonce': nonce, 497 497 'id': comment_id 498 498 }, … … jq(document).ready( function() { 770 770 jq.post( ajaxurl, { 771 771 action: 'groups_invite_user', 772 772 'friend_action': friend_action, 773 'cookie': encodeURIComponent(document.cookie),773 'cookie': bp_get_cookies(), 774 774 '_wpnonce': jq("#_wpnonce_invite_uninvite_user").val(), 775 775 'friend_id': friend_id, 776 776 'group_id': jq("#group_id").val() … … jq(document).ready( function() { 803 803 jq.post( ajaxurl, { 804 804 action: 'groups_invite_user', 805 805 'friend_action': 'uninvite', 806 'cookie': encodeURIComponent(document.cookie),806 'cookie': bp_get_cookies(), 807 807 '_wpnonce': jq("#_wpnonce_invite_uninvite_user").val(), 808 808 'friend_id': friend_id, 809 809 'group_id': jq("#group_id").val() … … jq(document).ready( function() { 870 870 871 871 jq.post( ajaxurl, { 872 872 action: action, 873 'cookie': encodeURIComponent(document.cookie),873 'cookie': bp_get_cookies(), 874 874 'id': id, 875 875 '_wpnonce': nonce 876 876 }, … … jq(document).ready( function() { 912 912 913 913 jq.post( ajaxurl, { 914 914 action: 'addremove_friend', 915 'cookie': encodeURIComponent(document.cookie),915 'cookie': bp_get_cookies(), 916 916 'fid': fid, 917 917 '_wpnonce': nonce 918 918 }, … … jq(document).ready( function() { 961 961 962 962 jq.post( ajaxurl, { 963 963 action: 'joinleave_group', 964 'cookie': encodeURIComponent(document.cookie),964 'cookie': bp_get_cookies(), 965 965 'gid': gid, 966 966 '_wpnonce': nonce 967 967 }, … … jq(document).ready( function() { 1018 1018 1019 1019 jq.post( ajaxurl, { 1020 1020 action: 'messages_send_reply', 1021 'cookie': encodeURIComponent(document.cookie),1021 'cookie': bp_get_cookies(), 1022 1022 '_wpnonce': jq("#send_message_nonce").val(), 1023 1023 1024 1024 'content': jq("#message_content").val(), … … function bp_filter_request( object, filter, scope, target, search_terms, page, e 1299 1299 1300 1300 bp_ajax_request = jq.post( ajaxurl, { 1301 1301 action: object + '_filter', 1302 'cookie': encodeURIComponent(document.cookie),1302 'cookie': bp_get_cookies(), 1303 1303 'object': object, 1304 1304 'filter': filter, 1305 1305 'search_terms': search_terms, … … function bp_activity_request(scope, filter) { 1347 1347 1348 1348 bp_ajax_request = jq.post( ajaxurl, { 1349 1349 action: 'activity_widget_filter', 1350 'cookie': encodeURIComponent(document.cookie),1350 'cookie': bp_get_cookies(), 1351 1351 '_wpnonce_activity_filter': jq("#_wpnonce_activity_filter").val(), 1352 1352 'scope': scope, 1353 1353 'filter': filter … … function clear(container) { 1441 1441 return; 1442 1442 } 1443 1443 1444 /* Returns a querystring of BP cookies (cookies beginning with 'bp-') */ 1445 function bp_get_cookies() { 1446 // get all cookies and split into an array 1447 var allCookies = document.cookie.split(";"); 1448 1449 var bpCookies = {}; 1450 var cookiePrefix = 'bp-'; 1451 1452 // loop through cookies 1453 for (var i = 0; i < allCookies.length; i++) { 1454 var cookie = allCookies[i]; 1455 var delimiter = cookie.indexOf("="); 1456 var name = unescape( cookie.slice(0, delimiter) ).trim(); 1457 var value = unescape( cookie.slice(delimiter + 1) ); 1458 1459 // if BP cookie, store it 1460 if ( name.indexOf(cookiePrefix) == 0 ) { 1461 bpCookies[name] = value; 1462 } 1463 } 1464 1465 // returns BP cookies as querystring 1466 return jq.param(bpCookies); 1467 } 1468 1444 1469 /* ScrollTo plugin - just inline and minified */ 1445 1470 ;(function($){var h=$.scrollTo=function(a,b,c){$(window).scrollTo(a,b,c)};h.defaults={axis:'xy',duration:parseFloat($.fn.jquery)>=1.3?0:1,limit:true};h.window=function(a){return $(window)._scrollable()};$.fn._scrollable=function(){return this.map(function(){var a=this,isWin=!a.nodeName||$.inArray(a.nodeName.toLowerCase(),['iframe','#document','html','body'])!=-1;if(!isWin)return a;var b=(a.contentWindow||a).document||a.ownerDocument||a;return/webkit/i.test(navigator.userAgent)||b.compatMode=='BackCompat'?b.body:b.documentElement})};$.fn.scrollTo=function(e,f,g){if(typeof f=='object'){g=f;f=0}if(typeof g=='function')g={onAfter:g};if(e=='max')e=9e9;g=$.extend({},h.defaults,g);f=f||g.duration;g.queue=g.queue&&g.axis.length>1;if(g.queue)f/=2;g.offset=both(g.offset);g.over=both(g.over);return this._scrollable().each(function(){if(e==null)return;var d=this,$elem=$(d),targ=e,toff,attr={},win=$elem.is('html,body');switch(typeof targ){case'number':case'string':if(/^([+-]=?)?\d+(\.\d+)?(px|%)?$/.test(targ)){targ=both(targ);break}targ=$(targ,this);if(!targ.length)return;case'object':if(targ.is||targ.style)toff=(targ=$(targ)).offset()}$.each(g.axis.split(''),function(i,a){var b=a=='x'?'Left':'Top',pos=b.toLowerCase(),key='scroll'+b,old=d[key],max=h.max(d,a);if(toff){attr[key]=toff[pos]+(win?0:old-$elem.offset()[pos]);if(g.margin){attr[key]-=parseInt(targ.css('margin'+b))||0;attr[key]-=parseInt(targ.css('border'+b+'Width'))||0}attr[key]+=g.offset[pos]||0;if(g.over[pos])attr[key]+=targ[a=='x'?'width':'height']()*g.over[pos]}else{var c=targ[pos];attr[key]=c.slice&&c.slice(-1)=='%'?parseFloat(c)/100*max:c}if(g.limit&&/^\d+$/.test(attr[key]))attr[key]=attr[key]<=0?0:Math.min(attr[key],max);if(!i&&g.queue){if(old!=attr[key])animate(g.onAfterFirst);delete attr[key]}});animate(g.onAfter);function animate(a){$elem.animate(attr,f,g.easing,a&&function(){a.call(this,e,g)})}}).end()};h.max=function(a,b){var c=b=='x'?'Width':'Height',scroll='scroll'+c;if(!$(a).is('html,body'))return a[scroll]-$(a)[c.toLowerCase()]();var d='client'+c,html=a.ownerDocument.documentElement,body=a.ownerDocument.body;return Math.max(html[scroll],body[scroll])-Math.min(html[d],body[d])};function both(a){return typeof a=='object'?a:{top:a,left:a}}})(jQuery); 1446 1471 -
bp-themes/bp-default/_inc/global.js
jq(document).ready( function() { 75 75 76 76 jq.post( ajaxurl, { 77 77 action: 'post_update', 78 'cookie': encodeURIComponent(document.cookie),78 'cookie': bp_get_cookies(), 79 79 '_wpnonce_post_update': jq("input#_wpnonce_post_update").val(), 80 80 'content': content, 81 81 'object': object, … … jq(document).ready( function() { 195 195 196 196 jq.post( ajaxurl, { 197 197 action: 'activity_mark_' + type, 198 'cookie': encodeURIComponent(document.cookie),198 'cookie': bp_get_cookies(), 199 199 'id': parent_id 200 200 }, 201 201 function(response) { … … jq(document).ready( function() { 249 249 250 250 jq.post( ajaxurl, { 251 251 action: 'delete_activity', 252 'cookie': encodeURIComponent(document.cookie),252 'cookie': bp_get_cookies(), 253 253 'id': id, 254 254 '_wpnonce': nonce 255 255 }, … … jq(document).ready( function() { 303 303 304 304 jq.post( ajaxurl, { 305 305 action: 'activity_get_older_updates', 306 'cookie': encodeURIComponent(document.cookie),306 'cookie': bp_get_cookies(), 307 307 'page': oldest_page 308 308 }, 309 309 function(response) … … jq(document).ready( function() { 416 416 417 417 var ajaxdata = { 418 418 action: 'new_activity_comment', 419 'cookie': encodeURIComponent(document.cookie),419 'cookie': bp_get_cookies(), 420 420 '_wpnonce_new_activity_comment': jq("input#_wpnonce_new_activity_comment").val(), 421 421 'comment_id': comment_id, 422 422 'form_id': form_id[2], … … jq(document).ready( function() { 488 488 489 489 jq.post( ajaxurl, { 490 490 action: 'delete_activity_comment', 491 'cookie': encodeURIComponent(document.cookie),491 'cookie': bp_get_cookies(), 492 492 '_wpnonce': nonce, 493 493 'id': comment_id 494 494 }, … … jq(document).ready( function() { 760 760 jq.post( ajaxurl, { 761 761 action: 'groups_invite_user', 762 762 'friend_action': friend_action, 763 'cookie': encodeURIComponent(document.cookie),763 'cookie': bp_get_cookies(), 764 764 '_wpnonce': jq("input#_wpnonce_invite_uninvite_user").val(), 765 765 'friend_id': friend_id, 766 766 'group_id': jq("input#group_id").val() … … jq(document).ready( function() { 793 793 jq.post( ajaxurl, { 794 794 action: 'groups_invite_user', 795 795 'friend_action': 'uninvite', 796 'cookie': encodeURIComponent(document.cookie),796 'cookie': bp_get_cookies(), 797 797 '_wpnonce': jq("input#_wpnonce_invite_uninvite_user").val(), 798 798 'friend_id': friend_id, 799 799 'group_id': jq("input#group_id").val() … … jq(document).ready( function() { 860 860 861 861 jq.post( ajaxurl, { 862 862 action: action, 863 'cookie': encodeURIComponent(document.cookie),863 'cookie': bp_get_cookies(), 864 864 'id': id, 865 865 '_wpnonce': nonce 866 866 }, … … jq(document).ready( function() { 902 902 903 903 jq.post( ajaxurl, { 904 904 action: 'addremove_friend', 905 'cookie': encodeURIComponent(document.cookie),905 'cookie': bp_get_cookies(), 906 906 'fid': fid, 907 907 '_wpnonce': nonce 908 908 }, … … jq(document).ready( function() { 951 951 952 952 jq.post( ajaxurl, { 953 953 action: 'joinleave_group', 954 'cookie': encodeURIComponent(document.cookie),954 'cookie': bp_get_cookies(), 955 955 'gid': gid, 956 956 '_wpnonce': nonce 957 957 }, … … jq(document).ready( function() { 1008 1008 1009 1009 jq.post( ajaxurl, { 1010 1010 action: 'messages_send_reply', 1011 'cookie': encodeURIComponent(document.cookie),1011 'cookie': bp_get_cookies(), 1012 1012 '_wpnonce': jq("input#send_message_nonce").val(), 1013 1013 1014 1014 'content': jq("#message_content").val(), … … function bp_filter_request( object, filter, scope, target, search_terms, page, e 1289 1289 1290 1290 bp_ajax_request = jq.post( ajaxurl, { 1291 1291 action: object + '_filter', 1292 'cookie': encodeURIComponent(document.cookie),1292 'cookie': bp_get_cookies(), 1293 1293 'object': object, 1294 1294 'filter': filter, 1295 1295 'search_terms': search_terms, … … function bp_activity_request(scope, filter) { 1337 1337 1338 1338 bp_ajax_request = jq.post( ajaxurl, { 1339 1339 action: 'activity_widget_filter', 1340 'cookie': encodeURIComponent(document.cookie),1340 'cookie': bp_get_cookies(), 1341 1341 '_wpnonce_activity_filter': jq("input#_wpnonce_activity_filter").val(), 1342 1342 'scope': scope, 1343 1343 'filter': filter … … function clear(container) { 1431 1431 return; 1432 1432 } 1433 1433 1434 /* Returns a querystring of BP cookies (cookies beginning with 'bp-') */ 1435 function bp_get_cookies() { 1436 // get all cookies and split into an array 1437 var allCookies = document.cookie.split(";"); 1438 1439 var bpCookies = {}; 1440 var cookiePrefix = 'bp-'; 1441 1442 // loop through cookies 1443 for (var i = 0; i < allCookies.length; i++) { 1444 var cookie = allCookies[i]; 1445 var delimiter = cookie.indexOf("="); 1446 var name = unescape( cookie.slice(0, delimiter) ).trim(); 1447 var value = unescape( cookie.slice(delimiter + 1) ); 1448 1449 // if BP cookie, store it 1450 if ( name.indexOf(cookiePrefix) == 0 ) { 1451 bpCookies[name] = value; 1452 } 1453 } 1454 1455 // returns BP cookies as querystring 1456 return jq.param(bpCookies); 1457 } 1458 1434 1459 /* ScrollTo plugin - just inline and minified */ 1435 1460 ;(function($){var h=$.scrollTo=function(a,b,c){$(window).scrollTo(a,b,c)};h.defaults={axis:'xy',duration:parseFloat($.fn.jquery)>=1.3?0:1,limit:true};h.window=function(a){return $(window)._scrollable()};$.fn._scrollable=function(){return this.map(function(){var a=this,isWin=!a.nodeName||$.inArray(a.nodeName.toLowerCase(),['iframe','#document','html','body'])!=-1;if(!isWin)return a;var b=(a.contentWindow||a).document||a.ownerDocument||a;return/webkit/i.test(navigator.userAgent)||b.compatMode=='BackCompat'?b.body:b.documentElement})};$.fn.scrollTo=function(e,f,g){if(typeof f=='object'){g=f;f=0}if(typeof g=='function')g={onAfter:g};if(e=='max')e=9e9;g=$.extend({},h.defaults,g);f=f||g.duration;g.queue=g.queue&&g.axis.length>1;if(g.queue)f/=2;g.offset=both(g.offset);g.over=both(g.over);return this._scrollable().each(function(){if(e==null)return;var d=this,$elem=$(d),targ=e,toff,attr={},win=$elem.is('html,body');switch(typeof targ){case'number':case'string':if(/^([+-]=?)?\d+(\.\d+)?(px|%)?$/.test(targ)){targ=both(targ);break}targ=$(targ,this);if(!targ.length)return;case'object':if(targ.is||targ.style)toff=(targ=$(targ)).offset()}$.each(g.axis.split(''),function(i,a){var b=a=='x'?'Left':'Top',pos=b.toLowerCase(),key='scroll'+b,old=d[key],max=h.max(d,a);if(toff){attr[key]=toff[pos]+(win?0:old-$elem.offset()[pos]);if(g.margin){attr[key]-=parseInt(targ.css('margin'+b))||0;attr[key]-=parseInt(targ.css('border'+b+'Width'))||0}attr[key]+=g.offset[pos]||0;if(g.over[pos])attr[key]+=targ[a=='x'?'width':'height']()*g.over[pos]}else{var c=targ[pos];attr[key]=c.slice&&c.slice(-1)=='%'?parseFloat(c)/100*max:c}if(g.limit&&/^\d+$/.test(attr[key]))attr[key]=attr[key]<=0?0:Math.min(attr[key],max);if(!i&&g.queue){if(old!=attr[key])animate(g.onAfterFirst);delete attr[key]}});animate(g.onAfter);function animate(a){$elem.animate(attr,f,g.easing,a&&function(){a.call(this,e,g)})}}).end()};h.max=function(a,b){var c=b=='x'?'Width':'Height',scroll='scroll'+c;if(!$(a).is('html,body'))return a[scroll]-$(a)[c.toLowerCase()]();var d='client'+c,html=a.ownerDocument.documentElement,body=a.ownerDocument.body;return Math.max(html[scroll],body[scroll])-Math.min(html[d],body[d])};function both(a){return typeof a=='object'?a:{top:a,left:a}}})(jQuery); 1436 1461