From 9bef3892616f20d47b655bdb9c0b59a01f802e8f Mon Sep 17 00:00:00 2001 From: Boone B Gorges Date: Thu, 14 Nov 2024 15:41:07 +0000 Subject: [PATCH] Compile assets for 1.7.81 release. --- wp-content/js/buddypress.js | 258 ++++++++++++++++++++---------------- 1 file changed, 145 insertions(+), 113 deletions(-) diff --git a/wp-content/js/buddypress.js b/wp-content/js/buddypress.js index 438ae9e2f9..e5e638f9c8 100644 --- a/wp-content/js/buddypress.js +++ b/wp-content/js/buddypress.js @@ -460,133 +460,165 @@ function bp_get_querystring( n ) { }); }); -;jQuery(document).ready( function($) { - var groupRow = $( '#groups-list li' ); - - if ( groupRow.find( 'div.ges-panel' ).length ) { - repositionGESPanel(); - $( window ).on('resize', function() { - repositionGESPanel(); - }); - } - - // If positioned right, ensure panel is aligned right as well. - function repositionGESPanel() { - if ( 'right' === groupRow.find('div.action').css('float') || 'right' === groupRow.find('div.action, div.item-actions').css('text-align') ) { - groupRow.find('.group-subscription-div').addClass( 'ges-panel-right' ); - } else { - groupRow.find('.group-subscription-div').removeClass( 'ges-panel-right' ); +;jQuery( document ).ready( + function ($) { + var groupRow = $( '#groups-list li' ); + + if ( groupRow.find( 'div.ges-panel' ).length ) { + repositionGESPanel(); + $( window ).on( + 'resize', + function () { + repositionGESPanel(); + } + ); } - } - // topic follow/mute - $( document ).on("click", '.ass-topic-subscribe > a', function() { - var it = $(this), - theid = $(this).attr('id'), - stheid = theid.split('-'), - data; - - //$('.pagination .ajax-loader').toggle(); - - data = { - action: 'ass_ajax', - a: stheid[0], - topic_id: stheid[1], - group_id: stheid[2] - //,_ajax_nonce: stheid[2] - }; - - // TODO: add ajax code to give status feedback that will fade out - - $.post( ajaxurl, data, function( response ) { - var m, theid; - - if ( response == 'follow' ) { - m = bp_ass.mute; - theid = theid.replace( 'follow', 'mute' ); - } else if ( response == 'mute' ) { - m = bp_ass.follow; - theid = theid.replace( 'mute', 'follow' ); + // If positioned right, ensure panel is aligned right as well. + function repositionGESPanel() { + if ( 'right' === groupRow.find( 'div.action' ).css( 'float' ) || 'right' === groupRow.find( 'div.action, div.item-actions' ).css( 'text-align' ) ) { + groupRow.find( '.group-subscription-div' ).addClass( 'ges-panel-right' ); } else { - m = bp_ass.error; + groupRow.find( '.group-subscription-div' ).removeClass( 'ges-panel-right' ); } + } - $(it).html(m); - $(it).attr('id', theid); - $(it).attr('title', ''); - - //$('.pagination .ajax-loader').toggle(); - - }); - }); - - - // group subscription options - $( document ).on("click", '.group-sub', function(e) { - e.preventDefault(); - - var it = $(this), - theid = $(this).attr('id'), - stheid = theid.split('-'), - group_id = stheid[1], - current = $( '#gsubstat-' + group_id ).html(), - newBtn = $('button.js-tooltip[data-tooltip-content-id="ges-panel-' + group_id + '"]'), - data; - - $('#gsubajaxload-' + group_id).css('display','inline-block'); - newBtn.hide(); + // topic follow/mute + $( document ).on( + "click", + '.ass-topic-subscribe > a', + function () { + var it = $( this ), + theid = $( this ).attr( 'id' ), + stheid = theid.split( '-' ), + data; + + //$('.pagination .ajax-loader').toggle(); + + data = { + action: 'ass_ajax', + a: stheid[0], + topic_id: stheid[1], + group_id: stheid[2] + //,_ajax_nonce: stheid[2] + }; + + // TODO: add ajax code to give status feedback that will fade out + + $.post( + ajaxurl, + data, + function ( response ) { + var m, theid; + + if ( response == 'follow' ) { + m = bp_ass.mute; + theid = theid.replace( 'follow', 'mute' ); + } else if ( response == 'mute' ) { + m = bp_ass.follow; + theid = theid.replace( 'mute', 'follow' ); + } else { + m = bp_ass.error; + } - data = { - action: 'ass_group_ajax', - a: stheid[0], - group_id: stheid[1], - _ajax_nonce: it.parent().data( 'security' ) - }; + $( it ).html( m ); + $( it ).attr( 'id', theid ); + $( it ).attr( 'title', '' ); - $( '#js-tooltip-close' ).click(); + //$('.pagination .ajax-loader').toggle(); - $.post( ajaxurl, data, function( response ) { - var status = $(it).html(); - if ( !current || current == 'No Email' ) { - $( '#gsublink-' + group_id ).html('change'); - //status = status + ' / '; + } + ); } - $( '#gsubstat-' + group_id ).html( status ); //add .animate({opacity: 1.0}, 2000) to slow things down for testing - $( '#gsubstat-' + group_id ).addClass( 'gemail_icon' ); - $( '#gsubopt-' + group_id ).slideToggle('fast'); - $( '#gsubajaxload-' + group_id ).hide(); - newBtn.show(); - }); - - }); - - $( document ).on("click", '.group-subscription-options-link', function() { - var stheid = $(this).attr('id').split('-'), - group_id = stheid[1]; + ); + + // group subscription options + $( document ).on( + "click", + '.group-sub', + function (e) { + e.preventDefault(); + + var it = $( this ), + theid = $( this ).attr( 'id' ), + stheid = theid.split( '-' ), + group_id = stheid[1], + current = $( '#gsubstat-' + group_id ).html(), + newBtn = $( 'button.js-tooltip[data-tooltip-content-id="ges-panel-' + group_id + '"]' ), + data; + + $( '#gsubajaxload-' + group_id ).css( 'display','inline-block' ); + newBtn.hide(); + + data = { + action: 'ass_group_ajax', + a: stheid[0], + group_id: stheid[1], + _ajax_nonce: it.parent().data( 'security' ) + }; + + $( '#js-tooltip-close' ).click(); + + $.post( + ajaxurl, + data, + function ( response ) { + var status = $( it ).html(); + if ( ! current || current == 'No Email' ) { + $( '#gsublink-' + group_id ).html( 'change' ); + //status = status + ' / '; + } + $( '#gsubstat-' + group_id ).html( status ); //add .animate({opacity: 1.0}, 2000) to slow things down for testing + $( '#gsubstat-' + group_id ).addClass( 'gemail_icon' ); + $( '#gsubopt-' + group_id ).slideToggle( 'fast' ); + $( '#gsubajaxload-' + group_id ).hide(); + newBtn.show(); + } + ); - $( '#gsubopt-' + group_id ).slideToggle('fast'); - }); + } + ); - $( document ).on("click", '.group-subscription-close', function() { - var stheid = $(this).attr('id').split('-'), - group_id = stheid[1]; + $( document ).on( + "click", + '.group-subscription-options-link', + function () { + var stheid = $( this ).attr( 'id' ).split( '-' ), + group_id = stheid[1]; - $( '#gsubopt-' + group_id ).slideToggle('fast'); - }); + $( '#gsubopt-' + group_id ).slideToggle( 'fast' ); + } + ); - //$( document ).on("click", '.ass-settings-advanced-link', function() { - // $( '.ass-settings-advanced' ).slideToggle('fast'); - //}); + $( document ).on( + "click", + '.group-subscription-close', + function () { + var stheid = $( this ).attr( 'id' ).split( '-' ), + group_id = stheid[1]; - // Toggle welcome email fields on group email options page - $( document ).on("change", '#ass-welcome-email-enabled', function() { - if ( $(this).prop('checked') ) { - $('.ass-welcome-email-field').show(); - } else { - $('.ass-welcome-email-field').hide(); - } - }); -}); + $( '#gsubopt-' + group_id ).slideToggle( 'fast' ); + } + ); + + //$( document ).on("click", '.ass-settings-advanced-link', function() { + // $( '.ass-settings-advanced' ).slideToggle('fast'); + //}); + + // Toggle welcome email fields on group email options page + $( document ).on( + "change", + '#ass-welcome-email-enabled', + function () { + if ( $( this ).prop( 'checked' ) ) { + $( '.ass-welcome-email-field' ).show(); + } else { + $( '.ass-welcome-email-field' ).hide(); + } + } + ); + } +); ;(function (root, factory) { if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module.