Ticket #8092: 8092.2.patch
| File 8092.2.patch, 31.7 KB (added by , 7 years ago) |
|---|
-
src/bp-templates/bp-nouveau/buddypress-functions.php
diff --git src/bp-templates/bp-nouveau/buddypress-functions.php src/bp-templates/bp-nouveau/buddypress-functions.php index 0a5d582ad..47cc20c19 100644
class BP_Nouveau extends BP_Theme_Compat { 322 322 return; 323 323 } 324 324 325 // Add The password verify if needed.326 if ( bp_is_active( 'settings' ) || bp_get_signup_allowed() ) {327 $scripts['bp-nouveau-password-verify'] = array(328 'file' => 'js/password-verify%s.js',329 'dependencies' => array( 'bp-nouveau', 'password-strength-meter' ),330 'footer' => true,331 );332 }333 334 325 foreach ( $scripts as $handle => $script ) { 335 326 if ( ! isset( $script['file'] ) ) { 336 327 continue; … … class BP_Nouveau extends BP_Theme_Compat { 372 363 wp_enqueue_script( 'bp-nouveau' ); 373 364 374 365 if ( bp_is_register_page() || bp_is_user_settings_general() ) { 375 wp_enqueue_script( ' bp-nouveau-password-verify' );366 wp_enqueue_script( 'user-profile' ); 376 367 } 377 368 378 369 if ( is_singular() && bp_is_blog_page() && get_option( 'thread_comments' ) ) { -
src/bp-templates/bp-nouveau/buddypress/members/single/settings/general.php
diff --git src/bp-templates/bp-nouveau/buddypress/members/single/settings/general.php src/bp-templates/bp-nouveau/buddypress/members/single/settings/general.php index 462191faa..460187d3c 100644
3 3 * BuddyPress - Members Settings ( General ) 4 4 * 5 5 * @since 3.0.0 6 * @version 3.1.06 * @version 5.0.0 7 7 */ 8 8 9 9 bp_nouveau_member_hook( 'before', 'settings_template' ); ?> 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> 56 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> 41 61 42 <div id="pass-strength-result"></div> 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' ); ?> 45 70 -
src/bp-templates/bp-nouveau/common-styles/_bp-mixins.scss
diff --git src/bp-templates/bp-nouveau/common-styles/_bp-mixins.scss src/bp-templates/bp-nouveau/common-styles/_bp-mixins.scss index 898ac7203..cb0f9910b 100644
532 532 color: $color; 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 537 558 // Bottom center tooltip - Default -
src/bp-templates/bp-nouveau/common-styles/_bp-variables.scss
diff --git src/bp-templates/bp-nouveau/common-styles/_bp-variables.scss src/bp-templates/bp-nouveau/common-styles/_bp-variables.scss index 1d97187b6..3ef12b57b 100644
$update-success: #8a2 !default; 69 69 $pwd-background: #eee !default; 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; 76 78 -
src/bp-templates/bp-nouveau/common-styles/_bp_forms.scss
diff --git src/bp-templates/bp-nouveau/common-styles/_bp_forms.scss src/bp-templates/bp-nouveau/common-styles/_bp_forms.scss index fa0f83c98..72b1fb1d3 100644
132 132 } 133 133 } 134 134 135 input:not(. button-small),135 input:not(.small), 136 136 textarea { 137 137 width: 100%; 138 138 } -
src/bp-templates/bp-nouveau/common-styles/_bp_info_messages.scss
diff --git src/bp-templates/bp-nouveau/common-styles/_bp_info_messages.scss src/bp-templates/bp-nouveau/common-styles/_bp_info_messages.scss index af15cd533..9ac95e156 100644
259 259 &.error, 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 275 280 } // close #pass-strength-result -
src/bp-templates/bp-nouveau/common-styles/_bp_registration.scss
diff --git src/bp-templates/bp-nouveau/common-styles/_bp_registration.scss src/bp-templates/bp-nouveau/common-styles/_bp_registration.scss index 7ba78f393..db45ec491 100644
51 51 margin: 0 $marg-med $marg-sml 0; 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-text, 65 .pw-weak { 66 display: none; 67 } 68 69 .show-password { 70 71 #pass1-text { 72 display: inline-block; 73 } 74 75 #pass1 { 76 display: none; 77 } 78 } 79 80 .description.indicator-hint { 81 82 @include font-size(14); 83 } 84 85 #submit:disabled { 86 color: $light-text; 87 opacity: 0.4; 88 } 89 54 90 .password-entry, 55 91 .password-entry-confirm { 56 92 border: 1px solid $bp-border-color; … … 59 95 60 96 } // close .register-page 61 97 98 body.buddypress.register.js { 99 100 .user-pass2-wrap { 101 display: none; 102 } 103 } 104 105 body.buddypress.register.no-js { 106 107 .wp-hide-pw { 108 display: none; 109 } 110 } 111 62 112 // Flex layout containers for registration sections 63 113 64 114 @include medium-up() { … … 101 151 .register-page { 102 152 103 153 .default-profile { 154 min-width: 14em; 104 155 flex: 1; 105 156 padding-right: $pad-med; 106 157 } -
src/bp-templates/bp-nouveau/common-styles/_bp_user_settings.scss
diff --git src/bp-templates/bp-nouveau/common-styles/_bp_user_settings.scss src/bp-templates/bp-nouveau/common-styles/_bp_user_settings.scss index 8ad15fc3f..c3719f6d8 100644
28 28 // General 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-text, 44 .pw-weak, 45 #pass-strength-result { 46 display: none; 47 } 48 49 .show-password { 50 51 #pass1-text { 52 display: inline-block; 53 } 54 55 #pass1 { 56 display: none; 57 } 58 } 59 60 #your-profile { 61 62 #submit:disabled { 63 color: $light-text; 64 opacity: 0.4; 65 } 66 } 67 } 68 69 body.buddypress.settings.js { 70 71 .wp-pwd, 72 .user-pass2-wrap { 73 display: none; 74 } 75 } 76 77 body.buddypress.settings.no-js { 78 79 .wp-generate-pw, 80 .wp-cancel-pw, 81 .wp-hide-pw { 82 display: none; 83 } 84 } 32 85 33 86 // Email notifications 34 87 -
src/bp-templates/bp-nouveau/css/buddypress-rtl.css
diff --git src/bp-templates/bp-nouveau/css/buddypress-rtl.css src/bp-templates/bp-nouveau/css/buddypress-rtl.css index b716e4fec..79816f493 100644
form.ac-form .ac-reply-content input { 1946 1946 margin: 0 0 10px 15px; 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-text, 1960 .register-page .signup-form .pw-weak { 1961 display: none; 1962 } 1963 1964 .register-page .signup-form .show-password #pass1-text { 1965 display: inline-block; 1966 } 1967 1968 .register-page .signup-form .show-password #pass1 { 1969 display: none; 1970 } 1971 1972 .register-page .signup-form .description.indicator-hint { 1973 font-size: 14px; 1974 } 1975 1976 .register-page .signup-form #submit:disabled { 1977 color: #767676; 1978 opacity: 0.4; 1979 } 1980 1949 1981 .register-page .signup-form .password-entry, 1950 1982 .register-page .signup-form .password-entry-confirm { 1951 1983 border: 1px solid #eee; 1952 1984 } 1953 1985 1986 body.buddypress.register.js .user-pass2-wrap { 1987 display: none; 1988 } 1989 1990 body.buddypress.register.no-js .wp-hide-pw { 1991 display: none; 1992 } 1993 1954 1994 @media screen and (min-width: 46.8em) { 1955 1995 .buddypress-wrap .register-page .layout-wrap { 1956 1996 display: flex; … … form.ac-form .ac-reply-content input { 1972 2012 1973 2013 @media screen and (min-width: 46.8em) { 1974 2014 .buddypress-wrap.extended-default-reg .register-page .default-profile { 2015 min-width: 14em; 1975 2016 flex: 1; 1976 2017 padding-left: 1em; 1977 2018 } … … div.bp-navs#subsubnav.bp-messages-filters .user-messages-bulk-actions { 3220 3261 } 3221 3262 3222 3263 /*__ General __*/ 3264 body.buddypress.settings .wp-pwd button { 3265 vertical-align: middle; 3266 } 3267 3268 body.buddypress.settings #pass1, 3269 body.buddypress.settings #pass1-text, 3270 body.buddypress.settings #pass-strength-result { 3271 width: 16em; 3272 } 3273 3274 body.buddypress.settings #pass1-text, 3275 body.buddypress.settings .pw-weak, 3276 body.buddypress.settings #pass-strength-result { 3277 display: none; 3278 } 3279 3280 body.buddypress.settings .show-password #pass1-text { 3281 display: inline-block; 3282 } 3283 3284 body.buddypress.settings .show-password #pass1 { 3285 display: none; 3286 } 3287 3288 body.buddypress.settings #your-profile #submit:disabled { 3289 color: #767676; 3290 opacity: 0.4; 3291 } 3292 3293 body.buddypress.settings.js .wp-pwd, 3294 body.buddypress.settings.js .user-pass2-wrap { 3295 display: none; 3296 } 3297 3298 body.buddypress.settings.no-js .wp-generate-pw, 3299 body.buddypress.settings.no-js .wp-cancel-pw, 3300 body.buddypress.settings.no-js .wp-hide-pw { 3301 display: none; 3302 } 3303 3223 3304 /*__ Email notifications __*/ 3224 3305 /*__ Profile visibility __*/ 3225 3306 /*__ Group Invites __*/ … … body.buddypress.settings.data #buddypress.buddypress-wrap .item-body p a { 3335 3416 border-color: #b71717; 3336 3417 } 3337 3418 3338 .buddypress-wrap .standard-form input:not(. button-small),3419 .buddypress-wrap .standard-form input:not(.small), 3339 3420 .buddypress-wrap .standard-form textarea { 3340 3421 width: 100%; 3341 3422 } … … body.no-js .buddypress #messages-bulk-management #select-all-messages { 4354 4435 .buddypress-wrap #pass-strength-result.error, .buddypress-wrap #pass-strength-result.bad { 4355 4436 background-color: #ffb78c; 4356 4437 border-color: #ff853c; 4357 color: # fff;4438 color: #333; 4358 4439 } 4359 4440 4360 4441 .buddypress-wrap #pass-strength-result.short { 4361 4442 background-color: #ffa0a0; 4362 4443 border-color: #f04040; 4363 color: #fff; 4444 color: #333; 4445 } 4446 4447 .buddypress-wrap #pass-strength-result.good { 4448 background-color: #ffec8b; 4449 border-color: #fc0; 4450 color: #333; 4364 4451 } 4365 4452 4366 4453 .buddypress-wrap #pass-strength-result.strong { 4367 4454 background-color: #66d66e; 4368 4455 border-color: #438c48; 4369 color: # fff;4456 color: #333; 4370 4457 } 4371 4458 4372 4459 .buddypress-wrap .standard-form#signup_form div div.error { -
src/bp-templates/bp-nouveau/css/buddypress.css
diff --git src/bp-templates/bp-nouveau/css/buddypress.css src/bp-templates/bp-nouveau/css/buddypress.css index 72848855d..bf353fc40 100644
form.ac-form .ac-reply-content input { 1946 1946 margin: 0 15px 10px 0; 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-text, 1960 .register-page .signup-form .pw-weak { 1961 display: none; 1962 } 1963 1964 .register-page .signup-form .show-password #pass1-text { 1965 display: inline-block; 1966 } 1967 1968 .register-page .signup-form .show-password #pass1 { 1969 display: none; 1970 } 1971 1972 .register-page .signup-form .description.indicator-hint { 1973 font-size: 14px; 1974 } 1975 1976 .register-page .signup-form #submit:disabled { 1977 color: #767676; 1978 opacity: 0.4; 1979 } 1980 1949 1981 .register-page .signup-form .password-entry, 1950 1982 .register-page .signup-form .password-entry-confirm { 1951 1983 border: 1px solid #eee; 1952 1984 } 1953 1985 1986 body.buddypress.register.js .user-pass2-wrap { 1987 display: none; 1988 } 1989 1990 body.buddypress.register.no-js .wp-hide-pw { 1991 display: none; 1992 } 1993 1954 1994 @media screen and (min-width: 46.8em) { 1955 1995 .buddypress-wrap .register-page .layout-wrap { 1956 1996 display: flex; … … form.ac-form .ac-reply-content input { 1972 2012 1973 2013 @media screen and (min-width: 46.8em) { 1974 2014 .buddypress-wrap.extended-default-reg .register-page .default-profile { 2015 min-width: 14em; 1975 2016 flex: 1; 1976 2017 padding-right: 1em; 1977 2018 } … … div.bp-navs#subsubnav.bp-messages-filters .user-messages-bulk-actions { 3220 3261 } 3221 3262 3222 3263 /*__ General __*/ 3264 body.buddypress.settings .wp-pwd button { 3265 vertical-align: middle; 3266 } 3267 3268 body.buddypress.settings #pass1, 3269 body.buddypress.settings #pass1-text, 3270 body.buddypress.settings #pass-strength-result { 3271 width: 16em; 3272 } 3273 3274 body.buddypress.settings #pass1-text, 3275 body.buddypress.settings .pw-weak, 3276 body.buddypress.settings #pass-strength-result { 3277 display: none; 3278 } 3279 3280 body.buddypress.settings .show-password #pass1-text { 3281 display: inline-block; 3282 } 3283 3284 body.buddypress.settings .show-password #pass1 { 3285 display: none; 3286 } 3287 3288 body.buddypress.settings #your-profile #submit:disabled { 3289 color: #767676; 3290 opacity: 0.4; 3291 } 3292 3293 body.buddypress.settings.js .wp-pwd, 3294 body.buddypress.settings.js .user-pass2-wrap { 3295 display: none; 3296 } 3297 3298 body.buddypress.settings.no-js .wp-generate-pw, 3299 body.buddypress.settings.no-js .wp-cancel-pw, 3300 body.buddypress.settings.no-js .wp-hide-pw { 3301 display: none; 3302 } 3303 3223 3304 /*__ Email notifications __*/ 3224 3305 /*__ Profile visibility __*/ 3225 3306 /*__ Group Invites __*/ … … body.buddypress.settings.data #buddypress.buddypress-wrap .item-body p a { 3335 3416 border-color: #b71717; 3336 3417 } 3337 3418 3338 .buddypress-wrap .standard-form input:not(. button-small),3419 .buddypress-wrap .standard-form input:not(.small), 3339 3420 .buddypress-wrap .standard-form textarea { 3340 3421 width: 100%; 3341 3422 } … … body.no-js .buddypress #messages-bulk-management #select-all-messages { 4354 4435 .buddypress-wrap #pass-strength-result.error, .buddypress-wrap #pass-strength-result.bad { 4355 4436 background-color: #ffb78c; 4356 4437 border-color: #ff853c; 4357 color: # fff;4438 color: #333; 4358 4439 } 4359 4440 4360 4441 .buddypress-wrap #pass-strength-result.short { 4361 4442 background-color: #ffa0a0; 4362 4443 border-color: #f04040; 4363 color: #fff; 4444 color: #333; 4445 } 4446 4447 .buddypress-wrap #pass-strength-result.good { 4448 background-color: #ffec8b; 4449 border-color: #fc0; 4450 color: #333; 4364 4451 } 4365 4452 4366 4453 .buddypress-wrap #pass-strength-result.strong { 4367 4454 background-color: #66d66e; 4368 4455 border-color: #438c48; 4369 color: # fff;4456 color: #333; 4370 4457 } 4371 4458 4372 4459 .buddypress-wrap .standard-form#signup_form div div.error { -
src/bp-templates/bp-nouveau/includes/functions.php
diff --git src/bp-templates/bp-nouveau/includes/functions.php src/bp-templates/bp-nouveau/includes/functions.php index 711596337..a4cd20aa8 100644
function bp_nouveau_get_signup_fields( $section = '' ) { 1161 1161 'type' => 'email', 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( 1182 1168 'signup_blog_url' => array( … … function bp_nouveau_get_submit_button( $action = '' ) { 1256 1242 'nonce' => 'bp_new_signup', 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 ), 1262 1248 ), -
src/bp-templates/bp-nouveau/includes/template-tags.php
diff --git src/bp-templates/bp-nouveau/includes/template-tags.php src/bp-templates/bp-nouveau/includes/template-tags.php index 3cb716076..fcd8281fe 100644
function bp_nouveau_signup_form( $section = 'account_details' ) { 2309 2309 } 2310 2310 2311 2311 foreach ( $fields as $name => $attributes ) { 2312 list( $label, $required, $value, $attribute_type, $type, $class ) = array_values( $attributes ); 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', 'bp-restricted-community' ); ?></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> 2313 2339 2314 // Text fields are using strings, radios are using their inputs2315 $label_output = '<label for="%1$s">%2$s</label>';2316 $id = $name;2317 $classes = '';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 ); 2318 2344 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 }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 = ''; 2323 2349 2324 // Output the label for regular fields2325 if ( 'radio' !== $type ) {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 ); 2334 } 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 } 2335 2362 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 } 2363 if ( ! empty( $value ) && is_callable( $value ) ) { 2364 $value = call_user_func( $value ); 2365 } 2344 2366 2345 // Set the additional attributes 2346 if ( $attribute_type ) { 2347 $existing_attributes = array(); 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 2374 } 2348 2375 2349 if ( ! empty( $required ) ) { 2350 $existing_attributes = array( 'aria-required' => 'true' ); 2376 // Set the additional attributes 2377 if ( $attribute_type ) { 2378 $existing_attributes = array(); 2351 2379 2352 /** 2353 * The blog section is hidden, so let's avoid a browser warning 2354 * and deal with the Blog section in Javascript. 2355 */ 2356 if ( $section !== 'blog_details' ) { 2357 $existing_attributes['required'] = 'required'; 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 } 2358 2390 } 2391 2392 $attribute_type = ' ' . bp_get_form_field_attributes( $attribute_type, $existing_attributes ); 2359 2393 } 2360 2394 2361 $attribute_type = ' ' . bp_get_form_field_attributes( $attribute_type, $existing_attributes ); 2362 } 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(); 2363 2399 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(); 2400 if ( ! $submitted ) { 2401 $submitted = 'public'; 2402 } 2368 2403 2369 if ( ! $submitted ) { 2370 $submitted = 'public'; 2404 $attribute_type = ' ' . checked( $value, $submitted, false ); 2371 2405 } 2372 2406 2373 $attribute_type = ' ' . checked( $value, $submitted, false );2374 }2407 // Do not run function to display errors for the private radio. 2408 if ( 'private' !== $value ) { 2375 2409 2376 // Do not run function to display errors for the private radio. 2377 if ( 'private' !== $value ) { 2410 /** 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. 2415 */ 2416 if ( isset( buddypress()->signup->errors[ $name ] ) ) { 2417 nouveau_error_template( buddypress()->signup->errors[ $name ] ); 2418 $invalid = 'invalid'; 2419 } 2420 } 2378 2421 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'; 2422 if ( isset( $invalid ) && isset( buddypress()->signup->errors[ $name ] ) ) { 2423 if ( ! empty( $class ) ) { 2424 $class = $class . ' ' . $invalid; 2425 } else { 2426 $class = $invalid; 2427 } 2388 2428 } 2389 }2390 2429 2391 if ( isset( $invalid ) && isset( buddypress()->signup->errors[ $name ] )) {2392 if ( ! empty( $class ) ) {2393 $class = $class . ' ' . $invalid;2394 } else {2395 $class = $invalid;2430 if ( $class ) { 2431 $class = sprintf( 2432 ' class="%s"', 2433 esc_attr( join( ' ', array_map( 'sanitize_html_class', explode( ' ', $class ) ) ) ) 2434 ); 2396 2435 } 2397 }2398 2436 2399 if ( $class ) { 2400 $class = sprintf( 2401 ' class="%s"', 2402 esc_attr( join( ' ', array_map( 'sanitize_html_class', explode( ' ', $class ) ) ) ) 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. 2403 2446 ); 2404 }2405 2447 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 ); 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 } 2431 2471 2432 // Subfolders!2472 // It's a radio, let's output the field inside the label 2433 2473 } else { 2434 printf( 2435 '%1$s %2$s', 2436 home_url( '/' ), 2437 $field_output // Constructed safely above. 2438 ); 2474 // $label_output and $field_output are constructed safely above. 2475 printf( $label_output, esc_attr( $name ), $field_output . ' ' . esc_html( $label ) ); 2439 2476 } 2440 2441 // It's a radio, let's output the field inside the label2442 } else {2443 // $label_output and $field_output are constructed safely above.2444 printf( $label_output, esc_attr( $name ), $field_output . ' ' . esc_html( $label ) );2445 2477 } 2446 2447 // Password strength is restricted to the signup_password field2448 if ( 'signup_password' === $name ) :2449 ?>2450 <div id="pass-strength-result"></div>2451 <?php2452 endif;2453 2478 } 2454 2479 2455 2480 /** -
deleted file src/bp-templates/bp-nouveau/js/password-verify.js
diff --git src/bp-templates/bp-nouveau/js/password-verify.js src/bp-templates/bp-nouveau/js/password-verify.js deleted file mode 100644 index 6fd604501..000000000
+ - 1 /* jshint undef: false */2 /* Password Verify */3 /* global pwsL10n */4 /* @version 3.0.0 */5 ( function( $ ){6 function check_pass_strength() {7 var pass1 = $( '.password-entry' ).val(),8 pass2 = $( '.password-entry-confirm' ).val(),9 strength;10 11 // Reset classes and result text12 $( '#pass-strength-result' ).removeClass( 'show mismatch short bad good strong' );13 if ( ! pass1 ) {14 $( '#pass-strength-result' ).html( pwsL10n.empty );15 return;16 }17 18 strength = wp.passwordStrength.meter( pass1, wp.passwordStrength.userInputBlacklist(), pass2 );19 20 switch ( strength ) {21 case 2:22 $( '#pass-strength-result' ).addClass( 'show bad' ).html( pwsL10n.bad );23 break;24 case 3:25 $( '#pass-strength-result' ).addClass( 'show good' ).html( pwsL10n.good );26 break;27 case 4:28 $( '#pass-strength-result' ).addClass( 'show strong' ).html( pwsL10n.strong );29 break;30 case 5:31 $( '#pass-strength-result' ).addClass( 'show mismatch' ).html( pwsL10n.mismatch );32 break;33 default:34 $( '#pass-strength-result' ).addClass( 'show short' ).html( pwsL10n['short'] );35 break;36 }37 }38 39 // Bind check_pass_strength to keyup events in the password fields40 $( document ).ready( function() {41 $( '.password-entry' ).val( '' ).keyup( check_pass_strength );42 $( '.password-entry-confirm' ).val( '' ).keyup( check_pass_strength );43 } );44 45 } )( jQuery );