Changeset 84623 in webkit
- Timestamp:
- Apr 22, 2011 6:18:13 AM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r84622 r84623 1 2011-04-21 Pavel Feldman <pfeldman@google.com> 2 3 Reviewed by Yury Semikhatsky. 4 5 Web Inspector: group content scripts in the scripts panel drop down. 6 https://bugs.webkit.org/show_bug.cgi?id=59108 7 8 * English.lproj/localizedStrings.js: 9 * inspector/front-end/ScriptsPanel.js: 10 (WebInspector.ScriptsPanel.prototype._addOptionToFilesSelect.optionCompare): 11 (WebInspector.ScriptsPanel.prototype._addOptionToFilesSelect): 12 1 13 2011-04-22 Mike West <mkwst@google.com> 2 14 -
trunk/Source/WebCore/inspector/front-end/ScriptsPanel.js
r84484 r84623 280 280 var option = document.createElement("option"); 281 281 option.text = sourceFile.url ? WebInspector.displayNameForURL(sourceFile.url) : WebInspector.UIString("(program)"); 282 option.isContentScript = sourceFile.isContentScript; 282 283 if (sourceFile.isContentScript) 283 284 option.addStyleClass("extension-script"); 284 285 function optionCompare(a, b) 285 286 { 287 if (a === select.contentScriptSection) 288 return b.isContentScript ? -1 : 1; 289 if (b === select.contentScriptSection) 290 return a.isContentScript ? 1 : -1; 291 292 if (a.isContentScript && !b.isContentScript) 293 return 1; 294 if (!a.isContentScript && b.isContentScript) 295 return -1; 296 286 297 if (a.text === b.text) 287 298 return 0; 288 299 return a.text < b.text ? -1 : 1; 289 300 } 301 290 302 var insertionIndex = insertionIndexForObjectInListSortedByFunction(option, select.childNodes, optionCompare); 291 if (insertionIndex < 0) 292 select.appendChild(option); 293 else 294 select.insertBefore(option, select.childNodes.item(insertionIndex)); 295 303 select.insertBefore(option, insertionIndex < 0 ? null : select.childNodes.item(insertionIndex)); 304 305 if (sourceFile.isContentScript && !select.contentScriptSection) { 306 var contentScriptSection = document.createElement("option"); 307 contentScriptSection.text = WebInspector.UIString("Content scripts"); 308 contentScriptSection.disabled = true; 309 select.contentScriptSection = contentScriptSection; 310 311 var insertionIndex = insertionIndexForObjectInListSortedByFunction(contentScriptSection, select.childNodes, optionCompare); 312 select.insertBefore(contentScriptSection, insertionIndex < 0 ? null : select.childNodes.item(insertionIndex)); 313 } 296 314 option._sourceFileId = sourceFileId; 297 315 this._sourceFileIdToFilesSelectOption[sourceFileId] = option;
Note: See TracChangeset
for help on using the changeset viewer.