Skip to:
Content

bbPress.org

Changeset 6558


Ignore:
Timestamp:
06/15/2017 07:29:28 PM (7 years ago)
Author:
johnjamesjacoby
Message:

Passwords: Upgrade the user-edit experience to use the new'ish password generator.

  • Introduces new form-user-passwords.php template part to encapsulate the more-elaborate password mark-up
  • Removes user.js from the default scripts, and enqueues user-profiles instead
  • Requires tweaks to the default template pack styling to accommodate the password generator being theme-side

This change will also allow bbPress to more easily keep-up with changes to the password generator code that comes with WordPress going forward. Huzzah!

Location:
trunk/src
Files:
1 added
1 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bbpress.php

    r6551 r6558  
    210210        /** Versions **********************************************************/
    211211
    212         $this->version    = '2.6-rc-6550';
     212        $this->version    = '2.6-rc-6558';
    213213        $this->db_version = '262';
    214214
  • trunk/src/templates/default/bbpress-functions.php

    r6552 r6558  
    200200        // User Profile edit
    201201        if ( bbp_is_single_user_edit() ) {
    202             $scripts['bbpress-user'] = array(
    203                 'file'         => 'js/user' . $suffix . '.js',
    204                 'dependencies' => array()
    205             );
     202            wp_enqueue_script( 'user-profile' );
    206203        }
    207204
  • trunk/src/templates/default/bbpress/form-user-edit.php

    r6557 r6558  
    114114        </div>
    115115
    116         <div id="password">
    117             <label for="pass1"><?php esc_html_e( 'New Password', 'bbpress' ); ?></label>
    118             <fieldset class="bbp-form password">
    119                 <input type="password" name="pass1" id="pass1" size="16" value="" autocomplete="new-password" />
    120 
    121                 <input type="password" name="pass2" id="pass2" size="16" value="" autocomplete="new-password" />
    122                 <span class="description"><?php esc_html_e( 'To update your password, type a new one twice here. (Leave them blank otherwise.)', 'bbpress' ); ?></span>
    123 
    124                 <div id="pass-strength-result"></div>
    125                 <span class="description indicator-hint"><?php esc_html_e( 'Your password should be at least ten characters long. Use upper and lower case letters, numbers, and symbols to make it even stronger.', 'bbpress' ); ?></span>
    126             </fieldset>
    127         </div>
     116        <?php bbp_get_template_part( 'form', 'user-passwords' ); ?>
    128117
    129118        <div>
  • trunk/src/templates/default/css/bbpress.css

    r6527 r6558  
    99-------------------------------------------------------------- */
    1010
     11.hidden,
     12.js .hide-if-js {
     13    display: none;
     14}
     15
     16/* Hide visually but not from screen readers */
     17.screen-reader-text,
     18.screen-reader-text span,
     19.ui-helper-hidden-accessible {
     20    position: absolute;
     21    margin: -1px;
     22    padding: 0;
     23    height: 1px;
     24    width: 1px;
     25    overflow: hidden;
     26    clip: rect(0 0 0 0);
     27    border: 0;
     28    word-wrap: normal !important; /* many screen reader and browser combinations announce broken words as they would appear visually */
     29}
     30
    1131.entry-content .bbpress-wrapper a,
    1232.entry-content .bbpress-wrapper a:hover {
    13     -webkit-box-shadow: none;
    1433    box-shadow: none;
    1534}
     
    683702textarea#bbp_forum_content {
    684703    width: 97%;
    685     -webkit-box-sizing: border-box;
    686     -moz-box-sizing: border-box;
    687704    box-sizing: border-box;
    688705}
     
    818835#bbpress-forums #bbp-your-profile fieldset select {
    819836    margin-bottom: 0;
     837    width: 60%;
     838    background-color: #f9f9f9;
     839    border: 1px solid #ddd;
    820840}
    821841
     
    824844    margin-bottom: 0;
    825845    width: 60%;
    826     background: #f9f9f9;
     846    background-color: #f9f9f9;
    827847    border: 1px solid #ddd;
    828     -webkit-box-shadow: none;
    829848    box-shadow: none;
    830     padding: 5px 8px;
    831     -webkit-border-radius: 0;
    832849    border-radius: 0;
    833850}
     
    836853#bbpress-forums #bbp-your-profile fieldset textarea:focus {
    837854    border: 1px solid #ccc;
    838     -webkit-box-shadow: inset 1px 1px 1px rgba(0, 0, 0, 0.1);
    839855    box-shadow: inset 1px 1px 1px rgba(0, 0, 0, 0.1);
    840856    outline-color: rgba(240, 255, 240, 0.1);
     
    862878}
    863879
    864 #bbpress-forums #bbp-your-profile fieldset span.description {
     880#bbpress-forums #bbp-your-profile fieldset p.description {
    865881    margin: 5px 0 0 20%;
    866882    font-size: 12px;
     
    882898}
    883899
     900#bbpress-forums #bbp-your-profile fieldset fieldset.capabilities dl {
     901    margin: 0;
     902}
     903
     904#bbpress-forums #bbp-your-profile fieldset.submit button {
     905    float: right;
     906}
     907
     908/* =Password Generator
     909-------------------------------------------------------------- */
     910
    884911#bbpress-forums #bbp-your-profile fieldset fieldset.password {
    885912    width: 60%;
     
    887914}
    888915
     916#bbpress-forums #bbp-your-profile fieldset fieldset.password .password-input-wrapper,
     917#bbpress-forums #bbp-your-profile fieldset fieldset.password .password-button-wrapper {
     918    width: 100%;
     919    margin: 0;
     920    display: inline-block;
     921}
     922
     923#bbpress-forums #bbp-your-profile fieldset fieldset.password .password-button-wrapper button {
     924    width: 46%;
     925    margin: 4% 2%;
     926    box-sizing: border-box;
     927    display: inline-block;
     928}
     929
    889930#bbpress-forums #bbp-your-profile fieldset fieldset.password input,
    890 #bbpress-forums #bbp-your-profile fieldset fieldset.password span {
     931#bbpress-forums #bbp-your-profile fieldset fieldset.passwword textarea {
    891932    width: 100%;
    892933}
    893934
    894 #bbpress-forums #bbp-your-profile fieldset fieldset.capabilities dl {
    895     margin: 0;
     935#bbpress-forums #bbp-your-profile fieldset fieldset.password button .dashicons {
     936    display: none;
    896937}
    897938
     
    901942}
    902943
    903 #bbpress-forums #bbp-your-profile fieldset.submit button {
    904     float: right;
     944#bbpress-forums #password #pass-strength-result {
     945    background-color: #eee;
     946    border: 1px solid #ddd;
     947    color: #23282d;
     948    margin: 0;
     949    padding: 8px;
     950    text-align: center;
     951    box-sizing: border-box;
     952    display: inline-block;
     953}
     954
     955#bbpress-forums #password #pass-strength-result.short {
     956    background-color: #f1adad;
     957    border-color: #e35b5b;
     958    opacity: 1;
     959}
     960
     961#bbpress-forums #password #pass-strength-result.bad {
     962    background-color: #fbc5a9;
     963    border-color: #f78b53;
     964    opacity: 1;
     965}
     966
     967#bbpress-forums #password #pass-strength-result.good {
     968    background-color: #ffe399;
     969    border-color: #ffc733;
     970    opacity: 1;
     971}
     972
     973#bbpress-forums #password #pass-strength-result.strong {
     974    background-color: #c1e1b9;
     975    border-color: #83c373;
     976    opacity: 1;
     977}
     978
     979#bbpress-forums #password #pass1.short,
     980#bbpress-forums #password #pass1-text.short {
     981    border-color: #e35b5b;
     982}
     983
     984#bbpress-forums #password#pass1.bad,
     985#bbpress-forums #password #pass1-text.bad {
     986    border-color: #f78b53;
     987}
     988
     989#bbpress-forums #password #pass1.good,
     990#bbpress-forums #password #pass1-text.good {
     991    border-color: #ffc733;
     992}
     993
     994#bbpress-forums #password #pass1.strong,
     995#bbpress-forums #password #pass1-text.strong {
     996    border-color: #83c373;
     997}
     998
     999#bbpress-forums .indicator-hint {
     1000    padding-top: 8px;
     1001}
     1002
     1003#bbpress-forums .pw-weak,
     1004#bbpress-forums #pass1-text,
     1005#bbpress-forums .show-password #pass1 {
     1006    display: none;
     1007}
     1008
     1009#bbpress-forums .show-password #pass1-text {
     1010    display: inline-block;
    9051011}
    9061012
     
    9141020    padding: 0 0.6em;
    9151021    margin: 5px 0 15px;
    916     -webkit-border-radius: 3px;
    9171022    border-radius: 3px;
    9181023    background-color: #ffffe0;
     
    10531158
    10541159#bbpress-forums img.avatar {
    1055     -webkit-box-shadow: none;
    10561160    box-shadow: none;
    10571161    display: inline-block;
     
    12261330    margin-top: -75px;
    12271331    margin-left: -185px;
    1228     -webkit-border-radius: 3px;
    12291332    border-radius: 3px;
    12301333    border: 1px solid #aaa;
Note: See TracChangeset for help on using the changeset viewer.