| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
| 3 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. | 3 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. |
| 4 * Copyright (C) 2009 Joseph Pecoraro | 4 * Copyright (C) 2009 Joseph Pecoraro |
| 5 * | 5 * |
| 6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
| 7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
| 8 * are met: | 8 * are met: |
| 9 * | 9 * |
| 10 * 1. Redistributions of source code must retain the above copyright | 10 * 1. Redistributions of source code must retain the above copyright |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 var fragment = | 242 var fragment = |
| 243 Components.linkifyStringAsFragmentWithCustomLinkifier(messageText,
linkifyRequest.bind(consoleMessage)); | 243 Components.linkifyStringAsFragmentWithCustomLinkifier(messageText,
linkifyRequest.bind(consoleMessage)); |
| 244 messageElement.appendChild(fragment); | 244 messageElement.appendChild(fragment); |
| 245 } | 245 } |
| 246 } else { | 246 } else { |
| 247 messageElement = this._format([messageText]); | 247 messageElement = this._format([messageText]); |
| 248 } | 248 } |
| 249 } else { | 249 } else { |
| 250 if (consoleMessage.source === SDK.ConsoleMessage.MessageSource.Violation) | 250 if (consoleMessage.source === SDK.ConsoleMessage.MessageSource.Violation) |
| 251 messageText = Common.UIString('[Violation] %s', messageText); | 251 messageText = Common.UIString('[Violation] %s', messageText); |
| 252 else if (consoleMessage.source === SDK.ConsoleMessage.MessageSource.Interv
ention) |
| 253 messageText = Common.UIString('[Intervention] %s', messageText); |
| 254 if (consoleMessage.source === SDK.ConsoleMessage.MessageSource.Deprecation
) |
| 255 messageText = Common.UIString('[Deprecation] %s', messageText); |
| 252 var args = consoleMessage.parameters || [messageText]; | 256 var args = consoleMessage.parameters || [messageText]; |
| 253 messageElement = this._format(args); | 257 messageElement = this._format(args); |
| 254 } | 258 } |
| 255 messageElement.classList.add('console-message-text'); | 259 messageElement.classList.add('console-message-text'); |
| 256 | 260 |
| 257 var formattedMessage = createElement('span'); | 261 var formattedMessage = createElement('span'); |
| 258 UI.appendStyle(formattedMessage, 'components/objectValue.css'); | 262 UI.appendStyle(formattedMessage, 'components/objectValue.css'); |
| 259 formattedMessage.className = 'source-code'; | 263 formattedMessage.className = 'source-code'; |
| 260 | 264 |
| 261 var anchorElement = this._buildMessageAnchor(consoleMessage); | 265 var anchorElement = this._buildMessageAnchor(consoleMessage); |
| (...skipping 670 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 932 case SDK.ConsoleMessage.MessageLevel.Warning: | 936 case SDK.ConsoleMessage.MessageLevel.Warning: |
| 933 this._element.classList.add('console-warning-level'); | 937 this._element.classList.add('console-warning-level'); |
| 934 this._updateMessageLevelIcon('smallicon-warning'); | 938 this._updateMessageLevelIcon('smallicon-warning'); |
| 935 break; | 939 break; |
| 936 case SDK.ConsoleMessage.MessageLevel.Error: | 940 case SDK.ConsoleMessage.MessageLevel.Error: |
| 937 this._element.classList.add('console-error-level'); | 941 this._element.classList.add('console-error-level'); |
| 938 this._updateMessageLevelIcon('smallicon-error'); | 942 this._updateMessageLevelIcon('smallicon-error'); |
| 939 break; | 943 break; |
| 940 } | 944 } |
| 941 | 945 |
| 946 // Render verbose and info deprecations, interventions and violations with w
arning background. |
| 947 if (this._message.level === SDK.ConsoleMessage.MessageLevel.Verbose || |
| 948 this._message.level === SDK.ConsoleMessage.MessageLevel.Info) { |
| 949 switch (this._message.source) { |
| 950 case SDK.ConsoleMessage.MessageSource.Violation: |
| 951 case SDK.ConsoleMessage.MessageSource.Deprecation: |
| 952 case SDK.ConsoleMessage.MessageSource.Intervention: |
| 953 this._element.classList.add('console-warning-level'); |
| 954 break; |
| 955 } |
| 956 } |
| 957 |
| 942 this._element.appendChild(this.contentElement()); | 958 this._element.appendChild(this.contentElement()); |
| 943 if (this._repeatCount > 1) | 959 if (this._repeatCount > 1) |
| 944 this._showRepeatCountElement(); | 960 this._showRepeatCountElement(); |
| 945 } | 961 } |
| 946 | 962 |
| 947 /** | 963 /** |
| 948 * @param {string} iconType | 964 * @param {string} iconType |
| 949 */ | 965 */ |
| 950 _updateMessageLevelIcon(iconType) { | 966 _updateMessageLevelIcon(iconType) { |
| 951 if (!iconType && !this._messageLevelIcon) | 967 if (!iconType && !this._messageLevelIcon) |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1196 toMessageElement() { | 1212 toMessageElement() { |
| 1197 if (!this._element) { | 1213 if (!this._element) { |
| 1198 super.toMessageElement(); | 1214 super.toMessageElement(); |
| 1199 this._expandGroupIcon = UI.Icon.create('', 'expand-group-icon'); | 1215 this._expandGroupIcon = UI.Icon.create('', 'expand-group-icon'); |
| 1200 this._contentElement.insertBefore(this._expandGroupIcon, this._contentElem
ent.firstChild); | 1216 this._contentElement.insertBefore(this._expandGroupIcon, this._contentElem
ent.firstChild); |
| 1201 this.setCollapsed(this._collapsed); | 1217 this.setCollapsed(this._collapsed); |
| 1202 } | 1218 } |
| 1203 return this._element; | 1219 return this._element; |
| 1204 } | 1220 } |
| 1205 }; | 1221 }; |
| OLD | NEW |