OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * | 10 * |
(...skipping 21 matching lines...) Expand all Loading... | |
32 * @param {!WebInspector.UISourceCode} uiSourceCode | 32 * @param {!WebInspector.UISourceCode} uiSourceCode |
33 */ | 33 */ |
34 WebInspector.UISourceCodeFrame = function(uiSourceCode) | 34 WebInspector.UISourceCodeFrame = function(uiSourceCode) |
35 { | 35 { |
36 this._uiSourceCode = uiSourceCode; | 36 this._uiSourceCode = uiSourceCode; |
37 WebInspector.SourceFrame.call(this, this._uiSourceCode); | 37 WebInspector.SourceFrame.call(this, this._uiSourceCode); |
38 this.textEditor.setAutocompleteDelegate(new WebInspector.SimpleAutocompleteD elegate()); | 38 this.textEditor.setAutocompleteDelegate(new WebInspector.SimpleAutocompleteD elegate()); |
39 | 39 |
40 this._uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.Working CopyChanged, this._onWorkingCopyChanged, this); | 40 this._uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.Working CopyChanged, this._onWorkingCopyChanged, this); |
41 this._uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.Working CopyCommitted, this._onWorkingCopyCommitted, this); | 41 this._uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.Working CopyCommitted, this._onWorkingCopyCommitted, this); |
42 this._uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.LineMes sageAdded, this._onLineMessageAdded, this); | |
43 this._uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.LineMes sageRemoved, this._onLineMessageRemoved, this); | |
42 this._updateStyle(); | 44 this._updateStyle(); |
43 } | 45 } |
44 | 46 |
45 WebInspector.UISourceCodeFrame.prototype = { | 47 WebInspector.UISourceCodeFrame.prototype = { |
46 /** | 48 /** |
47 * @return {!WebInspector.UISourceCode} | 49 * @return {!WebInspector.UISourceCode} |
48 */ | 50 */ |
49 uiSourceCode: function() | 51 uiSourceCode: function() |
50 { | 52 { |
51 return this._uiSourceCode; | 53 return this._uiSourceCode; |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
86 this._checkContentUpdated(); | 88 this._checkContentUpdated(); |
87 }, | 89 }, |
88 | 90 |
89 _checkContentUpdated: function() | 91 _checkContentUpdated: function() |
90 { | 92 { |
91 if (!this.loaded || !this.isShowing()) | 93 if (!this.loaded || !this.isShowing()) |
92 return; | 94 return; |
93 this._uiSourceCode.checkContentUpdated(); | 95 this._uiSourceCode.checkContentUpdated(); |
94 }, | 96 }, |
95 | 97 |
98 _onLineMessageAdded: function(evt) { | |
pfeldman
2015/10/27 17:37:34
Here and below, { goes the next line. Annotate evt
wes
2015/10/27 21:59:16
Acknowledged.
| |
99 var m = /** @type {!WebInspector.UISourceCodeMessage} */ (evt.data); | |
100 this.addMessageToSource(new WebInspector.SourceFrameMessage(m.text(), We bInspector.SourceFrameMessage.Level[m.kind()], m.location())); | |
pfeldman
2015/10/27 17:37:34
Lets move the level enum into the UISourceCodeMess
wes
2015/10/27 21:59:16
The actual enum is going to need to be moved out o
| |
101 }, | |
102 | |
103 _onLineMessageRemoved: function(evt) { | |
pfeldman
2015/10/27 17:37:34
ditto
wes
2015/10/27 21:59:16
Acknowledged.
| |
104 var m = /** @type {!WebInspector.UISourceCodeMessage} */ (evt.data); | |
105 this.removeMessageFromSource(new WebInspector.SourceFrameMessage(m.text( ), WebInspector.SourceFrameMessage.Level[m.kind()], m.location())); | |
106 }, | |
107 | |
96 commitEditing: function() | 108 commitEditing: function() |
97 { | 109 { |
98 if (!this._uiSourceCode.isDirty()) | 110 if (!this._uiSourceCode.isDirty()) |
99 return; | 111 return; |
100 | 112 |
101 this._muteSourceCodeEvents = true; | 113 this._muteSourceCodeEvents = true; |
102 this._uiSourceCode.commitWorkingCopy(); | 114 this._uiSourceCode.commitWorkingCopy(); |
103 delete this._muteSourceCodeEvents; | 115 delete this._muteSourceCodeEvents; |
104 }, | 116 }, |
105 | 117 |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
257 | 269 |
258 dispose: function() | 270 dispose: function() |
259 { | 271 { |
260 this.element.remove(); | 272 this.element.remove(); |
261 this._onResize(); | 273 this._onResize(); |
262 delete this._uiSourceCodeFrame; | 274 delete this._uiSourceCodeFrame; |
263 }, | 275 }, |
264 | 276 |
265 __proto__: WebInspector.Infobar.prototype | 277 __proto__: WebInspector.Infobar.prototype |
266 } | 278 } |
OLD | NEW |