Changeset 52149 in webkit
- Timestamp:
- Dec 15, 2009 3:29:08 AM (14 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 6 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r52146 r52149 1 2009-12-15 Alexander Pavlov <apavlov@chromium.org> 2 3 Reviewed by Pavel Feldman. 4 5 Extract WebInspector.Section from WebInspector.PropertiesSection. 6 https://bugs.webkit.org/show_bug.cgi?id=32523 7 8 * WebCore.gypi: 9 * WebCore.vcproj/WebCore.vcproj: 10 * inspector/front-end/PropertiesSection.js: 11 (WebInspector.PropertiesSection): 12 * inspector/front-end/Section.js: Added. 13 (WebInspector.Section): 14 (WebInspector.Section.prototype.get title): 15 (WebInspector.Section.prototype.set title): 16 (WebInspector.Section.prototype.get subtitle): 17 (WebInspector.Section.prototype.set subtitle): 18 (WebInspector.Section.prototype.get expanded): 19 (WebInspector.Section.prototype.set expanded): 20 (WebInspector.Section.prototype.get populated): 21 (WebInspector.Section.prototype.set populated): 22 (WebInspector.Section.prototype.expand): 23 (WebInspector.Section.prototype.collapse): 24 (WebInspector.Section.prototype.toggleExpanded): 25 * inspector/front-end/WebKit.qrc: 26 * inspector/front-end/inspector.html: 27 1 28 2009-12-15 Eric Seidel <eric@webkit.org> 2 29 -
trunk/WebCore/WebCore.gypi
r52103 r52149 3701 3701 'inspector/front-end/ScriptsPanel.js', 3702 3702 'inspector/front-end/ScriptView.js', 3703 'inspector/front-end/Section.js', 3703 3704 'inspector/front-end/SidebarPane.js', 3704 3705 'inspector/front-end/SidebarTreeElement.js', -
trunk/WebCore/WebCore.vcproj/WebCore.vcproj
r52103 r52149 42621 42621 </File> 42622 42622 <File 42623 RelativePath="..\inspector\front-end\Section.js" 42624 > 42625 </File> 42626 <File 42623 42627 RelativePath="..\inspector\front-end\SidebarPane.js" 42624 42628 > -
trunk/WebCore/inspector/front-end/PropertiesSection.js
r52099 r52149 1 1 /* 2 2 * Copyright (C) 2007 Apple Inc. All rights reserved. 3 * Copyright (C) 2009 Google Inc. All rights reserved. 3 4 * 4 5 * Redistribution and use in source and binary forms, with or without … … 29 30 WebInspector.PropertiesSection = function(title, subtitle) 30 31 { 31 this.element = document.createElement("div"); 32 this.element.className = "section"; 33 34 this.headerElement = document.createElement("div"); 35 this.headerElement.className = "header"; 36 37 this.titleElement = document.createElement("div"); 38 this.titleElement.className = "title"; 39 40 this.subtitleElement = document.createElement("div"); 41 this.subtitleElement.className = "subtitle"; 42 43 this.headerElement.appendChild(this.subtitleElement); 44 this.headerElement.appendChild(this.titleElement); 45 46 this.headerElement.addEventListener("click", this.toggleExpanded.bind(this), false); 32 WebInspector.Section.call(this, title, subtitle); 47 33 48 34 this.propertiesElement = document.createElement("ol"); … … 52 38 this.propertiesTreeOutline.section = this; 53 39 54 this.element.appendChild(this.headerElement);55 40 this.element.appendChild(this.propertiesElement); 56 57 this.title = title;58 this.subtitle = subtitle;59 this._expanded = false;60 41 } 61 42 62 WebInspector.PropertiesSection.prototype = { 63 get title() 64 { 65 return this._title; 66 }, 67 68 set title(x) 69 { 70 if (this._title === x) 71 return; 72 this._title = x; 73 74 if (x instanceof Node) { 75 this.titleElement.removeChildren(); 76 this.titleElement.appendChild(x); 77 } else 78 this.titleElement.textContent = x; 79 }, 80 81 get subtitle() 82 { 83 return this._subtitle; 84 }, 85 86 set subtitle(x) 87 { 88 if (this._subtitle === x) 89 return; 90 this._subtitle = x; 91 this.subtitleElement.innerHTML = x; 92 }, 93 94 get expanded() 95 { 96 return this._expanded; 97 }, 98 99 set expanded(x) 100 { 101 if (x) 102 this.expand(); 103 else 104 this.collapse(); 105 }, 106 107 get populated() 108 { 109 return this._populated; 110 }, 111 112 set populated(x) 113 { 114 this._populated = x; 115 if (!x && this.onpopulate && this._expanded) { 116 this.onpopulate(this); 117 this._populated = true; 118 } 119 }, 120 121 expand: function() 122 { 123 if (this._expanded) 124 return; 125 this._expanded = true; 126 this.element.addStyleClass("expanded"); 127 128 if (!this._populated && this.onpopulate) { 129 this.onpopulate(this); 130 this._populated = true; 131 } 132 }, 133 134 collapse: function() 135 { 136 if (!this._expanded) 137 return; 138 this._expanded = false; 139 this.element.removeStyleClass("expanded"); 140 }, 141 142 toggleExpanded: function() 143 { 144 this.expanded = !this.expanded; 145 } 146 } 43 WebInspector.PropertiesSection.prototype.__proto__ = WebInspector.Section.prototype; -
trunk/WebCore/inspector/front-end/Section.js
r52148 r52149 1 1 /* 2 2 * Copyright (C) 2007 Apple Inc. All rights reserved. 3 * Copyright (C) 2009 Google Inc. All rights reserved. 3 4 * 4 5 * Redistribution and use in source and binary forms, with or without … … 27 28 */ 28 29 29 WebInspector. PropertiesSection = function(title, subtitle)30 WebInspector.Section = function(title, subtitle) 30 31 { 31 32 this.element = document.createElement("div"); … … 45 46 46 47 this.headerElement.addEventListener("click", this.toggleExpanded.bind(this), false); 47 48 this.propertiesElement = document.createElement("ol");49 this.propertiesElement.className = "properties";50 this.propertiesElement.tabIndex = 0;51 this.propertiesTreeOutline = new TreeOutline(this.propertiesElement);52 this.propertiesTreeOutline.section = this;53 54 48 this.element.appendChild(this.headerElement); 55 this.element.appendChild(this.propertiesElement);56 49 57 50 this.title = title; … … 60 53 } 61 54 62 WebInspector. PropertiesSection.prototype = {55 WebInspector.Section.prototype = { 63 56 get title() 64 57 { -
trunk/WebCore/inspector/front-end/WebKit.qrc
r51839 r52149 54 54 <file>ScriptsPanel.js</file> 55 55 <file>ScriptView.js</file> 56 <file>Section.js</file> 56 57 <file>SidebarPane.js</file> 57 58 <file>SidebarTreeElement.js</file> -
trunk/WebCore/inspector/front-end/inspector.html
r52099 r52149 63 63 <script type="text/javascript" src="ElementsTreeOutline.js"></script> 64 64 <script type="text/javascript" src="SidebarTreeElement.js"></script> 65 <script type="text/javascript" src="Section.js"></script> 65 66 <script type="text/javascript" src="PropertiesSection.js"></script> 66 67 <script type="text/javascript" src="ObjectProxy.js"></script>
Note: See TracChangeset
for help on using the changeset viewer.