Changeset 45041
- Timestamp:
- 03/27/2019 08:38:07 PM (6 years ago)
- Location:
- trunk/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/js/_enqueues/admin/site-health.js
r44988 r45041 83 83 function RecalculateProgression() { 84 84 var r, c, pct; 85 var $progressBar = $( '#progressbar' ); 86 var $circle = $( '#progressbar svg #bar' ); 85 var $progress = $( '.site-health-progress' ); 86 var $progressCount = $progress.find( '.progress-count' ); 87 var $circle = $( '.site-health-progress svg #bar' ); 87 88 var totalTests = parseInt( SiteHealth.site_status.issues.good, 0 ) + parseInt( SiteHealth.site_status.issues.recommended, 0 ) + ( parseInt( SiteHealth.site_status.issues.critical, 0 ) * 1.5 ); 88 89 var failedTests = parseInt( SiteHealth.site_status.issues.recommended, 0 ) + ( parseInt( SiteHealth.site_status.issues.critical, 0 ) * 1.5 ); … … 90 91 91 92 if ( 0 === totalTests ) { 92 $progress Bar.addClass( 'hidden' );93 $progress.addClass( 'hidden' ); 93 94 return; 94 95 } 95 96 96 $progress Bar.removeClass( 'loading' );97 $progress.removeClass( 'loading' ); 97 98 98 99 r = $circle.attr( 'r' ); … … 131 132 } 132 133 133 $progressBar.attr( 'data-pct', val ); 134 $progressBar.attr( 'aria-valuenow', val ); 134 $progressCount.text( val + '%' ); 135 135 136 136 $.post( -
trunk/src/wp-admin/css/site-health.css
r44986 r45041 40 40 } 41 41 42 body.site-health .health-check-header .title-section #progressbar{42 .site-health-progress { 43 43 display: inline-block; 44 44 height: 40px; … … 51 51 } 52 52 53 body.site-health .health-check-header .title-section #progressbar:after{53 .site-health-progress .progress-count { 54 54 position: absolute; 55 55 display: block; … … 58 58 left: 50%; 59 59 top: 50%; 60 content: attr(data-pct) "%";61 60 margin-top: -40px; 62 61 margin-left: -40px; … … 66 65 } 67 66 68 body.site-health .health-check-header .title-section #progressbar.hidden { 67 .site-health-progress .progress-count::after { 68 content: ""; 69 } 70 71 .site-health-progress.hidden { 69 72 display: none; 70 73 } 71 74 72 body.site-health .health-check-header .title-section #progressbar.loading:after {75 .site-health-progress.loading .progress-count::after { 73 76 animation: loadingEllipsis 3s infinite ease-in-out; 74 77 } 75 78 76 body.site-health .health-check-header .title-section #progressbar.loading svg #bar {79 .site-health-progress.loading svg #bar { 77 80 stroke-dashoffset: 0; 78 81 stroke: #adc5d2; … … 80 83 } 81 84 82 body.site-health .health-check-header .title-section #progressbarsvg circle {85 .site-health-progress svg circle { 83 86 stroke-dashoffset: 0; 84 87 transition: stroke-dashoffset 1s linear; … … 87 90 } 88 91 89 body.site-health .health-check-header .title-section #progressbarsvg #bar {92 .site-health-progress svg #bar { 90 93 stroke-dashoffset: 565; 91 94 stroke: #dc3232; 92 95 } 93 96 94 body.site-health .health-check-header .title-section #progressbarsvg #bar.green {97 .site-health-progress svg #bar.green { 95 98 stroke: #46b450; 96 99 } 97 100 98 body.site-health .health-check-header .title-section #progressbarsvg #bar.orange {101 .site-health-progress svg #bar.orange { 99 102 stroke: #ffb900; 100 103 } … … 172 175 } 173 176 174 body.site-health .pass:before,175 body.site-health .good:before {177 .site-health .pass::before, 178 .site-health .good::before { 176 179 content: "\f147"; 177 180 display: inline-block; … … 181 184 } 182 185 183 body.site-health .warning:before {186 .site-health .warning::before { 184 187 content: "\f460"; 185 188 display: inline-block; … … 188 191 } 189 192 190 body.site-health .info:before {193 .site-health .info::before { 191 194 content: "\f348"; 192 195 display: inline-block; … … 195 198 } 196 199 197 body.site-health .fail:before,198 body.site-health .error:before {200 .site-health .fail::before, 201 .site-health .error::before { 199 202 content: "\f335"; 200 203 display: inline-block; -
trunk/src/wp-admin/site-health-info.php
r44986 r45041 35 35 </h1> 36 36 37 <div id="progressbar" class="loading" data-pct="0" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" aria-valuetext="<?php esc_attr_e( 'Site tests are running, please wait a moment.' ); ?>">38 <svg width="100%" height="100%" viewBox="0 0 200 200" version="1.1" xmlns="http://www.w3.org/2000/svg">37 <div class="site-health-progress loading"> 38 <svg role="img" aria-hidden="true" focusable="false" width="100%" height="100%" viewBox="0 0 200 200" version="1.1" xmlns="http://www.w3.org/2000/svg"> 39 39 <circle r="90" cx="100" cy="100" fill="transparent" stroke-dasharray="565.48" stroke-dashoffset="0"></circle> 40 40 <circle id="bar" r="90" cx="100" cy="100" fill="transparent" stroke-dasharray="565.48" stroke-dashoffset="0"></circle> 41 41 </svg> 42 <span class="screen-reader-text"><?php _e( 'Current health score:' ); ?></span> 43 <span class="progress-count"></span> 42 44 </div> 43 45 </div> -
trunk/src/wp-admin/site-health.php
r45026 r45041 37 37 </h1> 38 38 39 <div id="progressbar" class="loading" data-pct="0" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" aria-valuetext="<?php esc_attr_e( 'Site tests are running, please wait a moment.' ); ?>">40 <svg width="100%" height="100%" viewBox="0 0 200 200" version="1.1" xmlns="http://www.w3.org/2000/svg">39 <div class="site-health-progress loading"> 40 <svg role="img" aria-hidden="true" focusable="false" width="100%" height="100%" viewBox="0 0 200 200" version="1.1" xmlns="http://www.w3.org/2000/svg"> 41 41 <circle r="90" cx="100" cy="100" fill="transparent" stroke-dasharray="565.48" stroke-dashoffset="0"></circle> 42 42 <circle id="bar" r="90" cx="100" cy="100" fill="transparent" stroke-dasharray="565.48" stroke-dashoffset="0"></circle> 43 43 </svg> 44 <span class="screen-reader-text"><?php _e( 'Current health score:' ); ?></span> 45 <span class="progress-count"></span> 44 46 </div> 45 47 </div>
Note: See TracChangeset
for help on using the changeset viewer.