class-debug-bar-js.php 755 B

123456789101112131415161718192021222324
  1. <?php
  2. class Debug_Bar_JS extends Debug_Bar_Panel {
  3. var $real_error_handler = array();
  4. function init() {
  5. if ( !defined( 'SCRIPT_DEBUG' ) || !SCRIPT_DEBUG )
  6. return false;
  7. $this->title( __('JavaScript', 'debug-bar') );
  8. // attach here instead of debug_bar_enqueue_scripts
  9. // because we want to be as early as possible!
  10. $wcsf2011 = '20110813';
  11. wp_enqueue_script( 'debug-bar-js', plugins_url( "js/debug-bar-js.dev.js", dirname(__FILE__) ), array(), $wcsf2011 );
  12. }
  13. function render() {
  14. echo '<div id="debug-bar-js">';
  15. echo '<h2><span>' . __( 'Total Errors:', 'debug-bar' ) . "</span><div id='debug-bar-js-error-count'>0</div></h2>\n";
  16. echo '<ol class="debug-bar-js-list" id="debug-bar-js-errors"></ol>' . "\n";
  17. echo '</div>';
  18. }
  19. }