summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2016-02-26 20:50:36 +0100
committerAndreas Gohr <andi@splitbrain.org>2016-02-26 20:50:36 +0100
commitb288bde8c9db9190a39be1beb6f0a6ddfde2ad14 (patch)
treecda0d79f6307803b61cb06b3f8995295552ef2a0
parentcbc3610a1d15feae4b1fb006e2ea2fba2648f49b (diff)
downloadxdebug-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.php31
-rw-r--r--script.js13
-rw-r--r--style.css32
3 files changed, 65 insertions, 11 deletions
diff --git a/index.php b/index.php
index 387d0a3..095385b 100644
--- a/index.php
+++ b/index.php
@@ -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();
diff --git a/script.js b/script.js
index c143477..f45ab90 100644
--- a/script.js
+++ b/script.js
@@ -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
diff --git a/style.css b/style.css
index 280cd04..97844a1 100644
--- a/style.css
+++ b/style.css
@@ -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