Skip to:
Content

BuddyPress.org

Changeset 6051


Ignore:
Timestamp:
05/31/2012 08:42:53 PM (13 years ago)
Author:
boonebgorges
Message:

Markup enhancements for profile visibility

  • Removes an orphaned 'label' element
  • Replaces some 'label' elements with 'fieldset' and 'legend' for greater accuracy
  • Changes some div elements into paragraphs, so that text does not appear outside the context of semantic elements
  • Modifications to the visibility options toggle JavaScript, for better differentiation and smoothness

Fixes #4224
Props hnla

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-themes/bp-default/_inc/global.js

    r6033 r6051  
    809809
    810810    /** Profile Visibility Settings *********************************/
    811    
     811    jq('.field-visibility-settings').hide();
    812812    jq('.visibility-toggle-link').on( 'click', function() {
    813813        var toggle_div = jq(this).parent();
    814814       
    815         jq(toggle_div).slideUp( 200, function(){
    816             jq(toggle_div).siblings('.field-visibility-settings').slideDown(200);
     815        jq(toggle_div).fadeOut( 600, function(){
     816            jq(toggle_div).siblings('.field-visibility-settings').slideDown(400);
    817817        });
    818818       
     
    823823        var settings_div = jq(this).parent();
    824824       
    825         jq(settings_div).slideUp( 200, function(){
    826             jq(settings_div).siblings('.field-visibility-settings-toggle').slideDown(200);
     825        jq(settings_div).slideUp( 400, function(){
     826            jq(settings_div).siblings('.field-visibility-settings-toggle').fadeIn(800);
    827827        });
    828828       
  • trunk/bp-themes/bp-default/members/single/profile/edit.php

    r6015 r6051  
    115115               
    116116                <?php if ( bp_current_user_can( 'bp_xprofile_change_field_visibility' ) ) : ?>
    117                     <div class="field-visibility-settings-toggle" id="field-visibility-settings-toggle-<?php bp_the_profile_field_id() ?>">
     117                    <p class="field-visibility-settings-toggle" id="field-visibility-settings-toggle-<?php bp_the_profile_field_id() ?>">
    118118                        <?php printf( __( 'This field can be seen by: <span class="current-visibility-level">%s</span>', 'buddypress' ), bp_get_the_profile_field_visibility_level_label() ) ?> <a href="#" class="visibility-toggle-link"><?php _e( 'Change', 'buddypress' ); ?></a>
    119                     </div>
     119                    </p>
    120120                   
    121121                    <div class="field-visibility-settings" id="field-visibility-settings-<?php bp_the_profile_field_id() ?>">
    122                         <label for="field-visibility"><?php _e( 'Who can see this field?', 'buddypress' ) ?></label>
     122                        <fieldset>
     123                            <legend><?php _e( 'Who can see this field?', 'buddypress' ) ?></legend>
    123124                       
    124                         <?php bp_profile_visibility_radio_buttons() ?>
     125                            <?php bp_profile_visibility_radio_buttons() ?>
    125126                       
     127                        </fieldset>
    126128                        <a class="field-visibility-settings-close" href="#"><?php _e( 'Close', 'buddypress' ) ?></a>
    127129                    </div>
  • trunk/bp-themes/bp-default/registration/register.php

    r5837 r6051  
    156156                               
    157157                                <?php if ( bp_current_user_can( 'bp_xprofile_change_field_visibility' ) ) : ?>
    158                                     <div class="field-visibility-settings-toggle" id="field-visibility-settings-toggle-<?php bp_the_profile_field_id() ?>">
     158                                    <p class="field-visibility-settings-toggle" id="field-visibility-settings-toggle-<?php bp_the_profile_field_id() ?>">
    159159                                        <?php printf( __( 'This field can be seen by: <span class="current-visibility-level">%s</span>', 'buddypress' ), bp_get_the_profile_field_visibility_level_label() ) ?> <a href="#" class="visibility-toggle-link">Change</a>
    160                                     </div>
     160                                    </p>
    161161                                   
    162162                                    <div class="field-visibility-settings" id="field-visibility-settings-<?php bp_the_profile_field_id() ?>">
    163                                         <label for="field-visibility"><?php _e( 'Who can see this field?', 'buddypress' ) ?></label>
     163                                        <fieldset>
     164                                            <legend><?php _e( 'Who can see this field?', 'buddypress' ) ?></legend>
    164165                                       
    165                                         <?php bp_profile_visibility_radio_buttons() ?>
     166                                            <?php bp_profile_visibility_radio_buttons() ?>
    166167                                       
     168                                        </fieldset>
    167169                                        <a class="field-visibility-settings-close" href="#"><?php _e( 'Close', 'buddypress' ) ?></a>
     170                                       
    168171                                    </div>
    169172                                <?php else : ?>
    170                                     <div class="field-visibility-settings-notoggle" id="field-visibility-settings-toggle-<?php bp_the_profile_field_id() ?>">
     173                                    <p class="field-visibility-settings-notoggle" id="field-visibility-settings-toggle-<?php bp_the_profile_field_id() ?>">
    171174                                        <?php printf( __( 'This field can be seen by: <span class="current-visibility-level">%s</span>', 'buddypress' ), bp_get_the_profile_field_visibility_level_label() ) ?>
    172                                     </div>         
     175                                    </p>           
    173176                                <?php endif ?>
    174177
  • trunk/bp-xprofile/bp-xprofile-template.php

    r5949 r6051  
    900900            $checked = $level['id'] == bp_get_the_profile_field_visibility_level() ? ' checked="checked" ' : '';
    901901           
    902             $html .= '<li><input type="radio" name="field_' . bp_get_the_profile_field_id() . '_visibility" value="' . esc_attr( $level['id'] ) . '"' . $checked . '> ' . esc_html( $level['label'] ) . '</li>';
     902            $html .= '<li><label for="see-field_' . esc_attr( $level['id'] ) . '"><input type="radio" id="see-field_' . esc_attr( $level['id'] ) . '" name="field_' . bp_get_the_profile_field_id() . '_visibility" value="' . esc_attr( $level['id'] ) . '"' . $checked . ' /> ' . esc_html( $level['label'] ) . '</label></li>';
    903903        }
    904904       
Note: See TracChangeset for help on using the changeset viewer.