Changeset 50038 in webkit
- Timestamp:
- Oct 24, 2009 9:13:13 PM (14 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r50037 r50038 1 2009-10-24 Brian Weinstein <bweinstein@apple.com> 2 3 Reviewed by Timothy Hatcher. 4 5 Fixes <https://bugs.webkit.org/show_bug.cgi?id=30752>. 6 Web Inspector: Multiple Selection on Scope Bars by default Conflicts with other behavior on OSX. 7 8 Have the scope bars select one scope by default, but if the multiple selection key 9 is pressed, allow for multiple selection. 10 11 * inspector/front-end/ConsoleView.js: 12 (WebInspector.ConsoleView): 13 (WebInspector.ConsoleView.prototype._updateFilter): 14 (WebInspector.ConsoleView.prototype.filter): 15 * inspector/front-end/ResourcesPanel.js: 16 (WebInspector.ResourcesPanel): 17 (WebInspector.ResourcesPanel.prototype.filter): 18 (WebInspector.ResourcesPanel.prototype._updateFilter): 19 1 20 2009-10-24 Sam Weinig <sam@webkit.org> 2 21 -
trunk/WebCore/inspector/front-end/ConsoleView.js
r49917 r50038 95 95 this.logElement = createFilterElement.call(this, "Logs"); 96 96 97 this.filter(this.allElement );97 this.filter(this.allElement, false); 98 98 } 99 99 … … 102 102 _updateFilter: function(e) 103 103 { 104 this.filter(e.target); 104 var isMac = InspectorController.platform().indexOf("mac-") === 0; 105 var selectMultiple = false; 106 if (isMac && e.metaKey && !e.ctrlKey && !e.altKey && !e.shiftKey) 107 selectMultiple = true; 108 if (!isMac && e.ctrlKey && !e.metaKey && !e.altKey && !e.shiftKey) 109 selectMultiple = true; 110 111 this.filter(e.target, selectMultiple); 105 112 }, 106 113 107 filter: function(target) 108 { 114 filter: function(target, selectMultiple) 115 { 116 function unselectAll() 117 { 118 this.allElement.removeStyleClass("selected"); 119 this.errorElement.removeStyleClass("selected"); 120 this.warningElement.removeStyleClass("selected"); 121 this.logElement.removeStyleClass("selected"); 122 123 this.messagesElement.removeStyleClass("filter-all"); 124 this.messagesElement.removeStyleClass("filter-errors"); 125 this.messagesElement.removeStyleClass("filter-warnings"); 126 this.messagesElement.removeStyleClass("filter-logs"); 127 } 128 129 var targetFilterClass = "filter-" + target.category.toLowerCase(); 130 109 131 if (target.category == "All") { 110 132 if (target.hasStyleClass("selected")) { … … 112 134 return; 113 135 } 114 115 this.errorElement.removeStyleClass("selected"); 116 this.warningElement.removeStyleClass("selected"); 117 this.logElement.removeStyleClass("selected"); 118 119 document.getElementById("console-messages").removeStyleClass("filter-errors"); 120 document.getElementById("console-messages").removeStyleClass("filter-warnings"); 121 document.getElementById("console-messages").removeStyleClass("filter-logs"); 136 137 unselectAll.call(this); 122 138 } else { 123 139 // Something other than all is being selected, so we want to unselect all 124 140 if (this.allElement.hasStyleClass("selected")) { 125 141 this.allElement.removeStyleClass("selected"); 126 document.getElementById("console-messages").removeStyleClass("filter-all");142 this.messagesElement.removeStyleClass("filter-all"); 127 143 } 144 } 145 146 if (!selectMultiple) { 147 // If multiple selection is off, we want to unselect everything else 148 // and just select ourselves. 149 unselectAll.call(this); 150 151 target.addStyleClass("selected"); 152 this.messagesElement.addStyleClass(targetFilterClass); 153 154 return; 128 155 } 129 156 130 157 if (target.hasStyleClass("selected")) { 158 // If selectMultiple is turned on, and we were selected, we just 159 // want to unselect ourselves. 131 160 target.removeStyleClass("selected"); 132 var newClass = "filter-" + target.category.toLowerCase(); 133 var filterElement = document.getElementById("console-messages"); 134 filterElement.removeStyleClass(newClass); 161 this.messagesElement.removeStyleClass(targetFilterClass); 135 162 } else { 163 // If selectMultiple is turned on, and we weren't selected, we just 164 // want to select ourselves. 136 165 target.addStyleClass("selected"); 137 var newClass = "filter-" + target.category.toLowerCase(); 138 var filterElement = document.getElementById("console-messages"); 139 filterElement.addStyleClass(newClass); 166 this.messagesElement.addStyleClass(targetFilterClass); 140 167 } 141 168 }, -
trunk/WebCore/inspector/front-end/ResourcesPanel.js
r50036 r50038 165 165 createFilterElement.call(this, category); 166 166 167 this.filter(this.allElement );167 this.filter(this.allElement, false); 168 168 169 169 this.reset(); … … 186 186 }, 187 187 188 filter: function(target) 189 { 188 filter: function(target, selectMultiple) 189 { 190 function unselectAll() 191 { 192 for (var i = 0; i < this.filterBarElement.childNodes.length; ++i) { 193 var child = this.filterBarElement.childNodes[i]; 194 if (!child.category) 195 continue; 196 197 child.removeStyleClass("selected"); 198 199 var filterClass = "filter-" + child.category.toLowerCase(); 200 this.resourcesGraphsElement.removeStyleClass(filterClass); 201 this.resourcesTreeElement.childrenListElement.removeStyleClass(filterClass); 202 } 203 } 204 205 var targetFilterClass = "filter-" + target.category.toLowerCase(); 206 190 207 if (target === this.allElement) { 191 208 if (target.hasStyleClass("selected")) { … … 195 212 196 213 // If All wasn't selected, and now is, unselect everything else. 197 for (var i = 0; i < this.filterBarElement.childNodes.length; ++i) { 198 var child = this.filterBarElement.childNodes[i]; 199 if (!child.category) 200 continue; 201 202 if (child !== this.allElement) 203 child.removeStyleClass("selected"); 204 205 var filterClass = "filter-" + child.category.toLowerCase(); 206 this.resourcesGraphsElement.removeStyleClass(filterClass); 207 this.resourcesTreeElement.childrenListElement.removeStyleClass(filterClass); 208 } 214 unselectAll.call(this); 209 215 } else { 210 216 // Something other than All is being selected, so we want to unselect All. … … 215 221 } 216 222 } 223 224 if (!selectMultiple) { 225 // If multiple selection is off, we want to unselect everything else 226 // and just select ourselves. 227 unselectAll.call(this); 228 229 target.addStyleClass("selected"); 230 this.resourcesGraphsElement.addStyleClass(targetFilterClass); 231 this.resourcesTreeElement.childrenListElement.addStyleClass(targetFilterClass); 232 233 return; 234 } 217 235 218 236 if (target.hasStyleClass("selected")) { 237 // If selectMultiple is turned on, and we were selected, we just 238 // want to unselect ourselves. 219 239 target.removeStyleClass("selected"); 220 240 221 var filterClass = "filter-" + target.category.toLowerCase(); 222 this.resourcesGraphsElement.removeStyleClass(filterClass); 223 this.resourcesTreeElement.childrenListElement.removeStyleClass(filterClass); 241 this.resourcesGraphsElement.removeStyleClass(targetFilterClass); 242 this.resourcesTreeElement.childrenListElement.removeStyleClass(targetFilterClass); 224 243 } else { 244 // If selectMultiple is turned on, and we weren't selected, we just 245 // want to select ourselves. 225 246 target.addStyleClass("selected"); 226 247 227 var filterClass = "filter-" + target.category.toLowerCase(); 228 this.resourcesGraphsElement.addStyleClass(filterClass); 229 this.resourcesTreeElement.childrenListElement.addStyleClass(filterClass); 248 this.resourcesGraphsElement.addStyleClass(targetFilterClass); 249 this.resourcesTreeElement.childrenListElement.addStyleClass(targetFilterClass); 230 250 } 231 251 }, … … 238 258 _updateFilter: function(e) 239 259 { 240 this.filter(e.target); 260 var isMac = InspectorController.platform().indexOf("mac-") === 0; 261 var selectMultiple = false; 262 if (isMac && e.metaKey && !e.ctrlKey && !e.altKey && !e.shiftKey) 263 selectMultiple = true; 264 if (!isMac && e.ctrlKey && !e.metaKey && !e.altKey && !e.shiftKey) 265 selectMultiple = true; 266 267 this.filter(e.target, selectMultiple); 241 268 }, 242 269
Note: See TracChangeset
for help on using the changeset viewer.