Ticket #43620: 43620.5.diff
File 43620.5.diff, 8.5 KB (added by , 6 years ago) |
---|
-
src/wp-admin/css/edit.css
648 648 649 649 /* Sugested text for privacy policy postbox */ 650 650 .privacy-text-box { 651 margin: 10px 0 0;651 margin: -6px -12px -12px; 652 652 } 653 653 654 654 .privacy-text-box-head { … … 662 662 } 663 663 664 664 .privacy-text-box-head p { 665 padding: 012px 14px;665 padding: 12px 12px 14px; 666 666 margin: 0; 667 667 } 668 668 … … 671 671 overflow: auto; 672 672 } 673 673 674 #privacy-text-box .inside {675 margin: 0;676 }677 678 674 .privacy-text-box h3 { 679 675 font-size: 1em; 680 margin: 1em 0 0. 5em;676 margin: 1em 0 0.1em; 681 677 } 682 678 683 679 .privacy-text-section .privacy-text-copy { … … 686 682 687 683 .privacy-text-section { 688 684 position: relative; 689 padding: 1px 1 4px 1px 12px;685 padding: 1px 12px; 690 686 border-top: 1px solid #e3e3e3; 691 687 border-left: 4px solid transparent; 692 688 } … … 707 703 font-weight: 600; 708 704 } 709 705 710 .closed .privacy-text-box-body { 711 display: none; 712 } 713 714 .privacy-text-section.folded { 715 height: 150px; 706 .privacy-text-section.fold { 707 height: 140px; 716 708 overflow: hidden; 717 709 } 718 710 719 711 .privacy-text-actions { 720 712 line-height: 32px; 721 padding-bottom: 6px; 713 padding-bottom: 8px; 714 margin-top: -8px; 722 715 } 723 716 724 .fold ed.privacy-text-actions {717 .fold .privacy-text-actions { 725 718 position: absolute; 726 719 bottom: 0; 727 720 background-color: white; … … 740 733 } 741 734 742 735 .policy-text-more, 743 .fold ed.privacy-text-copy,744 .fold ed.policy-text-less {736 .fold .privacy-text-copy, 737 .fold .policy-text-less { 745 738 display: none; 746 739 } 747 740 748 .fold ed.policy-text-more {741 .fold .policy-text-more { 749 742 display: inline; 750 743 } 751 744 -
src/wp-admin/edit-form-advanced.php
37 37 38 38 wp_enqueue_script( 'post' ); 39 39 $_wp_editor_expand = $_content_editor_dfw = false; 40 $_wp_privacy_policy_page = ( 'page' === $post_type && $post_ID === (int) get_option( 'wp_page_for_privacy_policy' ) ); 40 41 41 42 /** 42 43 * Filters whether to enable the 'expand' functionality in the post editor. … … 56 57 $_wp_editor_expand = ( get_user_setting( 'editor_expand', 'on' ) === 'on' ); 57 58 } 58 59 60 // No editor expand for the Privacy Policy page. Makes it harder to see/access the postbox under the editor. 61 if ( $_wp_privacy_policy_page ) { 62 $_wp_editor_expand = false; 63 } 64 59 65 if ( wp_is_mobile() ) { 60 66 wp_enqueue_script( 'jquery-touch-punch' ); 61 67 } … … 243 249 // All meta boxes should be defined and added before the first do_meta_boxes() call (or potentially during the do_meta_boxes action). 244 250 require_once( ABSPATH . 'wp-admin/includes/meta-boxes.php' ); 245 251 252 // Privacy policy metabox. 253 if ( $_wp_privacy_policy_page ) { 254 add_meta_box( 'privacypolicy', __( 'Suggested Privacy Policy Content' ), array( 'WP_Privacy_Policy_Content', 'privacy_policy_postbox' ), 'page', 'normal', 'high' ); 255 } 246 256 247 257 $publish_callback_args = null; 248 258 if ( post_type_supports( $post_type, 'revisions' ) && 'auto-draft' != $post->post_status ) { -
src/wp-admin/includes/admin-filters.php
136 136 // Privacy policy text changes check. 137 137 add_action( 'admin_init', array( 'WP_Privacy_Policy_Content', 'text_change_check' ), 20 ); 138 138 139 // Show a "postbox" with the text suggestions for a privacy policy.140 add_action( 'edit_form_after_title', array( 'WP_Privacy_Policy_Content', 'privacy_policy_postbox' ) );141 142 139 // Add the suggested policy text from WordPress. 143 140 add_action( 'admin_init', array( 'WP_Privacy_Policy_Content', 'add_suggested_content' ), 15 ); 144 141 -
src/wp-admin/includes/misc.php
1571 1571 1572 1572 $plugin_name = esc_html( $section['plugin_name'] ); 1573 1573 1574 $content .= '<div class="privacy-text-section fold ed' . $class . '">';1574 $content .= '<div class="privacy-text-section fold' . $class . '">'; 1575 1575 $content .= '<h3>' . $plugin_name . '</h3>'; 1576 1576 1577 1577 if ( ! empty( $meta ) ) { … … 1603 1603 } 1604 1604 1605 1605 ?> 1606 <div id="privacy-text-box" class="privacy-text-box postbox <?php echo postbox_classes( 'privacy-text-box', 'page' ); ?>"> 1607 <button type="button" class="handlediv" aria-expanded="true"> 1608 <span class="screen-reader-text"><?php _e( 'Toggle panel: Suggested privacy policy text' ); ?></span> 1609 <span class="toggle-indicator" aria-hidden="true"></span> 1610 </button> 1611 <div class="privacy-text-box-head hndle"> 1612 <h2><?php _e( 'This suggested privacy policy text comes from plugins and themes you have installed.' ); ?></h2> 1606 <div class="privacy-text-box"> 1607 <div class="privacy-text-box-head"> 1613 1608 <p> 1614 <?php _e( 'We suggest reviewing this text then copying and pasting it into your privacy policy page.' ); ?> 1609 <?php _e( 'This suggested content comes from plugins and themes you have installed.' ); ?> 1610 <?php _e( 'We suggest reviewing it then copying and pasting it into your privacy policy page.' ); ?> 1615 1611 <?php _e( 'Please remember you are responsible for the policies you choose to adopt, so review the content and make any necessary edits.' ); ?> 1616 1612 </p> 1617 1613 </div> -
src/wp-admin/includes/screen.php
118 118 if ( false == $box || ! $box['title'] ) { 119 119 continue; 120 120 } 121 // Submit box cannot be hidden 122 if ( 'submitdiv' == $box['id'] || 'linksubmitdiv' == $box['id'] ) { 121 122 // These cannot be hidden 123 $not_hidden = array( 124 'submitdiv', 125 'linksubmitdiv', 126 'privacypolicy', 127 ); 128 if ( in_array( $box['id'], $not_hidden, true ) ) { 123 129 continue; 124 130 } 125 131 -
src/wp-admin/js/post.js
1269 1269 } ); 1270 1270 1271 1271 } )( jQuery, new wp.utils.WordCounter() ); 1272 1273 ( function( $ ) {1274 // Privacy policy postbox, copy button.1275 $( document ).on( 'click', function( event ) {1276 var $target = $( event.target );1277 var node, range;1278 1279 if ( $target.is( 'button.privacy-text-copy' ) ) {1280 node = $target.parent().parent().find( 'div.policy-text' )[0];1281 1282 if ( node ) {1283 try {1284 window.getSelection().removeAllRanges();1285 range = document.createRange();1286 range.selectNodeContents( node );1287 window.getSelection().addRange( range );1288 1289 document.execCommand( 'copy' );1290 window.getSelection().removeAllRanges();1291 } catch ( er ) {}1292 }1293 } else if ( $target.is( 'button.policy-text-more' ) ) {1294 $target.parents( '.privacy-text-section' ).removeClass( 'folded' )1295 .find( '.policy-text' ).attr( 'aria-expanded', 'true' );1296 } else if ( $target.is( 'button.policy-text-less' ) ) {1297 $target.parents( '.privacy-text-section' ).addClass( 'folded' )1298 .find( '.policy-text' ).attr( 'aria-expanded', 'false' );1299 }1300 });1301 1302 } )( jQuery ); -
src/wp-admin/js/postbox.js
444 444 }; 445 445 446 446 }(jQuery)); 447 448 ( function( $ ) { 449 // Privacy policy postbox, copy button. 450 $( document ).on( 'click', function( event ) { 451 var $target = $( event.target ); 452 var node, range; 453 454 if ( $target.is( 'button.privacy-text-copy' ) ) { 455 node = $target.parent().parent().find( 'div.policy-text' )[0]; 456 457 if ( node ) { 458 try { 459 window.getSelection().removeAllRanges(); 460 range = document.createRange(); 461 range.selectNodeContents( node ); 462 window.getSelection().addRange( range ); 463 464 document.execCommand( 'copy' ); 465 window.getSelection().removeAllRanges(); 466 } catch ( er ) {} 467 } 468 } else if ( $target.is( 'button.policy-text-more' ) ) { 469 $target.parents( '.privacy-text-section' ).removeClass( 'fold' ) 470 .find( '.policy-text' ).attr( 'aria-expanded', 'true' ); 471 } else if ( $target.is( 'button.policy-text-less' ) ) { 472 $target.parents( '.privacy-text-section' ).addClass( 'fold' ) 473 .find( '.policy-text' ).attr( 'aria-expanded', 'false' ); 474 } 475 }); 476 477 } )( jQuery );