Changeset 48234
- Timestamp:
- 06/30/2020 01:54:40 PM (4 years ago)
- Location:
- trunk/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/js/_enqueues/admin/privacy-tools.js
r47572 r48234 7 7 // Privacy request action handling. 8 8 jQuery( document ).ready( function( $ ) { 9 var strings = window.privacyToolsL10n || {}; 9 var strings = window.privacyToolsL10n || {}, 10 copiedNoticeTimeout; 10 11 11 12 function setActionState( $action, state ) { … … 89 90 } 90 91 91 setTimeout( function() { $rowActions.removeClass( 'processing' ); }, 500 );92 setTimeout( function() { $rowActions.removeClass( 'processing' ); }, 500 ); 92 93 } 93 94 … … 98 99 } 99 100 100 setTimeout( function() { $rowActions.removeClass( 'processing' ); }, 500 );101 setTimeout( function() { $rowActions.removeClass( 'processing' ); }, 500 ); 101 102 } 102 103 103 104 function setExportProgress( exporterIndex ) { 104 var progress = ( exportersCount > 0 ? exporterIndex / exportersCount : 0 ); 105 var progressString = Math.round( progress * 100 ).toString() + '%'; 105 var progress = ( exportersCount > 0 ? exporterIndex / exportersCount : 0 ), 106 progressString = Math.round( progress * 100 ).toString() + '%'; 107 106 108 $progress.html( progressString ); 107 109 } … … 126 128 if ( ! response.success ) { 127 129 // e.g. invalid request ID. 128 setTimeout( function() { onExportFailure( response.data ); }, 500 );130 setTimeout( function() { onExportFailure( response.data ); }, 500 ); 129 131 return; 130 132 } … … 137 139 setTimeout( doNextExport( exporterIndex + 1, 1 ) ); 138 140 } else { 139 setTimeout( function() { onExportDoneSuccess( responseData.url ); }, 500 );141 setTimeout( function() { onExportDoneSuccess( responseData.url ); }, 500 ); 140 142 } 141 143 } 142 144 }).fail( function( jqxhr, textStatus, error ) { 143 145 // e.g. Nonce failure. 144 setTimeout( function() { onExportFailure( error ); }, 500 );146 setTimeout( function() { onExportFailure( error ); }, 500 ); 145 147 }); 146 148 } … … 174 176 175 177 function onErasureDoneSuccess() { 176 var summaryMessage = strings.noDataFound ;177 varclasses = 'notice-success';178 var summaryMessage = strings.noDataFound, 179 classes = 'notice-success'; 178 180 179 181 setActionState( $action, 'remove-personal-data-success' ); … … 196 198 appendResultsAfterRow( $requestRow, classes, summaryMessage, messages ); 197 199 198 setTimeout( function() { $rowActions.removeClass( 'processing' ); }, 500 );200 setTimeout( function() { $rowActions.removeClass( 'processing' ); }, 500 ); 199 201 } 200 202 … … 203 205 appendResultsAfterRow( $requestRow, 'notice-error', strings.removalError, [] ); 204 206 205 setTimeout( function() { $rowActions.removeClass( 'processing' ); }, 500 );207 setTimeout( function() { $rowActions.removeClass( 'processing' ); }, 500 ); 206 208 } 207 209 208 210 function setErasureProgress( eraserIndex ) { 209 var progress = ( erasersCount > 0 ? eraserIndex / erasersCount : 0 ); 210 var progressString = Math.round( progress * 100 ).toString() + '%'; 211 var progress = ( erasersCount > 0 ? eraserIndex / erasersCount : 0 ), 212 progressString = Math.round( progress * 100 ).toString() + '%'; 213 211 214 $progress.html( progressString ); 212 215 } … … 227 230 228 231 if ( ! response.success ) { 229 setTimeout( function() { onErasureFailure(); }, 500 );232 setTimeout( function() { onErasureFailure(); }, 500 ); 230 233 return; 231 234 } … … 246 249 setTimeout( doNextErasure( eraserIndex + 1, 1 ) ); 247 250 } else { 248 setTimeout( function() { onErasureDoneSuccess(); }, 500 );251 setTimeout( function() { onErasureDoneSuccess(); }, 500 ); 249 252 } 250 253 } 251 254 }).fail( function() { 252 setTimeout( function() { onErasureFailure(); }, 500 );255 setTimeout( function() { onErasureFailure(); }, 500 ); 253 256 }); 254 257 } … … 269 272 copiedNotice = $target.siblings( '.success' ); 270 273 274 clearTimeout( copiedNoticeTimeout ); 275 271 276 if ( $target.is( 'button.privacy-text-copy' ) ) { 272 277 $parent = $target.parent().parent(); … … 310 315 311 316 // Delay notice dismissal. 312 setTimeout( function(){ copiedNotice.removeClass( 'visible' ); }, 3000 ); 317 copiedNoticeTimeout = setTimeout( function() { 318 copiedNotice.removeClass( 'visible' ); 319 }, 3000 ); 313 320 } catch ( er ) {} 314 321 } … … 316 323 }); 317 324 }); 318 -
trunk/src/wp-admin/css/edit.css
r48145 r48234 718 718 719 719 .privacy-text-actions { 720 display: inline-block; 721 width: 100%; 720 722 height: 32px; 721 723 line-height: 2.46153846; … … 744 746 } 745 747 746 .privacy-text-section a.return-to-top {748 .privacy-text-section .return-to-top { 747 749 float: right; 748 750 margin-right: -250px; 749 751 margin-top: 6px; 752 } 753 754 #wpbody:target:before { 755 content: ""; 756 display: block; 757 padding-top: 50px; 758 margin-top: -50px; 750 759 } 751 760 … … 1759 1768 } 1760 1769 1761 .privacy-text-section a.return-to-top { 1762 float: none; 1763 margin: 0; 1764 } 1765 } 1770 .privacy-text-section .return-to-top { 1771 margin: 2em 0 0; 1772 } 1773 } -
trunk/src/wp-admin/includes/class-wp-privacy-policy-content.php
r48145 r48234 413 413 414 414 $content .= '<div class="policy-text">' . $section['policy_text'] . '</div>'; 415 $content .= '<a href="#" class="return-to-top">' . __( '↑ Return to Top' ) . '</a>';416 415 417 416 if ( empty( $section['removed'] ) ) { … … 419 418 $content .= '<button type="button" class="privacy-text-copy button">'; 420 419 $content .= __( 'Copy this section to clipboard' ); 421 $content .= '<span class="screen-reader-text">';422 /* translators: %s: Plugin name. */423 $content .= sprintf( __( 'Copy suggested policy text from %s.' ), $plugin_name );424 $content .= '</span>';425 420 $content .= '</button>'; 426 421 $content .= '<span class="success" aria-hidden="true">' . __( 'Copied!' ) . '</span>'; 427 422 $content .= '</div>'; 428 423 } 424 425 $content .= '<a href="#wpbody" class="return-to-top"><span aria-hidden="true">↑ </span> ' . __( 'Return to Top' ) . '</a>'; 429 426 430 427 $content .= '</div>'; // End of .privacy-text-section. -
trunk/src/wp-admin/includes/privacy-tools.php
r48127 r48234 279 279 280 280 if ( 1 < $groups_count ) { 281 $group_html .= '<div class="return _to_top">';282 $group_html .= '<a href="#top"> ' . esc_html__( '↑Return to top' ) . '</a>';281 $group_html .= '<div class="return-to-top">'; 282 $group_html .= '<a href="#top"><span aria-hidden="true">↑ </span> ' . esc_html__( 'Return to top' ) . '</a>'; 283 283 $group_html .= '</div>'; 284 284 } … … 424 424 fwrite( $file, 'td { padding: 5px; }' ); 425 425 fwrite( $file, 'tr:nth-child(odd) { background-color: #fafafa; }' ); 426 fwrite( $file, '.return _to_top { text-align:right; }' );426 fwrite( $file, '.return-to-top { text-align: right; }' ); 427 427 fwrite( $file, '</style>' ); 428 428 fwrite( $file, '<title>' );
Note: See TracChangeset
for help on using the changeset viewer.