diff --git a/wp-content/plugins/debug-bar-console/class-debug-bar-console.php b/wp-content/plugins/debug-bar-console/class-debug-bar-console.php index 0398de0c5..030fedad2 100644 --- a/wp-content/plugins/debug-bar-console/class-debug-bar-console.php +++ b/wp-content/plugins/debug-bar-console/class-debug-bar-console.php @@ -48,7 +48,10 @@ function render() {
- +
diff --git a/wp-content/plugins/debug-bar-console/debug-bar-console.php b/wp-content/plugins/debug-bar-console/debug-bar-console.php index b7f5eb6ca..c64e40734 100644 --- a/wp-content/plugins/debug-bar-console/debug-bar-console.php +++ b/wp-content/plugins/debug-bar-console/debug-bar-console.php @@ -1,11 +1,18 @@ '); + iframe.body.html( html ); + } else { + iframe.body.html( data ); + } + }, + refresh: function() { + return output.render(); + } +}; mode = { mode: 'php', @@ -59,13 +81,8 @@ mode = { indentUnit: 4, indentWithTabs: true, enterMode: 'keep', - onKeyEvent: function(i, e) { - // Hook into shift-enter - if ( e.keyCode == 13 && e.shiftKey ) { - e.stop(); - run(); - return true; - } + extraKeys: { + 'Shift-Enter': run } } }, @@ -96,6 +113,7 @@ $(document).ready( function(){ $.extend( el, { form: $('#debug-bar-console'), submit: $('#debug-bar-console-submit a'), + input: $('#debug-bar-console-wrap'), output: $('#debug-bar-console-output') }); el.wrap = el.form.parent(); @@ -122,7 +140,7 @@ $(document).ready( function(){ }); // Bind tab switching - $('.debug-bar-console-tab').each( function() { + $( '.debug-bar-console-tab', el.input ).each( function() { var t = $(this), slug = t.find('input').val(), input; @@ -138,6 +156,19 @@ $(document).ready( function(){ }).click( function() { mode.change( $(this).data( 'console-tab' ) ); }); + + // Output tab switching + $( '.debug-bar-console-tab', el.output ).click( function() { + var t = $(this); + + output.mode = t.data('outputMode'); + output.refresh(); + + // Update tabs + t.siblings().removeClass('debug-bar-console-tab-active'); + t.addClass('debug-bar-console-tab-active'); + + }); }); })(jQuery); \ No newline at end of file diff --git a/wp-content/plugins/debug-bar-console/js/debug-bar-console.js b/wp-content/plugins/debug-bar-console/js/debug-bar-console.js index 91d2be224..7108924f9 100644 --- a/wp-content/plugins/debug-bar-console/js/debug-bar-console.js +++ b/wp-content/plugins/debug-bar-console/js/debug-bar-console.js @@ -1 +1 @@ -(function(d){var c={},b={},e,f,a;e=function(){var g=f.inputs[f.mode];if(!g){return}if(f.editors[f.mode]){f.editors[f.mode].save()}d.post(ajaxurl,{action:"debug_bar_console",mode:f.mode,data:g.val(),nonce:a},function(h){b.body.html(h)});return false};f={mode:"php",tabs:{},inputs:{},change:function(g){if(g==f.mode){return}if(f.tabs[f.mode]){f.tabs[f.mode].removeClass("debug-bar-console-tab-active")}c.form.removeClass("debug-bar-console-mode-"+f.mode);c.form.addClass("debug-bar-console-mode-"+g);f.mode=g;if(f.tabs[f.mode]){f.tabs[f.mode].addClass("debug-bar-console-tab-active")}f.maybeInitEditor()},editors:{},codemirror:{modes:{php:"application/x-httpd-php",sql:"text/x-mysql"},defaults:{lineNumbers:true,lineWrapping:true,matchBrackets:true,indentUnit:4,indentWithTabs:true,enterMode:"keep",onKeyEvent:function(g,h){if(h.keyCode==13&&h.shiftKey){h.stop();e();return true}}}},maybeInitEditor:function(){var g,h;if(!f.codemirror.modes[f.mode]||!f.inputs[f.mode]){return}if(!f.editors[f.mode]){g=d.extend({},f.codemirror.defaults,{mode:f.codemirror.modes[f.mode]});f.editors[f.mode]=CodeMirror.fromTextArea(f.inputs[f.mode][0],g);c.form.show()}h=f.editors[f.mode];h.focus();h.setCursor(h.lineCount())}};d(document).ready(function(){d.extend(c,{form:d("#debug-bar-console"),submit:d("#debug-bar-console-submit a"),output:d("#debug-bar-console-output")});c.wrap=c.form.parent();a=d("#_wpnonce_debug_bar_console").val();b.css=d("#debug-bar-console-iframe-css").val();b.container=d("iframe",c.output);b.contents=b.container.contents();b.document=b.contents[0];b.body=d(b.document.body);d("head",b.contents).append('');c.submit.click(e);c.wrap.bind("debug-bar-show",function(){f.maybeInitEditor()});d(".debug-bar-console-tab").each(function(){var i=d(this),h=i.find("input").val(),g;if(h){f.tabs[h]=i;i.data("console-tab",h);g=d("#debug-bar-console-input-"+h);if(g.length){f.inputs[h]=g}}}).click(function(){f.change(d(this).data("console-tab"))})})})(jQuery); \ No newline at end of file +(function(e){var d={},c={},f,g,a,b;f=function(){var h=g.inputs[g.mode];if(!h){return}if(g.editors[g.mode]){g.editors[g.mode].save()}e.post(ajaxurl,{action:"debug_bar_console",mode:g.mode,data:h.val(),nonce:b},a.render);return false};a={data:"",mode:"formatted",render:function(i){var h;if(arguments.length){a.data=i}else{i=a.data}if(a.mode==="formatted"){c.body.text(i);h=c.body.html();h=h.replace(/ /g," ").replace(/[\r\n]+/g,"
");c.body.html(h)}else{c.body.html(i)}},refresh:function(){return a.render()}};g={mode:"php",tabs:{},inputs:{},change:function(h){if(h==g.mode){return}if(g.tabs[g.mode]){g.tabs[g.mode].removeClass("debug-bar-console-tab-active")}d.form.removeClass("debug-bar-console-mode-"+g.mode);d.form.addClass("debug-bar-console-mode-"+h);g.mode=h;if(g.tabs[g.mode]){g.tabs[g.mode].addClass("debug-bar-console-tab-active")}g.maybeInitEditor()},editors:{},codemirror:{modes:{php:"application/x-httpd-php",sql:"text/x-mysql"},defaults:{lineNumbers:true,lineWrapping:true,matchBrackets:true,indentUnit:4,indentWithTabs:true,enterMode:"keep",extraKeys:{"Shift-Enter":f}}},maybeInitEditor:function(){var h,i;if(!g.codemirror.modes[g.mode]||!g.inputs[g.mode]){return}if(!g.editors[g.mode]){h=e.extend({},g.codemirror.defaults,{mode:g.codemirror.modes[g.mode]});g.editors[g.mode]=CodeMirror.fromTextArea(g.inputs[g.mode][0],h);d.form.show()}i=g.editors[g.mode];i.focus();i.setCursor(i.lineCount())}};e(document).ready(function(){e.extend(d,{form:e("#debug-bar-console"),submit:e("#debug-bar-console-submit a"),input:e("#debug-bar-console-wrap"),output:e("#debug-bar-console-output")});d.wrap=d.form.parent();b=e("#_wpnonce_debug_bar_console").val();c.css=e("#debug-bar-console-iframe-css").val();c.container=e("iframe",d.output);c.contents=c.container.contents();c.document=c.contents[0];c.body=e(c.document.body);e("head",c.contents).append('');d.submit.click(f);d.wrap.bind("debug-bar-show",function(){g.maybeInitEditor()});e(".debug-bar-console-tab",d.input).each(function(){var j=e(this),i=j.find("input").val(),h;if(i){g.tabs[i]=j;j.data("console-tab",i);h=e("#debug-bar-console-input-"+i);if(h.length){g.inputs[i]=h}}}).click(function(){g.change(e(this).data("console-tab"))});e(".debug-bar-console-tab",d.output).click(function(){var h=e(this);a.mode=h.data("outputMode");a.refresh();h.siblings().removeClass("debug-bar-console-tab-active");h.addClass("debug-bar-console-tab-active")})})})(jQuery); \ No newline at end of file diff --git a/wp-content/plugins/debug-bar-console/readme.txt b/wp-content/plugins/debug-bar-console/readme.txt index 05e52a265..3be3e69f8 100644 --- a/wp-content/plugins/debug-bar-console/readme.txt +++ b/wp-content/plugins/debug-bar-console/readme.txt @@ -1,43 +1,39 @@ === Debug Bar Console === -Contributors: koopersmith -Tags: debug, developer, console -Tested up to: 3.4 -Stable tag: 0.3 +Contributors: drewapicture, koopersmith +Tags: debugging, developer, console +Tested up to: 6.7 +Stable tag: 0.3.1 Requires at least: 3.1 +License: GPLv2 -Adds a PHP/MySQL console to the debug bar. Requires the debug bar plugin. +Adds a PHP/SQL console to the Debug Bar. Requires the Debug Bar plugin. == Description == -Adds a PHP/MySQL console to the debug bar. Requires the [Debug Bar plugin](http://wordpress.org/extend/plugins/debug-bar/) (v0.5 or later). +Adds a PHP/SQL console to the debug bar. Requires the [Debug Bar plugin](http://wordpress.org/extend/plugins/debug-bar/) (v0.5 or later). == Upgrade Notice == -= 0.3 = -Added syntax highlighting using the CodeMirror text editor. -Explicit PHP/SQL modes. -UI changes to reflect updated debug bar UI. - -= 0.2 = -Improvements to MySQL detection and display. -Bug fixes. - -= 0.1 = -Initial Release += 0.3.1 = +* Adopted by DrewAPicture == Changelog == += 0.3.1 = +* Adopted by DrewAPicture +* Tested up to WordPress 6.7 + = 0.3 = -Added syntax highlighting using the CodeMirror text editor. -Explicit PHP/SQL modes. -UI changes to reflect updated debug bar UI. +* Added syntax highlighting using the CodeMirror text editor. +* Explicit PHP/SQL modes. +* UI changes to reflect updated debug bar UI. = 0.2 = -Improvements to MySQL detection and display. -Bug fixes. +* Improvements to MySQL detection and display. +* Bug fixes. = 0.1 = -Initial Release +* Initial Release == Installation ==