OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. |
3 * Copyright (C) 2007 Matt Lilek (pewtermoose@gmail.com). | 3 * Copyright (C) 2007 Matt Lilek (pewtermoose@gmail.com). |
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 22 matching lines...) Expand all Loading... |
33 { | 33 { |
34 this.panels = {}; | 34 this.panels = {}; |
35 WebInspector.inspectorView = new WebInspector.InspectorView(); | 35 WebInspector.inspectorView = new WebInspector.InspectorView(); |
36 var parentElement = document.getElementById("main"); | 36 var parentElement = document.getElementById("main"); |
37 WebInspector.inspectorView.show(parentElement); | 37 WebInspector.inspectorView.show(parentElement); |
38 WebInspector.inspectorView.addEventListener(WebInspector.InspectorView.E
vents.PanelSelected, this._panelSelected, this); | 38 WebInspector.inspectorView.addEventListener(WebInspector.InspectorView.E
vents.PanelSelected, this._panelSelected, this); |
39 | 39 |
40 var elements = new WebInspector.ElementsPanelDescriptor(); | 40 var elements = new WebInspector.ElementsPanelDescriptor(); |
41 var resources = new WebInspector.PanelDescriptor("resources", WebInspect
or.UIString("Resources"), "ResourcesPanel", "ResourcesPanel.js"); | 41 var resources = new WebInspector.PanelDescriptor("resources", WebInspect
or.UIString("Resources"), "ResourcesPanel", "ResourcesPanel.js"); |
42 var network = new WebInspector.NetworkPanelDescriptor(); | 42 var network = new WebInspector.NetworkPanelDescriptor(); |
43 var scripts = new WebInspector.ScriptsPanelDescriptor(); | 43 var sources = new WebInspector.SourcesPanelDescriptor(); |
44 var timeline = new WebInspector.TimelinePanelDescriptor(); | 44 var timeline = new WebInspector.TimelinePanelDescriptor(); |
45 var profiles = new WebInspector.ProfilesPanelDescriptor(); | 45 var profiles = new WebInspector.ProfilesPanelDescriptor(); |
46 var audits = new WebInspector.PanelDescriptor("audits", WebInspector.UIS
tring("Audits"), "AuditsPanel", "AuditsPanel.js"); | 46 var audits = new WebInspector.PanelDescriptor("audits", WebInspector.UIS
tring("Audits"), "AuditsPanel", "AuditsPanel.js"); |
47 var console = new WebInspector.PanelDescriptor("console", WebInspector.U
IString("Console"), "ConsolePanel"); | 47 var console = new WebInspector.PanelDescriptor("console", WebInspector.U
IString("Console"), "ConsolePanel"); |
48 var allDescriptors = [elements, resources, network, scripts, timeline, p
rofiles, audits, console]; | 48 var allDescriptors = [elements, resources, network, sources, timeline, p
rofiles, audits, console]; |
49 if (WebInspector.experimentsSettings.layersPanel.isEnabled()) { | 49 if (WebInspector.experimentsSettings.layersPanel.isEnabled()) { |
50 var layers = new WebInspector.LayersPanelDescriptor(); | 50 var layers = new WebInspector.LayersPanelDescriptor(); |
51 allDescriptors.push(layers); | 51 allDescriptors.push(layers); |
52 } | 52 } |
53 var allProfilers = [profiles]; | 53 var allProfilers = [profiles]; |
54 if (WebInspector.experimentsSettings.customizableToolbar.isEnabled()) { | 54 if (WebInspector.experimentsSettings.customizableToolbar.isEnabled()) { |
55 allProfilers = []; | 55 allProfilers = []; |
56 allProfilers.push(new WebInspector.PanelDescriptor("cpu-profiler", W
ebInspector.UIString("CPU Profiler"), "CPUProfilerPanel", "ProfilesPanel.js")); | 56 allProfilers.push(new WebInspector.PanelDescriptor("cpu-profiler", W
ebInspector.UIString("CPU Profiler"), "CPUProfilerPanel", "ProfilesPanel.js")); |
57 if (!WebInspector.WorkerManager.isWorkerFrontend()) | 57 if (!WebInspector.WorkerManager.isWorkerFrontend()) |
58 allProfilers.push(new WebInspector.PanelDescriptor("css-profiler
", WebInspector.UIString("CSS Profiler"), "CSSSelectorProfilerPanel", "ProfilesP
anel.js")); | 58 allProfilers.push(new WebInspector.PanelDescriptor("css-profiler
", WebInspector.UIString("CSS Profiler"), "CSSSelectorProfilerPanel", "ProfilesP
anel.js")); |
59 allProfilers.push(new WebInspector.PanelDescriptor("heap-profiler",
WebInspector.UIString("Heap Profiler"), "HeapProfilerPanel", "ProfilesPanel.js")
); | 59 allProfilers.push(new WebInspector.PanelDescriptor("heap-profiler",
WebInspector.UIString("Heap Profiler"), "HeapProfilerPanel", "ProfilesPanel.js")
); |
60 if (!WebInspector.WorkerManager.isWorkerFrontend() && WebInspector.e
xperimentsSettings.canvasInspection.isEnabled()) | 60 if (!WebInspector.WorkerManager.isWorkerFrontend() && WebInspector.e
xperimentsSettings.canvasInspection.isEnabled()) |
61 allProfilers.push(new WebInspector.PanelDescriptor("canvas-profi
ler", WebInspector.UIString("Canvas Profiler"), "CanvasProfilerPanel", "Profiles
Panel.js")); | 61 allProfilers.push(new WebInspector.PanelDescriptor("canvas-profi
ler", WebInspector.UIString("Canvas Profiler"), "CanvasProfilerPanel", "Profiles
Panel.js")); |
62 Array.prototype.splice.bind(allDescriptors, allDescriptors.indexOf(p
rofiles), 1).apply(null, allProfilers); | 62 Array.prototype.splice.bind(allDescriptors, allDescriptors.indexOf(p
rofiles), 1).apply(null, allProfilers); |
63 } | 63 } |
64 | 64 |
65 var panelDescriptors = []; | 65 var panelDescriptors = []; |
66 if (WebInspector.WorkerManager.isWorkerFrontend()) { | 66 if (WebInspector.WorkerManager.isWorkerFrontend()) { |
67 panelDescriptors.push(scripts); | 67 panelDescriptors.push(sources); |
68 panelDescriptors.push(timeline); | 68 panelDescriptors.push(timeline); |
69 panelDescriptors = panelDescriptors.concat(allProfilers); | 69 panelDescriptors = panelDescriptors.concat(allProfilers); |
70 panelDescriptors.push(console); | 70 panelDescriptors.push(console); |
71 return panelDescriptors; | 71 return panelDescriptors; |
72 } | 72 } |
73 for (var i = 0; i < allDescriptors.length; ++i) | 73 for (var i = 0; i < allDescriptors.length; ++i) |
74 panelDescriptors.push(allDescriptors[i]); | 74 panelDescriptors.push(allDescriptors[i]); |
75 return panelDescriptors; | 75 return panelDescriptors; |
76 }, | 76 }, |
77 | 77 |
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
324 WebInspector.settings.zoomLevel.set(this._zoomLevel); | 324 WebInspector.settings.zoomLevel.set(this._zoomLevel); |
325 // For backwards compatibility, zoomLevel takes integers (with 0 being d
efault zoom). | 325 // For backwards compatibility, zoomLevel takes integers (with 0 being d
efault zoom). |
326 var index = this._zoomLevel + WebInspector.Zoom.DefaultOffset; | 326 var index = this._zoomLevel + WebInspector.Zoom.DefaultOffset; |
327 index = Math.min(WebInspector.Zoom.Table.length - 1, index); | 327 index = Math.min(WebInspector.Zoom.Table.length - 1, index); |
328 index = Math.max(0, index); | 328 index = Math.max(0, index); |
329 InspectorFrontendHost.setZoomFactor(WebInspector.Zoom.Table[index]); | 329 InspectorFrontendHost.setZoomFactor(WebInspector.Zoom.Table[index]); |
330 }, | 330 }, |
331 | 331 |
332 _debuggerPaused: function() | 332 _debuggerPaused: function() |
333 { | 333 { |
334 // Create scripts panel upon demand. | 334 // Create sources panel upon demand. |
335 WebInspector.panel("scripts"); | 335 WebInspector.panel("sources"); |
336 } | 336 } |
337 } | 337 } |
338 | 338 |
339 WebInspector.Events = { | 339 WebInspector.Events = { |
340 InspectorLoaded: "InspectorLoaded", | 340 InspectorLoaded: "InspectorLoaded", |
341 InspectorClosing: "InspectorClosing" | 341 InspectorClosing: "InspectorClosing" |
342 } | 342 } |
343 | 343 |
344 {(function parseQueryParameters() | 344 {(function parseQueryParameters() |
345 { | 345 { |
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
762 return; | 762 return; |
763 if (WebInspector.advancedSearchController.handleShortcut(event)) | 763 if (WebInspector.advancedSearchController.handleShortcut(event)) |
764 return; | 764 return; |
765 if (WebInspector.inspectElementModeController && WebInspector.inspectElement
ModeController.handleShortcut(event)) | 765 if (WebInspector.inspectElementModeController && WebInspector.inspectElement
ModeController.handleShortcut(event)) |
766 return; | 766 return; |
767 | 767 |
768 switch (event.keyIdentifier) { | 768 switch (event.keyIdentifier) { |
769 case "U+004F": // O key | 769 case "U+004F": // O key |
770 case "U+0050": // P key | 770 case "U+0050": // P key |
771 if (!event.shiftKey && !event.altKey && WebInspector.KeyboardShortcu
t.eventHasCtrlOrMeta(event)) { | 771 if (!event.shiftKey && !event.altKey && WebInspector.KeyboardShortcu
t.eventHasCtrlOrMeta(event)) { |
772 WebInspector.showPanel("scripts").showGoToSourceDialog(); | 772 WebInspector.showPanel("sources").showGoToSourceDialog(); |
773 event.consume(true); | 773 event.consume(true); |
774 } | 774 } |
775 break; | 775 break; |
776 case "U+0052": // R key | 776 case "U+0052": // R key |
777 if (WebInspector.KeyboardShortcut.eventHasCtrlOrMeta(event)) { | 777 if (WebInspector.KeyboardShortcut.eventHasCtrlOrMeta(event)) { |
778 DebuggerAgent.setSkipAllPauses(true, true); | 778 DebuggerAgent.setSkipAllPauses(true, true); |
779 PageAgent.reload(event.shiftKey); | 779 PageAgent.reload(event.shiftKey); |
780 event.consume(true); | 780 event.consume(true); |
781 } | 781 } |
782 if (window.DEBUG && event.altKey) { | 782 if (window.DEBUG && event.altKey) { |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
994 | 994 |
995 if (error) { | 995 if (error) { |
996 console.error(error); | 996 console.error(error); |
997 return; | 997 return; |
998 } | 998 } |
999 | 999 |
1000 var uiLocation = WebInspector.debuggerModel.rawLocationToUILocation(
response.location); | 1000 var uiLocation = WebInspector.debuggerModel.rawLocationToUILocation(
response.location); |
1001 if (!uiLocation) | 1001 if (!uiLocation) |
1002 return; | 1002 return; |
1003 | 1003 |
1004 WebInspector.showPanel("scripts").showUILocation(uiLocation); | 1004 WebInspector.showPanel("sources").showUILocation(uiLocation); |
1005 } | 1005 } |
1006 DebuggerAgent.getFunctionDetails(object.objectId, didGetDetails.bind(thi
s)); | 1006 DebuggerAgent.getFunctionDetails(object.objectId, didGetDetails.bind(thi
s)); |
1007 return; | 1007 return; |
1008 } | 1008 } |
1009 | 1009 |
1010 if (hints.databaseId) | 1010 if (hints.databaseId) |
1011 WebInspector.showPanel("resources").selectDatabase(WebInspector.database
Model.databaseForId(hints.databaseId)); | 1011 WebInspector.showPanel("resources").selectDatabase(WebInspector.database
Model.databaseForId(hints.databaseId)); |
1012 else if (hints.domStorageId) | 1012 else if (hints.domStorageId) |
1013 WebInspector.showPanel("resources").selectDOMStorage(WebInspector.domSto
rageModel.storageForId(hints.domStorageId)); | 1013 WebInspector.showPanel("resources").selectDOMStorage(WebInspector.domSto
rageModel.storageForId(hints.domStorageId)); |
1014 else if (hints.copyToClipboard) | 1014 else if (hints.copyToClipboard) |
(...skipping 27 matching lines...) Expand all Loading... |
1042 WebInspector.inspectElementModeController.disable(); | 1042 WebInspector.inspectElementModeController.disable(); |
1043 } | 1043 } |
1044 WebInspector.showPanel("elements").revealAndSelectNode(nodeId); | 1044 WebInspector.showPanel("elements").revealAndSelectNode(nodeId); |
1045 } | 1045 } |
1046 | 1046 |
1047 WebInspector.showAnchorLocation = function(anchor) | 1047 WebInspector.showAnchorLocation = function(anchor) |
1048 { | 1048 { |
1049 var preferredPanel = this.panels[anchor.preferredPanel]; | 1049 var preferredPanel = this.panels[anchor.preferredPanel]; |
1050 if (preferredPanel && WebInspector._showAnchorLocationInPanel(anchor, prefer
redPanel)) | 1050 if (preferredPanel && WebInspector._showAnchorLocationInPanel(anchor, prefer
redPanel)) |
1051 return true; | 1051 return true; |
1052 if (WebInspector._showAnchorLocationInPanel(anchor, this.panel("scripts"))) | 1052 if (WebInspector._showAnchorLocationInPanel(anchor, this.panel("sources"))) |
1053 return true; | 1053 return true; |
1054 if (WebInspector._showAnchorLocationInPanel(anchor, this.panel("resources"))
) | 1054 if (WebInspector._showAnchorLocationInPanel(anchor, this.panel("resources"))
) |
1055 return true; | 1055 return true; |
1056 if (WebInspector._showAnchorLocationInPanel(anchor, this.panel("network"))) | 1056 if (WebInspector._showAnchorLocationInPanel(anchor, this.panel("network"))) |
1057 return true; | 1057 return true; |
1058 return false; | 1058 return false; |
1059 } | 1059 } |
1060 | 1060 |
1061 WebInspector._showAnchorLocationInPanel = function(anchor, panel) | 1061 WebInspector._showAnchorLocationInPanel = function(anchor, panel) |
1062 { | 1062 { |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1124 | 1124 |
1125 /** | 1125 /** |
1126 * @return {string} | 1126 * @return {string} |
1127 */ | 1127 */ |
1128 WebInspector.getSelectionForegroundColor = function() | 1128 WebInspector.getSelectionForegroundColor = function() |
1129 { | 1129 { |
1130 return InspectorFrontendHost.getSelectionForegroundColor(); | 1130 return InspectorFrontendHost.getSelectionForegroundColor(); |
1131 } | 1131 } |
1132 | 1132 |
1133 window.DEBUG = true; | 1133 window.DEBUG = true; |
OLD | NEW |