README.md
6 years ago
class-jetpack-calypsoify.php
2 years ago
mods-gutenberg.js
2 years ago
mods.js
6 years ago
style-gutenberg-rtl.min.css
2 years ago
style-gutenberg.min.css
2 years ago
mods-gutenberg.js
45 lines
| 1 | /* eslint-disable no-var */ |
| 2 | /* global jQuery, wp, calypsoifyGutenberg */ |
| 3 | |
| 4 | jQuery( function ( $ ) { |
| 5 | // Force fullscreen mode for iframed post editor. |
| 6 | if ( |
| 7 | wp && |
| 8 | wp.data && |
| 9 | wp.data.select( 'core/edit-post' ) && |
| 10 | ! wp.data.select( 'core/edit-post' ).isFeatureActive( 'fullscreenMode' ) |
| 11 | ) { |
| 12 | wp.data.dispatch( 'core/edit-post' ).toggleFeature( 'fullscreenMode' ); |
| 13 | } |
| 14 | |
| 15 | // Force fullscreen mode for iframed site editor. |
| 16 | if ( |
| 17 | wp && |
| 18 | wp.data && |
| 19 | wp.data.select( 'core/edit-site' ) && |
| 20 | ! wp.data.select( 'core/edit-site' ).isFeatureActive( 'fullscreenMode' ) |
| 21 | ) { |
| 22 | wp.data.dispatch( 'core/edit-site' ).toggleFeature( 'fullscreenMode' ); |
| 23 | } |
| 24 | |
| 25 | var editPostHeaderInception = setInterval( function () { |
| 26 | var $closeButton = $( '.edit-post-fullscreen-mode-close__toolbar a' ); |
| 27 | if ( $closeButton.length < 1 ) { |
| 28 | return; |
| 29 | } |
| 30 | clearInterval( editPostHeaderInception ); |
| 31 | |
| 32 | if ( calypsoifyGutenberg.closeUrl ) { |
| 33 | $closeButton.attr( 'href', calypsoifyGutenberg.closeUrl ); |
| 34 | $closeButton.attr( 'target', '_parent' ); |
| 35 | } |
| 36 | } ); |
| 37 | |
| 38 | $( 'body.revision-php a' ).each( function () { |
| 39 | var href = $( this ).attr( 'href' ); |
| 40 | if ( href ) { |
| 41 | $( this ).attr( 'href', href.replace( '&classic-editor', '' ) ); |
| 42 | } |
| 43 | } ); |
| 44 | } ); |
| 45 |