| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 this._popoverHelper = new WebInspector.ObjectPopoverHelper(scriptsPanel.elem
ent, | 47 this._popoverHelper = new WebInspector.ObjectPopoverHelper(scriptsPanel.elem
ent, |
| 48 this._getPopoverAnchor.bind(this), this._resolveObjectForPopover.bind(th
is), this._onHidePopover.bind(this), true); | 48 this._getPopoverAnchor.bind(this), this._resolveObjectForPopover.bind(th
is), this._onHidePopover.bind(this), true); |
| 49 | 49 |
| 50 this.textEditor.element.addEventListener("keydown", this._onKeyDown.bind(thi
s), true); | 50 this.textEditor.element.addEventListener("keydown", this._onKeyDown.bind(thi
s), true); |
| 51 | 51 |
| 52 this.textEditor.addEventListener(WebInspector.CodeMirrorTextEditor.Events.Gu
tterClick, this._handleGutterClick.bind(this), this); | 52 this.textEditor.addEventListener(WebInspector.CodeMirrorTextEditor.Events.Gu
tterClick, this._handleGutterClick.bind(this), this); |
| 53 | 53 |
| 54 this._breakpointManager.addEventListener(WebInspector.BreakpointManager.Even
ts.BreakpointAdded, this._breakpointAdded, this); | 54 this._breakpointManager.addEventListener(WebInspector.BreakpointManager.Even
ts.BreakpointAdded, this._breakpointAdded, this); |
| 55 this._breakpointManager.addEventListener(WebInspector.BreakpointManager.Even
ts.BreakpointRemoved, this._breakpointRemoved, this); | 55 this._breakpointManager.addEventListener(WebInspector.BreakpointManager.Even
ts.BreakpointRemoved, this._breakpointRemoved, this); |
| 56 | 56 |
| 57 WebInspector.presentationConsoleMessageHelper.addConsoleMessageEventListener
(WebInspector.PresentationConsoleMessageHelper.Events.ConsoleMessageAdded, this.
_uiSourceCode, this._consoleMessageAdded, this); | |
| 58 WebInspector.presentationConsoleMessageHelper.addConsoleMessageEventListener
(WebInspector.PresentationConsoleMessageHelper.Events.ConsoleMessageRemoved, thi
s._uiSourceCode, this._consoleMessageRemoved, this); | |
| 59 WebInspector.presentationConsoleMessageHelper.addConsoleMessageEventListener
(WebInspector.PresentationConsoleMessageHelper.Events.ConsoleMessagesCleared, th
is._uiSourceCode, this._consoleMessagesCleared, this); | |
| 60 this._uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.SourceM
appingChanged, this._onSourceMappingChanged, this); | 57 this._uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.SourceM
appingChanged, this._onSourceMappingChanged, this); |
| 61 this._uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.Working
CopyChanged, this._workingCopyChanged, this); | 58 this._uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.Working
CopyChanged, this._workingCopyChanged, this); |
| 62 this._uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.Working
CopyCommitted, this._workingCopyCommitted, this); | 59 this._uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.Working
CopyCommitted, this._workingCopyCommitted, this); |
| 63 this._uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.TitleCh
anged, this._showBlackboxInfobarIfNeeded, this); | 60 this._uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.TitleCh
anged, this._showBlackboxInfobarIfNeeded, this); |
| 64 | 61 |
| 65 /** @type {!Map.<!WebInspector.Target, !WebInspector.ResourceScriptFile>}*/ | 62 /** @type {!Map.<!WebInspector.Target, !WebInspector.ResourceScriptFile>}*/ |
| 66 this._scriptFileForTarget = new Map(); | 63 this._scriptFileForTarget = new Map(); |
| 67 this._registerShortcuts(); | 64 this._registerShortcuts(); |
| 68 var targets = WebInspector.targetManager.targets(); | 65 var targets = WebInspector.targetManager.targets(); |
| 69 for (var i = 0; i < targets.length; ++i) { | 66 for (var i = 0; i < targets.length; ++i) { |
| (...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 377 | 374 |
| 378 var warningLevel = WebInspector.Console.MessageLevel.Warning; | 375 var warningLevel = WebInspector.Console.MessageLevel.Warning; |
| 379 if (!liveEditErrorData) { | 376 if (!liveEditErrorData) { |
| 380 if (liveEditError) | 377 if (liveEditError) |
| 381 WebInspector.console.addMessage(WebInspector.UIString("LiveE
dit failed: %s", liveEditError), warningLevel); | 378 WebInspector.console.addMessage(WebInspector.UIString("LiveE
dit failed: %s", liveEditError), warningLevel); |
| 382 return; | 379 return; |
| 383 } | 380 } |
| 384 var compileError = liveEditErrorData.compileError; | 381 var compileError = liveEditErrorData.compileError; |
| 385 if (compileError) { | 382 if (compileError) { |
| 386 var messageText = WebInspector.UIString("LiveEdit compile failed
: %s", compileError.message); | 383 var messageText = WebInspector.UIString("LiveEdit compile failed
: %s", compileError.message); |
| 387 var message = new WebInspector.UISourceCode.Message(WebInspector
.UISourceCode.Message.Level.Error, messageText, compileError.lineNumber - 1, com
pileError.columnNumber + 1); | 384 this.uiSourceCode().addMessage(WebInspector.UISourceCode.Message
.Level.Error, messageText, compileError.lineNumber - 1, compileError.columnNumbe
r + 1); |
| 388 this.addMessageToSource(message); | |
| 389 } else { | 385 } else { |
| 390 WebInspector.console.addMessage(WebInspector.UIString("Unknown L
iveEdit error: %s; %s", JSON.stringify(liveEditErrorData), liveEditError), warni
ngLevel); | 386 WebInspector.console.addMessage(WebInspector.UIString("Unknown L
iveEdit error: %s; %s", JSON.stringify(liveEditErrorData), liveEditError), warni
ngLevel); |
| 391 } | 387 } |
| 392 } | 388 } |
| 393 | 389 |
| 394 this._scriptsPanel.setIgnoreExecutionLineEvents(true); | 390 this._scriptsPanel.setIgnoreExecutionLineEvents(true); |
| 395 this._hasCommittedLiveEdit = true; | 391 this._hasCommittedLiveEdit = true; |
| 396 var scriptFiles = this._scriptFileForTarget.valuesArray(); | 392 var scriptFiles = this._scriptFileForTarget.valuesArray(); |
| 397 for (var i = 0; i < scriptFiles.length; ++i) | 393 for (var i = 0; i < scriptFiles.length; ++i) |
| 398 scriptFiles[i].commitLiveEdit(liveEditCallback.bind(this)); | 394 scriptFiles[i].commitLiveEdit(liveEditCallback.bind(this)); |
| (...skipping 532 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 931 if (uiLocation.uiSourceCode !== this._uiSourceCode) | 927 if (uiLocation.uiSourceCode !== this._uiSourceCode) |
| 932 return; | 928 return; |
| 933 if (this._shouldIgnoreExternalBreakpointEvents()) | 929 if (this._shouldIgnoreExternalBreakpointEvents()) |
| 934 return; | 930 return; |
| 935 | 931 |
| 936 var remainingBreakpoint = this._breakpointManager.findBreakpointOnLine(t
his._uiSourceCode, uiLocation.lineNumber); | 932 var remainingBreakpoint = this._breakpointManager.findBreakpointOnLine(t
his._uiSourceCode, uiLocation.lineNumber); |
| 937 if (!remainingBreakpoint && this.loaded) | 933 if (!remainingBreakpoint && this.loaded) |
| 938 this._removeBreakpointDecoration(uiLocation.lineNumber); | 934 this._removeBreakpointDecoration(uiLocation.lineNumber); |
| 939 }, | 935 }, |
| 940 | 936 |
| 941 _consoleMessageAdded: function(event) | |
| 942 { | |
| 943 var message = /** @type {!WebInspector.PresentationConsoleMessage} */ (e
vent.data); | |
| 944 if (this.loaded) | |
| 945 this.addMessageToSource(this._sourceFrameMessage(message)); | |
| 946 }, | |
| 947 | |
| 948 _consoleMessageRemoved: function(event) | |
| 949 { | |
| 950 var message = /** @type {!WebInspector.PresentationConsoleMessage} */ (e
vent.data); | |
| 951 if (this.loaded) | |
| 952 this.removeMessageFromSource(this._sourceFrameMessage(message)); | |
| 953 }, | |
| 954 | |
| 955 /** | |
| 956 * @param {!WebInspector.PresentationConsoleMessage} message | |
| 957 * @return {!WebInspector.UISourceCode.Message} | |
| 958 */ | |
| 959 _sourceFrameMessage: function(message) | |
| 960 { | |
| 961 return WebInspector.UISourceCodeFrame.uiMessageFromConsoleMessage(messag
e.originalMessage, message.lineNumber(), message.columnNumber()); | |
| 962 }, | |
| 963 | |
| 964 _consoleMessagesCleared: function(event) | |
| 965 { | |
| 966 this.clearMessages(); | |
| 967 }, | |
| 968 | |
| 969 /** | 937 /** |
| 970 * @param {!WebInspector.Event} event | 938 * @param {!WebInspector.Event} event |
| 971 */ | 939 */ |
| 972 _onSourceMappingChanged: function(event) | 940 _onSourceMappingChanged: function(event) |
| 973 { | 941 { |
| 974 var data = /** @type {{target: !WebInspector.Target}} */ (event.data); | 942 var data = /** @type {{target: !WebInspector.Target}} */ (event.data); |
| 975 this._updateScriptFile(data.target); | 943 this._updateScriptFile(data.target); |
| 976 this._updateLinesWithoutMappingHighlight(); | 944 this._updateLinesWithoutMappingHighlight(); |
| 977 }, | 945 }, |
| 978 | 946 |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1019 onTextEditorContentLoaded: function() | 987 onTextEditorContentLoaded: function() |
| 1020 { | 988 { |
| 1021 WebInspector.UISourceCodeFrame.prototype.onTextEditorContentLoaded.call(
this); | 989 WebInspector.UISourceCodeFrame.prototype.onTextEditorContentLoaded.call(
this); |
| 1022 if (this._executionLocation) | 990 if (this._executionLocation) |
| 1023 this.setExecutionLocation(this._executionLocation); | 991 this.setExecutionLocation(this._executionLocation); |
| 1024 | 992 |
| 1025 var breakpointLocations = this._breakpointManager.breakpointLocationsFor
UISourceCode(this._uiSourceCode); | 993 var breakpointLocations = this._breakpointManager.breakpointLocationsFor
UISourceCode(this._uiSourceCode); |
| 1026 for (var i = 0; i < breakpointLocations.length; ++i) | 994 for (var i = 0; i < breakpointLocations.length; ++i) |
| 1027 this._breakpointAdded({data:breakpointLocations[i]}); | 995 this._breakpointAdded({data:breakpointLocations[i]}); |
| 1028 | 996 |
| 1029 var messages = WebInspector.presentationConsoleMessageHelper.consoleMess
ages(this._uiSourceCode); | |
| 1030 for (var message of messages) | |
| 1031 this.addMessageToSource(this._sourceFrameMessage(message)); | |
| 1032 | |
| 1033 var scriptFiles = this._scriptFileForTarget.valuesArray(); | 997 var scriptFiles = this._scriptFileForTarget.valuesArray(); |
| 1034 for (var i = 0; i < scriptFiles.length; ++i) | 998 for (var i = 0; i < scriptFiles.length; ++i) |
| 1035 scriptFiles[i].checkMapping(); | 999 scriptFiles[i].checkMapping(); |
| 1036 | 1000 |
| 1037 this._updateLinesWithoutMappingHighlight(); | 1001 this._updateLinesWithoutMappingHighlight(); |
| 1038 }, | 1002 }, |
| 1039 | 1003 |
| 1040 /** | 1004 /** |
| 1041 * @param {!WebInspector.Event} event | 1005 * @param {!WebInspector.Event} event |
| 1042 */ | 1006 */ |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1103 */ | 1067 */ |
| 1104 _setBreakpoint: function(lineNumber, columnNumber, condition, enabled) | 1068 _setBreakpoint: function(lineNumber, columnNumber, condition, enabled) |
| 1105 { | 1069 { |
| 1106 this._breakpointManager.setBreakpoint(this._uiSourceCode, lineNumber, co
lumnNumber, condition, enabled); | 1070 this._breakpointManager.setBreakpoint(this._uiSourceCode, lineNumber, co
lumnNumber, condition, enabled); |
| 1107 }, | 1071 }, |
| 1108 | 1072 |
| 1109 dispose: function() | 1073 dispose: function() |
| 1110 { | 1074 { |
| 1111 this._breakpointManager.removeEventListener(WebInspector.BreakpointManag
er.Events.BreakpointAdded, this._breakpointAdded, this); | 1075 this._breakpointManager.removeEventListener(WebInspector.BreakpointManag
er.Events.BreakpointAdded, this._breakpointAdded, this); |
| 1112 this._breakpointManager.removeEventListener(WebInspector.BreakpointManag
er.Events.BreakpointRemoved, this._breakpointRemoved, this); | 1076 this._breakpointManager.removeEventListener(WebInspector.BreakpointManag
er.Events.BreakpointRemoved, this._breakpointRemoved, this); |
| 1113 WebInspector.presentationConsoleMessageHelper.removeConsoleMessageEventL
istener(WebInspector.PresentationConsoleMessageHelper.Events.ConsoleMessageAdded
, this._uiSourceCode, this._consoleMessageAdded, this); | |
| 1114 WebInspector.presentationConsoleMessageHelper.removeConsoleMessageEventL
istener(WebInspector.PresentationConsoleMessageHelper.Events.ConsoleMessageRemov
ed, this._uiSourceCode, this._consoleMessageRemoved, this); | |
| 1115 WebInspector.presentationConsoleMessageHelper.removeConsoleMessageEventL
istener(WebInspector.PresentationConsoleMessageHelper.Events.ConsoleMessagesClea
red, this._uiSourceCode, this._consoleMessagesCleared, this); | |
| 1116 this._uiSourceCode.removeEventListener(WebInspector.UISourceCode.Events.
SourceMappingChanged, this._onSourceMappingChanged, this); | 1077 this._uiSourceCode.removeEventListener(WebInspector.UISourceCode.Events.
SourceMappingChanged, this._onSourceMappingChanged, this); |
| 1117 this._uiSourceCode.removeEventListener(WebInspector.UISourceCode.Events.
WorkingCopyChanged, this._workingCopyChanged, this); | 1078 this._uiSourceCode.removeEventListener(WebInspector.UISourceCode.Events.
WorkingCopyChanged, this._workingCopyChanged, this); |
| 1118 this._uiSourceCode.removeEventListener(WebInspector.UISourceCode.Events.
WorkingCopyCommitted, this._workingCopyCommitted, this); | 1079 this._uiSourceCode.removeEventListener(WebInspector.UISourceCode.Events.
WorkingCopyCommitted, this._workingCopyCommitted, this); |
| 1119 this._uiSourceCode.removeEventListener(WebInspector.UISourceCode.Events.
TitleChanged, this._showBlackboxInfobarIfNeeded, this); | 1080 this._uiSourceCode.removeEventListener(WebInspector.UISourceCode.Events.
TitleChanged, this._showBlackboxInfobarIfNeeded, this); |
| 1120 WebInspector.moduleSetting("skipStackFramesPattern").removeChangeListene
r(this._showBlackboxInfobarIfNeeded, this); | 1081 WebInspector.moduleSetting("skipStackFramesPattern").removeChangeListene
r(this._showBlackboxInfobarIfNeeded, this); |
| 1121 WebInspector.moduleSetting("skipContentScripts").removeChangeListener(th
is._showBlackboxInfobarIfNeeded, this); | 1082 WebInspector.moduleSetting("skipContentScripts").removeChangeListener(th
is._showBlackboxInfobarIfNeeded, this); |
| 1122 WebInspector.UISourceCodeFrame.prototype.dispose.call(this); | 1083 WebInspector.UISourceCodeFrame.prototype.dispose.call(this); |
| 1123 }, | 1084 }, |
| 1124 | 1085 |
| 1125 __proto__: WebInspector.UISourceCodeFrame.prototype | 1086 __proto__: WebInspector.UISourceCodeFrame.prototype |
| 1126 } | 1087 } |
| OLD | NEW |