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 * * 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 */ | 49 */ |
50 function populateRevisions(uiSourceCode) | 50 function populateRevisions(uiSourceCode) |
51 { | 51 { |
52 if (uiSourceCode.history.length) | 52 if (uiSourceCode.history.length) |
53 this._createUISourceCodeItem(uiSourceCode); | 53 this._createUISourceCodeItem(uiSourceCode); |
54 } | 54 } |
55 | 55 |
56 WebInspector.workspace.uiSourceCodes().forEach(populateRevisions.bind(this))
; | 56 WebInspector.workspace.uiSourceCodes().forEach(populateRevisions.bind(this))
; |
57 WebInspector.workspace.addEventListener(WebInspector.Workspace.Events.UISour
ceCodeContentCommitted, this._revisionAdded, this); | 57 WebInspector.workspace.addEventListener(WebInspector.Workspace.Events.UISour
ceCodeContentCommitted, this._revisionAdded, this); |
58 WebInspector.workspace.addEventListener(WebInspector.Workspace.Events.UISour
ceCodeRemoved, this._uiSourceCodeRemoved, this); | 58 WebInspector.workspace.addEventListener(WebInspector.Workspace.Events.UISour
ceCodeRemoved, this._uiSourceCodeRemoved, this); |
59 WebInspector.workspace.addEventListener(WebInspector.Workspace.Events.Projec
tWillReset, this._projectWillReset, this); | 59 WebInspector.workspace.addEventListener(WebInspector.Workspace.Events.Projec
tRemoved, this._projectRemoved, this); |
60 } | 60 } |
61 | 61 |
62 /** | 62 /** |
63 * @param {!WebInspector.UISourceCode} uiSourceCode | 63 * @param {!WebInspector.UISourceCode} uiSourceCode |
64 */ | 64 */ |
65 WebInspector.RevisionHistoryView.showHistory = function(uiSourceCode) | 65 WebInspector.RevisionHistoryView.showHistory = function(uiSourceCode) |
66 { | 66 { |
67 if (!WebInspector.RevisionHistoryView._view) | 67 if (!WebInspector.RevisionHistoryView._view) |
68 WebInspector.RevisionHistoryView._view = new WebInspector.RevisionHistor
yView(); | 68 WebInspector.RevisionHistoryView._view = new WebInspector.RevisionHistor
yView(); |
69 var view = WebInspector.RevisionHistoryView._view; | 69 var view = WebInspector.RevisionHistoryView._view; |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 */ | 160 */ |
161 _removeUISourceCode: function(uiSourceCode) | 161 _removeUISourceCode: function(uiSourceCode) |
162 { | 162 { |
163 var uiSourceCodeItem = this._uiSourceCodeItems.get(uiSourceCode); | 163 var uiSourceCodeItem = this._uiSourceCodeItems.get(uiSourceCode); |
164 if (!uiSourceCodeItem) | 164 if (!uiSourceCodeItem) |
165 return; | 165 return; |
166 this._treeOutline.removeChild(uiSourceCodeItem); | 166 this._treeOutline.removeChild(uiSourceCodeItem); |
167 this._uiSourceCodeItems.remove(uiSourceCode); | 167 this._uiSourceCodeItems.remove(uiSourceCode); |
168 }, | 168 }, |
169 | 169 |
170 _projectWillReset: function(event) | 170 _projectRemoved: function(event) |
171 { | 171 { |
172 var project = event.data; | 172 var project = event.data; |
173 project.uiSourceCodes().forEach(this._removeUISourceCode.bind(this)); | 173 project.uiSourceCodes().forEach(this._removeUISourceCode.bind(this)); |
174 }, | 174 }, |
175 | 175 |
176 __proto__: WebInspector.VBox.prototype | 176 __proto__: WebInspector.VBox.prototype |
177 } | 177 } |
178 | 178 |
179 /** | 179 /** |
180 * @constructor | 180 * @constructor |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
313 child.listItemElement.classList.add("revision-history-line-" + changeTyp
e); | 313 child.listItemElement.classList.add("revision-history-line-" + changeTyp
e); |
314 }, | 314 }, |
315 | 315 |
316 allowRevert: function() | 316 allowRevert: function() |
317 { | 317 { |
318 this._revertElement.classList.remove("hidden"); | 318 this._revertElement.classList.remove("hidden"); |
319 }, | 319 }, |
320 | 320 |
321 __proto__: TreeElement.prototype | 321 __proto__: TreeElement.prototype |
322 } | 322 } |
OLD | NEW |