Skip to content

[VarDumper] Dynamic HTML dumper #12125

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

Merged
merged 1 commit into from
Oct 5, 2014
Merged

Conversation

nicolas-grekas
Copy link
Member

Q A
Bug fix? yes
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #12109
License MIT
Doc PR -

This PR partially reverts #12109 because it didn't take into account that many dumps can share a single style tag.
More importantly, this PR enhance dump rendering with some cute JS navigation effects:

  • references highlighting on hovering
  • moving references toggling

Here is a screenshot (note the yellow background and the fact that #2 appears after the first @2):
capture du 2014-10-04 09 45 44

this.childLen= this.childElts.length;

while (i < this.childLen) {
elt = this.childElts[i];
if ("" == elt.className) {
elt.className = "sf-dump-child";
elt.innerHTML = '<a class=sf-dump-ref onclick="Sfjs.dump.toggle(this)">'+('sf-dump-0' == elt.parentNode.className ? aExpanded : aCompact)+elt.innerHTML+'</span>';
elt.innerHTML = '<a class=sf-dump-ref onclick="Sfjs.dump.toggle(this)"><span>▼</span></a><span class="sf-dump-expanded">'+elt.innerHTML+'</span>';
if ('sf-dump-0' != elt.parentNode.className) {
Copy link
Member

Choose a reason for hiding this comment

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

this does not work well if you have multiple classes on the element

@fabpot
Copy link
Member

fabpot commented Oct 5, 2014

Thank you @nicolas-grekas.

@fabpot fabpot merged commit b799844 into symfony:master Oct 5, 2014
fabpot added a commit that referenced this pull request Oct 5, 2014
This PR was merged into the 2.6-dev branch.

Discussion
----------

[VarDumper] Dynamic HTML dumper

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #12109
| License       | MIT
| Doc PR        | -

This PR partially reverts #12109 because it didn't take into account that many dumps can share a single style tag.
More importantly, this PR enhance dump rendering with some cute JS navigation effects:
- references highlighting on hovering
- moving references toggling

Here is a screenshot (note the yellow background and the fact that `#2` appears after the first `@2`):
![capture du 2014-10-04 09 45 44](https://cloud.githubusercontent.com/assets/243674/4514936/4431c67e-4b9b-11e4-9809-8d06836be824.png)

Commits
-------

b799844 [VarDumper] Dynamic HTML dumper
xabbuh added a commit to xabbuh/symfony that referenced this pull request Oct 5, 2014
Make test compatible with the changes from symfony#12125.
nicolas-grekas pushed a commit to nicolas-grekas/symfony that referenced this pull request Oct 6, 2014
Make test compatible with the changes from symfony#12125.
nicolas-grekas pushed a commit to nicolas-grekas/symfony that referenced this pull request Oct 6, 2014
Make test compatible with the changes from symfony#12125.
nicolas-grekas pushed a commit to nicolas-grekas/symfony that referenced this pull request Oct 6, 2014
Make test compatible with the changes from symfony#12125.
fabpot added a commit that referenced this pull request Oct 6, 2014
This PR was squashed before being merged into the 2.6-dev branch (closes #12142).

Discussion
----------

[TwigBridge] fix `DumpExtension` tests

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

Make test compatible with the changes from #12125.

Commits
-------

e3332ad [TwigBridge] fix  tests
@nicolas-grekas nicolas-grekas deleted the dhtml-dumper branch October 22, 2014 09:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants