Index: branches/5.2.x/core/kernel/utility/debugger/debugger.js =================================================================== diff -u -N -r16056 -r16410 --- branches/5.2.x/core/kernel/utility/debugger/debugger.js (.../debugger.js) (revision 16056) +++ branches/5.2.x/core/kernel/utility/debugger/debugger.js (.../debugger.js) (revision 16410) @@ -60,6 +60,7 @@ // Debugger function Debugger($params) { this.RowSeparator = ''; + this.FilterTypes = $params['FilterTypes']; this.IsFatalError = false; this.ErrorsCount = 0; this.SQLCount = 0; @@ -215,11 +216,28 @@ this.MakeDragable('debug_toolbar_span', function() {}, function() {}, function() {}); } -Debugger.prototype.AppendRow = function($html) { +Debugger.prototype.AppendRow = function($html, $row_type) { + var $message_type = $row_type || 'other'; + + if ( $message_type == 'warning' || $message_type == 'notice' ) { + $row_type = 'error'; + } else { + $row_type = $message_type; + } + this.RowCount++; var $tr = document.createElement('TR'); this.DebuggerTable.appendChild($tr); $tr.className = 'debug_row_' + (this.RowCount % 2 ? 'odd' : 'even'); + + if ( this.RowCount > 2 ) { + $tr.setAttribute('data-row-type', $row_type); + + if ( $message_type == 'error' ) { + document.getElementById('debug_row_' + (this.RowCount -1 )).setAttribute('data-row-type', 'error'); + } + } + $tr.id = 'debug_row_' + this.RowCount; var $td = document.createElement('TD'); $td.className = 'debug_cell'; @@ -365,6 +383,22 @@ if ($e.preventDefault) $e.preventDefault(); } +Debugger.prototype.Filter = function() { + + var $new_filter = document.getElementById('dbg_filter').value; + var $container_class_name = 'debug_layer_container'; + + if ( $new_filter != '' ) { + for (var index = 0; index < this.FilterTypes.length; ++index) { + if ( this.FilterTypes[index] != $new_filter ) { + $container_class_name += ' dbg-' + this.FilterTypes[index] + '-row-hidden'; + } + } + } + + this.DebuggerDIV.className = $container_class_name; +} + Debugger.prototype.Toggle = function($KeyCode) { if(!this.DebuggerDIV) return false; this.IsVisible = this.DebuggerDIV.style.display == 'none' ? false : true; @@ -400,7 +434,8 @@ } for (var $i = 0; $i < contents.length - 1; $i++) { - p_object.AppendRow(contents[$i]); + $json = eval('(' + contents[$i] + ')'); + p_object.AppendRow($json['html'], $json['row_type']); } if ( p_object.jQueryFound() ) {