diff --git a/css/debug-bar.css b/css/debug-bar.css index a327bc9..4b5b670 100644 --- a/css/debug-bar.css +++ b/css/debug-bar.css @@ -1 +1 @@ -#wpadminbar #wp-admin-bar-debug-bar{float:right}#wpadminbar #wp-admin-bar-debug-bar.active{background:#555}#wpadminbar #wp-admin-bar-debug-bar.debug-bar-php-notice-summary,#wpadminbar #wp-admin-bar-debug-bar.debug-bar-php-notice-summary .ab-item:focus{background-color:#ff8922}#wpadminbar #wp-admin-bar-debug-bar.debug-bar-php-notice-summary .ab-item:hover,.debug-bar-visible #wpadminbar #wp-admin-bar-debug-bar.debug-bar-php-notice-summary,.debug-bar-visible #wpadminbar #wp-admin-bar-debug-bar.debug-bar-php-notice-summary .ab-item:focus{background-color:#ee6f00}#wpadminbar #wp-admin-bar-debug-bar.debug-bar-php-notice-summary .ab-item{color:#f0f0f1}#wpadminbar #wp-admin-bar-debug-bar.debug-bar-php-warning-summary,#wpadminbar #wp-admin-bar-debug-bar.debug-bar-php-warning-summary .ab-item:focus,#wpadminbar #wp-admin-bar-debug-bar.debug-bar-php-warning-summary .ab-item:hover,.debug-bar-visible #wpadminbar #wp-admin-bar-debug-bar.debug-bar-php-warning-summary,.debug-bar-visible #wpadminbar #wp-admin-bar-debug-bar.debug-bar-php-warning-summary .ab-item:focus{background-color:#d00}#wpadminbar #wp-admin-bar-debug-bar.debug-bar-php-warning-summary .ab-item{color:#f0f0f1}#wpadminbar #wp-admin-bar-debug-bar ul{right:0}#querylist{background:#f1f1f1;bottom:0;color:#000;direction:ltr;display:none;font-family:Helvetica Neue,sans-serif;font-size:12px;height:33%;left:0;line-height:150%!important;min-height:350px;position:fixed;right:0;text-align:left;z-index:99000}#querylist a{border:0}.debug-bar-visible #querylist{display:block}.debug-bar-maximized #querylist{height:auto;position:fixed;top:28px}body.debug-bar-maximized.debug-bar-visible{overflow:hidden}#debug-bar-info{background:#f1f1f1;border-bottom:1px solid #fff;height:60px;position:absolute;width:100%;z-index:200}#debug-bar-menu{background:#333;left:0;width:250px;z-index:100}#debug-bar-menu,#debug-menu-targets{bottom:0;overflow:auto;position:absolute;top:61px}#debug-menu-targets{left:250px;right:0;z-index:150}#debug-status{color:#bbb;float:left;font-size:14px;line-height:60px;padding-left:20px}.debug-status{float:left;margin-right:40px}#debug-status .debug-status-title{color:#555;font-size:12px;font-weight:500;line-height:18px;margin-top:10px}#debug-status .debug-status-data{color:#999;font-size:18px;font-weight:200;line-height:20px}#debug-status #debug-status-warning{color:#d00;font-weight:700}#debug-status #debug-status-site{font-weight:700}#querylist pre{font-size:12px;padding:10px;text-align:left}#querylist .left{float:left}#querylist .right{float:right}#querylist h1,#querylist h2,#querylist h3{font-weight:400}#debug-menu-links{list-style:none;margin:0;overflow:hidden;padding:0}#debug-menu-links li{float:left;margin-bottom:0!important}#debug-menu-links li a{box-sizing:content-box;color:#fff!important;display:block;font-size:14px;font-weight:500!important;line-height:32px;margin:0;outline:none;padding:0 20px;text-decoration:none!important;width:210px}#debug-menu-links li a.current{background:rgba(0,0,0,.2)}#querylist h2{border:1px solid #eee;clear:none;color:#000;float:left;font-family:georgia,times,serif;font-size:28px;margin:15px 10px 15px 0!important;min-width:150px;padding:5px 10px 15px;text-align:center}#querylist h2 span{color:#888;display:block;font-size:12px;margin-bottom:5px;text-transform:uppercase;white-space:nowrap}#querylist h2 span#debug-bar-js-error-count{color:inherit;display:inherit;font-size:inherit;margin-bottom:inherit;text-transform:inherit;white-space:inherit}#object-cache-stats h2{border:none;float:left;font-size:22px;margin-bottom:0;text-align:left}#object-cache-stats ul.debug-menu-links,#object-cache-stats-menu-targets{clear:both}.object-cache-stats-menu-target pre{margin:1rem 0;white-space:pre-wrap}#object-cache-stats ul.debug-menu-links li{background:none;border:1px solid #eee;color:#4b5259;float:left;list-style:none;margin:0 10px 10px 0}#object-cache-stats ul.debug-menu-links li:hover{border-color:#ddd}#object-cache-stats ul.debug-menu-links li a{background:none;color:#4b5259;display:block;overflow:hidden;padding:5px 9px;text-decoration:none}#querylist h3{margin-bottom:15px}#querylist ol.wpd-queries{clear:left;list-style:none;margin:0!important;padding:0!important}#querylist ol.wpd-queries li{background:#f0f0f0;margin:0 0 10px;padding:10px}#querylist ol.wpd-queries li div.qdebug{background:#e8e8e8;font-size:11px;margin:10px -10px -10px;min-height:20px;padding:5px 150px 5px 5px;position:relative}#querylist ol.wpd-queries li div.qdebug span{position:absolute;right:10px;top:5px;white-space:nowrap}#querylist a{color:blue!important;cursor:pointer;text-decoration:underline!important}#querylist a:hover{text-decoration:none!important}#querylist .debug-menu-target{display:none;margin:20px}#querylist ol{font:12px Monaco,Courier New,Courier,Fixed!important;line-height:180%!important}#querylist table{table-layout:auto}#querylist td,#querylist th{text-transform:none}#querylist table,#querylist table td,#querylist table th{border:0;vertical-align:top}#debug-bar-php ol.debug-bar-php-list{clear:left;list-style:none;margin:0!important;padding:0!important}#debug-bar-php ol.debug-bar-php-list li{margin:0 0 10px;padding:10px}#debug-bar-php .debug-bar-php-warning{background-color:#ffebe8;border:1px solid #d00}#debug-bar-php .debug-bar-php-notice{background-color:#ffffe0;border:1px solid #e6db55}#debug-bar-deprecated ol.debug-bar-deprecated-list{clear:left;list-style:none;margin:0!important;padding:0!important}#debug-bar-deprecated ol.debug-bar-deprecated-list li{background:#f0f0f0;margin:0 0 10px;padding:10px}#debug-bar-wp-query table.debug-bar-wp-query-list{cell-padding:1em;border-collapse:collapse;clear:both;width:100%}#debug-bar-wp-query table.debug-bar-wp-query-list td{border-bottom:1px solid #ccc;padding:.5em 5px}#debug-bar-wp-query table.debug-bar-wp-query-list th{border-bottom:1px solid #ccc;font-weight:700;padding:.5em 5px}#debug-bar-wp-query table.debug-bar-wp-query-list tr:nth-child(odd){background-color:#e8e8e8}#debug-bar-wp-query table.debug-bar-wp-query-list tr td:first-of-type{font-size:140%;padding:.3em .5em}#debug-bar-request h3,#debug-bar-wp-query h3{clear:both;float:none;font-family:georgia,times,serif;font-size:22px;margin:15px 10px 15px 0!important}#debug-bar-request p{background:#f0f0f0;margin:0 0 10px;padding:10px}#debug-bar-actions{position:absolute;right:20px;top:21px;z-index:300}#debug-bar-actions span{background:#aaa;-moz-border-radius:20px;-webkit-border-radius:20px;border-radius:20px;color:#eee;cursor:pointer;display:block;float:left;font-size:18px;font-weight:700;height:20px;line-height:20px;margin-left:5px;text-align:center;width:20px}#debug-bar-actions span.maximize,#debug-bar-actions span.restore{background-color:#9d9}#debug-bar-actions span.close{background-color:#d99}#debug-bar-actions span:hover{background:#888}#debug-bar-actions span.maximize:hover,#debug-bar-actions span.restore:hover{background:#40bf40}#debug-bar-actions span.close:hover{background:#bf4040}.debug-bar-maximized #debug-bar-actions span.restore{display:block}.debug-bar-maximized #debug-bar-actions span.maximize,.debug-bar-partial #debug-bar-actions span.restore{display:none}.debug-bar-partial #debug-bar-actions span.maximize{display:block}#debug-menu-links li a#debug-menu-link-Debug_Bar_JS,#wp-admin-bar-debug-bar-Debug_Bar_JS{display:none}#debug-bar-js ol.debug-bar-js-list{clear:left;list-style:none;margin:0!important;padding:0!important}#debug-bar-js ol.debug-bar-js-list li{margin:0 0 10px;padding:10px}#debug-bar-js .debug-bar-js-error{background-color:#ffebe8;border:1px solid #d00}#debug-bar-js .debug-bar-js-error span{color:#666;display:block;font-size:.8em}#debug-bar-js .debug-bar-js-error:hover span{color:#000} \ No newline at end of file +#wpadminbar #wp-admin-bar-debug-bar{float:right}#wpadminbar #wp-admin-bar-debug-bar.active{background:#555}#wpadminbar #wp-admin-bar-debug-bar.debug-bar-php-notice-summary,#wpadminbar #wp-admin-bar-debug-bar.debug-bar-php-notice-summary .ab-item:focus{background-color:#ff8922}#wpadminbar #wp-admin-bar-debug-bar.debug-bar-php-notice-summary .ab-item:hover,.debug-bar-visible #wpadminbar #wp-admin-bar-debug-bar.debug-bar-php-notice-summary,.debug-bar-visible #wpadminbar #wp-admin-bar-debug-bar.debug-bar-php-notice-summary .ab-item:focus{background-color:#ee6f00}#wpadminbar #wp-admin-bar-debug-bar.debug-bar-php-notice-summary .ab-item{color:#f0f0f1}#wpadminbar #wp-admin-bar-debug-bar.debug-bar-php-warning-summary,#wpadminbar #wp-admin-bar-debug-bar.debug-bar-php-warning-summary .ab-item:focus,#wpadminbar #wp-admin-bar-debug-bar.debug-bar-php-warning-summary .ab-item:hover,.debug-bar-visible #wpadminbar #wp-admin-bar-debug-bar.debug-bar-php-warning-summary,.debug-bar-visible #wpadminbar #wp-admin-bar-debug-bar.debug-bar-php-warning-summary .ab-item:focus{background-color:#d00}#wpadminbar #wp-admin-bar-debug-bar.debug-bar-php-warning-summary .ab-item{color:#f0f0f1}#wpadminbar #wp-admin-bar-debug-bar ul{right:0}#querylist,#querylist pre{text-align:left;font-size:12px}#querylist{direction:ltr;display:none;position:fixed;height:33%;min-height:350px;font-family:"Helvetica Neue",sans-serif;left:0;right:0;bottom:0;background:#f1f1f1;z-index:99000;color:#000;line-height:150%!important}#querylist a{border:0;text-decoration:underline!important;color:#00f!important;cursor:pointer}.debug-bar-visible #querylist{display:block}.debug-bar-maximized #querylist{position:fixed;top:28px;height:auto}body.debug-bar-maximized.debug-bar-visible{overflow:hidden}#debug-bar-info{height:60px;width:100%;position:absolute;z-index:200;background:#f1f1f1;border-bottom:1px solid #fff}#debug-bar-menu,#debug-menu-targets{overflow:auto;position:absolute;top:61px;bottom:0}#debug-bar-menu{left:0;width:250px;z-index:100;background:#333}#debug-menu-targets{left:250px;right:0;z-index:150}#debug-status{float:left;padding-left:20px;color:#bbb;font-size:14px;line-height:60px}.debug-status{float:left;margin-right:40px}#debug-status .debug-status-title{color:#555;font-weight:500;line-height:18px;font-size:12px;margin-top:10px}#debug-status .debug-status-data{color:#999;font-weight:200;line-height:20px;font-size:18px}#debug-status #debug-status-warning{font-weight:700;color:#d00}#debug-status #debug-status-site{font-weight:700}#querylist pre{padding:10px}#querylist .left{float:left}#querylist .right{float:right}#querylist h1,#querylist h2,#querylist h3{font-weight:400}#debug-menu-links{overflow:hidden;list-style:none;margin:0;padding:0}#debug-menu-links li{float:left;margin-bottom:0!important}#debug-menu-links li a{box-sizing:content-box;padding:0 20px;width:210px;line-height:32px;outline:0;display:block;margin:0;color:#fff!important;font-weight:500!important;font-size:14px}#debug-menu-links li a.current{background:rgba(0,0,0,.2)}#querylist h2{float:left;min-width:150px;border:1px solid #eee;padding:5px 10px 15px;clear:none;text-align:center;color:#000;font-family:georgia,times,serif;font-size:28px;margin:15px 10px 15px 0!important}#querylist h2 span{font-size:12px;color:#888;text-transform:uppercase;white-space:nowrap;display:block;margin-bottom:5px}#querylist h2 span#debug-bar-js-error-count{font-size:inherit;color:inherit;text-transform:inherit;white-space:inherit;display:inherit;margin-bottom:inherit}#object-cache-stats h2{border:0;float:left;text-align:left;font-size:22px;margin-bottom:0}#object-cache-stats ul.debug-menu-links,#object-cache-stats-menu-targets{clear:both}.object-cache-stats-menu-target pre{white-space:pre-wrap;margin:1rem 0}#object-cache-stats ul.debug-menu-links li{float:left;margin:0 10px 10px 0;background:0 0;border:1px solid #eee;color:#4b5259;list-style:none}#object-cache-stats ul.debug-menu-links li:hover{border-color:#ddd}#object-cache-stats ul.debug-menu-links li a{background:0 0;color:#4b5259;overflow:hidden;display:block;padding:5px 9px;text-decoration:none}#querylist h3{margin-bottom:15px}#debug-bar-deprecated ol.debug-bar-deprecated-list,#debug-bar-js ol.debug-bar-js-list,#debug-bar-php ol.debug-bar-php-list,#querylist ol.wpd-queries{padding:0!important;margin:0!important;list-style:none;clear:left}#querylist ol.wpd-queries li{padding:10px;background:#f0f0f0;margin:0 0 10px}#querylist ol.wpd-queries li div.qdebug{background:#e8e8e8;margin:10px -10px -10px;padding:5px 150px 5px 5px;font-size:11px;position:relative;min-height:20px}#querylist ol.wpd-queries li div.qdebug span{position:absolute;right:10px;top:5px;white-space:nowrap}#debug-menu-links li a,#querylist a:hover{text-decoration:none!important}#querylist .debug-menu-target{margin:20px;display:none}#querylist ol{font:12px Monaco,"Courier New",Courier,Fixed!important;line-height:180%!important}#querylist table{table-layout:auto}#querylist td,#querylist th{text-transform:none}#querylist table,#querylist table td,#querylist table th{border:0;vertical-align:top}#debug-bar-php ol.debug-bar-php-list li{padding:10px;margin:0 0 10px}#debug-bar-php .debug-bar-php-warning{background-color:#ffebe8;border:1px solid #d00}#debug-bar-php .debug-bar-php-notice{background-color:#ffffe0;border:1px solid #e6db55}#debug-bar-deprecated ol.debug-bar-deprecated-list li,#debug-bar-request p{padding:10px;margin:0 0 10px;background:#f0f0f0}#debug-bar-wp-query table.debug-bar-wp-query-list{width:100%;border-collapse:collapse;cell-padding:1em;clear:both}#debug-bar-wp-query table.debug-bar-wp-query-list td{padding:.5em 5px;border-bottom:1px solid #ccc}#debug-bar-wp-query table.debug-bar-wp-query-list th{padding:.5em 5px;font-weight:700;border-bottom:1px solid #ccc}#debug-bar-wp-query table.debug-bar-wp-query-list tr:nth-child(2n+1){background-color:#e8e8e8}#debug-bar-wp-query table.debug-bar-wp-query-list tr td:first-of-type{font-size:140%;padding:.3em .5em}#debug-bar-request h3,#debug-bar-wp-query h3{float:none;clear:both;font-family:georgia,times,serif;font-size:22px;margin:15px 10px 15px 0!important}#debug-bar-actions{position:absolute;top:21px;right:20px;z-index:300}#debug-bar-actions span{-moz-border-radius:20px;-webkit-border-radius:20px;border-radius:20px;display:block;float:left;height:20px;width:20px;line-height:20px;margin-left:5px;font-size:18px;text-align:center;font-weight:700;color:#eee;background:#aaa;cursor:pointer}#debug-bar-actions span.maximize,#debug-bar-actions span.restore{background-color:#9d9}#debug-bar-actions span.close{background-color:#d99}#debug-bar-actions span:hover{background:#888}#debug-bar-actions span.maximize:hover,#debug-bar-actions span.restore:hover{background:#40bf40}#debug-bar-actions span.close:hover{background:#bf4040}.debug-bar-maximized #debug-bar-actions span.restore{display:block}#debug-menu-links li a#debug-menu-link-Debug_Bar_JS,#wp-admin-bar-debug-bar-Debug_Bar_JS,.debug-bar-maximized #debug-bar-actions span.maximize,.debug-bar-partial #debug-bar-actions span.restore{display:none}.debug-bar-partial #debug-bar-actions span.maximize{display:block}#debug-bar-js ol.debug-bar-js-list li{padding:10px;margin:0 0 10px}#debug-bar-js .debug-bar-js-error{background-color:#ffebe8;border:1px solid #d00}#debug-bar-js .debug-bar-js-error span{color:#666;font-size:.8em;display:block}#debug-bar-js .debug-bar-js-error:hover span{color:#000}.debug-bar-template-parts h3{float:none;clear:both;font-family:georgia,times,serif;font-size:22px;margin:15px 10px 15px 0}.debug-bar-template-parts__row{padding:5px}.debug-bar-template-parts__group{position:relative;background:#e8e8e8;margin:10px 0 10px 25px;padding:5px} \ No newline at end of file diff --git a/css/debug-bar.dev.css b/css/debug-bar.dev.css index a0f18a9..aaac731 100644 --- a/css/debug-bar.dev.css +++ b/css/debug-bar.dev.css @@ -508,3 +508,27 @@ body.debug-bar-maximized.debug-bar-visible { #debug-bar-js .debug-bar-js-error:hover span { color: #000; } + +/* ========================================================================= + * Template Parts styling + * ========================================================================= */ + +.debug-bar-template-parts h3 { + float: none; + clear: both; + font-family: georgia,times,serif; + font-size: 22px; + margin: 15px 10px 15px 0; +} + +.debug-bar-template-parts__row { + padding: 5px; +} + +.debug-bar-template-parts__group { + position: relative; + background: #e8e8e8; + margin: 10px 0; + margin-left: 25px; + padding: 5px; +} diff --git a/debug-bar.php b/debug-bar.php index 04bcc83..cb6f30a 100644 --- a/debug-bar.php +++ b/debug-bar.php @@ -4,7 +4,7 @@ Plugin URI: https://wordpress.org/plugins/debug-bar/ Description: Adds a debug menu to the admin bar that shows query, cache, and other helpful debugging information. Author: wordpressdotorg - Version: 1.1.7 + Version: 1.2.1 Author URI: https://wordpress.org/ Text Domain: debug-bar */ @@ -117,7 +117,7 @@ function init_ajax() { function requirements() { $path = plugin_dir_path( __FILE__ ); - $recs = array( 'panel', 'php', 'queries', 'request', 'wp-query', 'object-cache', 'deprecated', 'js' ); + $recs = array( 'panel', 'php', 'queries', 'request', 'wp-query', 'object-cache', 'deprecated', 'js', 'template-parts' ); foreach ( $recs as $rec ) { require_once "$path/panels/class-debug-bar-$rec.php"; @@ -165,6 +165,7 @@ function init_panels() { 'Debug_Bar_Request', 'Debug_Bar_Object_Cache', 'Debug_Bar_JS', + 'Debug_Bar_Template_Parts', ); foreach ( $classes as $class ) { diff --git a/js/debug-bar-js.js b/js/debug-bar-js.js index 5d03998..1707cd1 100644 --- a/js/debug-bar-js.js +++ b/js/debug-bar-js.js @@ -1 +1 @@ -!function(){var e,i,t,r=0,n=[];window.onerror=function(e,i,r){document.getElementById("debug-bar-js-error-count")?t(e,i,r):n[n.length]=[e,i,r]},jQuery(function(){for(err in n)t(n[err][0],n[err][1],n[err][2])}),t=function(t,n,a){var s,o,u,d;if(r++,e||(e=document.getElementById("debug-bar-js-error-count")),i||(i=document.getElementById("debug-bar-js-errors")),e&&i){if(1==r){if(u=document.getElementById("wp-admin-bar-debug-bar"),!u)return;-1===u.className.indexOf("debug-bar-php-warning-summary")&&(u.className=u.className+" debug-bar-php-warning-summary"),["debug-menu-link-Debug_Bar_JS","wp-admin-bar-debug-bar-Debug_Bar_JS"].map(function(e){d=document.getElementById(e),d&&(d.style.display="block")})}e.textContent=r,s=document.createElement("li"),s.className="debug-bar-js-error",s.textContent=t,o=document.createElement("span"),o.textContent=n+" line "+a,s.appendChild(o),i.appendChild(s)}}}(); \ No newline at end of file +!function(){var e,n,r,t=0,a=[];window.onerror=function(e,n,t){document.getElementById("debug-bar-js-error-count")?r(e,n,t):a[a.length]=[e,n,t]},jQuery(function(){for(err in a)r(a[err][0],a[err][1],a[err][2])}),r=function(r,a,d){var u,m,o,b;if(t++,e||(e=document.getElementById("debug-bar-js-error-count")),n||(n=document.getElementById("debug-bar-js-errors")),e&&n){if(1==t){if(!(o=document.getElementById("wp-admin-bar-debug-bar")))return;-1===o.className.indexOf("debug-bar-php-warning-summary")&&(o.className=o.className+" debug-bar-php-warning-summary"),["debug-menu-link-Debug_Bar_JS","wp-admin-bar-debug-bar-Debug_Bar_JS"].map(function(e){(b=document.getElementById(e))&&(b.style.display="block")})}e.textContent=t,(u=document.createElement("li")).className="debug-bar-js-error",u.textContent=r,(m=document.createElement("span")).textContent=a+" line "+d,u.appendChild(m),n.appendChild(u)}}}(); \ No newline at end of file diff --git a/js/debug-bar.js b/js/debug-bar.js index 0ce3693..76a67c7 100644 --- a/js/debug-bar.js +++ b/js/debug-bar.js @@ -1 +1 @@ -var wpDebugBar;!function(e){var i;wpDebugBar=i={body:void 0,init:function(){i.body=e(document.body),i.toggle.init(),i.tabs(),i.actions.init()},isVisible:function(){return i.body.hasClass("debug-bar-visible")},toggle:{init:function(){e("#wp-admin-bar-debug-bar").click(function(t){if(t.preventDefault(),t.target.hash){var s=e(t.target.rel);if(i.isVisible()){if(s.hasClass("current"))return s.removeClass("current"),void i.toggle.visibility()}else i.toggle.visibility();e(".debug-menu-target").hide().trigger("debug-bar-hide"),e(".debug-menu-link").removeClass("current"),s.addClass("current"),e(t.target.hash).show().trigger("debug-bar-show")}else i.toggle.visibility()})},visibility:function(t){t=void 0===t?!i.isVisible():t,i.body.toggleClass("debug-bar-visible",t),e(this).toggleClass("active",t)}},tabs:function(){var i=e(".debug-menu-link"),t=e(".debug-menu-target");i.click(function(s){var r=e(this);s.preventDefault(),r.hasClass("current")||(t.hide().trigger("debug-bar-hide"),i.removeClass("current"),r.addClass("current"),e("#"+this.href.substr(this.href.indexOf("#")+1)).show().trigger("debug-bar-show"))})},actions:{init:function(){var t=e("#debug-bar-actions");e(document).keydown(function(e){var t=e.key||e.which||e.keyCode;27===t&&i.isVisible()&&(e.preventDefault(),i.actions.close())}),e(".maximize",t).click(i.actions.maximize),e(".restore",t).click(i.actions.restore),e(".close",t).click(i.actions.close)},maximize:function(){i.body.removeClass("debug-bar-partial"),i.body.addClass("debug-bar-maximized")},restore:function(){i.body.removeClass("debug-bar-maximized"),i.body.addClass("debug-bar-partial")},close:function(){i.toggle.visibility(!1)}}},e(wpDebugBar.init)}(jQuery); \ No newline at end of file +var wpDebugBar;!function(e){var i;wpDebugBar=i={body:void 0,init:function(){i.body=e(document.body),i.toggle.init(),i.tabs(),i.actions.init()},isVisible:function(){return i.body.hasClass("debug-bar-visible")},toggle:{init:function(){e("#wp-admin-bar-debug-bar").on("click",function(t){if(t.preventDefault(),t.target.hash){var s=e(t.target.rel);if(i.isVisible()){if(s.hasClass("current"))return s.removeClass("current"),void i.toggle.visibility()}else i.toggle.visibility();e(".debug-menu-target").hide().trigger("debug-bar-hide"),e(".debug-menu-link").removeClass("current"),s.addClass("current"),e(t.target.hash).show().trigger("debug-bar-show")}else i.toggle.visibility()})},visibility:function(t){t=void 0===t?!i.isVisible():t,i.body.toggleClass("debug-bar-visible",t),e(this).toggleClass("active",t)}},tabs:function(){var i=e(".debug-menu-link"),t=e(".debug-menu-target");i.on("click",function(s){var a=e(this);s.preventDefault(),a.hasClass("current")||(t.hide().trigger("debug-bar-hide"),i.removeClass("current"),a.addClass("current"),e("#"+this.href.substr(this.href.indexOf("#")+1)).show().trigger("debug-bar-show"))})},actions:{init:function(){var t=e("#debug-bar-actions");e(document).on("keydown",function(e){var t=e.key||e.which||e.keyCode;27!==t&&"Escape"!==t||!i.isVisible()||(e.preventDefault(),i.actions.close())}),e(".maximize",t).on("click",i.actions.maximize),e(".restore",t).on("click",i.actions.restore),e(".close",t).on("click",i.actions.close)},maximize:function(){i.body.removeClass("debug-bar-partial"),i.body.addClass("debug-bar-maximized")},restore:function(){i.body.removeClass("debug-bar-maximized"),i.body.addClass("debug-bar-partial")},close:function(){i.toggle.visibility(!1)}}},e(wpDebugBar.init)}(jQuery); \ No newline at end of file diff --git a/js/ui-dockable.js b/js/ui-dockable.js index 288e04d..fa6faa5 100644 --- a/js/ui-dockable.js +++ b/js/ui-dockable.js @@ -1 +1 @@ -(function(a){a.widget("db.dockable",a.ui.mouse,{options:{handle:false,axis:"y",resize:function(){},resized:function(){}},_create:function(){if(this.options.axis=="x"){this.page="pageX";this.dimension="width"}else{this.page="pageY";this.dimension="height"}if(!this.options.handle){return}this.handle=a(this.options.handle);this._mouseInit()},_handoff:function(){return{element:this.element,handle:this.handle,axis:this.options.axis}},_mouseStart:function(b){this._trigger("start",b,this._handoff());this.d0=this.element[this.dimension]()+b[this.page]},_mouseDrag:function(c){var b=this._trigger("resize",c,this._handoff());if(b===false){return}this.element[this.dimension](this.d0-c[this.page]);this._trigger("resized",c,this._handoff())},_mouseCapture:function(b){return !this.options.disabled&&b.target==this.handle[0]},_mouseStop:function(b){this._trigger("stop",b,this._handoff())}})})(jQuery); \ No newline at end of file +!function(i){i.widget("db.dockable",i.ui.mouse,{options:{handle:!1,axis:"y",resize:function(){},resized:function(){}},_create:function(){"x"==this.options.axis?(this.page="pageX",this.dimension="width"):(this.page="pageY",this.dimension="height"),this.options.handle&&(this.handle=i(this.options.handle),this._mouseInit())},_handoff:function(){return{element:this.element,handle:this.handle,axis:this.options.axis}},_mouseStart:function(i){this._trigger("start",i,this._handoff()),this.d0=this.element[this.dimension]()+i[this.page]},_mouseDrag:function(i){!1!==this._trigger("resize",i,this._handoff())&&(this.element[this.dimension](this.d0-i[this.page]),this._trigger("resized",i,this._handoff()))},_mouseCapture:function(i){return!this.options.disabled&&i.target==this.handle[0]},_mouseStop:function(i){this._trigger("stop",i,this._handoff())}})}(jQuery); \ No newline at end of file diff --git a/panels/class-debug-bar-template-parts.php b/panels/class-debug-bar-template-parts.php new file mode 100644 index 0000000..49c8655 --- /dev/null +++ b/panels/class-debug-bar-template-parts.php @@ -0,0 +1,124 @@ +title( __( 'Template Parts', 'debug-bar' ) ); + + add_action( 'wp_before_load_template', array( $this, 'action_template_part' ), 10, 3 ); + } + + function prerender() { + $this->set_visible( defined( 'SAVE_TEMPLATE_PARTS' ) && SAVE_TEMPLATE_PARTS ); + } + + function render() { + global $template_parts; + + echo '
'; + } + + function list_row($template_part, $depth, $color) { + $params = ''; + if ( ! empty( $template_part['params'] ) ) { + $params = implode( ',', $template_part['params'] ); + $params = "