| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2009 Joseph Pecoraro | 3 * Copyright (C) 2009 Joseph Pecoraro |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * | 8 * |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 1073 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1084 this.messagesElement = messagesElement; | 1084 this.messagesElement = messagesElement; |
| 1085 } | 1085 } |
| 1086 | 1086 |
| 1087 WebInspector.ConsoleGroup.prototype = { | 1087 WebInspector.ConsoleGroup.prototype = { |
| 1088 addMessage: function(msg) | 1088 addMessage: function(msg) |
| 1089 { | 1089 { |
| 1090 var element = msg.toMessageElement(); | 1090 var element = msg.toMessageElement(); |
| 1091 | 1091 |
| 1092 if (msg.type === WebInspector.ConsoleMessage.MessageType.StartGroup || m
sg.type === WebInspector.ConsoleMessage.MessageType.StartGroupCollapsed) { | 1092 if (msg.type === WebInspector.ConsoleMessage.MessageType.StartGroup || m
sg.type === WebInspector.ConsoleMessage.MessageType.StartGroupCollapsed) { |
| 1093 this.messagesElement.parentNode.insertBefore(element, this.messagesE
lement); | 1093 this.messagesElement.parentNode.insertBefore(element, this.messagesE
lement); |
| 1094 element.addEventListener("click", this._titleClicked.bind(this), tru
e); | 1094 element.addEventListener("click", this._titleClicked.bind(this), fal
se); |
| 1095 var groupElement = element.enclosingNodeOrSelfWithClass("console-gro
up"); | 1095 var groupElement = element.enclosingNodeOrSelfWithClass("console-gro
up"); |
| 1096 if (groupElement && msg.type === WebInspector.ConsoleMessage.Message
Type.StartGroupCollapsed) | 1096 if (groupElement && msg.type === WebInspector.ConsoleMessage.Message
Type.StartGroupCollapsed) |
| 1097 groupElement.addStyleClass("collapsed"); | 1097 groupElement.addStyleClass("collapsed"); |
| 1098 } else | 1098 } else |
| 1099 this.messagesElement.appendChild(element); | 1099 this.messagesElement.appendChild(element); |
| 1100 | 1100 |
| 1101 if (element.previousSibling && msg.originatingCommand && element.previou
sSibling.command === msg.originatingCommand) | 1101 if (element.previousSibling && msg.originatingCommand && element.previou
sSibling.command === msg.originatingCommand) |
| 1102 element.previousSibling.addStyleClass("console-adjacent-user-command
-result"); | 1102 element.previousSibling.addStyleClass("console-adjacent-user-command
-result"); |
| 1103 }, | 1103 }, |
| 1104 | 1104 |
| 1105 _titleClicked: function(event) | 1105 _titleClicked: function(event) |
| 1106 { | 1106 { |
| 1107 var groupTitleElement = event.target.enclosingNodeOrSelfWithClass("conso
le-group-title"); | 1107 var groupTitleElement = event.target.enclosingNodeOrSelfWithClass("conso
le-group-title"); |
| 1108 if (groupTitleElement) { | 1108 if (groupTitleElement) { |
| 1109 var groupElement = groupTitleElement.enclosingNodeOrSelfWithClass("c
onsole-group"); | 1109 var groupElement = groupTitleElement.enclosingNodeOrSelfWithClass("c
onsole-group"); |
| 1110 if (groupElement) | 1110 if (groupElement) |
| 1111 if (groupElement.hasStyleClass("collapsed")) | 1111 if (groupElement.hasStyleClass("collapsed")) |
| 1112 groupElement.removeStyleClass("collapsed"); | 1112 groupElement.removeStyleClass("collapsed"); |
| 1113 else | 1113 else |
| 1114 groupElement.addStyleClass("collapsed"); | 1114 groupElement.addStyleClass("collapsed"); |
| 1115 groupTitleElement.scrollIntoViewIfNeeded(true); | 1115 groupTitleElement.scrollIntoViewIfNeeded(true); |
| 1116 } | 1116 } |
| 1117 | 1117 |
| 1118 event.stopPropagation(); | 1118 event.stopPropagation(); |
| 1119 event.preventDefault(); | 1119 event.preventDefault(); |
| 1120 } | 1120 } |
| 1121 } | 1121 } |
| 1122 | 1122 |
| OLD | NEW |