Skip to:
Content

BuddyPress.org

Ticket #6569: 6569.patch

File 6569.patch, 9.4 KB (added by imath, 9 years ago)
  • src/bp-activity/bp-activity-template.php

    diff --git src/bp-activity/bp-activity-template.php src/bp-activity/bp-activity-template.php
    index e73a259..ab3f898 100644
    function bp_activity_per_page() { 
    993993                return apply_filters( 'bp_get_activity_per_page', (int) $activities_template->pag_num );
    994994        }
    995995
     996
     997function bp_activity_whats_new_placeholder() {
     998        echo bp_get_activity_whats_new_placeholder();
     999}
     1000
     1001        function bp_get_activity_whats_new_placeholder() {
     1002                $placeholder = sprintf( __( "What's new, %s?", 'buddypress' ), bp_get_user_firstname( bp_get_loggedin_user_fullname() ) );
     1003
     1004                if ( bp_is_group() ) {
     1005                        $placeholder = sprintf( __( "What's new in %s, %s?", 'buddypress' ), bp_get_group_name(), bp_get_user_firstname( bp_get_loggedin_user_fullname() ) );
     1006                }
     1007
     1008                return apply_filters( 'bp_get_activity_whats_new_placeholder', 'placeholder="' . $placeholder . '"' );
     1009        }
     1010
    9961011/**
    9971012 * Output the activities title.
    9981013 *
  • src/bp-templates/bp-legacy/buddypress/activity/post-form.php

    diff --git src/bp-templates/bp-legacy/buddypress/activity/post-form.php src/bp-templates/bp-legacy/buddypress/activity/post-form.php
    index 12023a8..9f8499f 100644
     
    2626                </a>
    2727        </div>
    2828
    29         <p class="activity-greeting"><?php if ( bp_is_group() )
    30                 printf( __( "What's new in %s, %s?", 'buddypress' ), bp_get_group_name(), bp_get_user_firstname( bp_get_loggedin_user_fullname() ) );
    31         else
    32                 printf( __( "What's new, %s?", 'buddypress' ), bp_get_user_firstname( bp_get_loggedin_user_fullname() ) );
    33         ?></p>
    34 
    3529        <div id="whats-new-content">
     30
    3631                <div id="whats-new-textarea">
    37                         <textarea class="bp-suggestions" name="whats-new" id="whats-new" cols="50" rows="10"
     32                        <textarea class="bp-suggestions" name="whats-new" id="whats-new" cols="50" rows="1"
    3833                                <?php if ( bp_is_group() ) : ?>data-suggestions-group-id="<?php echo esc_attr( (int) bp_get_current_group_id() ); ?>" <?php endif; ?>
    39                         ><?php if ( isset( $_GET['r'] ) ) : ?>@<?php echo esc_textarea( $_GET['r'] ); ?> <?php endif; ?></textarea>
     34                        <?php bp_activity_whats_new_placeholder() ;?>><?php if ( isset( $_GET['r'] ) ) : ?>@<?php echo esc_textarea( $_GET['r'] ); ?> <?php endif; ?></textarea>
    4035                </div>
    4136
    42                 <div id="whats-new-options">
    43                         <div id="whats-new-submit">
    44                                 <input type="submit" name="aw-whats-new-submit" id="aw-whats-new-submit" value="<?php esc_attr_e( 'Post Update', 'buddypress' ); ?>" />
    45                         </div>
     37                <div id="whats-new-actions">
     38                        <?php
     39                        /**
     40                         * Fires before the activity post form options.
     41                         *
     42                         * @since BuddyPress (2.4.0)
     43                         */
     44                        do_action( 'bp_activity_post_form_before_options' ); ?>
    4645
    47                         <?php if ( bp_is_active( 'groups' ) && !bp_is_my_profile() && !bp_is_group() ) : ?>
     46                        <div id="whats-new-options">
    4847
    49                                 <div id="whats-new-post-in-box">
     48                                <?php if ( bp_is_active( 'groups' ) && !bp_is_my_profile() && !bp_is_group() ) : ?>
    5049
    51                                         <?php _e( 'Post in', 'buddypress' ); ?>:
     50                                        <div id="whats-new-post-in-box">
    5251
    53                                         <select id="whats-new-post-in" name="whats-new-post-in">
    54                                                 <option selected="selected" value="0"><?php _e( 'My Profile', 'buddypress' ); ?></option>
     52                                                <?php _e( 'Post in', 'buddypress' ); ?>:
    5553
    56                                                 <?php if ( bp_has_groups( 'user_id=' . bp_loggedin_user_id() . '&type=alphabetical&max=100&per_page=100&populate_extras=0&update_meta_cache=0' ) ) :
    57                                                         while ( bp_groups() ) : bp_the_group(); ?>
     54                                                <select id="whats-new-post-in" name="whats-new-post-in">
     55                                                        <option selected="selected" value="0"><?php _e( 'My Profile', 'buddypress' ); ?></option>
    5856
    59                                                                 <option value="<?php bp_group_id(); ?>"><?php bp_group_name(); ?></option>
     57                                                        <?php if ( bp_has_groups( 'user_id=' . bp_loggedin_user_id() . '&type=alphabetical&max=100&per_page=100&populate_extras=0&update_meta_cache=0' ) ) :
     58                                                                while ( bp_groups() ) : bp_the_group(); ?>
    6059
    61                                                         <?php endwhile;
    62                                                 endif; ?>
     60                                                                        <option value="<?php bp_group_id(); ?>"><?php bp_group_name(); ?></option>
    6361
    64                                         </select>
    65                                 </div>
    66                                 <input type="hidden" id="whats-new-post-object" name="whats-new-post-object" value="groups" />
     62                                                                <?php endwhile;
     63                                                        endif; ?>
    6764
    68                         <?php elseif ( bp_is_group_home() ) : ?>
     65                                                </select>
     66                                        </div>
     67                                        <input type="hidden" id="whats-new-post-object" name="whats-new-post-object" value="groups" />
    6968
    70                                 <input type="hidden" id="whats-new-post-object" name="whats-new-post-object" value="groups" />
    71                                 <input type="hidden" id="whats-new-post-in" name="whats-new-post-in" value="<?php bp_group_id(); ?>" />
     69                                <?php elseif ( bp_is_group_home() ) : ?>
    7270
    73                         <?php endif; ?>
     71                                        <input type="hidden" id="whats-new-post-object" name="whats-new-post-object" value="groups" />
     72                                        <input type="hidden" id="whats-new-post-in" name="whats-new-post-in" value="<?php bp_group_id(); ?>" />
    7473
    75                         <?php
     74                                <?php endif; ?>
    7675
     76                                <?php
     77
     78                                /**
     79                                 * Fires at the end of the activity post form options.
     80                                 *
     81                                 * @since BuddyPress (1.2.0)
     82                                 */
     83                                do_action( 'bp_activity_post_form_options' ); ?>
     84
     85                        </div><!-- #whats-new-options -->
     86
     87                        <?php
    7788                        /**
    78                          * Fires at the end of the activity post form markup.
     89                         * Fires before the activity post form submit.
    7990                         *
    80                          * @since BuddyPress (1.2.0)
     91                         * @since BuddyPress (2.4.0)
    8192                         */
    82                         do_action( 'bp_activity_post_form_options' ); ?>
     93                        do_action( 'bp_activity_post_form_before_submit' ); ?>
     94
     95                        <div id="whats-new-submit">
     96
     97                                <input type="submit" name="aw-whats-new-submit" id="aw-whats-new-submit" value="<?php esc_attr_e( 'Post Update', 'buddypress' ); ?>" />
    8398
    84                 </div><!-- #whats-new-options -->
     99                                 <?php
     100                                /**
     101                                 * Fires at the end of the activity post form submit.
     102                                 *
     103                                 * @since BuddyPress (2.4.0)
     104                                 */
     105                                do_action( 'bp_activity_post_form_submit' ); ?>
     106                        </div><!-- #whats-new-submit -->
     107                </div><!-- #whats-new-actions -->
    85108        </div><!-- #whats-new-content -->
    86109
    87110        <?php wp_nonce_field( 'post_update', '_wpnonce_post_update' ); ?>
  • src/bp-templates/bp-legacy/css/buddypress.css

    diff --git src/bp-templates/bp-legacy/css/buddypress.css src/bp-templates/bp-legacy/css/buddypress.css
    index 1957cef..1727c61 100644
    Hello, this is the BuddyPress Legacy stylesheet. 
    127127        color: #555;
    128128        font-family: inherit;
    129129        font-size: medium;
    130         height: 20px;
    131130        padding: 6px;
    132131        width: 98%;
     132        resize: none;
     133        overflow: hidden;
    133134}
    134135body.no-js #buddypress form#whats-new-form textarea {
    135136        height: 50px;
    body.no-js #buddypress form#whats-new-form textarea { 
    142143        float: right;
    143144        margin-top: 12px;
    144145}
     146
    145147#buddypress #whats-new-options {
    146148        overflow: auto;
    147         height: 0;
     149        height: auto;
     150        float:left;
     151}
     152
     153#buddypress #whats-new-content #whats-new-actions {
     154        height:0;
    148155}
     156
     157#buddypress #whats-new-content.active #whats-new-actions {
     158        width:auto;
     159}
     160
    149161body.no-js #buddypress #whats-new-options {
    150162        height: auto;
    151163}
    body.no-js #buddypress #whats-new-options { 
    154166        outline-color: rgba(31, 179, 221, 0.9);
    155167}
    156168
     169#buddypress #whats-new-content, #buddypress #whats-new-actions {
     170        overflow: hidden;
     171}
     172
    157173/*--------------------------------------------------------------
    1581743.1.1 - Activity Listing
    159175--------------------------------------------------------------*/
  • src/bp-templates/bp-legacy/js/buddypress.js

    diff --git src/bp-templates/bp-legacy/js/buddypress.js src/bp-templates/bp-legacy/js/buddypress.js
    index 4c5e139..693696b 100644
    jq(document).ready( function() { 
    3232        if ( $whats_new.length && bp_get_querystring('r') ) {
    3333                var $member_nicename = $whats_new.val();
    3434
    35                 jq('#whats-new-options').animate({
    36                         height:'50px'
    37                 });
    38 
    39                 $whats_new.animate({
    40                         height:'50px'
     35                jq('#whats-new-actions').animate({
     36                        height:'100%'
    4137                });
    4238
    4339                jq.scrollTo( $whats_new, 500, {
    jq(document).ready( function() { 
    5248
    5349        /* Textarea focus */
    5450        $whats_new.focus( function(){
    55                 jq('#whats-new-options').animate({
    56                         height:'50px'
    57                 });
    58                 jq('#whats-new-form textarea').animate({
    59                         height:'50px'
     51                jq('#whats-new-actions').animate({
     52                        height:'100%'
    6053                });
     54
    6155                jq('#aw-whats-new-submit').prop('disabled', false);
    6256
    6357                jq( '#whats-new-content' ).addClass( 'active' );
    jq(document).ready( function() { 
    8882                if ( document.activeElement !== this ) {
    8983                        if (!this.value.match(/\S+/)) {
    9084                                this.value = '';
    91                                 jq('#whats-new-options').animate({
     85                                jq('#whats-new-actions').animate({
    9286                                        height:'0'
    9387                                });
    94                                 jq('form#whats-new-form textarea').animate({
    95                                         height:'20px'
    96                                 });
     88
     89                                jq('#whats-new-form textarea').css( {
     90                                        height:'auto'
     91                                } );
     92
    9793                                jq('#aw-whats-new-submit').prop('disabled', true);
    9894                                jq( '#whats-new-content' ).removeClass( 'active' );
    9995                        }
    10096                }
    10197        });
    10298
     99        /* Texarea auto-resize */
     100        $whats_new.on( 'keyup', function( event ) {
     101                jq( this ).css( {
     102                        height: this.scrollHeight + 'px'
     103                } );
     104        } );
     105
    103106        /* New posts */
    104107        jq('#aw-whats-new-submit').on( 'click', function() {
    105108                var last_date_recorded = 0,
    jq(document).ready( function() { 
    211214                                activity_last_recorded  = 0;
    212215                        }
    213216
    214                         jq('#whats-new-options').animate({
     217                        jq('#whats-new-actions').animate({
    215218                                height:'0px'
    216219                        });
    217                         jq('#whats-new-form textarea').animate({
    218                                 height:'20px'
    219                         });
     220
    220221                        jq('#aw-whats-new-submit').prop('disabled', true).removeClass('loading');
    221222                        jq( '#whats-new-content' ).removeClass( 'active' );
    222223                });