diff --git a/debug_toolbar/static/debug_toolbar/css/print.css b/debug_toolbar/static/debug_toolbar/css/print.css new file mode 100644 index 000000000..c9241e90b --- /dev/null +++ b/debug_toolbar/static/debug_toolbar/css/print.css @@ -0,0 +1,3 @@ +#djDebug { + display:none; +} diff --git a/debug_toolbar/static/debug_toolbar/css/toolbar.css b/debug_toolbar/static/debug_toolbar/css/toolbar.css index a02768fb0..40f7f49db 100644 --- a/debug_toolbar/static/debug_toolbar/css/toolbar.css +++ b/debug_toolbar/static/debug_toolbar/css/toolbar.css @@ -646,3 +646,13 @@ display: none; } } + +#djDebug .djdt-width-20 { + width: 20%; +} +#djDebug .djdt-width-60 { + width: 60%; +} +#djDebug .djdt-highlighted { + background-color: lightgrey; +} diff --git a/debug_toolbar/static/debug_toolbar/js/jquery_existing.js b/debug_toolbar/static/debug_toolbar/js/jquery_existing.js new file mode 100644 index 000000000..085495a65 --- /dev/null +++ b/debug_toolbar/static/debug_toolbar/js/jquery_existing.js @@ -0,0 +1 @@ +var djdt = {jQuery: jQuery}; diff --git a/debug_toolbar/static/debug_toolbar/js/jquery_post.js b/debug_toolbar/static/debug_toolbar/js/jquery_post.js new file mode 100644 index 000000000..d94e6755a --- /dev/null +++ b/debug_toolbar/static/debug_toolbar/js/jquery_post.js @@ -0,0 +1 @@ +var djdt = {jQuery: jQuery.noConflict(true)}; window.define = _djdt_define_backup; diff --git a/debug_toolbar/static/debug_toolbar/js/jquery_pre.js b/debug_toolbar/static/debug_toolbar/js/jquery_pre.js new file mode 100644 index 000000000..d94199668 --- /dev/null +++ b/debug_toolbar/static/debug_toolbar/js/jquery_pre.js @@ -0,0 +1 @@ +var _djdt_define_backup = window.define; window.define = undefined; diff --git a/debug_toolbar/static/debug_toolbar/js/toolbar.js b/debug_toolbar/static/debug_toolbar/js/toolbar.js index 7bd10454a..62752cd21 100644 --- a/debug_toolbar/static/debug_toolbar/js/toolbar.js +++ b/debug_toolbar/static/debug_toolbar/js/toolbar.js @@ -285,13 +285,21 @@ return value; } + }, + applyStyle: function(name) { + $('#djDebug [data-' + name + ']').each(function() { + var css = {}; + css[name] = $(this).data(name); + $(this).css(css); + }); } }; $.extend(publicAPI, { show_toolbar: djdt.show_toolbar, hide_toolbar: djdt.hide_toolbar, close: djdt.close, - cookie: djdt.cookie + cookie: djdt.cookie, + applyStyle: djdt.applyStyle }); $(document).ready(djdt.init); })(djdt.jQuery, djdt); diff --git a/debug_toolbar/static/debug_toolbar/js/toolbar.profiling.js b/debug_toolbar/static/debug_toolbar/js/toolbar.profiling.js index 1018e9b41..2389bace9 100644 --- a/debug_toolbar/static/debug_toolbar/js/toolbar.profiling.js +++ b/debug_toolbar/static/debug_toolbar/js/toolbar.profiling.js @@ -17,4 +17,5 @@ subcalls.hide(); } }); + djdt.applyStyle('padding-left'); })(djdt.jQuery); diff --git a/debug_toolbar/static/debug_toolbar/js/toolbar.sql.js b/debug_toolbar/static/debug_toolbar/js/toolbar.sql.js index e470ac8fa..109a74d0e 100644 --- a/debug_toolbar/static/debug_toolbar/js/toolbar.sql.js +++ b/debug_toolbar/static/debug_toolbar/js/toolbar.sql.js @@ -4,4 +4,7 @@ $(this).parent().find('.djDebugCollapsed').toggle(); $(this).parent().find('.djDebugUncollapsed').toggle(); }); + djdt.applyStyle('background-color'); + djdt.applyStyle('left'); + djdt.applyStyle('width'); })(djdt.jQuery); diff --git a/debug_toolbar/static/debug_toolbar/js/toolbar.timer.js b/debug_toolbar/static/debug_toolbar/js/toolbar.timer.js index cc9d6ae70..0c0f4a5bb 100644 --- a/debug_toolbar/static/debug_toolbar/js/toolbar.timer.js +++ b/debug_toolbar/static/debug_toolbar/js/toolbar.timer.js @@ -24,14 +24,17 @@ if (endStat) { // Render a start through end bar $row.html('' + stat.replace('Start', '') + '' + - '
 
' + + '
 
' + '' + (perf.timing[stat] - timingOffset) + ' (+' + (perf.timing[endStat] - perf.timing[stat]) + ')'); + $row.find('strong').css({width: getCSSWidth(stat, endStat)}); } else { // Render a point in time $row.html('' + stat + '' + - '
 
' + + '
 
' + '' + (perf.timing[stat] - timingOffset) + ''); + $row.find('strong').css({width: 2}); } + $row.find('djDebugLineChart').css({left: getLeft(stat) + '%'}); $('#djDebugBrowserTimingTableBody').append($row); } diff --git a/debug_toolbar/templates/debug_toolbar/base.html b/debug_toolbar/templates/debug_toolbar/base.html index 1986976e5..348ae2941 100644 --- a/debug_toolbar/templates/debug_toolbar/base.html +++ b/debug_toolbar/templates/debug_toolbar/base.html @@ -1,21 +1,19 @@ {% load i18n %}{% load static from staticfiles %}{% load url from compat %} - + {% if toolbar.config.JQUERY_URL %} - + - + {% else %} - + {% endif %} -