Message info
 
To:buddypress-trac@lists.automattic.com From:buddypress-trac@lists.automattic.com Subject:[buddypress-trac] [BuddyPress][6051] trunk: Markup enhancements for profile visibility Date:Thu, 31 May 2012 20:42:53 +0000 (UTC)
 

Revision
6051
Author
boonebgorges
Date
2012-05-31 20:42:53 +0000 (Thu, 31 May 2012)

Log 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

Modified Paths

Diff

Modified: trunk/bp-themes/bp-default/_inc/global.js (6050 => 6051)


--- trunk/bp-themes/bp-default/_inc/global.js	2012-05-27 16:36:16 UTC (rev 6050)
+++ trunk/bp-themes/bp-default/_inc/global.js	2012-05-31 20:42:53 UTC (rev 6051)
@@ -808,12 +808,12 @@
 	});
 
 	/** Profile Visibility Settings *********************************/
-	
+	jq('.field-visibility-settings').hide();
 	jq('.visibility-toggle-link').on( 'click', function() {
 		var toggle_div = jq(this).parent();
 		
-		jq(toggle_div).slideUp( 200, function(){
-			jq(toggle_div).siblings('.field-visibility-settings').slideDown(200);
+		jq(toggle_div).fadeOut( 600, function(){
+			jq(toggle_div).siblings('.field-visibility-settings').slideDown(400);
 		});
 		
 		return false;
@@ -822,8 +822,8 @@
 	jq('.field-visibility-settings-close').on( 'click', function() {
 		var settings_div = jq(this).parent();
 		
-		jq(settings_div).slideUp( 200, function(){
-			jq(settings_div).siblings('.field-visibility-settings-toggle').slideDown(200);
+		jq(settings_div).slideUp( 400, function(){
+			jq(settings_div).siblings('.field-visibility-settings-toggle').fadeIn(800);
 		});
 		
 		return false;

Modified: trunk/bp-themes/bp-default/members/single/profile/edit.php (6050 => 6051)


--- trunk/bp-themes/bp-default/members/single/profile/edit.php	2012-05-27 16:36:16 UTC (rev 6050)
+++ trunk/bp-themes/bp-default/members/single/profile/edit.php	2012-05-31 20:42:53 UTC (rev 6051)
@@ -114,15 +114,17 @@
 				<?php endif; ?>
 				
 				<?php if ( bp_current_user_can( 'bp_xprofile_change_field_visibility' ) ) : ?>
-					<div class="field-visibility-settings-toggle" id="field-visibility-settings-toggle-<?php bp_the_profile_field_id() ?>">
+					<p class="field-visibility-settings-toggle" id="field-visibility-settings-toggle-<?php bp_the_profile_field_id() ?>">
 						<?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>
-					</div>
+					</p>
 					
 					<div class="field-visibility-settings" id="field-visibility-settings-<?php bp_the_profile_field_id() ?>">
-						<label for="field-visibility"><?php _e( 'Who can see this field?', 'buddypress' ) ?></label>
+						<fieldset>
+							<legend><?php _e( 'Who can see this field?', 'buddypress' ) ?></legend>
 						
-						<?php bp_profile_visibility_radio_buttons() ?>
+							<?php bp_profile_visibility_radio_buttons() ?>
 						
+						</fieldset>
 						<a class="field-visibility-settings-close" href="#"><?php _e( 'Close', 'buddypress' ) ?></a>
 					</div>
 				<?php else : ?>

Modified: trunk/bp-themes/bp-default/registration/register.php (6050 => 6051)


--- trunk/bp-themes/bp-default/registration/register.php	2012-05-27 16:36:16 UTC (rev 6050)
+++ trunk/bp-themes/bp-default/registration/register.php	2012-05-31 20:42:53 UTC (rev 6051)
@@ -155,21 +155,24 @@
 								<?php endif; ?>
 								
 								<?php if ( bp_current_user_can( 'bp_xprofile_change_field_visibility' ) ) : ?>
-									<div class="field-visibility-settings-toggle" id="field-visibility-settings-toggle-<?php bp_the_profile_field_id() ?>">
+									<p class="field-visibility-settings-toggle" id="field-visibility-settings-toggle-<?php bp_the_profile_field_id() ?>">
 										<?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>
-									</div>
+									</p>
 									
 									<div class="field-visibility-settings" id="field-visibility-settings-<?php bp_the_profile_field_id() ?>">
-										<label for="field-visibility"><?php _e( 'Who can see this field?', 'buddypress' ) ?></label>
+										<fieldset>
+											<legend><?php _e( 'Who can see this field?', 'buddypress' ) ?></legend>
 										
-										<?php bp_profile_visibility_radio_buttons() ?>
+											<?php bp_profile_visibility_radio_buttons() ?>
 										
+										</fieldset>
 										<a class="field-visibility-settings-close" href="#"><?php _e( 'Close', 'buddypress' ) ?></a>
+										
 									</div>
 								<?php else : ?>
-									<div class="field-visibility-settings-notoggle" id="field-visibility-settings-toggle-<?php bp_the_profile_field_id() ?>">
+									<p class="field-visibility-settings-notoggle" id="field-visibility-settings-toggle-<?php bp_the_profile_field_id() ?>">
 										<?php printf( __( 'This field can be seen by: <span class="current-visibility-level">%s</span>', 'buddypress' ), bp_get_the_profile_field_visibility_level_label() ) ?>
-									</div>			
+									</p>			
 								<?php endif ?>
 
 

Modified: trunk/bp-xprofile/bp-xprofile-template.php (6050 => 6051)


--- trunk/bp-xprofile/bp-xprofile-template.php	2012-05-27 16:36:16 UTC (rev 6050)
+++ trunk/bp-xprofile/bp-xprofile-template.php	2012-05-31 20:42:53 UTC (rev 6051)
@@ -899,7 +899,7 @@
 		foreach( bp_xprofile_get_visibility_levels() as $level ) {
 			$checked = $level['id'] == bp_get_the_profile_field_visibility_level() ? ' checked="checked" ' : '';
 			
-			$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>';
+			$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>';
 		}
 		
 		$html .= '</ul>';