8000 [Profiler][VarDumper] Add a search feature to the HtmlDumper by ogizanagi · Pull Request #21109 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Profiler][VarDumper] Add a search feature to the HtmlDumper #21109

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 10 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
New output
  • Loading branch information
ogizanagi committed Jan 3, 2017
commit 5018b0e8bac38ff29e2178bc01e2261f0dbff1bc
Original file line number Diff line number Diff line change
Expand Up @@ -934,19 +934,6 @@ table.logs .metadata {
background: rgba(255, 255, 153, 0.5);
}

#collector-content .sf-dump-search-wrapper {
margin: 0;
background: rgba(210, 210, 210, 0.5);
border: 1px solid #dcdcdc;
border-top: none;
border-right: none;
}
#collector-content div.sf-dump .sf-dump-search-wrapper {
margin-top: -10px;
margin-right: -10px;
}
#collector-content .sf-dump-search-wrapper > .sf-dump-search-count { color: #000; }

{# Search Results page
========================================================================= #}
#search-results td {
Expand Down
8000
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,10 @@
.sf-toolbar-block-dump pre.sf-dump:last-child {
margin-bottom: 0;
}
.sf-toolbar-block-dump pre.sf-dump span.sf-dump-search-count {
color: #333;
font-size: 12px;
}
.sf-toolbar-block-dump .sf-toolbar-info-piece {
display: block;
}
Expand Down
46 changes: 22 additions & 24 deletions src/Symfony/Component/VarDumper/Dumper/HtmlDumper.php
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,7 @@ function xpathString(str) {
search.className = 'sf-dump-search-wrapper sf-dump-search-hidden';
search.innerHTML = '
<input type="text" class="sf-dump-search-input">
<span class="sf-dump-search-count">0 on 0<\/span>
<button type="button" class="sf-dump-search-input-previous" tabindex="-1">
<svg viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg">
<path d="M1683 1331l-166 165q-19 19-45 19t-45-19l-531-531-531 531q-19 19-45 19t-45-19l-166-165q-19-19-19-45.5t19-45.5l742-741q19-19 45-19t45 19l742 741q19 19 19 45.5t-19 45.5z"\/>
Expand All @@ -473,7 +474,6 @@ function xpathString(str) {
<path d="M1683 808l-742 741q-19 19-45 19t-45-19l-742-741q-19-19-19-45.5t19-45.5l166-165q19-19 45-19t45 19l531 531 531-531q19-19 45-19t45 19l166 165q19 19 19 45.5t-19 45.5z"\/>
<\/svg>
<\/button>
<span class="sf-dump-search-count">0 on 0<\/span>
';
root.insertBefore(search, root.firstChild);

Expand Down Expand Up @@ -625,7 +625,7 @@ function xpathString(str) {
.sf-dump-str.sf-dump-highlight,
.sf-dump-key.sf-dump-highlight {
background: rgba(111, 172, 204, 0.3);
border: 1px solid #7da0b1;
border: 1px solid #7DA0B1;
border-radius: 3px;
}
.sf-dump-public.sf-dump-highlight-active,
Expand All @@ -634,46 +634,43 @@ function xpathString(str) {
.sf-dump-str.sf-dump-highlight-active,
.sf-dump-key.sf-dump-highlight-active {
background: rgba(253, 175, 0, 0.4);
border: 1px solid #FFA500;
border: 1px solid #ffa500;
border-radius: 3px;
}
.sf-dump-search-hidden {
display: none;
}
.sf-dump-search-wrapper {
float: right;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a clearfix behavior in the styles of the parent block ? If no, it does not ensure the min height

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you. I've added it in 9b57189. Hope that's enough.

margin-top: -5px;
margin-right: -5px;
text-align: right;
max-width: 100%;
font-size: 0;
padding: 5px;
background: rgba(255, 255, 255, 0.3);
border-radius: 0 0 0 3px;
}
.sf-dump-search-wrapper > * {
vertical-align: top;
box-sizing: border-box;
height: 21px;
font-weight: normal;
border-radius: 0;
background: #FFF;
color: #757575;
border: 1px solid #BBB;
}
.sf-dump-search-wrapper > input.sf-dump-search-input {
color: #333;
padding: 3px;
height: 21px;
border: 1px solid #bbb;
box-sizing: border-box;
font-size: 12px;
border-right: none;
max-width: 150px;
border-top-left-radius: 3px;
border-bottom-left-radius: 3px;
color: #000;
}
.sf-dump-search-wrapper > .sf-dump-search-input-next,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

couldn't it simply be .sf-dump-search-input-next ?

Copy link
Contributor Author
@ogizanagi ogizanagi Jan 3, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could be, but more specific selectors ensure it has priority, for instance over some more global styles defined and used by the WDT (I had some issues with that).

.sf-dump-search-wrapper > .sf-dump-search-input-previous {
border-radius: 0;
background: white;
background: #F2F2F2;
outline: none;
border: 1px solid #bbb;
border-left: none;
height: 21px;
font-size: 0;
color: #333;
vertical-align: top;
box-sizing: border-box;
line-height: 0;
}
.sf-dump-search-wrapper > .sf-dump-search-input-next {
border-top-right-radius: 3px;
Expand All @@ -686,11 +683,12 @@ function xpathString(str) {
height: 12px;
}
.sf-dump-search-wrapper > .sf-dump-search-count {
display: inline-block;
padding: 0 5px;
margin: 0;
border-left: none;
line-height: 21px;
font-size: 12px;
color: #FFF;
font-weight: normal;
margin-top: 5px;
display: block;
}
EOHTML
);
Expand Down
0