class-jetpack-search-debug-bar.php
7 months ago
debug-bar.css
4 months ago
debug-bar.js
3 months ago
debug-bar.js
23 lines
| 1 | /* global jQuery */ |
| 2 | /* eslint no-var: "off" */ |
| 3 | |
| 4 | ( function ( $ ) { |
| 5 | $( document ).ready( function () { |
| 6 | $( '.jetpack-search-debug-bar .json-toggle-wrap .toggle' ).click( function () { |
| 7 | var t = $( this ), |
| 8 | wrap = t.closest( '.json-toggle-wrap' ), |
| 9 | pre = wrap.find( 'pre' ), |
| 10 | content = pre.text(), |
| 11 | isPretty = wrap.hasClass( 'pretty' ); |
| 12 | |
| 13 | if ( ! isPretty ) { |
| 14 | pre.text( JSON.stringify( JSON.parse( content ), null, 2 ) ); |
| 15 | } else { |
| 16 | pre.text( JSON.stringify( JSON.parse( content ) ) ); |
| 17 | } |
| 18 | |
| 19 | wrap.toggleClass( 'pretty' ); |
| 20 | } ); |
| 21 | } ); |
| 22 | } )( jQuery ); |
| 23 |