From 96966b8e86ca8a4a12359312d5ab7351d3788dfd Mon Sep 17 00:00:00 2001 From: Rob Hudson Date: Fri, 28 Aug 2009 12:07:26 -0700 Subject: Made ESC work on various toolbar states. When toolbar is minimized, ESC key isn't bound. Otherwise ESC will fall through until one of the following happens: If a sub panel is opened, hide it ; if a panel is open, close it ; if the toolbar is open, minimize it. --- debug_toolbar/media/debug_toolbar/toolbar.js | 50 +++++++++++++++++++--------- 1 file changed, 34 insertions(+), 16 deletions(-) diff --git a/debug_toolbar/media/debug_toolbar/toolbar.js b/debug_toolbar/media/debug_toolbar/toolbar.js index 7b6d534..ccd0185 100644 --- a/debug_toolbar/media/debug_toolbar/toolbar.js +++ b/debug_toolbar/media/debug_toolbar/toolbar.js @@ -16,8 +16,7 @@ jQuery(function($j) { $j(document).trigger('close.djDebug'); $j(this).parent().removeClass("active"); } else { - //$j('.panelContent').hide(); - $j(document).trigger('close.djDebug'); + $j('.panelContent').hide(); // Hide any that are already open current.show(); $j.djDebug.open(); $j('#djDebugToolbar li').removeClass("active"); @@ -63,11 +62,7 @@ jQuery(function($j) { } }, open: function() { - $j(document).bind('keydown.djDebug', function(e) { - if (e.keyCode == 27) { - $j.djDebug.close(); - } - }); + // TODO: Decide if we should remove this }, toggle_content: function(elem) { if (elem.is(':visible')) { @@ -81,9 +76,13 @@ jQuery(function($j) { return false; }, hide_toolbar: function(setCookie) { - $j(document).trigger('close.djDebug'); - $j('#djDebugToolbar').hide("fast"); + // close any sub panels + $j('#djDebugWindow').hide(); + // close all panels + $j('.panelContent').hide(); $j('#djDebugToolbar li').removeClass("active"); + // finally close toolbar + $j('#djDebugToolbar').hide("fast"); $j('#djDebugToolbarHandle').show(); if (setCookie) { $j.cookie(COOKIE_NAME, 'hide', { @@ -93,6 +92,12 @@ jQuery(function($j) { } }, show_toolbar: function() { + // Set up keybindings + $j(document).bind('keydown.djDebug', function(e) { + if (e.keyCode == 27) { + $j.djDebug.close(); + } + }); $j('#djDebugToolbarHandle').hide(); $j('#djDebugToolbar').show("fast"); $j.cookie(COOKIE_NAME, null, { @@ -101,15 +106,28 @@ jQuery(function($j) { }); }, toggle_arrow: function(elem) { - var uarr = String.fromCharCode(0x25b6); - var darr = String.fromCharCode(0x25bc); - elem.html(elem.html() == uarr ? darr : uarr); - } + var uarr = String.fromCharCode(0x25b6); + var darr = String.fromCharCode(0x25bc); + elem.html(elem.html() == uarr ? darr : uarr); + } }); $j(document).bind('close.djDebug', function() { - $j(document).unbind('keydown.djDebug'); - $j('.panelContent').hide() - $j('#djDebugToolbar li').removeClass("active"); + // If a sub-panel is open, close that + if ($j('#djDebugWindow').is(':visible')) { + $j('#djDebugWindow').hide(); + return; + } + // If a panel is open, close that + if ($j('.panelContent').is(':visible')) { + $j('.panelContent').hide(); + return; + } + // Otherwise, just minimize the toolbar + if ($j('#djDebugToolbar').is(':visible')) { + $j.djDebug.hide_toolbar(true); + $j(document).unbind('keydown.djDebug'); + return; + } }); }); jQuery(function() { -- cgit v1.2.3 From f25ec5bb9998f26c75fccf85c880c23502c9e165 Mon Sep 17 00:00:00 2001 From: Rob Hudson Date: Fri, 28 Aug 2009 14:49:10 -0700 Subject: Fixed so key bindings are setup on init, regardless of toolbar cookie. --- debug_toolbar/media/debug_toolbar/toolbar.js | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/debug_toolbar/media/debug_toolbar/toolbar.js b/debug_toolbar/media/debug_toolbar/toolbar.js index ccd0185..8155e2f 100644 --- a/debug_toolbar/media/debug_toolbar/toolbar.js +++ b/debug_toolbar/media/debug_toolbar/toolbar.js @@ -14,13 +14,13 @@ jQuery(function($j) { current = $j('#djDebug #' + this.className); if (current.is(':visible')) { $j(document).trigger('close.djDebug'); - $j(this).parent().removeClass("active"); + $j(this).parent().removeClass('active'); } else { $j('.panelContent').hide(); // Hide any that are already open current.show(); $j.djDebug.open(); - $j('#djDebugToolbar li').removeClass("active"); - $j(this).parent().addClass("active"); + $j('#djDebugToolbar li').removeClass('active'); + $j(this).parent().addClass('active'); } return false; }); @@ -58,7 +58,7 @@ jQuery(function($j) { if ($j.cookie(COOKIE_NAME)) { $j.djDebug.hide_toolbar(false); } else { - $j('#djDebugToolbar').show(); + $j.djDebug.show_toolbar(false); } }, open: function() { @@ -80,10 +80,12 @@ jQuery(function($j) { $j('#djDebugWindow').hide(); // close all panels $j('.panelContent').hide(); - $j('#djDebugToolbar li').removeClass("active"); + $j('#djDebugToolbar li').removeClass('active'); // finally close toolbar - $j('#djDebugToolbar').hide("fast"); + $j('#djDebugToolbar').hide('fast'); $j('#djDebugToolbarHandle').show(); + // Unbind keydown + $j(document).unbind('keydown.djDebug'); if (setCookie) { $j.cookie(COOKIE_NAME, 'hide', { path: '/', @@ -91,7 +93,7 @@ jQuery(function($j) { }); } }, - show_toolbar: function() { + show_toolbar: function(animate) { // Set up keybindings $j(document).bind('keydown.djDebug', function(e) { if (e.keyCode == 27) { @@ -99,7 +101,11 @@ jQuery(function($j) { } }); $j('#djDebugToolbarHandle').hide(); - $j('#djDebugToolbar').show("fast"); + if (animate) { + $j('#djDebugToolbar').show('fast'); + } else { + $j('#djDebugToolbar').show(); + } $j.cookie(COOKIE_NAME, null, { path: '/', expires: -1 @@ -125,7 +131,6 @@ jQuery(function($j) { // Otherwise, just minimize the toolbar if ($j('#djDebugToolbar').is(':visible')) { $j.djDebug.hide_toolbar(true); - $j(document).unbind('keydown.djDebug'); return; } }); -- cgit v1.2.3 From 44368bb18002e9f754cd49a4001d743fc1e33210 Mon Sep 17 00:00:00 2001 From: Diego Búrigo Zacarão Date: Mon, 31 Aug 2009 16:02:14 +0000 Subject: l10n: Fixed an issue of duplicated entry in the Spanish translation Transmitted-via: Transifex (www.transifex.net) --- debug_toolbar/locale/es/LC_MESSAGES/django.po | 9 --------- 1 file changed, 9 deletions(-) diff --git a/debug_toolbar/locale/es/LC_MESSAGES/django.po b/debug_toolbar/locale/es/LC_MESSAGES/django.po index d15b2c1..fe7e60b 100644 --- a/debug_toolbar/locale/es/LC_MESSAGES/django.po +++ b/debug_toolbar/locale/es/LC_MESSAGES/django.po @@ -62,15 +62,6 @@ msgstr "Total Llamadas" msgid "Total Time" msgstr "Tiempo Total" -#: templates/debug_toolbar/panels/cache.html:39 -#: templates/debug_toolbar/panels/logger.html:8 -#: templates/debug_toolbar/panels/sql.html:6 -#: templates/debug_toolbar/panels/sql_explain.html:7 -#: templates/debug_toolbar/panels/sql_profile.html:7 -#: templates/debug_toolbar/panels/sql_select.html:7 -msgid "Time" -msgstr "Tiempo" - #: templates/debug_toolbar/panels/cache.html:40 msgid "Type" msgstr "Tipo" -- cgit v1.2.3 From d23196e480faa01bc96605260bdf58b595010b1d Mon Sep 17 00:00:00 2001 From: Rob Hudson Date: Tue, 1 Sep 2009 06:56:36 -0700 Subject: Fixed translated string in redirect template. --- debug_toolbar/templates/debug_toolbar/redirect.html | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/debug_toolbar/templates/debug_toolbar/redirect.html b/debug_toolbar/templates/debug_toolbar/redirect.html index d0d9b35..068fe8c 100644 --- a/debug_toolbar/templates/debug_toolbar/redirect.html +++ b/debug_toolbar/templates/debug_toolbar/redirect.html @@ -6,11 +6,7 @@
Location: {{ redirect_to }}
- {% trans "The Django Debug Toolbar has intercepted a redirect to the above URL for
- debug viewing purposes. You can click the above link to continue with the
- redirect as normal. If you'd like to disable this feature, set the" %}
- DEBUG_TOOLBAR_CONFIG dictionary's key
- INTERCEPT_REDIRECTS to False." %}
+ {% trans "The Django Debug Toolbar has intercepted a redirect to the above URL for debug viewing purposes. You can click the above link to continue with the redirect as normal. If you'd like to disable this feature, set the DEBUG_TOOLBAR_CONFIG dictionary's key INTERCEPT_REDIRECTS to False." %}