Skip to content

Commit 93fe130

Browse files
committed
More font/padding/styling tweaks. Methods panel cleanup. Fix Git panel layout issue. Bug fixes and additions to image column in Request Info panel.
1 parent 30649fe commit 93fe130

File tree

6 files changed

+53
-46
lines changed

6 files changed

+53
-46
lines changed

TracyDebugger.module

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class TracyDebugger extends WireData implements Module, ConfigurableModule {
3232
'summary' => __('Tracy debugger from Nette with several PW specific custom tools.', __FILE__),
3333
'author' => 'Adrian Jones',
3434
'href' => 'https://processwire.com/talk/topic/12208-tracy-debugger/',
35-
'version' => '4.10.16',
35+
'version' => '4.10.17',
3636
'autoload' => true,
3737
'singular' => true,
3838
'requires' => 'ProcessWire>=2.7.2, PHP>=5.4.4',

panels/GitInfoPanel.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,11 @@ function getPanel() {
6262
$cntTable .= '<tr><td>Tags</td><td> ' . $this->getTags() . ' </td></tr>';
6363
}
6464

65-
$content = '<div class=\"tracy-inner tracy-InfoPanel\"><table><tbody>' .
65+
$content = '<div class="tracy-inner tracy-InfoPanel"><table><tbody>' .
6666
$cntTable .
67-
'</tbody></table></div>';
67+
'</tbody></table>';
6868

69-
$content .= \TracyDebugger::generatedTimeSize('gitInfo', \Tracy\Debugger::timer('gitInfo'), strlen($content));
69+
$content .= \TracyDebugger::generatedTimeSize('gitInfo', \Tracy\Debugger::timer('gitInfo'), strlen($content)) . '</div>';
7070

7171
return parent::loadResources() . $title . $content;
7272
}

panels/MethodsInfoPanel.php

Lines changed: 29 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -41,76 +41,75 @@ public function getPanel() {
4141
<div class="tracy-inner">
4242
<p><a href="'.$docsUrl.'" target="_blank"><button class="tracyCopyBtn">TracyDebugger Docs</button></a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="https://tracy.nette.org/" target="_blank"><button class="tracyCopyBtn">Tracy Docs</button></a></p>
4343
<br />
44-
4544
<p><strong><a href="'.$debugMethodsRootUrl.'additional-debug-methods" target="_blank">addBreakpoint($name = NULL, $enforceParent&nbsp;=&nbsp;NULL)</a></strong></p>
4645
<p>
47-
TD::addBreakpoint()<br />
48-
addBreakpoint()<br />
49-
bp()<br />
46+
<strong>bp()</strong><br />
47+
addBreakpoint()<br />
48+
TD::addBreakpoint()<br />
5049
</p>
5150
5251
<p><strong><a href="'.$debugMethodsRootUrl.'bardump" target="_blank">barDump($var, $title = NULL, array $options = NULL)</a></strong></p>
5352
<p>
54-
TD::barDump()<br />
55-
barDump()<br />
56-
bd()<br />
53+
<strong>bd()</strong><br />
54+
barDump()<br />
55+
TD::barDump()<br />
5756
</p>
5857
5958
<p><strong><a href="'.$debugMethodsRootUrl.'bardumpbig" target="_blank">barDumpBig($var, $title = NULL)</a></strong></p>
6059
<p>
61-
TD::barDumpBig()<br />
62-
barDumpBig()<br />
63-
bdb()<br />
60+
<strong>bdb()</strong><br />
61+
barDumpBig()<br />
62+
TD::barDumpBig()<br />
6463
</p>
6564
6665
6766
<p><strong><a href="'.$debugMethodsRootUrl.'bardumplive" target="_blank">barDumpLive($var, $title = NULL)</a></strong></p>
6867
<p>
69-
TD::barDumpLive()<br />
70-
barDumpLive()<br />
71-
bdl()<br />
68+
<strong>bdl()</strong><br />
69+
barDumpLive()<br />
70+
TD::barDumpLive()<br />
7271
</p>
7372
7473
<p><strong><a href="'.$debugMethodsRootUrl.'debugall" target="_blank">debugAll($var, $title = NULL, array $options = NULL)</a></strong></p>
7574
<p>
76-
TD::debugAll()<br />
77-
debugAll()<br />
78-
da()<br />
75+
<strong>da()</strong><br />
76+
debugAll()<br />
77+
TD::debugAll()<br />
7978
</p>
8079
8180
<p><strong><a href="'.$debugMethodsRootUrl.'dump" target="_blank">dump($var, $title = NULL, array $options = NULL, $return = FALSE)</a></strong></p>
8281
<p>
83-
TD::dump()<br />
84-
dump()<br />
85-
d()<br />
82+
<strong>d()</strong><br />
83+
dump()<br />
84+
TD::dump()<br />
8685
</p>
8786
8887
<p><strong><a href="'.$debugMethodsRootUrl.'firelog" target="_blank">fireLog($var)</a></strong></p>
8988
<p>
90-
TD::fireLog()<br />
91-
fireLog()<br />
92-
fl()<br />
89+
<strong>fl()</strong><br />
90+
fireLog()<br />
91+
TD::fireLog()<br />
9392
</p>
9493
9594
<p><strong><a href="'.$debugMethodsRootUrl.'log" target="_blank">log($str, $priority = ILogger::INFO)</a></strong></p>
9695
@priority: "debug", "info", "warning", "error", "exception", "critical"
9796
<p>
98-
TD::log()<br />
99-
l()<br />
97+
<strong>l()</strong><br />
98+
TD::log()<br />
10099
</p>
101100
102101
<p><strong><a href="'.$debugMethodsRootUrl.'dump-all-variables-at-various-breakpoints" target="_blank">templateVars(get_defined_vars())</a></strong></p>
103102
<p>
104-
TD::templateVars()<br />
105-
templateVars()<br />
106-
tv()<br />
103+
<strong>tv()</strong><br />
104+
templateVars()<br />
105+
TD::templateVars()<br />
107106
</p>
108107
109108
<p><strong><a href="'.$debugMethodsRootUrl.'timer" target="_blank">timer($name = NULL)</a></strong></p>
110109
<p>
111-
TD::timer()<br />
112-
timer()<br />
113-
t()<br />
110+
<strong>t()</strong><br />
111+
timer()<br />
112+
TD::timer()<br />
114113
</p>
115114
';
116115
$out .= \TracyDebugger::generatedTimeSize('methodsInfo', \Tracy\Debugger::timer('methodsInfo'), strlen($out)) . '

panels/RequestInfoPanel.php

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -656,9 +656,8 @@ private function imageDetails($p, $f) {
656656
$p->of(false);
657657
$imageStr = '';
658658
$imagePreview = '';
659-
if(\TracyDebugger::getDataValue('imagesInFieldListValues')) {
660-
$inputfield = $f->getInputfield($p);
661-
}
659+
$inputfield = \TracyDebugger::getDataValue('imagesInFieldListValues') ? $f->getInputfield($p) : null;
660+
662661
if($f->type instanceof FieldtypeRepeater) {
663662
if(is_object($p->$f) && count($p->$f)) {
664663
foreach($p->$f as $subpage) {
@@ -696,8 +695,9 @@ private function getImages($p) {
696695
foreach($p as $field => $item) {
697696
$f = $this->wire('fields')->get($field);
698697
if($item && $f && $f->type instanceof FieldTypeImage) {
698+
$inputfield = \TracyDebugger::getDataValue('imagesInFieldListValues') ? $f->getInputfield($p) : null;
699699
foreach($item as $image) {
700-
$imageStr .= $this->imageStr($f->getInputfield($p), $image);
700+
$imageStr .= $this->imageStr($inputfield, $image);
701701
}
702702
}
703703
}
@@ -708,12 +708,22 @@ private function getImages($p) {
708708

709709

710710
private function imageStr($inputfield, $image) {
711+
$imagePreview = '';
711712
if(isset($inputfield) && $inputfield) {
712713
$thumb = $inputfield->getAdminThumb($image);
713714
$thumb = $thumb['thumb'];
714-
$imagePreview = '<a class="pw-modal" href="'.$image->url.'"><img width="125" src="'.$thumb->url.'" /></a><br />';
715+
$imagePreview = '<a class="pw-modal" href="'.$image->url.'"><img style="padding:5px 0" width="125" src="'.$thumb->url.'" /></a><br />';
716+
}
717+
return '<p><strong>'.$image->name.'</strong><br />'.$imagePreview.'description: '.$image->description.'<br />tags: '.$image->tags.'<br />dimensions: '.$image->width.'x'.$image->height.'<br />size: '.$image->filesizeStr.'<br />variations: '.$this->variationsStr($image).'</p><br />';
718+
}
719+
720+
721+
private function variationsStr($image) {
722+
$variationsArr = array();
723+
foreach($image->getVariations() as $var) {
724+
$variationsArr[] = $var->width . 'x' . $var->height . '&nbsp;(' . str_replace(' ', '&nbsp;', $var->filesizeStr) . ')';
715725
}
716-
return '<p>'.$image->name.'<br />'.$imagePreview.'width: '.$image->width.'<br />height: '.$image->height.'<br />size: '.$image->filesizeStr.'</p><br />';
726+
return implode (', ', $variationsArr);
717727
}
718728

719729

styles.css

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,6 @@ body.tracyHidden:before {
215215

216216
#tracy-debug a {
217217
border: none !important;
218-
font-weight: normal !important;
219218
}
220219

221220
#tracy-debug table {
@@ -242,7 +241,7 @@ body.tracyHidden:before {
242241
#tracy-debug .tracy-panel th {
243242
font: normal normal 13px/1.3 Arial, sans-serif !important;
244243
font-weight: normal !important;
245-
padding: 4px !important;
244+
padding: 2px 4px !important;
246245
border: 1px solid #C9D4E1 !important;
247246
line-height: 1.8 !important;
248247
}
@@ -327,6 +326,7 @@ table.captainHookTable td:nth-child(3), table.captainHookTable th:nth-child(3) {
327326

328327
.tracy-inner p {
329328
font-size:13px !important;
329+
margin: 1em 0 !important;
330330
}
331331

332332
#tracy-debug td pre, #tracy-debug code {
@@ -436,7 +436,7 @@ ul.pw-info-links {
436436

437437
.pw-info-links li.with-labels {
438438
display: block !important;
439-
padding: 0 0 5px 0 !important;
439+
padding: 1px 0 !important;
440440
line-height: 0.7 !important;
441441
}
442442

tracy-master/src/Tracy/assets/Bar/bar.css

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ body#tracy-debug { /* in popup window */
1818
position: absolute;
1919
left: 0;
2020
top: 0;
21-
width: calc(100vw - 100px); /* bigger to not affect inner content when windows gets smaller */
22-
height: calc(100vh - 100px);
2321
pointer-events: none;
2422
}
2523

@@ -376,4 +374,4 @@ body#tracy-debug .tracy-panel { /* in popup window */
376374
#tracy-debug * {
377375
display: none;
378376
}
379-
}
377+
}

0 commit comments

Comments
 (0)