Skip to content

Commit

Permalink
Merge branch 'master' of github.com:ArrayAccess/TrayDigita
Browse files Browse the repository at this point in the history
  • Loading branch information
ArrayIterator committed Jul 16, 2024
2 parents 3bdd737 + 44838b8 commit dca7ac6
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 6 deletions.
7 changes: 6 additions & 1 deletion src/Benchmark/Waterfall.php
Original file line number Diff line number Diff line change
Expand Up @@ -1208,12 +1208,13 @@ private function renderCSS(bool $darkMode) : string
--waterfall-toolbar-bg: #fafafa;
}
.{$this->prefix}section-wrapper {
scroll-behavior: smooth;
position: fixed;
z-index: 2147483647;
left:0;
right:0;
bottom:0;
font-weight: lighter;
font-weight: 250;
margin: 0;
padding: 0;
border: 0;
Expand Down Expand Up @@ -1449,6 +1450,10 @@ private function renderCSS(bool $darkMode) : string
position: relative;
z-index: 900;
overflow: auto;
scrollbar-width: thin;
scroll-behavior: smooth;
/* make smooth */
scrollbar-color: rgba(0,0,0,.1) transparent;
}
.{$this->prefix}section-wrapper .{$this->prefix}hidden {
display: none !important;
Expand Down
45 changes: 40 additions & 5 deletions src/View/ErrorRenderer/HtmlTraceAbleErrorRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ private function exceptionDetail(Throwable $exception): string
$exception->getLine()
);
$mainErrorInfo .= sprintf(
"<div class='current'><strong>Message</strong>: <code>%s</code></div>\n",
"<div class='current current-message'><strong>Message</strong>: <code>%s</code></div>\n",
htmlentities($message)
);
$mainErrorInfo .= '<div><br></div>';
Expand Down Expand Up @@ -569,6 +569,14 @@ private function exceptionDetail(Throwable $exception): string
display: flex;
flex-direction: column;
justify-content: flex-start;
scroll-behavior: smooth;
scrollbar-width: thin;
scrollbar-color: rgba(255, 255, 255, .3) transparent;
}
.current-message > code {
word-wrap:break-word;
white-space: normal
}
.tab-info {
Expand Down Expand Up @@ -744,6 +752,7 @@ private function exceptionDetail(Throwable $exception): string
min-height: 100%;
outline: none;
box-shadow: none;
flex: 0 0 auto;
/* margin-right: 1em; */
}
Expand Down Expand Up @@ -882,13 +891,39 @@ private function exceptionDetail(Throwable $exception): string
navigator.clipboard.writeText(content);
});
e.addEventListener('keydown', function(e) {
if (/^(Backspace|Delete)/i.test(e.code)) {
e.preventDefault();
return false;
}
if (e.code === 'Escape') {
window.getSelection()?.removeAllRanges();
return;
}
// if cut just select current select range
if (e.code === 'KeyX' && (e.ctrlKey || e.metaKey)) {
const selection = window.getSelection();
if (selection) {
const range = selection.getRangeAt(0);
const content = range.cloneContents();
const div = document.createElement('div');
div.appendChild(content);
const text = div.textContent;
try {
navigator.clipboard.writeText(text).catch(() => null);
} catch (err) {
// pass
}
return;
}
return;
}
if (['ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown', 'Tab'].includes(e.code)
|| (
(e.ctrlKey || e.metaKey) && (
['KeyA', 'KeyC', 'KeyV', 'KeyX', 'KeyR'].includes(e.code)
)
)
) {
return;
}
e.preventDefault();
return false;
});
});
let navTabs = document.querySelectorAll('.trace-tab-nav');
Expand Down

0 comments on commit dca7ac6

Please sign in to comment.