diff --git a/common/css/xe.css b/common/css/xe.css index 9c1d76115..680013067 100644 --- a/common/css/xe.css +++ b/common/css/xe.css @@ -296,6 +296,7 @@ button.btn { position: fixed; left: 0; bottom: 40px; background: #eeeeee; + background: linear-gradient(to bottom, #f4f4f4 0%, #eaeaea 100%); border: 1px solid #ccc; border-left: 0; border-top-right-radius: 4px; border-bottom-right-radius: 4px; @@ -303,7 +304,8 @@ button.btn { z-index: 1073741824; } #rhymix_debug_button:hover { - background: #444444; + background: #dddddd; + background: linear-gradient(to bottom, #e8e8e8 0%, #d9d9d9 100%); } #rhymix_debug_button a { display: block; @@ -312,8 +314,8 @@ button.btn { text-decoration: none; padding: 4px 8px; } -#rhymix_debug_button a:hover { - color: #eeeeee; +#rhymix_debug_button a.has_errors { + color: #f44336; } #rhymix_debug_panel { display: none; @@ -369,6 +371,7 @@ button.btn { padding-bottom: 8px; border-bottom: 1px solid #ddd; position: relative; + cursor: pointer; } #rhymix_debug_panel .debug_page .debug_page_header h3 { color: #444; @@ -401,16 +404,25 @@ button.btn { } #rhymix_debug_panel .debug_page .debug_entry { font-family: Consolas, "Courier New", monospace; - color: #666; + color: #444; margin-left: 38px; margin-bottom: 8px; text-indent: -28px; - white-space: pre-wrap; + word-wrap: break-word; + word-break: break-all; } -#rhymix_debug_panel .debug_page .debug_entry.no_indentation { - margin-left: 10px; - text-indent: 0; +#rhymix_debug_panel .debug_page .debug_entry ul.debug_metadata { + margin: 0 0 0 -16px; padding: 0; } -#rhymix_debug_panel .debug_page .debug_entry.collapse_spaces { - white-space: pre-line; +#rhymix_debug_panel .debug_page .debug_entry ul.debug_metadata li { + list-style: disc; + margin: 0; padding: 0; text-indent: 0; +} +#rhymix_debug_panel .debug_page .debug_entry ul.debug_backtrace { + margin: 4px 0 0 16px; padding: 0; +} +#rhymix_debug_panel .debug_page .debug_entry ul.debug_backtrace li { + list-style: disc; + margin: 0; padding: 0; text-indent: 0; + color: #888; } diff --git a/common/js/debug.js b/common/js/debug.js index dcbd84e5a..44612f1e7 100644 --- a/common/js/debug.js +++ b/common/js/debug.js @@ -13,7 +13,7 @@ $(function() { var button = $("#rhymix_debug_button"); // Initialize the debug button. - $('').text("DEBUG").appendTo(button).click(function(event) { + var button_link = $('').text("DEBUG").appendTo(button).click(function(event) { event.preventDefault(); var max_width = Math.min(540, $(window).width()); panel.css({ width: max_width, left: max_width * -1 }).show().animate({ left: 0 }, 200); @@ -55,10 +55,13 @@ $(function() { } // Create the page header. - var page_header = $('
').prependTo(page); + var page_header = $('').prependTo(page).click(function() { + $(this).find("a.debug_page_collapse").triggerHandler("click"); + }); page_header.append($('').text(data.page_title).attr("title", data.url)); page_header.append($('').text(open ? "▲" : "▼").click(function(event) { event.preventDefault(); + event.stopPropagation(); if (page_body.is(":visible")) { page_body.slideUp(200); $(this).text("▼"); @@ -70,10 +73,12 @@ $(function() { // Add general information. page_body.append($('').text('General Information')); - page_body.append($('').text( - 'Request: ' + data.request.method + ' (' + data.request.size + ' bytes)' + "\n" + - 'Response: ' + data.response.method + ' (' + data.response.size + ' bytes)' + "\n" + - 'Time: ' + data.timing.total)); + entry = $('').appendTo(page_body); + var metadata = $('').appendTo(entry); + metadata.append($('').text('Request: ' + data.request.method + (data.request.method !== "GET" ? (' - ' + data.request.size + ' bytes') : ""))); + metadata.append($('').text('Response: ' + data.response.method + ' - ' + data.response.size + ' bytes')); + metadata.append($('').text('Total Time: ' + data.timing.total)); + metadata.append($('').text('Query Time: ' + data.timing.db_query)); // Add debug entries. if (data.entries && data.entries.length) { @@ -81,13 +86,13 @@ $(function() { for (i in data.entries) { entry = $('').appendTo(page_body); num = parseInt(i) + 1; if (num < 10) num = "0" + num; - backtrace = ""; + entry.text(num + ". " + data.entries[i].message); + backtrace = $('