Skip to content

Commit

Permalink
BlueScreen, Dumper: links to editor have class tracy-editor [Closes #…
Browse files Browse the repository at this point in the history
…443]
  • Loading branch information
dg committed Oct 14, 2020
1 parent d694ea2 commit 2e72f0f
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions src/Tracy/BlueScreen/BlueScreen.php
Expand Up @@ -384,7 +384,7 @@ function ($m) {
if (empty($r) || !$r->getFileName()) {
return $m[0];
}
return '<a href="' . Helpers::escapeHtml(Helpers::editorUri($r->getFileName(), $r->getStartLine())) . '">' . $m[0] . '</a>';
return '<a href="' . Helpers::escapeHtml(Helpers::editorUri($r->getFileName(), $r->getStartLine())) . '" class="tracy-editor">' . $m[0] . '</a>';
},
$msg
);
Expand All @@ -394,7 +394,7 @@ function ($m) {
'#([\w\\\\/.:-]+\.(?:php|phpt|phtml|latte|neon))(?|:(\d+)| on line (\d+))?#',
function ($m) {
return @is_file($m[1])
? '<a href="' . Helpers::escapeHtml(Helpers::editorUri($m[1], isset($m[2]) ? (int) $m[2] : null)) . '">' . $m[0] . '</a>'
? '<a href="' . Helpers::escapeHtml(Helpers::editorUri($m[1], isset($m[2]) ? (int) $m[2] : null)) . '" class="tracy-editor">' . $m[0] . '</a>'
: $m[0];
},
$msg
Expand Down
4 changes: 2 additions & 2 deletions src/Tracy/BlueScreen/assets/bluescreen.css
Expand Up @@ -238,13 +238,13 @@
font-style: normal;
}

#tracy-bs a[href^=editor\:] {
#tracy-bs a.tracy-editor {
color: inherit;
border-bottom: 1px dotted rgba(0, 0, 0, .3);
border-radius: 3px;
}

#tracy-bs a[href^=editor\:]:hover {
#tracy-bs a.tracy-editor:hover {
background: #0001;
}

Expand Down
2 changes: 1 addition & 1 deletion src/Tracy/Helpers.php
Expand Up @@ -27,7 +27,7 @@ public static function editorLink(string $file, int $line = null): string
$file = '...' . $m[0];
}
$file = strtr($file, '/', DIRECTORY_SEPARATOR);
return self::formatHtml('<a href="%" title="%">%<b>%</b>%</a>',
return self::formatHtml('<a href="%" title="%" class="tracy-editor">%<b>%</b>%</a>',
$editor,
$origFile . ($line ? ":$line" : ''),
rtrim(dirname($file), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR,
Expand Down
4 changes: 2 additions & 2 deletions tests/Tracy/expected/Debugger.error-in-eval.expect
Expand Up @@ -65,7 +65,7 @@
</li>
<li><p>

<a href="editor:%a%" title="%a%Debugger.error-in-eval.phpt:%d%">%a%<b>Debugger.error-in-eval.phpt</b>:%d%</a>
<a href="editor:%a%" title="%a%Debugger.error-in-eval.phpt:%d%" class="tracy-editor">%a%<b>Debugger.error-in-eval.phpt</b>:%d%</a>
<a data-tracy-ref="^p + .file" class="tracy-toggle tracy-collapsed">source</a>&nbsp;
eval()
</p>
Expand All @@ -76,7 +76,7 @@
</li>
<li><p>

<a href="editor:%a%" title="%a%Debugger.error-in-eval.phpt:%d%">%a%<b>Debugger.error-in-eval.phpt</b>:%d%</a>
<a href="editor:%a%" title="%a%Debugger.error-in-eval.phpt:%d%" class="tracy-editor">%a%<b>Debugger.error-in-eval.phpt</b>:%d%</a>
<a data-tracy-ref="^p + .file" class="tracy-toggle tracy-collapsed">source</a>&nbsp;
first(<a data-tracy-ref="^p + .args" class="tracy-toggle tracy-collapsed">arguments</a>)
</p>
Expand Down
8 changes: 4 additions & 4 deletions tests/Tracy/expected/Debugger.exception.html.expect
Expand Up @@ -47,7 +47,7 @@
<ol>
<li><p>

<a href="editor:%a%" title="%a%Debugger.exception.html.phpt:%d%">%a%<b>Debugger.exception.html.phpt</b>:%d%</a>
<a href="editor:%a%" title="%a%Debugger.exception.html.phpt:%d%" class="tracy-editor">%a%<b>Debugger.exception.html.phpt</b>:%d%</a>
<a data-tracy-ref="^p + .file" class="tracy-toggle tracy-collapsed">source</a>&nbsp;
third(<a data-tracy-ref="^p + .args" class="tracy-toggle tracy-collapsed">arguments</a>)
</p>
Expand All @@ -64,7 +64,7 @@
</li>
<li><p>

<a href="editor:%a%" title="%a%Debugger.exception.html.phpt:%d%">%a%<b>Debugger.exception.html.phpt</b>:%d%</a>
<a href="editor:%a%" title="%a%Debugger.exception.html.phpt:%d%" class="tracy-editor">%a%<b>Debugger.exception.html.phpt</b>:%d%</a>
<a data-tracy-ref="^p + .file" class="tracy-toggle tracy-collapsed">source</a>&nbsp;
second(<a data-tracy-ref="^p + .args" class="tracy-toggle tracy-collapsed">arguments</a>)
</p>
Expand All @@ -83,7 +83,7 @@
</li>
<li><p>

<a href="editor:%a%" title="%a%Debugger.exception.html.phpt:%d%">%a%<b>Debugger.exception.html.phpt</b>:%d%</a>
<a href="editor:%a%" title="%a%Debugger.exception.html.phpt:%d%" class="tracy-editor">%a%<b>Debugger.exception.html.phpt</b>:%d%</a>
<a data-tracy-ref="^p + .file" class="tracy-toggle tracy-collapsed">source</a>&nbsp;
first(<a data-tracy-ref="^p + .args" class="tracy-toggle tracy-collapsed">arguments</a>)
</p>
Expand Down Expand Up @@ -114,7 +114,7 @@
<div class="tracy-collapsed inner">

<h3>Notice: Undefined variable: undefined</h3>
<p><a href="editor:%a%" title="%a%Debugger.exception.html.phpt:%d%">%a%<b>Debugger.exception.html.phpt</b>:%d%</a></p>
<p><a href="editor:%a%" title="%a%Debugger.exception.html.phpt:%d%" class="tracy-editor">%a%<b>Debugger.exception.html.phpt</b>:%d%</a></p>
<div>%A%</div>

</div></div>
Expand Down
6 changes: 3 additions & 3 deletions tests/Tracy/expected/Debugger.strict.html.expect
Expand Up @@ -47,7 +47,7 @@
<ol>
<li><p>

<a href="editor:%a%" title="%a%Debugger.strict.html.phpt:%d%">%a%<b>Debugger.strict.html.phpt</b>:%d%</a>
<a href="editor:%a%" title="%a%Debugger.strict.html.phpt:%d%" class="tracy-editor">%a%<b>Debugger.strict.html.phpt</b>:%d%</a>
<a data-tracy-ref="^p + .file" class="tracy-toggle tracy-collapsed">source</a>&nbsp;
third(<a data-tracy-ref="^p + .args" class="tracy-toggle tracy-collapsed">arguments</a>)
</p>
Expand All @@ -64,7 +64,7 @@
</li>
<li><p>

<a href="editor:%a%" title="%a%Debugger.strict.html.phpt:%d%">%a%<b>Debugger.strict.html.phpt</b>:%d%</a>
<a href="editor:%a%" title="%a%Debugger.strict.html.phpt:%d%" class="tracy-editor">%a%<b>Debugger.strict.html.phpt</b>:%d%</a>
<a data-tracy-ref="^p + .file" class="tracy-toggle tracy-collapsed">source</a>&nbsp;
second(<a data-tracy-ref="^p + .args" class="tracy-toggle tracy-collapsed">arguments</a>)
</p>
Expand All @@ -83,7 +83,7 @@
</li>
<li><p>

<a href="editor:%a%" title="%a%Debugger.strict.html.phpt:%d%">%a%<b>Debugger.strict.html.phpt</b>:%d%</a>
<a href="editor:%a%" title="%a%Debugger.strict.html.phpt:%d%" class="tracy-editor">%a%<b>Debugger.strict.html.phpt</b>:%d%</a>
<a data-tracy-ref="^p + .file" class="tracy-toggle tracy-collapsed">source</a>&nbsp;
first(<a data-tracy-ref="^p + .args" class="tracy-toggle tracy-collapsed">arguments</a>)
</p>
Expand Down

0 comments on commit 2e72f0f

Please sign in to comment.