| 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 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 this.console = new WebInspector.ConsoleModel(); | 336 this.console = new WebInspector.ConsoleModel(); |
| 337 this.console.addEventListener(WebInspector.ConsoleModel.Events.ConsoleCleare
d, this._resetErrorAndWarningCounts, this); | 337 this.console.addEventListener(WebInspector.ConsoleModel.Events.ConsoleCleare
d, this._resetErrorAndWarningCounts, this); |
| 338 this.console.addEventListener(WebInspector.ConsoleModel.Events.MessageAdded,
this._updateErrorAndWarningCounts, this); | 338 this.console.addEventListener(WebInspector.ConsoleModel.Events.MessageAdded,
this._updateErrorAndWarningCounts, this); |
| 339 this.console.addEventListener(WebInspector.ConsoleModel.Events.RepeatCountUp
dated, this._updateErrorAndWarningCounts, this); | 339 this.console.addEventListener(WebInspector.ConsoleModel.Events.RepeatCountUp
dated, this._updateErrorAndWarningCounts, this); |
| 340 this.networkManager = new WebInspector.NetworkManager(); | 340 this.networkManager = new WebInspector.NetworkManager(); |
| 341 this.resourceTreeModel = new WebInspector.ResourceTreeModel(this.networkMana
ger); | 341 this.resourceTreeModel = new WebInspector.ResourceTreeModel(this.networkMana
ger); |
| 342 this.debuggerModel = new WebInspector.DebuggerModel(); | 342 this.debuggerModel = new WebInspector.DebuggerModel(); |
| 343 this.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.Debugg
erPaused, this._debuggerPaused, this); | 343 this.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.Debugg
erPaused, this._debuggerPaused, this); |
| 344 this.networkLog = new WebInspector.NetworkLog(); | 344 this.networkLog = new WebInspector.NetworkLog(); |
| 345 this.domAgent = new WebInspector.DOMAgent(); | 345 this.domAgent = new WebInspector.DOMAgent(); |
| 346 this.domAgent.addEventListener(WebInspector.DOMAgent.Events.InspectNodeReque
sted, this._inspectNodeRequested, this); | |
| 347 this.workerManager = new WebInspector.WorkerManager(Capabilities.canInspectW
orkers); | 346 this.workerManager = new WebInspector.WorkerManager(Capabilities.canInspectW
orkers); |
| 348 this.runtimeModel = new WebInspector.RuntimeModel(this.resourceTreeModel); | 347 this.runtimeModel = new WebInspector.RuntimeModel(this.resourceTreeModel); |
| 349 | 348 |
| 350 this.zoomManager = new WebInspector.ZoomManager(); | 349 this.zoomManager = new WebInspector.ZoomManager(); |
| 351 | 350 |
| 352 this.advancedSearchController = new WebInspector.AdvancedSearchController(); | 351 this.advancedSearchController = new WebInspector.AdvancedSearchController(); |
| 353 this.consoleView = new WebInspector.ConsoleView(WebInspector.isWorkerFronten
d()); | 352 this.consoleView = new WebInspector.ConsoleView(WebInspector.isWorkerFronten
d()); |
| 354 | 353 |
| 355 InspectorBackend.registerInspectorDispatcher(this); | 354 InspectorBackend.registerInspectorDispatcher(this); |
| 356 | 355 |
| (...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 803 WebInspector.showErrorMessage = function(error) | 802 WebInspector.showErrorMessage = function(error) |
| 804 { | 803 { |
| 805 WebInspector.log(error, WebInspector.ConsoleMessage.MessageLevel.Error, true
); | 804 WebInspector.log(error, WebInspector.ConsoleMessage.MessageLevel.Error, true
); |
| 806 } | 805 } |
| 807 | 806 |
| 808 // Inspector.inspect protocol event | 807 // Inspector.inspect protocol event |
| 809 WebInspector.inspect = function(payload, hints) | 808 WebInspector.inspect = function(payload, hints) |
| 810 { | 809 { |
| 811 var object = WebInspector.RemoteObject.fromPayload(payload); | 810 var object = WebInspector.RemoteObject.fromPayload(payload); |
| 812 if (object.subtype === "node") { | 811 if (object.subtype === "node") { |
| 812 |
| 813 object.pushNodeToFrontend(callback); |
| 814 var elementsPanel = /** @type {!WebInspector.ElementsPanel} */ WebInspec
tor.panel("elements"); |
| 815 elementsPanel.omitDefaultSelection(); |
| 816 WebInspector.inspectorView.setCurrentPanel(elementsPanel); |
| 817 |
| 813 function callback(nodeId) | 818 function callback(nodeId) |
| 814 { | 819 { |
| 815 WebInspector._updateFocusedNode(nodeId); | 820 elementsPanel.stopOmittingDefaultSelection(); |
| 821 WebInspector.Revealer.reveal(WebInspector.domAgent.nodeForId(nodeId)
); |
| 816 InspectorFrontendHost.inspectElementCompleted(); | 822 InspectorFrontendHost.inspectElementCompleted(); |
| 817 object.release(); | 823 object.release(); |
| 818 } | 824 } |
| 819 object.pushNodeToFrontend(callback); | 825 |
| 820 WebInspector.showPanel("elements"); | |
| 821 return; | 826 return; |
| 822 } | 827 } |
| 823 | 828 |
| 824 if (object.type === "function") { | 829 if (object.type === "function") { |
| 825 /** | 830 /** |
| 826 * @param {?Protocol.Error} error | 831 * @param {?Protocol.Error} error |
| 827 * @param {!DebuggerAgent.FunctionDetails} response | 832 * @param {!DebuggerAgent.FunctionDetails} response |
| 828 */ | 833 */ |
| 829 function didGetDetails(error, response) | 834 function didGetDetails(error, response) |
| 830 { | 835 { |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 868 { | 873 { |
| 869 WebInspector._updateFocusedNode(event.data); | 874 WebInspector._updateFocusedNode(event.data); |
| 870 } | 875 } |
| 871 | 876 |
| 872 WebInspector._updateFocusedNode = function(nodeId) | 877 WebInspector._updateFocusedNode = function(nodeId) |
| 873 { | 878 { |
| 874 if (WebInspector.inspectElementModeController && WebInspector.inspectElement
ModeController.enabled()) { | 879 if (WebInspector.inspectElementModeController && WebInspector.inspectElement
ModeController.enabled()) { |
| 875 InspectorFrontendHost.bringToFront(); | 880 InspectorFrontendHost.bringToFront(); |
| 876 WebInspector.inspectElementModeController.disable(); | 881 WebInspector.inspectElementModeController.disable(); |
| 877 } | 882 } |
| 878 WebInspector.showPanel("elements").revealAndSelectNode(nodeId); | 883 WebInspector.panel("elements").revealAndSelectNode(nodeId); |
| 884 } |
| 885 |
| 886 WebInspector.evaluateInConsole = function(expression, showResultOnly) |
| 887 { |
| 888 this.showConsole(); |
| 889 this.consoleView.evaluateUsingTextPrompt(expression, showResultOnly); |
| 879 } | 890 } |
| 880 | 891 |
| 881 WebInspector.addMainEventListeners = function(doc) | 892 WebInspector.addMainEventListeners = function(doc) |
| 882 { | 893 { |
| 883 doc.addEventListener("keydown", this.postDocumentKeyDown.bind(this), false); | 894 doc.addEventListener("keydown", this.postDocumentKeyDown.bind(this), false); |
| 884 doc.addEventListener("beforecopy", this.documentCanCopy.bind(this), true); | 895 doc.addEventListener("beforecopy", this.documentCanCopy.bind(this), true); |
| 885 doc.addEventListener("copy", this.documentCopy.bind(this), false); | 896 doc.addEventListener("copy", this.documentCopy.bind(this), false); |
| 886 doc.addEventListener("contextmenu", this.contextMenuEventFired.bind(this), t
rue); | 897 doc.addEventListener("contextmenu", this.contextMenuEventFired.bind(this), t
rue); |
| 887 doc.addEventListener("click", this.documentClick.bind(this), false); | 898 doc.addEventListener("click", this.documentClick.bind(this), false); |
| 888 } | 899 } |
| (...skipping 10 matching lines...) Expand all Loading... |
| 899 this._fontFamily = "'Lucida Grande', sans-serif"; | 910 this._fontFamily = "'Lucida Grande', sans-serif"; |
| 900 break; | 911 break; |
| 901 case "windows": | 912 case "windows": |
| 902 this._fontFamily = "'Segoe UI', Tahoma, sans-serif"; | 913 this._fontFamily = "'Segoe UI', Tahoma, sans-serif"; |
| 903 break; | 914 break; |
| 904 } | 915 } |
| 905 return WebInspector._fontFamily; | 916 return WebInspector._fontFamily; |
| 906 } | 917 } |
| 907 | 918 |
| 908 window.DEBUG = true; | 919 window.DEBUG = true; |
| OLD | NEW |