WordPress.org

Make WordPress Core

Ticket #25603: 25603.9.diff

File 25603.9.diff, 10.7 KB (added by jorbin, 6 years ago)
  • src/wp-includes/script-loader.php

     
    327327                'strong' => __('Strong'),
    328328                'mismatch' => __('Mismatch')
    329329        ) );
     330        $scripts->add( 'about', "/wp-admin/js/about$suffix.js", array( 'jquery', 'password-strength-meter'), false, 1);
    330331
    331332        $scripts->add( 'user-profile', "/wp-admin/js/user-profile$suffix.js", array( 'jquery', 'password-strength-meter' ), false, 1 );
    332333
  • src/wp-admin/js/password-strength-meter.js

     
    1414                        if ( ! $.isArray( blacklist ) )
    1515                                blacklist = [ blacklist.toString() ];
    1616
    17                         if (password1 != password2 && password2.length > 0)
     17                        if (password1 != password2 && password2 && password2.length > 0)
    1818                                return 5;
    1919
    2020                        var result = zxcvbn( password1, blacklist );
  • src/wp-admin/js/about.js

     
     1(function($){
     2    var password = 'Gosh, WordPress is grand.',
     3        $input = $('#pass'),
     4        shouldAnimate = true,
     5        indicatorString = $('#pass-strength-result').text();
     6
     7    function updateResult(){
     8        var strength = wp.passwordStrength.meter($input.val(), [], $input.val());
     9
     10        $('#pass-strength-result').removeClass('short bad good strong');
     11        switch ( strength ) {
     12            case 2:
     13                $('#pass-strength-result').addClass('bad').html( pwsL10n['bad'] );
     14                break;
     15            case 3:
     16                $('#pass-strength-result').addClass('good').html( pwsL10n['good'] );
     17                break;
     18            case 4:
     19                $('#pass-strength-result').addClass('strong').html( pwsL10n['strong'] );
     20                break;
     21            default:
     22                $('#pass-strength-result').addClass('short').html( pwsL10n['short'] );
     23        }
     24    }
     25
     26    function animate(){
     27        if (shouldAnimate === false)
     28            return;
     29        if ($input.val().length < password.length){
     30            $input.val( password.substr(0, $input.val().length + 1) );
     31            updateResult();
     32        } else {
     33            $input.val('');
     34                    $('#pass-strength-result').removeClass('short bad good strong');
     35        }
     36        // Look like real typing by changing the speed new letters are added each time
     37        setTimeout(animate, 220 + Math.floor(Math.random() * ( 800 - 220)) );
     38    }
     39    //
     40    function begin(){
     41        // we async load zxcvbn, so we need to make sure it's loaded before starting
     42        if (typeof(zxcvbn) !== 'undefined')
     43            animate();
     44        else
     45            setTimeout(begin,800);
     46    }
     47   
     48    // Turn off the animation on focus
     49    $input.on('focus', function(){
     50        shouldAnimate = false;
     51        $('#pass-strength-result').removeClass('short bad good strong');
     52        $('#pass-strength-result').text(indicatorString);
     53        $input.val('')
     54    });
     55
     56    // Act like a normal password strength meter
     57    $input.on('keyup', function(){
     58        updateResult();
     59    });
     60
     61    // Start the animation
     62    begin();
     63
     64})(jQuery)
  • src/wp-admin/css/wp-admin.css

     
    57665766        display: none !important;
    57675767}
    57685768
     5769.about-wrap p.about-notice {
     5770        background-color: #ffffe0;
     5771        border: 1px solid #e6db55;
     5772        margin: 5px 0 15px;
     5773        padding: 0.4em 0.8em;
     5774        border-radius: 3px;
     5775        -webkit-border-radius: 3px;
     5776}
     5777
     5778.about-wrap .about-passwords {
     5779        margin: 20px 0;
     5780        padding: 1px 20px 10px;
     5781        background-color: #f9f9f9;
     5782}
     5783
     5784.about-wrap .about-password-meter input {
     5785        font-size: 250%;
     5786        width: 100%;
     5787    display: block;
     5788    width: 100%;
     5789    padding: 5px;
     5790}
     5791
     5792.about-wrap .about-password-meter #pass-strength-result {
     5793        font-weight: normal !important;
     5794    display:block !important;
     5795        font-size: 150%;
     5796    width: 100%;
     5797    padding: 17px 0;
     5798    margin-bottom: 15px;
     5799}
     5800
     5801.about-wrap .feature-section img {
     5802        border: 0;
     5803        background: transparent;
     5804        box-shadow: none;
     5805        -webkit-box-shadow: none;
     5806        max-width: 20%;
     5807}
     5808
     5809.about-wrap .feature-section div p img {
     5810        float: right;
     5811        margin-left: 10px;
     5812}
     5813
    57695814/* Typography */
    57705815
    57715816.about-wrap p {
     
    58085853        padding-bottom: 20px;
    58095854}
    58105855
     5856.about-wrap .feature-section
     5857
    58115858.about-wrap .feature-section h4 {
    58125859        margin-bottom: 0.6em;
    58135860}
     
    59606007        float: left;
    59616008}
    59626009
     6010.about-wrap .three-col.about-updates div:nth-of-type(1),
     6011.about-wrap .three-col.about-updates div:nth-of-type(3) {
     6012        width: 37%;
     6013        margin: 0;
     6014}
     6015
     6016.about-wrap .three-col.about-updates div:nth-of-type(2) {
     6017        width: 16%;
     6018        margin: 0 5%;
     6019}
     6020
     6021.about-wrap .three-col.about-updates img {
     6022        margin: 0;
     6023}
     6024
    59636025.about-wrap .three-col-images {
    59646026        text-align: center;
    59656027}
  • src/wp-admin/css/colors-classic.css

     
    20002000        color: #464646;
    20012001}
    20022002
    2003 .about-wrap .feature-section img {
    2004         background: #fff;
    2005         border: 1px #ccc solid;
    2006         -webkit-box-shadow: 0 1px 3px rgba( 0, 0, 0, 0.3 );
    2007         box-shadow:         0 1px 3px rgba( 0, 0, 0, 0.3 );
    2008 }
    2009 
    20102003.about-wrap h4.wp-people-group {
    20112004        text-shadow: 1px 1px 1px #fff;
    20122005}
  • src/wp-admin/css/colors-fresh.css

     
    18891889        color: #464646;
    18901890}
    18911891
    1892 .about-wrap .feature-section img {
    1893         background: #fff;
    1894         border: 1px #ccc solid;
    1895         -webkit-box-shadow: 0 1px 3px rgba( 0, 0, 0, 0.3 );
    1896         box-shadow:         0 1px 3px rgba( 0, 0, 0, 0.3 );
    1897 }
    1898 
    18991892.about-wrap h4.wp-people-group {
    19001893        text-shadow: 1px 1px 1px #fff;
    19011894}
  • src/wp-admin/about.php

     
    1313
    1414list( $display_version ) = explode( '-', $wp_version );
    1515
     16wp_enqueue_script('about');
     17
    1618include( ABSPATH . 'wp-admin/admin-header.php' );
    1719?>
    1820<div class="wrap about-wrap">
     
    3638<div class="changelog">
    3739        <h3><?php _e( 'Background Updates' ); ?></h3>
    3840
    39         <div class="feature-section col two-col">
     41        <div class="feature-section col three-col about-updates">
    4042                <div>
    4143                        <h4><?php _e( 'Updates While You Sleep' ); ?></h4>
    4244                        <p><?php _e( 'With WordPress 3.7, you don&#8217;t have to lift a finger to apply maintenance and security updates. Most sites are now able to automatically apply these updates in the background, though some configurations may not allow it.' ); ?></p>
    43                         <?php
     45                </div>
     46                <div><img alt="" src="images/about-updates-2x.png" /></div>
     47                <div class="last-feature">
     48                        <h4><?php _e( 'More Reliable Than Ever' ); ?></h4>
     49                        <p><?php _e( 'The update process has been made even more reliable and secure, with dozens of new checks and safeguards.' ); ?></p>
     50                        <p><?php _e( 'You&#8217;ll still need to click &#8220;Update Now&#8221; once WordPress 3.8 is released, but we&#8217;ve never had more confidence in that beautiful blue button.' ); ?></p>
     51                </div>
     52                <?php
    4453                        $can_auto_update = wp_http_supports( 'ssl' );
    4554                        if ( $can_auto_update ) {
    4655                                require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
     
    5766                                <p><?php _e( '&rarr; This site <strong>is</strong> able to apply these updates automatically. Cool!' ); ?></p>
    5867                        <?php else : ?>
    5968                                <p><?php printf( __( '&rarr; This site <strong>is not</strong> able to apply these updates automatically. But we&#8217;ll email %s when there is a new security release.' ), esc_html( get_site_option( 'admin_email' ) ) ); ?></p>
    60                         <?php endif; ?>
    61                 </div>
    62                 <div class="last-feature">
    63                         <h4><?php _e( 'More Reliable Than Ever' ); ?></h4>
    64                         <p><?php _e( 'The update process has been made even more reliable and secure, with dozens of new checks and safeguards.' ); ?></p>
    65                         <p><?php _e( 'You&#8217;ll still need to click &#8220;Update Now&#8221; once WordPress 3.8 is released, but we&#8217;ve never had more confidence in that beautiful blue button.' ); ?></p>
    66                 </div>
     69                <?php endif; ?>
    6770        </div>
    6871</div>
    6972
    70 <div class="changelog">
     73<div class="changelog about-passwords">
    7174        <h3><?php _e( 'Create Stronger Passwords' ); ?></h3>
    7275
    7376        <div class="feature-section col two-col">
    7477                <div>
    7578                        <p><?php _e( 'Your password is your site&#8217;s first line of defense. It&#8217;s best to create passwords that are complex, long, and unique. To that end, our password meter has been updated in WordPress 3.7 to recognize common mistakes that can weaken your password: dates, names, keyboard patterns (123456789), and even pop culture references.' ); ?> <?php _e( 'Try it out on the right.' ); ?></p>
    7679                </div>
    77                 <div class="last-feature">
    78                         (Actual password meter demo)
     80                <div class="last-feature about-password-meter">
     81                        <input type="password" id="pass" size="25" value="" />
     82                        <p id="pass-strength-result" ><?php _e( 'Strength indicator' ); ?></p>
     83                        <a href="<?php echo esc_url( self_admin_url() ); ?>profile.php"><?php _e( 'Getting the urge to change your password now?' ); ?></a>
    7984                </div>
    8085        </div>
    8186</div>
     
    8489        <div class="feature-section col two-col">
    8590                <div>
    8691                        <h3><?php _e( 'Improved Search Results' ); ?></h3>
    87                         <p><?php _e( 'Search results are now ordered by how well the search query matches a post, instead of ordered only by date. For example, when your search terms match a post title, that result will be pushed to the top.' ); ?></p>
     92                        <p><img alt="" src="images/about-search-2x.png" /><?php _e( 'Search results are now ordered by how well the search query matches a post, instead of ordered only by date. For example, when your search terms match a post title, that result will be pushed to the top.' ); ?></p>
    8893                </div>
    8994                <div class="last-feature">
    9095                        <h3><?php _e( 'Better Global Support' ); ?></h3>
    91                         <p><?php _e( 'Localized versions of WordPress will receive faster and more complete translations. WordPress 3.7 adds support for automatically installing the right language files and keeping them up to date.' ); ?></p>
     96                        <p><img alt="" src="images/about-globe-2x.png" /><?php _e( 'Localized versions of WordPress will receive faster and more complete translations. WordPress 3.7 adds support for automatically installing the right language files and keeping them up to date.' ); ?></p>
    9297                </div>
    9398        </div>
    9499</div>