class-debug-bar-js.php 729 B

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