Ticket #43620: 43620.1.diff
File 43620.1.diff, 3.5 KB (added by , 7 years ago) |
---|
-
src/wp-admin/css/edit.css
694 694 border-left: 4px solid transparent; 695 695 } 696 696 697 .privacy-text-box-body .privacy-text-section:nth-child(odd):not(.text-removed):not(.text-updated) { 698 background-color: #f9f9f9; 699 } 700 697 701 .privacy-text-section.text-updated { 698 702 border-left-color: #46b450; 699 703 background-color: #ecf7ed; … … 704 708 background-color: #fbeaea; 705 709 } 706 710 711 .policy-text, 712 .policy-text-less, 707 713 .closed .privacy-text-box-body { 708 714 display: none; 709 715 } -
src/wp-admin/includes/misc.php
1569 1569 1570 1570 $content .= '<div class="privacy-text-section' . $class . '">'; 1571 1571 $content .= '<h3>' . $section['plugin_name'] . '</h3>'; 1572 $content .= '<button type="button" class="privacy-text-copy-button button">';1573 $content .= $copy;1574 $content .= '<span class="screen-reader-text">' . sprintf( __( 'Copy suggested policy text from %s.' ), $section['plugin_name'] ) . '</span>';1575 $content .= '</button>';1576 1572 1573 if ( empty( $section['removed'] ) ) { 1574 $content .= '<button type="button" class="privacy-text-copy-button button" disabled>'; 1575 $content .= $copy; 1576 $content .= '<span class="screen-reader-text">' . sprintf( __( 'Copy suggested policy text from %s.' ), $section['plugin_name'] ) . '</span>'; 1577 $content .= '</button>'; 1578 } 1579 1577 1580 if ( ! empty( $meta ) ) { 1578 1581 $content .= '<span class="privacy-text-meta">' . $meta . '</span>'; 1579 1582 } 1580 1583 1581 $content .= '<div class="policy-text">' . $section['policy_text'] . '</div>'; 1584 $content .= '<div class="policy-text">' . $section['policy_text'] . '</div><p><a href="#" class="policy-text-less">' . __( 'Read Less' ) . '</a></p>'; 1585 $content .= '<div class="policy-text-excerpt">' . substr( $section['policy_text'], 0, 400 ) . '…</div><p><a href="#" class="policy-text-more">' . __( 'Read More' ) . '</a></p>'; 1582 1586 $content .= "</div>\n"; 1583 1587 } 1584 1588 -
src/wp-admin/js/post.js
1268 1268 update(); 1269 1269 } ); 1270 1270 1271 // Privacy policy postbox, copy button. 1271 } )( jQuery, new wp.utils.WordCounter() ); 1272 1273 1274 // Privacy policy postbox, copy button, policy text read more, policy text read less. 1275 ( function( $ ) { 1276 1272 1277 $( document ).on( 'click', function( event ) { 1273 1278 var $target = $( event.target ); 1274 1279 var node, range; … … 1288 1293 } catch ( er ) {} 1289 1294 } 1290 1295 } 1296 1297 if ( $target.is( 'a.policy-text-more' ) ) { 1298 $target.toggle(); 1299 $target.parent().siblings('div.policy-text').toggle(); 1300 $target.parent().siblings('div.policy-text-excerpt').toggle(); 1301 $target.parent().parent().find('a.policy-text-less').toggle(); 1302 $target.parent().parent().find('.privacy-text-copy-button').prop( 'disabled', false ); 1303 } 1304 1305 if ( $target.is( 'a.policy-text-less' ) ) { 1306 $target.toggle(); 1307 $target.parent().siblings( 'div.policy-text' ).toggle(); 1308 $target.parent().siblings( 'div.policy-text-excerpt' ).toggle(); 1309 $target.parent().parent().find('a.policy-text-more').toggle(); 1310 $target.parent().parent().find('.privacy-text-copy-button').prop( 'disabled', true ); 1311 } 1291 1312 }); 1292 1313 1293 } )( jQuery , new wp.utils.WordCounter());1314 } )( jQuery );