Changeset 12397
- Timestamp:
- 05/18/2019 06:57:54 AM (6 years ago)
- Location:
- trunk/src/bp-templates/bp-nouveau
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-templates/bp-nouveau/buddypress-functions.php
r12240 r12397 325 325 // Add The password verify if needed. 326 326 if ( bp_is_active( 'settings' ) || bp_get_signup_allowed() ) { 327 /** 328 * BP Nouveau is now directly using the `wp-admin/js/user-profile.js` script. 329 * 330 * Setting the user password is now more consistent with how WordPress handles it. 331 * 332 * @deprecated 5.0.0 333 */ 327 334 $scripts['bp-nouveau-password-verify'] = array( 328 335 'file' => 'js/password-verify%s.js', … … 373 380 374 381 if ( bp_is_register_page() || bp_is_user_settings_general() ) { 375 wp_enqueue_script( ' bp-nouveau-password-verify' );382 wp_enqueue_script( 'user-profile' ); 376 383 } 377 384 -
trunk/src/bp-templates/bp-nouveau/buddypress/members/single/settings/general.php
r12156 r12397 4 4 * 5 5 * @since 3.0.0 6 * @version 3.1.06 * @version 5.0.0 7 7 */ 8 8 … … 10 10 11 11 <h2 class="screen-heading general-settings-screen"> 12 <?php _e( 'Email & Password', 'buddypress' ); ?>12 <?php esc_html_e( 'Email & Password', 'buddypress' ); ?> 13 13 </h2> 14 14 15 15 <p class="info email-pwd-info"> 16 <?php _e( 'Update your email and or password.', 'buddypress' ); ?>16 <?php esc_html_e( 'Update your email and or password.', 'buddypress' ); ?> 17 17 </p> 18 18 19 <form action="<?php echo esc_url( bp_displayed_user_domain() . bp_get_settings_slug() . '/general' ); ?>" method="post" class="standard-form" id=" settings-form">19 <form action="<?php echo esc_url( bp_displayed_user_domain() . bp_get_settings_slug() . '/general' ); ?>" method="post" class="standard-form" id="your-profile"> 20 20 21 21 <?php if ( ! is_super_admin() ) : ?> 22 22 23 <label for="pwd"><?php _e( 'Current Password <span>(required to update email or change current password)</span>', 'buddypress' ); ?></label>24 <input type="password" name="pwd" id="pwd" size="16" value="" class="settings-input small" <?php bp_form_field_attributes( 'password' ); ?>/> <a href="<?php echo esc_url( wp_lostpassword_url() ); ?>"><?php esc_html_e( 'Lost your password?', 'buddypress' ); ?></a>23 <label for="pwd"><?php printf( esc_html__( 'Current Password %s', 'buddypress' ), '<span>' . esc_html__( '(required to update email or change current password)', 'buddypress' ) . '</span>' ); ?></label> 24 <input type="password" name="pwd" id="pwd" value="" size="24" class="settings-input small" <?php bp_form_field_attributes( 'password' ); ?>/> <a href="<?php echo esc_url( wp_lostpassword_url() ); ?>"><?php esc_html_e( 'Lost your password?', 'buddypress' ); ?></a> 25 25 26 26 <?php endif; ?> 27 27 28 <label for="email"><?php _e( 'Account Email', 'buddypress' ); ?></label>28 <label for="email"><?php esc_html_e( 'Account Email', 'buddypress' ); ?></label> 29 29 <input type="email" name="email" id="email" value="<?php echo esc_attr( bp_get_displayed_user_email() ); ?>" class="settings-input" <?php bp_form_field_attributes( 'email' ); ?>/> 30 30 31 31 <div class="info bp-feedback"> 32 32 <span class="bp-icon" aria-hidden="true"></span> 33 <p class="text"><?php esc_html_e( ' Leave password fields blank for no change', 'buddypress' ); ?></p>33 <p class="text"><?php esc_html_e( 'Click on the "Generate Password" button to change your password.', 'buddypress' ); ?></p> 34 34 </div> 35 35 36 <label for="pass1"><?php esc_html_e( 'Add Your New Password', 'buddypress' ); ?></label> 37 <input type="password" name="pass1" id="pass1" size="16" value="" class="settings-input small password-entry" <?php bp_form_field_attributes( 'password' ); ?>/> 36 <div class="user-pass1-wrap"> 37 <button type="button" class="button wp-generate-pw"> 38 <?php esc_html_e( 'Generate Password', 'buddypress' ); ?> 39 </button> 38 40 39 <label for="pass2" class="repeated-pwd"><?php esc_html_e( 'Repeat Your New Password', 'buddypress' ); ?></label> 40 <input type="password" name="pass2" id="pass2" size="16" value="" class="settings-input small password-entry-confirm" <?php bp_form_field_attributes( 'password' ); ?>/> 41 <div class="wp-pwd"> 42 <label for="pass1"><?php esc_html_e( 'Add Your New Password', 'buddypress' ); ?></label> 43 <span class="password-input-wrapper"> 44 <input type="password" name="pass1" id="pass1" size="24" class="settings-input small password-entry" value="" <?php bp_form_field_attributes( 'password', array( 'data-pw' => wp_generate_password( 24 ), 'aria-describedby' => 'pass-strength-result' ) ); ?> /> 45 </span> 46 <button type="button" class="button wp-hide-pw" data-toggle="0" aria-label="<?php esc_attr_e( 'Hide password', 'buddypress' ); ?>"> 47 <span class="dashicons dashicons-hidden" aria-hidden="true"></span> 48 <span class="text bp-screen-reader-text"><?php esc_html_e( 'Hide', 'buddypress' ); ?></span> 49 </button> 50 <button type="button" class="button wp-cancel-pw" data-toggle="0" aria-label="<?php esc_attr_e( 'Cancel password change', 'buddypress' ); ?>"> 51 <span class="text"><?php esc_html_e( 'Cancel', 'buddypress' ); ?></span> 52 </button> 53 <div id="pass-strength-result" aria-live="polite"></div> 54 </div> 55 </div> 41 56 42 <div id="pass-strength-result"></div> 57 <div class="user-pass2-wrap"> 58 <label class="label" for="pass2"><?php esc_html_e( 'Repeat Your New Password', 'buddypress' ); ?></label> 59 <input name="pass2" type="password" id="pass2" size="24" class="settings-input small password-entry-confirm" value="" <?php bp_form_field_attributes( 'password' ); ?> /> 60 </div> 61 62 <div class="pw-weak"> 63 <label> 64 <input type="checkbox" name="pw_weak" class="pw-checkbox" /> 65 <span id="pw-weak-text-label"><?php esc_html_e( 'Confirm use of potentially weak password', 'buddypress' ); ?></span> 66 </label> 67 </div> 43 68 44 69 <?php bp_nouveau_submit_button( 'members-general-settings' ); ?> -
trunk/src/bp-templates/bp-nouveau/common-styles/_bp-mixins.scss
r12082 r12397 533 533 } 534 534 535 @mixin pwd-strong-colors($color: inherit, $background: null, $border: null) { 536 537 @if $background { 538 $background: $background; 539 } @else { 540 $background: $background-strong; 541 } 542 543 background-color: $background; 544 545 @if $border { 546 $border: $border; 547 } @else { 548 $border: $border-strong; 549 } 550 551 border-color: $border; 552 553 color: $color; 554 } 555 535 556 // BP Tooltips 536 557 -
trunk/src/bp-templates/bp-nouveau/common-styles/_bp-variables.scss
r12082 r12397 70 70 $background-short: #ffa0a0 !default; 71 71 $border-short: #f04040 !default; 72 $background-good: #66d66e !default; 73 $border-good: #438c48 !default; 72 $background-good: #ffec8b !default; 73 $border-good: #fc0 !default; 74 $background-strong: #66d66e !default; 75 $border-strong: #438c48 !default; 74 76 $background-bad: #ffb78c !default; 75 77 $border-bad: #ff853c !default; -
trunk/src/bp-templates/bp-nouveau/common-styles/_bp_forms.scss
r12082 r12397 133 133 } 134 134 135 input:not(. button-small),135 input:not(.small), 136 136 textarea { 137 137 width: 100%; -
trunk/src/bp-templates/bp-nouveau/common-styles/_bp_info_messages.scss
r12082 r12397 260 260 &.bad { 261 261 262 @include pwd-bad-colors($color: $ white);262 @include pwd-bad-colors($color: $black); 263 263 } 264 264 265 265 &.short { 266 266 267 @include pwd-short-colors($color: $white); 267 @include pwd-short-colors($color: $black); 268 } 269 270 &.good { 271 272 @include pwd-good-colors($color: $black); 268 273 } 269 274 270 275 &.strong { 271 276 272 @include pwd- good-colors($color: $white);277 @include pwd-strong-colors($color: $black); 273 278 } 274 279 -
trunk/src/bp-templates/bp-nouveau/common-styles/_bp_registration.scss
r12082 r12397 52 52 } 53 53 54 .wp-pwd button { 55 vertical-align: middle; 56 } 57 58 #pass1, 59 #pass1-text, 60 #pass-strength-result { 61 width: 10em; 62 } 63 64 #pass1 { 65 display: inline-block; 66 margin-bottom: inherit; 67 } 68 69 #pass1-text, 70 .pw-weak { 71 display: none; 72 } 73 74 .show-password { 75 76 #pass1-text { 77 display: inline-block; 78 margin-bottom: inherit; 79 } 80 81 #pass1 { 82 display: none; 83 } 84 } 85 86 .description.indicator-hint { 87 88 @include font-size(14); 89 } 90 91 #submit:disabled { 92 color: $light-text; 93 opacity: 0.4; 94 } 95 54 96 .password-entry, 55 97 .password-entry-confirm { … … 59 101 60 102 } // close .register-page 103 104 body.buddypress.register.js { 105 106 .user-pass2-wrap { 107 display: none; 108 } 109 } 110 111 body.buddypress.register.no-js { 112 113 .wp-hide-pw { 114 display: none; 115 } 116 } 61 117 62 118 // Flex layout containers for registration sections … … 102 158 103 159 .default-profile { 160 min-width: 14em; 104 161 flex: 1; 105 162 padding-right: $pad-med; -
trunk/src/bp-templates/bp-nouveau/common-styles/_bp_user_settings.scss
r12394 r12397 29 29 30 30 /*__ General __*/ 31 body.buddypress.settings { 31 32 33 .wp-pwd button { 34 vertical-align: middle; 35 } 36 37 #pass1, 38 #pass1-text, 39 #pass-strength-result { 40 width: 16em; 41 } 42 43 #pass1 { 44 display: inline-block; 45 margin-bottom: inherit; 46 } 47 48 #pass1-text, 49 .pw-weak, 50 #pass-strength-result { 51 display: none; 52 } 53 54 .show-password { 55 56 #pass1-text { 57 display: inline-block; 58 margin-bottom: inherit; 59 } 60 61 #pass1 { 62 display: none; 63 } 64 } 65 66 #your-profile { 67 68 #submit:disabled { 69 color: $light-text; 70 opacity: 0.4; 71 } 72 } 73 } 74 75 body.buddypress.settings.js { 76 77 .wp-pwd, 78 .user-pass2-wrap { 79 display: none; 80 } 81 } 82 83 body.buddypress.settings.no-js { 84 85 .wp-generate-pw, 86 .wp-cancel-pw, 87 .wp-hide-pw { 88 display: none; 89 } 90 } 32 91 33 92 // Email notifications -
trunk/src/bp-templates/bp-nouveau/css/buddypress-rtl.css
r12394 r12397 1947 1947 } 1948 1948 1949 .register-page .signup-form .wp-pwd button { 1950 vertical-align: middle; 1951 } 1952 1953 .register-page .signup-form #pass1, 1954 .register-page .signup-form #pass1-text, 1955 .register-page .signup-form #pass-strength-result { 1956 width: 10em; 1957 } 1958 1959 .register-page .signup-form #pass1 { 1960 display: inline-block; 1961 margin-bottom: inherit; 1962 } 1963 1964 .register-page .signup-form #pass1-text, 1965 .register-page .signup-form .pw-weak { 1966 display: none; 1967 } 1968 1969 .register-page .signup-form .show-password #pass1-text { 1970 display: inline-block; 1971 margin-bottom: inherit; 1972 } 1973 1974 .register-page .signup-form .show-password #pass1 { 1975 display: none; 1976 } 1977 1978 .register-page .signup-form .description.indicator-hint { 1979 font-size: 14px; 1980 } 1981 1982 .register-page .signup-form #submit:disabled { 1983 color: #767676; 1984 opacity: 0.4; 1985 } 1986 1949 1987 .register-page .signup-form .password-entry, 1950 1988 .register-page .signup-form .password-entry-confirm { 1951 1989 border: 1px solid #eee; 1990 } 1991 1992 body.buddypress.register.js .user-pass2-wrap { 1993 display: none; 1994 } 1995 1996 body.buddypress.register.no-js .wp-hide-pw { 1997 display: none; 1952 1998 } 1953 1999 … … 1973 2019 @media screen and (min-width: 46.8em) { 1974 2020 .buddypress-wrap.extended-default-reg .register-page .default-profile { 2021 min-width: 14em; 1975 2022 flex: 1; 1976 2023 padding-left: 1em; … … 3221 3268 3222 3269 /*__ General __*/ 3270 body.buddypress.settings .wp-pwd button { 3271 vertical-align: middle; 3272 } 3273 3274 body.buddypress.settings #pass1, 3275 body.buddypress.settings #pass1-text, 3276 body.buddypress.settings #pass-strength-result { 3277 width: 16em; 3278 } 3279 3280 body.buddypress.settings #pass1 { 3281 display: inline-block; 3282 margin-bottom: inherit; 3283 } 3284 3285 body.buddypress.settings #pass1-text, 3286 body.buddypress.settings .pw-weak, 3287 body.buddypress.settings #pass-strength-result { 3288 display: none; 3289 } 3290 3291 body.buddypress.settings .show-password #pass1-text { 3292 display: inline-block; 3293 margin-bottom: inherit; 3294 } 3295 3296 body.buddypress.settings .show-password #pass1 { 3297 display: none; 3298 } 3299 3300 body.buddypress.settings #your-profile #submit:disabled { 3301 color: #767676; 3302 opacity: 0.4; 3303 } 3304 3305 body.buddypress.settings.js .wp-pwd, 3306 body.buddypress.settings.js .user-pass2-wrap { 3307 display: none; 3308 } 3309 3310 body.buddypress.settings.no-js .wp-generate-pw, 3311 body.buddypress.settings.no-js .wp-cancel-pw, 3312 body.buddypress.settings.no-js .wp-hide-pw { 3313 display: none; 3314 } 3315 3223 3316 /*__ Email notifications __*/ 3224 3317 /*__ Profile visibility __*/ … … 3336 3429 } 3337 3430 3338 .buddypress-wrap .standard-form input:not(. button-small),3431 .buddypress-wrap .standard-form input:not(.small), 3339 3432 .buddypress-wrap .standard-form textarea { 3340 3433 width: 100%; … … 4355 4448 background-color: #ffb78c; 4356 4449 border-color: #ff853c; 4357 color: # fff;4450 color: #333; 4358 4451 } 4359 4452 … … 4361 4454 background-color: #ffa0a0; 4362 4455 border-color: #f04040; 4363 color: #fff; 4456 color: #333; 4457 } 4458 4459 .buddypress-wrap #pass-strength-result.good { 4460 background-color: #ffec8b; 4461 border-color: #fc0; 4462 color: #333; 4364 4463 } 4365 4464 … … 4367 4466 background-color: #66d66e; 4368 4467 border-color: #438c48; 4369 color: # fff;4468 color: #333; 4370 4469 } 4371 4470 -
trunk/src/bp-templates/bp-nouveau/css/buddypress.css
r12394 r12397 1947 1947 } 1948 1948 1949 .register-page .signup-form .wp-pwd button { 1950 vertical-align: middle; 1951 } 1952 1953 .register-page .signup-form #pass1, 1954 .register-page .signup-form #pass1-text, 1955 .register-page .signup-form #pass-strength-result { 1956 width: 10em; 1957 } 1958 1959 .register-page .signup-form #pass1 { 1960 display: inline-block; 1961 margin-bottom: inherit; 1962 } 1963 1964 .register-page .signup-form #pass1-text, 1965 .register-page .signup-form .pw-weak { 1966 display: none; 1967 } 1968 1969 .register-page .signup-form .show-password #pass1-text { 1970 display: inline-block; 1971 margin-bottom: inherit; 1972 } 1973 1974 .register-page .signup-form .show-password #pass1 { 1975 display: none; 1976 } 1977 1978 .register-page .signup-form .description.indicator-hint { 1979 font-size: 14px; 1980 } 1981 1982 .register-page .signup-form #submit:disabled { 1983 color: #767676; 1984 opacity: 0.4; 1985 } 1986 1949 1987 .register-page .signup-form .password-entry, 1950 1988 .register-page .signup-form .password-entry-confirm { 1951 1989 border: 1px solid #eee; 1990 } 1991 1992 body.buddypress.register.js .user-pass2-wrap { 1993 display: none; 1994 } 1995 1996 body.buddypress.register.no-js .wp-hide-pw { 1997 display: none; 1952 1998 } 1953 1999 … … 1973 2019 @media screen and (min-width: 46.8em) { 1974 2020 .buddypress-wrap.extended-default-reg .register-page .default-profile { 2021 min-width: 14em; 1975 2022 flex: 1; 1976 2023 padding-right: 1em; … … 3221 3268 3222 3269 /*__ General __*/ 3270 body.buddypress.settings .wp-pwd button { 3271 vertical-align: middle; 3272 } 3273 3274 body.buddypress.settings #pass1, 3275 body.buddypress.settings #pass1-text, 3276 body.buddypress.settings #pass-strength-result { 3277 width: 16em; 3278 } 3279 3280 body.buddypress.settings #pass1 { 3281 display: inline-block; 3282 margin-bottom: inherit; 3283 } 3284 3285 body.buddypress.settings #pass1-text, 3286 body.buddypress.settings .pw-weak, 3287 body.buddypress.settings #pass-strength-result { 3288 display: none; 3289 } 3290 3291 body.buddypress.settings .show-password #pass1-text { 3292 display: inline-block; 3293 margin-bottom: inherit; 3294 } 3295 3296 body.buddypress.settings .show-password #pass1 { 3297 display: none; 3298 } 3299 3300 body.buddypress.settings #your-profile #submit:disabled { 3301 color: #767676; 3302 opacity: 0.4; 3303 } 3304 3305 body.buddypress.settings.js .wp-pwd, 3306 body.buddypress.settings.js .user-pass2-wrap { 3307 display: none; 3308 } 3309 3310 body.buddypress.settings.no-js .wp-generate-pw, 3311 body.buddypress.settings.no-js .wp-cancel-pw, 3312 body.buddypress.settings.no-js .wp-hide-pw { 3313 display: none; 3314 } 3315 3223 3316 /*__ Email notifications __*/ 3224 3317 /*__ Profile visibility __*/ … … 3336 3429 } 3337 3430 3338 .buddypress-wrap .standard-form input:not(. button-small),3431 .buddypress-wrap .standard-form input:not(.small), 3339 3432 .buddypress-wrap .standard-form textarea { 3340 3433 width: 100%; … … 4355 4448 background-color: #ffb78c; 4356 4449 border-color: #ff853c; 4357 color: # fff;4450 color: #333; 4358 4451 } 4359 4452 … … 4361 4454 background-color: #ffa0a0; 4362 4455 border-color: #f04040; 4363 color: #fff; 4456 color: #333; 4457 } 4458 4459 .buddypress-wrap #pass-strength-result.good { 4460 background-color: #ffec8b; 4461 border-color: #fc0; 4462 color: #333; 4364 4463 } 4365 4464 … … 4367 4466 background-color: #66d66e; 4368 4467 border-color: #438c48; 4369 color: # fff;4468 color: #333; 4370 4469 } 4371 4470 -
trunk/src/bp-templates/bp-nouveau/includes/functions.php
r12156 r12397 1162 1162 'class' => '', 1163 1163 ), 1164 'signup_password' => array( 1165 'label' => __( 'Choose a Password', 'buddypress' ), 1166 'required' => true, 1167 'value' => '', 1168 'attribute_type' => 'password', 1169 'type' => 'password', 1170 'class' => 'password-entry', 1171 ), 1172 'signup_password_confirm' => array( 1173 'label' => __( 'Confirm Password', 'buddypress' ), 1174 'required' => true, 1175 'value' => '', 1176 'attribute_type' => 'password', 1177 'type' => 'password', 1178 'class' => 'password-entry-confirm', 1179 ), 1164 'signup_password' => array(), 1165 'signup_password_confirm' => array(), 1180 1166 ), 1181 1167 'blog_details' => array( … … 1257 1243 'attributes' => array( 1258 1244 'name' => 'signup_submit', 1259 'id' => 's ignup_submit',1245 'id' => 'submit', 1260 1246 'value' => __( 'Complete Sign Up', 'buddypress' ), 1261 1247 ), -
trunk/src/bp-templates/bp-nouveau/includes/template-tags.php
r12322 r12397 2310 2310 2311 2311 foreach ( $fields as $name => $attributes ) { 2312 list( $label, $required, $value, $attribute_type, $type, $class ) = array_values( $attributes ); 2313 2314 // Text fields are using strings, radios are using their inputs 2315 $label_output = '<label for="%1$s">%2$s</label>'; 2316 $id = $name; 2317 $classes = ''; 2318 2319 if ( $required ) { 2320 /* translators: Do not translate placeholders. 2 = form field name, 3 = "(required)". */ 2321 $label_output = __( '<label for="%1$s">%2$s %3$s</label>', 'buddypress' ); 2322 } 2323 2324 // Output the label for regular fields 2325 if ( 'radio' !== $type ) { 2312 if ( 'signup_password' === $name ) { 2313 ?> 2314 <label for="pass1"><?php esc_html_e( 'Choose a Password (required)', 'buddypress' ); ?></label> 2315 <div class="user-pass1-wrap"> 2316 <div class="wp-pwd"> 2317 <div class="password-input-wrapper"> 2318 <input type="password" data-reveal="1" name="signup_password" id="pass1" class="password-entry" size="24" value="" <?php bp_form_field_attributes( 'password', array( 'data-pw' => wp_generate_password( 12 ), 'aria-describedby' => 'pass-strength-result' ) ); ?> /> 2319 <button type="button" class="button wp-hide-pw"> 2320 <span class="dashicons dashicons-hidden" aria-hidden="true"></span> 2321 </button> 2322 </div> 2323 <div id="pass-strength-result" aria-live="polite"><?php esc_html_e( 'Strength indicator', 'buddypress' ); ?></div> 2324 </div> 2325 <div class="pw-weak"> 2326 <label> 2327 <input type="checkbox" name="pw_weak" class="pw-checkbox" /> 2328 <?php esc_html_e( 'Confirm use of weak password', 'buddypress' ); ?> 2329 </label> 2330 </div> 2331 </div> 2332 <?php 2333 } elseif ( 'signup_password_confirm' === $name ) { 2334 ?> 2335 <p class="user-pass2-wrap"> 2336 <label for="pass2"><?php esc_html_e( 'Confirm new password', 'buddypress' ); ?></label><br /> 2337 <input type="password" name="signup_password_confirm" id="pass2" class="password-entry-confirm" size="24" value="" <?php bp_form_field_attributes( 'password' ); ?> /> 2338 </p> 2339 2340 <p class="description indicator-hint"><?php echo wp_get_password_hint(); ?></p> 2341 <?php 2342 } else { 2343 list( $label, $required, $value, $attribute_type, $type, $class ) = array_values( $attributes ); 2344 2345 // Text fields are using strings, radios are using their inputs 2346 $label_output = '<label for="%1$s">%2$s</label>'; 2347 $id = $name; 2348 $classes = ''; 2349 2326 2350 if ( $required ) { 2327 printf( $label_output, esc_attr( $name ), esc_html( $label ), __( '(required)', 'buddypress' ) ); 2328 } else { 2329 printf( $label_output, esc_attr( $name ), esc_html( $label ) ); 2351 /* translators: Do not translate placeholders. 2 = form field name, 3 = "(required)". */ 2352 $label_output = __( '<label for="%1$s">%2$s %3$s</label>', 'buddypress' ); 2330 2353 } 2331 2354 2332 if ( ! empty( $value ) && is_callable( $value ) ) { 2333 $value = call_user_func( $value ); 2355 // Output the label for regular fields 2356 if ( 'radio' !== $type ) { 2357 if ( $required ) { 2358 printf( $label_output, esc_attr( $name ), esc_html( $label ), __( '(required)', 'buddypress' ) ); 2359 } else { 2360 printf( $label_output, esc_attr( $name ), esc_html( $label ) ); 2361 } 2362 2363 if ( ! empty( $value ) && is_callable( $value ) ) { 2364 $value = call_user_func( $value ); 2365 } 2366 2367 // Handle the specific case of Site's privacy differently 2368 } elseif ( 'signup_blog_privacy_private' !== $name ) { 2369 ?> 2370 <span class="label"> 2371 <?php esc_html_e( 'I would like my site to appear in search engines, and in public listings around this network.', 'buddypress' ); ?> 2372 </span> 2373 <?php 2334 2374 } 2335 2375 2336 // Handle the specific case of Site's privacy differently 2337 } elseif ( 'signup_blog_privacy_private' !== $name ) { 2338 ?> 2339 <span class="label"> 2340 <?php esc_html_e( 'I would like my site to appear in search engines, and in public listings around this network.', 'buddypress' ); ?> 2341 </span> 2342 <?php 2343 } 2344 2345 // Set the additional attributes 2346 if ( $attribute_type ) { 2347 $existing_attributes = array(); 2348 2349 if ( ! empty( $required ) ) { 2350 $existing_attributes = array( 'aria-required' => 'true' ); 2376 // Set the additional attributes 2377 if ( $attribute_type ) { 2378 $existing_attributes = array(); 2379 2380 if ( ! empty( $required ) ) { 2381 $existing_attributes = array( 'aria-required' => 'true' ); 2382 2383 /** 2384 * The blog section is hidden, so let's avoid a browser warning 2385 * and deal with the Blog section in Javascript. 2386 */ 2387 if ( $section !== 'blog_details' ) { 2388 $existing_attributes['required'] = 'required'; 2389 } 2390 } 2391 2392 $attribute_type = ' ' . bp_get_form_field_attributes( $attribute_type, $existing_attributes ); 2393 } 2394 2395 // Specific case for Site's privacy 2396 if ( 'signup_blog_privacy_public' === $name || 'signup_blog_privacy_private' === $name ) { 2397 $name = 'signup_blog_privacy'; 2398 $submitted = bp_get_signup_blog_privacy_value(); 2399 2400 if ( ! $submitted ) { 2401 $submitted = 'public'; 2402 } 2403 2404 $attribute_type = ' ' . checked( $value, $submitted, false ); 2405 } 2406 2407 // Do not run function to display errors for the private radio. 2408 if ( 'private' !== $value ) { 2351 2409 2352 2410 /** 2353 * The blog section is hidden, so let's avoid a browser warning 2354 * and deal with the Blog section in Javascript. 2411 * Fetch & display any BP member registration field errors. 2412 * 2413 * Passes BP signup errors to Nouveau's template function to 2414 * render suitable markup for error string. 2355 2415 */ 2356 if ( $section !== 'blog_details' ) { 2357 $existing_attributes['required'] = 'required'; 2416 if ( isset( buddypress()->signup->errors[ $name ] ) ) { 2417 nouveau_error_template( buddypress()->signup->errors[ $name ] ); 2418 $invalid = 'invalid'; 2358 2419 } 2359 2420 } 2360 2421 2361 $attribute_type = ' ' . bp_get_form_field_attributes( $attribute_type, $existing_attributes ); 2362 } 2363 2364 // Specific case for Site's privacy 2365 if ( 'signup_blog_privacy_public' === $name || 'signup_blog_privacy_private' === $name ) { 2366 $name = 'signup_blog_privacy'; 2367 $submitted = bp_get_signup_blog_privacy_value(); 2368 2369 if ( ! $submitted ) { 2370 $submitted = 'public'; 2422 if ( isset( $invalid ) && isset( buddypress()->signup->errors[ $name ] ) ) { 2423 if ( ! empty( $class ) ) { 2424 $class = $class . ' ' . $invalid; 2425 } else { 2426 $class = $invalid; 2427 } 2371 2428 } 2372 2429 2373 $attribute_type = ' ' . checked( $value, $submitted, false ); 2374 } 2375 2376 // Do not run function to display errors for the private radio. 2377 if ( 'private' !== $value ) { 2378 2379 /** 2380 * Fetch & display any BP member registration field errors. 2381 * 2382 * Passes BP signup errors to Nouveau's template function to 2383 * render suitable markup for error string. 2384 */ 2385 if ( isset( buddypress()->signup->errors[ $name ] ) ) { 2386 nouveau_error_template( buddypress()->signup->errors[ $name ] ); 2387 $invalid = 'invalid'; 2388 } 2389 } 2390 2391 if ( isset( $invalid ) && isset( buddypress()->signup->errors[ $name ] ) ) { 2392 if ( ! empty( $class ) ) { 2393 $class = $class . ' ' . $invalid; 2394 } else { 2395 $class = $invalid; 2396 } 2397 } 2398 2399 if ( $class ) { 2400 $class = sprintf( 2401 ' class="%s"', 2402 esc_attr( join( ' ', array_map( 'sanitize_html_class', explode( ' ', $class ) ) ) ) 2403 ); 2404 } 2405 2406 // Set the input. 2407 $field_output = sprintf( 2408 '<input type="%1$s" name="%2$s" id="%3$s" %4$s value="%5$s" %6$s />', 2409 esc_attr( $type ), 2410 esc_attr( $name ), 2411 esc_attr( $id ), 2412 $class, // Constructed safely above. 2413 esc_attr( $value ), 2414 $attribute_type // Constructed safely above. 2415 ); 2416 2417 // Not a radio, let's output the field 2418 if ( 'radio' !== $type ) { 2419 if ( 'signup_blog_url' !== $name ) { 2420 print( $field_output ); // Constructed safely above. 2421 2422 // If it's the signup blog url, it's specific to Multisite config. 2423 } elseif ( is_subdomain_install() ) { 2424 // Constructed safely above. 2425 printf( 2426 '%1$s %2$s . %3$s', 2427 is_ssl() ? 'https://' : 'http://', 2428 $field_output, 2429 bp_signup_get_subdomain_base() 2430 ); 2431 2432 // Subfolders! 2433 } else { 2434 printf( 2435 '%1$s %2$s', 2436 home_url( '/' ), 2437 $field_output // Constructed safely above. 2430 if ( $class ) { 2431 $class = sprintf( 2432 ' class="%s"', 2433 esc_attr( join( ' ', array_map( 'sanitize_html_class', explode( ' ', $class ) ) ) ) 2438 2434 ); 2439 2435 } 2440 2436 2441 // It's a radio, let's output the field inside the label 2442 } else { 2443 // $label_output and $field_output are constructed safely above. 2444 printf( $label_output, esc_attr( $name ), $field_output . ' ' . esc_html( $label ) ); 2445 } 2446 2447 // Password strength is restricted to the signup_password field 2448 if ( 'signup_password' === $name ) : 2449 ?> 2450 <div id="pass-strength-result"></div> 2451 <?php 2452 endif; 2437 // Set the input. 2438 $field_output = sprintf( 2439 '<input type="%1$s" name="%2$s" id="%3$s" %4$s value="%5$s" %6$s />', 2440 esc_attr( $type ), 2441 esc_attr( $name ), 2442 esc_attr( $id ), 2443 $class, // Constructed safely above. 2444 esc_attr( $value ), 2445 $attribute_type // Constructed safely above. 2446 ); 2447 2448 // Not a radio, let's output the field 2449 if ( 'radio' !== $type ) { 2450 if ( 'signup_blog_url' !== $name ) { 2451 print( $field_output ); // Constructed safely above. 2452 2453 // If it's the signup blog url, it's specific to Multisite config. 2454 } elseif ( is_subdomain_install() ) { 2455 // Constructed safely above. 2456 printf( 2457 '%1$s %2$s . %3$s', 2458 is_ssl() ? 'https://' : 'http://', 2459 $field_output, 2460 bp_signup_get_subdomain_base() 2461 ); 2462 2463 // Subfolders! 2464 } else { 2465 printf( 2466 '%1$s %2$s', 2467 home_url( '/' ), 2468 $field_output // Constructed safely above. 2469 ); 2470 } 2471 2472 // It's a radio, let's output the field inside the label 2473 } else { 2474 // $label_output and $field_output are constructed safely above. 2475 printf( $label_output, esc_attr( $name ), $field_output . ' ' . esc_html( $label ) ); 2476 } 2477 } 2453 2478 } 2454 2479 -
trunk/src/bp-templates/bp-nouveau/js/password-verify.js
r12082 r12397 2 2 /* Password Verify */ 3 3 /* global pwsL10n */ 4 /* @version 3.0.0 */ 4 /* @since 3.0.0 */ 5 /* @version 5.0.0 */ 5 6 ( function( $ ){ 7 /** 8 * Function to inform the user about the strength of its password. 9 * 10 * @deprecated since version 5.0.0. 11 */ 6 12 function check_pass_strength() { 7 13 var pass1 = $( '.password-entry' ).val(), … … 41 47 $( '.password-entry' ).val( '' ).keyup( check_pass_strength ); 42 48 $( '.password-entry-confirm' ).val( '' ).keyup( check_pass_strength ); 49 50 // Display a deprecated warning. 51 console.warn( 'The bp-nouveau/js/password-verify.js script is deprecated since 5.0.0 and will be deleted in version 6.0.0.' ); 43 52 } ); 44 53
Note: See TracChangeset
for help on using the changeset viewer.