Created
August 8, 2013 14:53
-
-
Save dannylloyd/6185294 to your computer and use it in GitHub Desktop.
Formats asp.net trace information into manageable blocks. Use it like this: formatTraceInformation('Trace-Information');. Where the preferedPane is the ID of the table of information you want to see first opened.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function formatTraceInformation(preferedPane) { | |
| var tracer = $('#__asptrace'); | |
| var traceContent = $('span.tracecontent'); | |
| //$('*', tracer).removeAttr('style'); | |
| //Removes style from trace block | |
| //$('*', tracer).remove('style'); | |
| if (tracer.length > 0 && $('#tracer_Show').length == 0) { | |
| $('span.tracecontent > table', tracer).each(function (index, element) { | |
| $(element).addClass('trace-table'); | |
| $('tr:first', element).addClass('titleHeading'); | |
| var headerText = $('th:first b', element).html().replace(/ /g, '-'); | |
| //$(element).addClass(headerText); | |
| $(element).attr('id', headerText); | |
| $('tr:first', element).click(function () { | |
| $('tr:not(tr:first)', element).toggle(); | |
| }); | |
| $('tr:not(tr:first)', element).hide(); | |
| }); | |
| //Session-State | |
| $('#' + preferedPane + ' tr', tracer).show(); | |
| var sessionState = $('#' + preferedPane + ''); | |
| //$('*', sessionState).removeAttr('style'); | |
| $('#' + preferedPane + '', tracer).prependTo(traceContent); | |
| $(tracer).prepend('<b id="showAll">Show All</b>'); | |
| $('#showAll', tracer).click(function () { | |
| $('tr:not(tr.titleHeading)', tracer).toggle(); | |
| }); | |
| $('#aspnetForm').append('<a href="#" id="tracer_Show" style="text-align:center;">Show Trace Information</a>') | |
| $('#tracer_Show').click(function (event) { | |
| event.preventDefault(); | |
| tracer.toggle(); | |
| }); | |
| //tracer.hide(); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment