diff options
author | Andreas Gohr <andi@splitbrain.org> | 2016-02-26 20:50:36 +0100 |
---|---|---|
committer | Andreas Gohr <andi@splitbrain.org> | 2016-02-26 20:50:36 +0100 |
commit | b288bde8c9db9190a39be1beb6f0a6ddfde2ad14 (patch) | |
tree | cda0d79f6307803b61cb06b3f8995295552ef2a0 | |
parent | cbc3610a1d15feae4b1fb006e2ea2fba2648f49b (diff) | |
download | xdebug-trace-tree-b288bde8c9db9190a39be1beb6f0a6ddfde2ad14.zip xdebug-trace-tree-b288bde8c9db9190a39be1beb6f0a6ddfde2ad14.tar.gz xdebug-trace-tree-b288bde8c9db9190a39be1beb6f0a6ddfde2ad14.tar.bz2 |
allow collapsing all functions of the same name
-rw-r--r-- | index.php | 31 | ||||
-rw-r--r-- | script.js | 13 | ||||
-rw-r--r-- | style.css | 32 |
3 files changed, 65 insertions, 11 deletions
@@ -8,31 +8,42 @@ </head> <body> -<form method="post"> +<form method="post" class="load"> <label for="file">File:</label> <select name="file" id="file"> <?php $dir = ini_get('xdebug.trace_output_dir'); - if(!$dir) $dir = '/tmp/'; + if (!$dir) { + $dir = '/tmp/'; + } $files = glob("$dir/*.xt"); - foreach($files as $file) { - echo '<option value="'.htmlspecialchars($file).'">'.htmlspecialchars(basename($file)).'</option>'; + foreach ($files as $file) { + echo '<option value="' . htmlspecialchars($file) . '">' . htmlspecialchars(basename($file)) . '</option>'; } ?> </select> - <button type="submit">Load</button> + <button type="submit">Load</button><br /> + Files are read from xdebug.trace_output_dir = <?php echo htmlspecialchars($dir)?> </form> - -<form> - <input type="checkbox" value="1" checked="checked" id="internal"><label for="internal">Show internal functions</label> +<ul class="help"> + <li>load a trace file from the dropdown</li> + <li>click a left margin to collapse a whole sub tree</li> + <li>click a function name to collapse all calls to the same function</li> + <li>click the parameter list to expand it</li> + <li>click the return list to expand it</li> + <li>use the checkbox to hide all PHP internal functions</li> +</ul> + +<form class="options"> + <input type="checkbox" value="1" checked="checked" id="internal"><label for="internal">Show internal + functions</label> </form> <?php - -if(!empty($_REQUEST['file'])) { +if (!empty($_REQUEST['file'])) { require_once 'XDebugParser.php'; $parser = new XDebugParser($_REQUEST['file']); $parser->parse(); @@ -1,7 +1,7 @@ $(function(){ - $('div.d').click(function (e) { + $('div.d, div.f').click(function (e) { if (e.target !== this) return; $(this).toggleClass('hide'); e.preventDefault(); @@ -18,4 +18,15 @@ $(function(){ $('#internal').change(function(){ $('div.i').toggle(); }); + + $('span.name').click(function(e){ + if (e.target !== this) return; + + var $fn = $(this); + var name = $(this).text(); + $("span.name:contains('"+name+"')").closest('div.f').toggleClass('hide'); + + e.preventDefault(); + e.stopPropagation(); + }); });
\ No newline at end of file @@ -1,10 +1,12 @@ div.d { padding-left: 2em; + border-left: 1px solid #ccc; cursor: pointer; } div.d.hide { height: 5px; + margin-top: 1px; background-color: #ccc; } @@ -12,6 +14,12 @@ div.d.hide * { display: none; } +div.f.hide { + height: 5px; + margin-top: 1px; + background-color: #a1b7cc; + cursor: pointer; +} div.f { cursor: auto; @@ -20,6 +28,10 @@ div.f { width: 100%; } +div.f.hide * { + display: none; +} + div.f div { padding: 5px 0; @@ -49,6 +61,7 @@ span.short { span.name { font-weight: bold; + cursor: pointer; } span.params { @@ -74,3 +87,22 @@ div.header { font-weight: bold; background-color: antiquewhite; } + +form.load { + width: 50%; + float: left; +} + +select { + width: 80%; +} + +ul.help { + margin: 0; + width: 45%; + float: left; +} + +form.options { + clear:both; +}
\ No newline at end of file |