From 1a151560c78ae0180ff520f82daa4ad444abbb37 Mon Sep 17 00:00:00 2001 From: Brad Kent Date: Tue, 31 Jan 2023 09:19:49 -0600 Subject: [PATCH] nested channels ignoring their output config value. restore non-sidebar channel filter/toggles functionality (used by documentation) --- src/Debug/Internal.php | 3 +++ src/Debug/js/Debug.jquery.js | 5 ++++- src/Debug/js/Debug.jquery.min.js | 2 +- src/Debug/js_src/filter.js | 3 +++ 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/Debug/Internal.php b/src/Debug/Internal.php index ff601e5c..01bb7c5f 100644 --- a/src/Debug/Internal.php +++ b/src/Debug/Internal.php @@ -98,6 +98,9 @@ public function publishOutputEvent() } $channels[] = $debug; foreach ($channels as $channel) { + if ($channel->getCfg('output', Debug::CONFIG_DEBUG) === false) { + continue; + } $event = $channel->eventManager->publish( Debug::EVENT_OUTPUT, $channel, diff --git a/src/Debug/js/Debug.jquery.js b/src/Debug/js/Debug.jquery.js index 9639ed9f..bcbbcb28 100644 --- a/src/Debug/js/Debug.jquery.js +++ b/src/Debug/js/Debug.jquery.js @@ -1079,11 +1079,14 @@ ]; function init$4 ($delegateNode) { - var $debugTabLog = $delegateNode.find('> .tab-panes > .tab-primary'); + /* + var $debugTabLog = $delegateNode.find('> .tab-panes > .tab-primary') if ($debugTabLog.length > 0 && $debugTabLog.data('options').sidebar === false) { // no sidebar -> no filtering + // documentation uses non-sidebar filtering return } + */ applyFilter($delegateNode); $delegateNode.on('change', 'input[type=checkbox]', onCheckboxChange); $delegateNode.on('change', 'input[data-toggle=error]', onToggleErrorChange); diff --git a/src/Debug/js/Debug.jquery.min.js b/src/Debug/js/Debug.jquery.min.js index 05131c93..f2ccaa61 100644 --- a/src/Debug/js/Debug.jquery.min.js +++ b/src/Debug/js/Debug.jquery.min.js @@ -1 +1 @@ -!function(g){"use strict";var r,o,s;function l(e){r=e.data("config").get(),e.on("click","[data-toggle=vis]",function(){var e,t,n,a,i,r,o;return e=g(this),t=e.data("vis"),n=e.closest(".t_object"),a=n.find("> .object-inner"),i=a.find("[data-toggle=vis][data-vis="+t+"]"),r=a.find("."+t),o=e.hasClass("toggle-off"),i.html(e.html().replace(o?"show ":"hide ",o?"hide ":"show ")).addClass(o?"toggle-on":"toggle-off").removeClass(o?"toggle-off":"toggle-on"),o?function(e){e.each(function(){var n=g(this),e=n.closest(".object-inner"),a=!0;e.find("> .vis-toggles [data-toggle]").each(function(){var e=g(this),t=e.data("vis");if(!e.is(".toggle-on")&&n.hasClass(t))return a=!1}),a&&n.show()})}(r):r.hide(),c(n,!0),!1}),e.on("click","[data-toggle=interface]",function(){return function(e){var t=g(e),n=t.data("interface"),a=t.closest(".t_object"),i=a.find("> .object-inner > dd[data-implements="+n+"]");t.is(".toggle-off")?(t.addClass("toggle-on").removeClass("toggle-off"),i.show()):(t.addClass("toggle-off").removeClass("toggle-on"),i.hide());c(a)}(this),!1})}function a(e){var i,n=e.find("> .object-inner"),t=e.data("accessible"),a=[];e.is(".enhanced")||(n.find("> .method[data-implements]").hide().length&&(n.find("> .method[data-implements]").each(function(){var e=g(this).data("implements");a.indexOf(e)<0&&a.push(e)}),g.each(a,function(e,t){n.find("> .interface").each(function(){var e=''+t+"";g(this).text()===t&&g(this).html(e)})}),c(e)),n.find("> .private, > .protected").filter(".magic, .magic-read, .magic-write").removeClass("private protected"),"public"===t&&n.find(".private, .protected").hide(),function(e,t){var n=0');n&&l.append(''+s+" protected");a&&l.append(''+s+" private");i&&l.append('show excluded');r&&l.append('hide inherited');if(e.find("> dt.t_modifier_final").length)return e.find("> dt.t_modifier_final").after(l);e.prepend(l)}(n,t),i=n,g.each(r.iconsObject,function(e,t){var n=!0,a=t.match(/^([ap])\s*:(.+)$/);a&&(n="p"===a[1],t=a[2]),n?i.find(e).prepend(t):i.find(e).append(t)}),n.find("> .property.forceShow").show().find("> .t_array").debugEnhance("expand"),e.addClass("enhanced"))}function c(e,t){var n=t?".object-inner > dt":"> .object-inner > dt";e.find(n).each(function(e,t){var n=g(t).nextUntil("dt"),a=n.filter(function(e,t){return"none"!==g(t).css("display")});g(t).toggleClass("text-muted",0 thead");return i.is("table.sortable")&&(i.addClass("table-sort"),t.on("click","th",function(){var e=g(this),t=g(this).closest("tr").children(),n=t.index(e),a="desc"==(e.is(".sort-asc")?"asc":"desc")?"asc":"desc";t.removeClass("sort-asc sort-desc"),e.addClass("sort-"+a),e.find(".sort-arrows").length||(t.find(".sort-arrows").remove(),e.append('')),function(e,t,n){var a,i=e.tBodies[0],r=i.rows,o="function"==typeof Intl.Collator?new Intl.Collator([],{numeric:!0,sensitivity:"base"}):null;for(n="desc"===n?-1:1,r=(r=Array.prototype.slice.call(r,0)).sort(function(s,l,c){var d=/^([+-]?(?:0|[1-9]\d*)(?:\.\d*)?)(?:[eE]([+-]?\d+))?$/;return function(e,t){var n=e.cells[s].textContent.trim(),a=t.cells[s].textContent.trim(),i=n.match(d),r=a.match(d),o=0;return i&&(n=f(n,i)),r&&(a=f(a,r)),i&&r?n .object-inner > .property.debug-value > .t_identifier").filter(function(){return this.innerText.match(/^file$/)}),i=!0===e.data("detectFiles")||0 *:last-child").remove()}else e.find("table thead tr > *:last-child").after("");e.find("table tbody tr").each(function(){var e=g(this),t=e.find("> td"),n=g("",{class:"file-link",href:u(t.eq(0).text(),t.eq(1).text()),html:'',style:"vertical-align: bottom",title:"Open in editor"});a?e.find(".file-link").replaceWith(n):e.hasClass("context")?t.eq(0).attr("colspan",parseInt(t.eq(0).attr("colspan"),10)+1):t.last().after(g("",{class:"text-center",html:n}))})}(e,n):e.is("[data-file]")?function(e,t){if(e.find("> .file-link").remove(),t)return;e.append(g("",{html:'',href:u(e.data("file"),e.data("line")),title:"Open in editor",class:"file-link lpad"})[0].outerHTML)}(e,n):function(e,t,n){var a=e.data("foundFiles")||[];e.is(".m_table")&&(t=e.find("> table > tbody > tr > .t_string"));t=t||[];g.each(t,function(){!function(e,t,n){var a,i=g(e),r=e.attributes,o=g.trim(i.html()),s=function(e,t){var a=[],n=g.trim(e.html());if(e.data("file"))return"boolean"==typeof e.data("file")?[null,n,1]:[null,e.data("file"),e.data("line")||1];if(0===t.indexOf(n))return[null,n,1];if(e.parent(".property.debug-value").find("> .t_identifier").text().match(/^file$/))return a={line:1},e.parent().parent().find("> .property.debug-value").each(function(){var e=g(this).find("> .t_identifier")[0].innerText,t=g(this).find("> *:last-child"),n=g.trim(t[0].innerText);a[e]=n}),[null,n,a.line];return n.match(/^(\/.+\.php)(?: \(line (\d+)\))?$/)||[]}(i,n);if(i.closest(".m_trace").length)return p(i.closest(".m_trace"));if(!s.length)return;if(a=t||i.find(".fa-external-link").length?g("",{html:o}):g("",{class:"file-link",href:u(s[1],s[2]),html:o+' ',title:"Open in editor"}),g.each(r,function(){var e=this.name;-1<["html","href","title"].indexOf(e)||("class"!==e?a.attr(e,this.value):a.addClass(this.value))}),i.is("td, th, li"))return i.html(t?o:a);i.replaceWith(a)}(this,n,a)})}(e,t,n))}function u(e,t){var n={file:e,line:t||1};return o.linkFilesTemplate.replace(/%(\w*)\b/g,function(e,t){return Object.prototype.hasOwnProperty.call(n,t)?n[t]:""})}g=g&&Object.prototype.hasOwnProperty.call(g,"default")?g.default:g,Object.keys=Object.keys||function(e){if(e!==Object(e))throw new TypeError("Object.keys called on a non-object");var t,n=[];for(t in e)Object.prototype.hasOwnProperty.call(e,t)&&n.push(t);return n};var h,m,t,n,b=[],v=!1;function y(e){var t=e.parent(),n=!t.hasClass("m_group")||t.hasClass("expanded");e.hide(),e.children().each(function(){w(g(this))}),n&&e.show().trigger("expanded.debug.group"),function(){if(v)return;v=!0;for(;b.length;)b.shift().debugEnhance("expand");v=!1}(),!1===e.parent().hasClass("m_group")&&e.addClass("enhanced")}function w(e){if(!e.hasClass("enhanced")){if(e.hasClass("m_group"))!function(a){var i=a.find("> .group-header"),e=i.next();if(j(a),j(i),i.attr("data-toggle","group"),i.find(".t_array, .t_object").each(function(){g(this).data("expand",!1),x(a,this)}),g.each(["level-error","level-info","level-warn"],function(e,t){var n;a.hasClass(t)&&(n=i.children("i").eq(0),i.wrapInner(''),i.prepend(n))}),a.hasClass("expanded")||e.find(".m_error, .m_warn").not(".filter-hidden").not("[data-uncollapse=false]").length)return b.push(i);i.debugEnhance("collapse",!0)}(e);else{if(e.hasClass("filter-hidden"))return;(e.is(".m_table, .m_trace")?function(e){p(e),j(e),e.hasClass("m_table")&&e.find("> table > tbody > tr > td").each(function(){x(e,this)});e.find("tbody > tr.expanded").next().trigger("expanded.debug.next"),i(e.find("> table"))}:function(e){e.data("file")&&(e.attr("title")||e.attr("title",e.data("file")+": line "+e.data("line")),p(e));j(e),e.children().each(function(){x(e,this)})})(e)}e.addClass("enhanced"),e.trigger("enhanced.debug")}}function x(e,t){var n=g(t);n.is(".t_array")?D(n):n.is(".t_object")?n.find("> .classname, > .t_const").each(function(){var e=g(this),t=e.next(),n="object"===e.data("toggle");t.is(".t_recursion, .excluded")?e.addClass("empty"):n||0!==t.length&&(e.wrap('').after(' '),t.hide())}):n.is("table")?i(n):n.is(".t_string")?p(e,n):n.is(".string-encoded.tabs-container")&&x(n,n.find("> .tab-pane.active > *"))}function _(){var e=g(this).closest(".show-more-container");e.find(".show-more-wrapper").css("display","block").animate({height:"70px"}),e.find(".show-more-fade").fadeIn(),e.find(".show-more").show(),e.find(".show-less").hide()}function C(){var e=g(this).closest(".show-more-container");e.find(".show-more-wrapper").animate({height:e.find(".t_string").height()},400,"swing",function(){g(this).css("display","inline")}),e.find(".show-more-fade").fadeOut(),e.find(".show-more").hide(),e.find(".show-less").show()}function O(e){var t=g(e.target),n=t.closest("li[class*=m_]");e.stopPropagation(),t.find("> .array-inner > li > :last-child, > .array-inner > li[class]").each(function(){x(n,this)})}function k(e){var t=g(e.target);e.stopPropagation(),t.find("> .group-body").debugEnhance()}function E(e){var t=g(e.target),n=t.closest("li[class*=m_]");e.stopPropagation(),t.is(".enhanced")||(t.find("> .object-inner").find("> .constant > :last-child,> .property > :last-child,> .method .t_string").each(function(){x(n,this)}),a(t))}function T(e){var t=g(e.target);(t.hasClass("t_array")?t.find("> .array-inner").find("> li > .t_string, > li.t_string"):t.hasClass("m_group")?t.find("> .group-body > li > .t_string"):t.hasClass("t_object")?t.find("> .object-inner").find("> dd.constant > .t_string, > dd.property:visible > .t_string, > dd.method > .t_string"):g()).not("[data-type-more=numeric]").each(function(){var e,t,n;35<(e=g(this)).height()-70&&((n=e.wrap('
').parent()).append('
'),(t=n.wrap('
').parent()).append(''),t.append(''))})}function j(e){var t,n=function(e){var t,n,a;if(e.data("icon"))return e.data("icon").match("<")?g(e.data("icon")):g("").addClass(e.data("icon"));if(e.hasClass("m_group"))return t;for(a in n=e.hasClass("group-header")?e.parent():e,s.iconsMethods)if(n.is(a)){t=g(s.iconsMethods[a]);break}return t}(e);!function(e){var t,n,a;for(a in s.iconsMisc)0!==(n=e.find(a)).length&&(t=g(s.iconsMisc[a]),t=(n.find("> i:first-child").hasClass(t.attr("class"))||n.prepend(t),null))}(e),n&&(e.hasClass("m_group")?e=e.find("> .group-header .group-label").eq(0):e.find("> table").length&&((t=e.find("> table > caption")).length||(t=g(""),e.find("> table").prepend(t)),e=t),e.find("> i:first-child").hasClass(n.attr("class"))||e.prepend(n))}function D(n){var e=n.find("> .array-inner");0 .t_array-expand").length||g.trim(e.html()).length<1&&(n.addClass("expanded").find("br").hide(),!1===n.hasClass("max-depth"))||(function(t){var e,n=t.find("> .array-inner");if(t.closest(".array-file-tree").length)return t.find("> .t_keyword, > .t_punct").remove(),n.find("> li > .t_operator, > li > .t_key.t_int").remove(),t.prevAll(".t_key").each(function(){var e=g(this).attr("data-toggle","array");t.prepend(e),t.prepend('')});e=g('array( ··· )'),t.find("> .t_keyword").first().wrap('').after('( ').parent().next().remove(),t.prepend(e)}(n),g.each(s.iconsArray,function(e,t){n.find(e).prepend(t)}),n.debugEnhance(function(e){var t=e.data("expand"),n=e.parentsUntil(".m_group",".t_object, .t_array").length,a=0===n;void 0===t&&0!==n&&(t=e.closest(".t_array[data-expand]").data("expand"));void 0===t&&(t=a);return t||e.hasClass("array-file-tree")}(n)?"expand":"collapse"))}function A(e){var t;(m=(h=e).data("config")).get("drawer")&&(h.addClass("debug-drawer debug-enhanced-ui"),(t=h.find(".debug-menu-bar")).before('
PHP
'),t.find(".float-right").append(''),h.find(".tab-panes").scrollLock(),h.find(".debug-resize-handle").on("mousedown",F),h.find(".debug-pull-tab").on("click",M),h.find(".debug-menu-bar .close").on("click",L),m.get("persistDrawer")&&m.get("openDrawer")&&M())}function M(){h.addClass("debug-drawer-open"),h.debugEnhance(),H(),g("body").css("marginBottom",h.height()+8+"px"),g(window).on("resize",H),m.get("persistDrawer")&&m.set("openDrawer",!0)}function L(){h.removeClass("debug-drawer-open"),g("body").css("marginBottom",""),g(window).off("resize",H),m.get("persistDrawer")&&m.set("openDrawer",!1)}function S(e){H(t+(n-e.pageY),!0)}function F(e){g(e.target).closest(".debug-drawer").is(".debug-drawer-open")&&(t=h.find(".tab-panes").height(),n=e.pageY,g("html").addClass("debug-resizing"),h.parents().on("mousemove",S).on("mouseup",P),e.preventDefault())}function P(){g("html").removeClass("debug-resizing"),h.parents().off("mousemove",S).off("mouseup",P),g("body").css("marginBottom",h.height()+8+"px")}function H(e,t){var n=h.find(".tab-panes"),a=h.find(".debug-menu-bar").outerHeight(),i=window.innerHeight-a-50;e=function(e){var t=h.find(".tab-panes");if(e&&"object"!=typeof e)return e;!(e=parseInt(t[0].style.height,10))&&m.get("persistDrawer")&&(e=m.get("height"));return e||100}(e),e=Math.min(e,i),e=Math.max(e,20),n.css("height",e),t&&m.get("persistDrawer")&&m.set("height",e)}g.fn.scrollLock=function(e){return(e=void 0===e||e)?void g(this).on("DOMMouseScroll mousewheel wheel",function(e){function t(){return e.stopPropagation(),e.preventDefault(),e.returnValue=!1}var n=g(this),a=this.scrollTop,i=this.scrollHeight,r=n.innerHeight(),o=e.originalEvent.wheelDelta,s=0 .tab-panes > .tab-primary > .tab-body").find(".m_alert, .group-body > *:not(.m_groupSummary)").each(function(){i.push({depth:g(this).parentsUntil(".tab_body").length,node:g(this)})}),i.sort(function(e,t){return e.depth .group-body").debugEnhance(),r&&e.hasClass("m_group")&&e.trigger("collapsed.debug.group")}}function z(e){var t=0
'),N.get("drawer")||t.find("input[name=persistDrawer]").closest("label").remove(),I.find(".debug-options-toggle").on("click",ie),g("input[name=debugCookie]").on("change",ae).prop("checked",N.get("debugKey")&&K("debug")===N.get("debugKey")),N.get("debugKey")||g("input[name=debugCookie]").prop("disabled",!0).closest("label").addClass("disabled"),g("input[name=persistDrawer]").on("change",se).prop("checked",N.get("persistDrawer")),I.find("input[name=linkFiles]").on("change",re).prop("checked",N.get("linkFiles")).trigger("change"),I.find("input[name=linkFilesTemplate]").on("change",oe).val(N.get("linkFilesTemplate"))}function te(e){0===I.find(".debug-options").find(e.target).length&&le()}function ne(e){e.keyCode===Z&&le()}function ae(){g(this).is(":checked")?e("debug",N.get("debugKey"),7):e("debug","",-1)}function ie(e){var t=g(this).closest(".debug-bar").find(".debug-options").is(".show");I=g(this).closest(".debug"),t?le():(I.find(".debug-options").addClass("show"),g("body").on("click",te),g("body").on("keyup",ne)),e.stopPropagation()}function re(){var e=g(this).prop("checked"),t=g("#linkFilesTemplate").closest(".form-group");e?t.slideDown():t.slideUp(),N.set("linkFiles",e),g("input[name=linkFilesTemplate]").trigger("change")}function oe(){var e=g(this).val();N.set("linkFilesTemplate",e),I.trigger("config.debug.updated","linkFilesTemplate")}function se(){var e=g(this).is(":checked");N.set({persistDrawer:e,openDrawer:e,openSidebar:!0})}function le(){I.find(".debug-options").removeClass("show"),g("body").off("click",te),g("body").off("keyup",ne)}var ce,de,fe,pe=!1,ue={alert:'Alerts',error:'Error',warn:'Warning',info:'Info',other:'Other'},ge='
';function he(e){var t,n,a=e.find("> .tab-panes > .tab-primary");Y=e.data("config")||g("body").data("config"),Q=e,a.length&&a.data("options").sidebar&&xe(Q),Y.get("persistDrawer")&&!Y.get("openSidebar")&&_e(Q),Q.on("click",".close[data-dismiss=alert]",be),Q.on("click",".sidebar-toggle",ve),Q.on("change",".debug-sidebar input[type=checkbox]",me),pe||(t=we,R.push(t),n=ye,B.push(n),pe=!0)}function me(e){var t=g(this),n=t.closest(".toggle"),a=n.next("ul").find(".toggle"),i=t.is(":checked"),r=g(".m_alert.error-summary.have-fatal");n.toggleClass("active",i),a.toggleClass("active",i),"fatal"===t.val()&&(r.find(".error-fatal").toggleClass("filter-hidden",!i),r.toggleClass("filter-hidden",0===r.children().not(".filter-hidden").length))}function be(){var e=g(this).closest(".debug");setTimeout(function(){e.find(".m_alert").length&&e.find(".debug-sidebar input[data-toggle=method][value=alert]").parent().addClass("disabled")})}function ve(){var e=g(this).closest(".debug");(e.find(".debug-sidebar").is(".show")?_e:Ce)(e)}function ye(e){var t=e[0].className.match(/\bm_(\S+)\b/),n=t?t[1]:null;return!G.sidebar||("group"===n&&e.find("> .group-body")[0].className.match(/level-(error|info|warn)/)&&(n=e.find("> .group-body")[0].className.match(/level-(error|info|warn)/)[1],e.toggleClass("filter-hidden-body",X.indexOf(n)<0)),-1<["alert","error","warn","info"].indexOf(n)?-1 .tab-primary > .tab-body > .expand-all");e.find(".tab-panes > .tab-primary > .tab-body").before(r),t=e.closest(".debug").find(".m_alert.error-summary"),(n=t.find(".in-console")).prev().remove(),n.remove(),0===t.children().length&&t.remove(),i=(a=e).find(".debug-sidebar .php-errors ul"),g.each(["fatal","error","warning","deprecated","notice","strict"],function(e,t){var n="fatal"===t?a.find(".m_alert.error-summary.have-fatal").length:a.find(".error-"+t).filter(".m_error,.m_warn").length;0!==n&&i.append(g("
  • ").append(g('