Skip to content

Commit 930669f

Browse files
committed
Debug toolbar markup is now XHTML compliant.
1 parent 4baa51e commit 930669f

File tree

6 files changed

+22
-18
lines changed

6 files changed

+22
-18
lines changed

debug_toolbar/media/debug_toolbar/toolbar.css

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,10 @@
129129
opacity:1.0;
130130
}
131131

132-
#djDebug pre {
132+
#djDebug code {
133+
display:block;
134+
font-family:Consolas, Monaco, "Bitstream Vera Sans Mono", "Lucida Console", monospace;
135+
white-space:pre;
133136
background-color:#ffffff;
134137
overflow:auto;
135138
}
@@ -222,9 +225,6 @@
222225
padding-right:.5em;
223226
}
224227

225-
#djDebug .panelContent code {
226-
font-family:Consolas, Monaco, "Bitstream Vera Sans Mono", "Lucida Console", monospace;
227-
}
228228
/*
229229
#djDebug .panelContent p a:hover, #djDebug .panelContent dd a:hover {
230230
color:#111;

debug_toolbar/media/debug_toolbar/toolbar.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

debug_toolbar/templates/debug_toolbar/base.html

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,25 @@
11
{% load i18n %}
22
<script type="text/javascript" charset="utf-8">
3+
/* <![CDATA[ */
34
// When jQuery is sourced, it's going to overwrite whatever might be in the
45
// '$' variable, so store a reference of it in a temporary variable...
56
var _$ = window.$;
67
if (typeof jQuery == 'undefined') {
78
var jquery_url = '{{ BASE_URL }}/__debug__/m/jquery.js';
89
document.write(unescape('%3Cscript src="' + jquery_url + '" type="text/javascript"%3E%3C/script%3E'));
910
}
11+
/* ]]> */
1012
</script>
1113
<script type="text/javascript" src="{{ BASE_URL }}/__debug__/m/toolbar.min.js"></script>
1214
<script type="text/javascript" charset="utf-8">
15+
/* <![CDATA[ */
1316
// Now that jQuery is done loading, put the '$' variable back to what it was...
1417
var $ = _$;
18+
$(document).ready(function() {
19+
$('head').append('<link rel="stylesheet" href="{{ BASE_URL }}/__debug__/m/toolbar.min.css" type="text/css" />');
20+
});
21+
/* ]]> */
1522
</script>
16-
<style type="text/css">
17-
@import url({{ BASE_URL }}/__debug__/m/toolbar.min.css);
18-
</style>
1923
<div id="djDebug">
2024
<div style="display:none;" id="djDebugToolbar">
2125
<ul id="djDebugPanelList">
@@ -33,7 +37,7 @@
3337
{% endif %}
3438
{{ panel.nav_title }}
3539
{% with panel.nav_subtitle as subtitle %}
36-
{% if subtitle %}<br><small>{{ subtitle }}</small>{% endif %}
40+
{% if subtitle %}<br /><small>{{ subtitle }}</small>{% endif %}
3741
{% endwith %}
3842
{% if panel.has_content %}
3943
</a>

debug_toolbar/templates/debug_toolbar/panels/sql.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515
<td>
1616
{% if query.params %}
1717
{% if query.is_select %}
18-
<a class="remoteCall" href="/__debug__/sql_select/?sql={{ query.raw_sql|urlencode }}&params={{ query.params|urlencode }}&duration={{ query.duration|floatformat:"2"|urlencode }}&hash={{ query.hash }}">SELECT</a><br>
18+
<a class="remoteCall" href="/__debug__/sql_select/?sql={{ query.raw_sql|urlencode }}&amp;params={{ query.params|urlencode }}&amp;duration={{ query.duration|floatformat:"2"|urlencode }}&amp;hash={{ query.hash }}">SELECT</a><br />
1919
{% endif %}
20-
<a class="remoteCall" href="/__debug__/sql_explain/?sql={{ query.raw_sql|urlencode }}&params={{ query.params|urlencode }}&duration={{ query.duration|floatformat:"2"|urlencode }}&hash={{ query.hash }}">EXPLAIN</a><br>
20+
<a class="remoteCall" href="/__debug__/sql_explain/?sql={{ query.raw_sql|urlencode }}&amp;params={{ query.params|urlencode }}&amp;duration={{ query.duration|floatformat:"2"|urlencode }}&amp;hash={{ query.hash }}">EXPLAIN</a><br />
2121
{% if is_mysql %}
22-
<a class="remoteCall" href="/__debug__/sql_profile/?sql={{ query.raw_sql|urlencode }}&params={{ query.params|urlencode }}&duration={{ query.duration|floatformat:"2"|urlencode }}&hash={{ query.hash }}">PROFILE</a><br>
22+
<a class="remoteCall" href="/__debug__/sql_profile/?sql={{ query.raw_sql|urlencode }}&amp;params={{ query.params|urlencode }}&amp;duration={{ query.duration|floatformat:"2"|urlencode }}&amp;hash={{ query.hash }}">PROFILE</a><br />
2323
{% endif %}
2424
{% endif %}
2525
</td>
@@ -42,8 +42,8 @@
4242
{% for file, line, method in query.stacktrace %}
4343
<tr>
4444
<td>{{ line }}</td>
45-
<td><pre>{{ method|escape }}<pre></td>
46-
<td><pre>{{ file|escape }}</pre></td>
45+
<td><code>{{ method|escape }}</code></td>
46+
<td><code>{{ file|escape }}</code></td>
4747
</tr>
4848
{% endfor %}
4949
</table>
@@ -52,7 +52,7 @@
5252
{% for line in query.template_info.context %}
5353
<tr>
5454
<td>{{ line.num }}</td>
55-
<td><pre style="font-family: monospace;{% if line.highlight %}background-color: lightgrey{% endif %}">{{ line.content }}</pre></td>
55+
<td><code style="font-family: monospace;{% if line.highlight %}background-color: lightgrey{% endif %}">{{ line.content }}</code></td>
5656
</tr>
5757
{% endfor %}
5858
</table>

debug_toolbar/templates/debug_toolbar/panels/template_source.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ <h3>{% trans 'Template Source' %}: <code>{{ template_name }}</code></h3>
66
<div class="djDebugPanelContent">
77
<div class="scroll">
88
{% if not source.pygmentized %}
9-
<pre>{{ source }}</pre>
9+
<code>{{ source }}</code>
1010
{% else %}
1111
{{ source }}
1212
{% endif %}

debug_toolbar/templates/debug_toolbar/panels/templates.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ <h4>{% trans "Template" %}{{ templates|length|pluralize }}</h4>
1919
{% if template.context %}
2020
<dd>
2121
<div class="djTemplateShowContextDiv"><a class="djTemplateShowContext"><span class="toggleArrow">&#x25B6;</span> {% trans 'Toggle Context' %}</a></div>
22-
<div class="djTemplateHideContextDiv" style="display:none;"><pre>{{ template.context }}</pre></div>
22+
<div class="djTemplateHideContextDiv" style="display:none;"><code>{{ template.context }}</code></div>
2323
</dd>
2424
{% endif %}
2525
{% endfor %}
@@ -35,7 +35,7 @@ <h4>{% trans 'Context processor' %}{{ context_processors|length|pluralize }}</h4
3535
<dt><strong>{{ key|escape }}</strong></dt>
3636
<dd>
3737
<div class="djTemplateShowContextDiv"><a class="djTemplateShowContext"><span class="toggleArrow">&#x25B6;</span> {% trans 'Toggle Context' %}</a></div>
38-
<div class="djTemplateHideContextDiv" style="display:none;"><pre>{{ value|escape }}</pre></div>
38+
<div class="djTemplateHideContextDiv" style="display:none;"><code>{{ value|escape }}</code></div>
3939
</dd>
4040
{% endfor %}
4141
</dl>

0 commit comments

Comments
 (0)