Awesome about page design for WordPress 3.7.
The page includes a giant password meter that serves as both an animated example and a working demo. How cool is that? props jorbin, melchoyce. see #25603. git-svn-id: https://develop.svn.wordpress.org/trunk@25839 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
142d8c3d30
commit
6810bc9069
@ -13,6 +13,8 @@ $title = __( 'About' );
|
||||
|
||||
list( $display_version ) = explode( '-', $wp_version );
|
||||
|
||||
wp_enqueue_script( 'about' );
|
||||
|
||||
include( ABSPATH . 'wp-admin/admin-header.php' );
|
||||
?>
|
||||
<div class="wrap about-wrap">
|
||||
@ -36,11 +38,18 @@ include( ABSPATH . 'wp-admin/admin-header.php' );
|
||||
<div class="changelog">
|
||||
<h3><?php _e( 'Background Updates' ); ?></h3>
|
||||
|
||||
<div class="feature-section col two-col">
|
||||
<div class="feature-section col three-col about-updates">
|
||||
<div>
|
||||
<h4><?php _e( 'Updates While You Sleep' ); ?></h4>
|
||||
<p><?php _e( 'With WordPress 3.7, you don’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>
|
||||
<?php
|
||||
</div>
|
||||
<div><img alt="" src="images/about-updates-2x.png" /></div>
|
||||
<div class="last-feature">
|
||||
<h4><?php _e( 'More Reliable Than Ever' ); ?></h4>
|
||||
<p><?php _e( 'The update process has been made even more reliable and secure, with dozens of new checks and safeguards.' ); ?></p>
|
||||
<p><?php _e( 'You’ll still need to click “Update Now” once WordPress 3.8 is released, but we’ve never had more confidence in that beautiful blue button.' ); ?></p>
|
||||
</div>
|
||||
<?php
|
||||
$can_auto_update = wp_http_supports( 'ssl' );
|
||||
if ( $can_auto_update ) {
|
||||
require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
|
||||
@ -57,25 +66,22 @@ include( ABSPATH . 'wp-admin/admin-header.php' );
|
||||
<p><?php _e( '→ This site <strong>is</strong> able to apply these updates automatically. Cool!' ); ?></p>
|
||||
<?php else : ?>
|
||||
<p><?php printf( __( '→ This site <strong>is not</strong> able to apply these updates automatically. But we’ll email %s when there is a new security release.' ), esc_html( get_site_option( 'admin_email' ) ) ); ?></p>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<div class="last-feature">
|
||||
<h4><?php _e( 'More Reliable Than Ever' ); ?></h4>
|
||||
<p><?php _e( 'The update process has been made even more reliable and secure, with dozens of new checks and safeguards.' ); ?></p>
|
||||
<p><?php _e( 'You’ll still need to click “Update Now” once WordPress 3.8 is released, but we’ve never had more confidence in that beautiful blue button.' ); ?></p>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="changelog">
|
||||
<div class="changelog about-passwords">
|
||||
<h3><?php _e( 'Create Stronger Passwords' ); ?></h3>
|
||||
|
||||
<div class="feature-section col two-col">
|
||||
<div>
|
||||
<p><?php _e( 'Your password is your site’s first line of defense. It’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>
|
||||
<p><?php _e( 'Your password is your site’s first line of defense. It’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.' ); ?></p>
|
||||
<p><strong><?php _e( 'Try it out on the right.' ); ?></strong></p>
|
||||
</div>
|
||||
<div class="last-feature">
|
||||
(Actual password meter demo)
|
||||
<div class="last-feature about-password-meter">
|
||||
<input type="password" id="pass" size="25" value="" />
|
||||
<p id="pass-strength-result" ><?php _e( 'Strength indicator' ); ?></p>
|
||||
<?php printf( __( 'Getting the urge to <a href="%s">change your password</a>?' ), esc_url( self_admin_url( 'profile.php' ) ) ); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -84,11 +90,11 @@ include( ABSPATH . 'wp-admin/admin-header.php' );
|
||||
<div class="feature-section col two-col">
|
||||
<div>
|
||||
<h3><?php _e( 'Improved Search Results' ); ?></h3>
|
||||
<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>
|
||||
<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>
|
||||
</div>
|
||||
<div class="last-feature">
|
||||
<h3><?php _e( 'Better Global Support' ); ?></h3>
|
||||
<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>
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -2000,13 +2000,6 @@ h2.nav-tab-wrapper, h3.nav-tab-wrapper {
|
||||
color: #464646;
|
||||
}
|
||||
|
||||
.about-wrap .feature-section img {
|
||||
background: #fff;
|
||||
border: 1px #ccc solid;
|
||||
-webkit-box-shadow: 0 1px 3px rgba( 0, 0, 0, 0.3 );
|
||||
box-shadow: 0 1px 3px rgba( 0, 0, 0, 0.3 );
|
||||
}
|
||||
|
||||
.about-wrap h4.wp-people-group {
|
||||
text-shadow: 1px 1px 1px #fff;
|
||||
}
|
||||
|
@ -1889,13 +1889,6 @@ h2.nav-tab-wrapper, h3.nav-tab-wrapper {
|
||||
color: #464646;
|
||||
}
|
||||
|
||||
.about-wrap .feature-section img {
|
||||
background: #fff;
|
||||
border: 1px #ccc solid;
|
||||
-webkit-box-shadow: 0 1px 3px rgba( 0, 0, 0, 0.3 );
|
||||
box-shadow: 0 1px 3px rgba( 0, 0, 0, 0.3 );
|
||||
}
|
||||
|
||||
.about-wrap h4.wp-people-group {
|
||||
text-shadow: 1px 1px 1px #fff;
|
||||
}
|
||||
|
@ -5766,6 +5766,51 @@ h2 .nav-tab {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.about-wrap p.about-notice {
|
||||
background-color: #ffffe0;
|
||||
border: 1px solid #e6db55;
|
||||
margin: 5px 0 15px;
|
||||
padding: 0.4em 0.8em;
|
||||
border-radius: 3px;
|
||||
-webkit-border-radius: 3px;
|
||||
}
|
||||
|
||||
.about-wrap .about-passwords {
|
||||
margin: 20px 0;
|
||||
padding: 1px 20px 10px;
|
||||
background-color: #f9f9f9;
|
||||
}
|
||||
|
||||
.about-wrap .about-password-meter input {
|
||||
font-size: 250%;
|
||||
width: 100%;
|
||||
display: block;
|
||||
width: 100%;
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
.about-wrap .about-password-meter #pass-strength-result {
|
||||
font-weight: normal !important;
|
||||
display:block !important;
|
||||
font-size: 150%;
|
||||
width: 100%;
|
||||
padding: 17px 0;
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
.about-wrap .feature-section img {
|
||||
border: 0;
|
||||
background: transparent;
|
||||
box-shadow: none;
|
||||
-webkit-box-shadow: none;
|
||||
max-width: 20%;
|
||||
}
|
||||
|
||||
.about-wrap .feature-section div p img {
|
||||
float: right;
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
/* Typography */
|
||||
|
||||
.about-wrap p {
|
||||
@ -5808,6 +5853,8 @@ h2 .nav-tab {
|
||||
padding-bottom: 20px;
|
||||
}
|
||||
|
||||
.about-wrap .feature-section
|
||||
|
||||
.about-wrap .feature-section h4 {
|
||||
margin-bottom: 0.6em;
|
||||
}
|
||||
@ -5960,6 +6007,21 @@ h2 .nav-tab {
|
||||
float: left;
|
||||
}
|
||||
|
||||
.about-wrap .three-col.about-updates div:nth-of-type(1),
|
||||
.about-wrap .three-col.about-updates div:nth-of-type(3) {
|
||||
width: 37%;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.about-wrap .three-col.about-updates div:nth-of-type(2) {
|
||||
width: 16%;
|
||||
margin: 0 5%;
|
||||
}
|
||||
|
||||
.about-wrap .three-col.about-updates img {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.about-wrap .three-col-images {
|
||||
text-align: center;
|
||||
}
|
||||
|
BIN
src/wp-admin/images/about-globe-2x.png
Normal file
BIN
src/wp-admin/images/about-globe-2x.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 10 KiB |
BIN
src/wp-admin/images/about-search-2x.png
Normal file
BIN
src/wp-admin/images/about-search-2x.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.7 KiB |
BIN
src/wp-admin/images/about-updates-2x.png
Normal file
BIN
src/wp-admin/images/about-updates-2x.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 12 KiB |
64
src/wp-admin/js/about.js
Normal file
64
src/wp-admin/js/about.js
Normal file
@ -0,0 +1,64 @@
|
||||
(function($){
|
||||
var password = 'Gosh, WordPress is grand.',
|
||||
$input = $('#pass'),
|
||||
shouldAnimate = true,
|
||||
indicatorString = $('#pass-strength-result').text();
|
||||
|
||||
function updateResult(){
|
||||
var strength = wp.passwordStrength.meter($input.val(), [], $input.val());
|
||||
|
||||
$('#pass-strength-result').removeClass('short bad good strong');
|
||||
switch ( strength ) {
|
||||
case 2:
|
||||
$('#pass-strength-result').addClass('bad').html( pwsL10n['bad'] );
|
||||
break;
|
||||
case 3:
|
||||
$('#pass-strength-result').addClass('good').html( pwsL10n['good'] );
|
||||
break;
|
||||
case 4:
|
||||
$('#pass-strength-result').addClass('strong').html( pwsL10n['strong'] );
|
||||
break;
|
||||
default:
|
||||
$('#pass-strength-result').addClass('short').html( pwsL10n['short'] );
|
||||
}
|
||||
}
|
||||
|
||||
function animate(){
|
||||
if (shouldAnimate === false)
|
||||
return;
|
||||
if ($input.val().length < password.length){
|
||||
$input.val( password.substr(0, $input.val().length + 1) );
|
||||
updateResult();
|
||||
} else {
|
||||
$input.val('');
|
||||
$('#pass-strength-result').removeClass('short bad good strong');
|
||||
}
|
||||
// Look like real typing by changing the speed new letters are added each time
|
||||
setTimeout(animate, 220 + Math.floor(Math.random() * ( 800 - 220)) );
|
||||
}
|
||||
//
|
||||
function begin(){
|
||||
// we async load zxcvbn, so we need to make sure it's loaded before starting
|
||||
if (typeof(zxcvbn) !== 'undefined')
|
||||
animate();
|
||||
else
|
||||
setTimeout(begin,800);
|
||||
}
|
||||
|
||||
// Turn off the animation on focus
|
||||
$input.on('focus', function(){
|
||||
shouldAnimate = false;
|
||||
$('#pass-strength-result').removeClass('short bad good strong');
|
||||
$('#pass-strength-result').text(indicatorString);
|
||||
$input.val('')
|
||||
});
|
||||
|
||||
// Act like a normal password strength meter
|
||||
$input.on('keyup', function(){
|
||||
updateResult();
|
||||
});
|
||||
|
||||
// Start the animation
|
||||
begin();
|
||||
|
||||
})(jQuery);
|
0
src/wp-admin/js/about.min.js
vendored
Normal file
0
src/wp-admin/js/about.min.js
vendored
Normal file
@ -14,7 +14,7 @@ var passwordStrength;
|
||||
if ( ! $.isArray( blacklist ) )
|
||||
blacklist = [ blacklist.toString() ];
|
||||
|
||||
if (password1 != password2 && password2.length > 0)
|
||||
if (password1 != password2 && password2 && password2.length > 0)
|
||||
return 5;
|
||||
|
||||
var result = zxcvbn( password1, blacklist );
|
||||
|
@ -332,6 +332,8 @@ function wp_default_scripts( &$scripts ) {
|
||||
|
||||
$scripts->add( 'user-suggest', "/wp-admin/js/user-suggest$suffix.js", array( 'jquery-ui-autocomplete' ), false, 1 );
|
||||
|
||||
$scripts->add( 'about', "/wp-admin/js/about$suffix.js", array( 'jquery', 'password-strength-meter' ), false, 1 );
|
||||
|
||||
$scripts->add( 'admin-bar', "/wp-includes/js/admin-bar$suffix.js", array(), false, 1 );
|
||||
|
||||
$scripts->add( 'wplink', "/wp-includes/js/wplink$suffix.js", array( 'jquery', 'wpdialogs' ), false, 1 );
|
||||
|
Loading…
Reference in New Issue
Block a user