OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 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 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 this.nameElement = document.createElement("span"); | 173 this.nameElement = document.createElement("span"); |
174 this.nameElement.className = "name"; | 174 this.nameElement.className = "name"; |
175 this.nameElement.textContent = this.property.name; | 175 this.nameElement.textContent = this.property.name; |
176 | 176 |
177 var separatorElement = document.createElement("span"); | 177 var separatorElement = document.createElement("span"); |
178 separatorElement.className = "separator"; | 178 separatorElement.className = "separator"; |
179 separatorElement.textContent = ": "; | 179 separatorElement.textContent = ": "; |
180 | 180 |
181 this.valueElement = document.createElement("span"); | 181 this.valueElement = document.createElement("span"); |
182 this.valueElement.className = "value"; | 182 this.valueElement.className = "value"; |
183 this.valueElement.textContent = this.property.value.description; | 183 |
| 184 var description = this.property.value.description; |
| 185 // Render \n as a nice unicode cr symbol. |
| 186 if (this.property.value.type === "string" && typeof description === "str
ing") |
| 187 description = description.replace(/\n/g, "\u21B5"); |
| 188 this.valueElement.textContent = description; |
| 189 |
184 if (this.property.isGetter) | 190 if (this.property.isGetter) |
185 this.valueElement.addStyleClass("dimmed"); | 191 this.valueElement.addStyleClass("dimmed"); |
186 if (this.property.value.isError()) | 192 if (this.property.value.isError()) |
187 this.valueElement.addStyleClass("error"); | 193 this.valueElement.addStyleClass("error"); |
188 if (this.property.value.type) | 194 if (this.property.value.type) |
189 this.valueElement.addStyleClass("console-formatted-" + this.property
.value.type); | 195 this.valueElement.addStyleClass("console-formatted-" + this.property
.value.type); |
190 if (this.property.value.type === "node") | 196 if (this.property.value.type === "node") |
191 this.valueElement.addEventListener("contextmenu", this._contextMenuE
ventFired.bind(this), true); | 197 this.valueElement.addEventListener("contextmenu", this._contextMenuE
ventFired.bind(this), true); |
192 | 198 |
193 this.listItemElement.removeChildren(); | 199 this.listItemElement.removeChildren(); |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 } else { | 293 } else { |
288 // Call updateSiblings since their value might be based on the v
alue that just changed. | 294 // Call updateSiblings since their value might be based on the v
alue that just changed. |
289 self.updateSiblings(); | 295 self.updateSiblings(); |
290 } | 296 } |
291 }; | 297 }; |
292 this.property.parentObject.setPropertyValue(this.property.name, expressi
on.trim(), callback); | 298 this.property.parentObject.setPropertyValue(this.property.name, expressi
on.trim(), callback); |
293 } | 299 } |
294 } | 300 } |
295 | 301 |
296 WebInspector.ObjectPropertyTreeElement.prototype.__proto__ = TreeElement.prototy
pe; | 302 WebInspector.ObjectPropertyTreeElement.prototype.__proto__ = TreeElement.prototy
pe; |
OLD | NEW |