Privacy: outputting the privacy policy guide and suggested content to a new page instead of a postbox.

Props melchoyce, azaozz.
See #43980.
Built from https://develop.svn.wordpress.org/trunk@43184


git-svn-id: http://core.svn.wordpress.org/trunk@43013 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Ozz
2018-05-08 23:45:21 +00:00
parent 76efbf47da
commit 3099f4d9ed
12 changed files with 300 additions and 267 deletions

View File

@@ -1269,34 +1269,3 @@ jQuery(document).ready( function($) {
} );
} )( jQuery, new wp.utils.WordCounter() );
( function( $ ) {
// Privacy policy postbox, copy button.
$( document ).on( 'click', function( event ) {
var $target = $( event.target );
var node, range;
if ( $target.is( 'button.privacy-text-copy' ) ) {
node = $target.parent().parent().find( 'div.policy-text' )[0];
if ( node ) {
try {
window.getSelection().removeAllRanges();
range = document.createRange();
range.selectNodeContents( node );
window.getSelection().addRange( range );
document.execCommand( 'copy' );
window.getSelection().removeAllRanges();
} catch ( er ) {}
}
} else if ( $target.is( 'button.policy-text-more' ) ) {
$target.parents( '.privacy-text-section' ).removeClass( 'folded' )
.find( '.policy-text' ).attr( 'aria-expanded', 'true' );
} else if ( $target.is( 'button.policy-text-less' ) ) {
$target.parents( '.privacy-text-section' ).addClass( 'folded' )
.find( '.policy-text' ).attr( 'aria-expanded', 'false' );
}
});
} )( jQuery );