| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008 Apple 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 | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 { | 238 { |
| 239 var script = new WebInspector.Script(sourceID, sourceURL, source, starti
ngLine, errorLine, errorMessage, scriptWorldType); | 239 var script = new WebInspector.Script(sourceID, sourceURL, source, starti
ngLine, errorLine, errorMessage, scriptWorldType); |
| 240 this._sourceIDMap[sourceID] = script; | 240 this._sourceIDMap[sourceID] = script; |
| 241 | 241 |
| 242 var resource = WebInspector.resourceForURL(sourceURL); | 242 var resource = WebInspector.resourceForURL(sourceURL); |
| 243 if (resource) { | 243 if (resource) { |
| 244 if (resource.finished) { | 244 if (resource.finished) { |
| 245 // Resource is finished, bind the script right away. | 245 // Resource is finished, bind the script right away. |
| 246 resource.addScript(script); | 246 resource.addScript(script); |
| 247 this._sourceIDMap[sourceID] = resource; | 247 this._sourceIDMap[sourceID] = resource; |
| 248 var view = WebInspector.ResourceManager.existingResourceViewForR
esource(resource); | |
| 249 if (view && view.sourceFrame) | |
| 250 view.sourceFrame.addScript(script); | |
| 251 } else { | 248 } else { |
| 252 // Resource is not finished, bind the script later. | 249 // Resource is not finished, bind the script later. |
| 253 if (!resource._scriptsPendingResourceLoad) { | 250 if (!resource._scriptsPendingResourceLoad) { |
| 254 resource._scriptsPendingResourceLoad = []; | 251 resource._scriptsPendingResourceLoad = []; |
| 255 resource.addEventListener("finished", this._resourceLoadingF
inished, this); | 252 resource.addEventListener("finished", this._resourceLoadingF
inished, this); |
| 256 } | 253 } |
| 257 resource._scriptsPendingResourceLoad.push(script); | 254 resource._scriptsPendingResourceLoad.push(script); |
| 258 } | 255 } |
| 259 } | 256 } |
| 260 this._addScriptToFilesMenu(script); | 257 this._addScriptToFilesMenu(script); |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 308 { | 305 { |
| 309 return Preferences.canEditScriptSource; | 306 return Preferences.canEditScriptSource; |
| 310 }, | 307 }, |
| 311 | 308 |
| 312 editScriptSource: function(editData, commitEditingCallback, cancelEditingCal
lback) | 309 editScriptSource: function(editData, commitEditingCallback, cancelEditingCal
lback) |
| 313 { | 310 { |
| 314 if (!this.canEditScripts()) | 311 if (!this.canEditScripts()) |
| 315 return; | 312 return; |
| 316 | 313 |
| 317 // Need to clear breakpoints and re-create them later when editing sourc
e. | 314 // Need to clear breakpoints and re-create them later when editing sourc
e. |
| 318 var breakpoints = WebInspector.breakpointManager.breakpointsForSourceID(
sourceID); | 315 var breakpoints = WebInspector.breakpointManager.breakpointsForSourceID(
editData.sourceID); |
| 319 for (var i = 0; i < breakpoints.length; ++i) | 316 for (var i = 0; i < breakpoints.length; ++i) |
| 320 breakpoints[i].remove(); | 317 breakpoints[i].remove(); |
| 321 | 318 |
| 322 function mycallback(success, newBodyOrErrorMessage, callFrames) | 319 function mycallback(success, newBodyOrErrorMessage, callFrames) |
| 323 { | 320 { |
| 324 if (success) { | 321 if (success) { |
| 325 commitEditingCallback(newBodyOrErrorMessage); | 322 commitEditingCallback(newBodyOrErrorMessage); |
| 326 if (callFrames && callFrames.length) | 323 if (callFrames && callFrames.length) |
| 327 this.debuggerPaused(callFrames); | 324 this.debuggerPaused(callFrames); |
| 328 } else { | 325 } else { |
| (...skipping 764 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1093 showGoToLineDialog: function(e) | 1090 showGoToLineDialog: function(e) |
| 1094 { | 1091 { |
| 1095 var view = this.visibleView; | 1092 var view = this.visibleView; |
| 1096 if (view) | 1093 if (view) |
| 1097 WebInspector.GoToLineDialog.show(view); | 1094 WebInspector.GoToLineDialog.show(view); |
| 1098 } | 1095 } |
| 1099 } | 1096 } |
| 1100 | 1097 |
| 1101 WebInspector.ScriptsPanel.prototype.__proto__ = WebInspector.Panel.prototype; | 1098 WebInspector.ScriptsPanel.prototype.__proto__ = WebInspector.Panel.prototype; |
| 1102 | 1099 |
| OLD | NEW |