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 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 if (this._scriptsTree.selectedTreeElement) | 167 if (this._scriptsTree.selectedTreeElement) |
168 this._scriptsTree.selectedTreeElement.deselect(); | 168 this._scriptsTree.selectedTreeElement.deselect(); |
169 this._lastSelectedUISourceCode = uiSourceCode; | 169 this._lastSelectedUISourceCode = uiSourceCode; |
170 node.reveal(select); | 170 node.reveal(select); |
171 }, | 171 }, |
172 | 172 |
173 /** | 173 /** |
174 * @param {WebInspector.UISourceCode} uiSourceCode | 174 * @param {WebInspector.UISourceCode} uiSourceCode |
175 * @param {boolean} focusSource | 175 * @param {boolean} focusSource |
176 */ | 176 */ |
177 _scriptSelected: function(uiSourceCode, focusSource) | 177 _sourceSelected: function(uiSourceCode, focusSource) |
178 { | 178 { |
179 this._lastSelectedUISourceCode = uiSourceCode; | 179 this._lastSelectedUISourceCode = uiSourceCode; |
180 var data = { uiSourceCode: uiSourceCode, focusSource: focusSource}; | 180 var data = { uiSourceCode: uiSourceCode, focusSource: focusSource}; |
181 this.dispatchEventToListeners(WebInspector.NavigatorView.Events.ItemSele
cted, data); | 181 this.dispatchEventToListeners(WebInspector.NavigatorView.Events.ItemSele
cted, data); |
182 }, | 182 }, |
183 | 183 |
184 /** | 184 /** |
185 * @param {WebInspector.UISourceCode} uiSourceCode | 185 * @param {WebInspector.UISourceCode} uiSourceCode |
186 */ | 186 */ |
187 removeUISourceCode: function(uiSourceCode) | 187 removeUISourceCode: function(uiSourceCode) |
(...skipping 18 matching lines...) Expand all Loading... |
206 parentNode.removeChild(node); | 206 parentNode.removeChild(node); |
207 node = parentNode; | 207 node = parentNode; |
208 } | 208 } |
209 }, | 209 }, |
210 | 210 |
211 /** | 211 /** |
212 * @param {WebInspector.UISourceCode} uiSourceCode | 212 * @param {WebInspector.UISourceCode} uiSourceCode |
213 */ | 213 */ |
214 requestRename: function(uiSourceCode) | 214 requestRename: function(uiSourceCode) |
215 { | 215 { |
216 this.dispatchEventToListeners(WebInspector.ScriptsNavigator.Events.ItemR
enamingRequested, uiSourceCode); | 216 this.dispatchEventToListeners(WebInspector.SourcesNavigator.Events.ItemR
enamingRequested, uiSourceCode); |
217 }, | 217 }, |
218 | 218 |
219 /** | 219 /** |
220 * @param {WebInspector.UISourceCode} uiSourceCode | 220 * @param {WebInspector.UISourceCode} uiSourceCode |
221 * @param {function(boolean)=} callback | 221 * @param {function(boolean)=} callback |
222 */ | 222 */ |
223 rename: function(uiSourceCode, callback) | 223 rename: function(uiSourceCode, callback) |
224 { | 224 { |
225 var node = this._uiSourceCodeNodes.get(uiSourceCode); | 225 var node = this._uiSourceCodeNodes.get(uiSourceCode); |
226 if (!node) | 226 if (!node) |
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
642 | 642 |
643 _ondragstart: function(event) | 643 _ondragstart: function(event) |
644 { | 644 { |
645 event.dataTransfer.setData("text/plain", this._warmedUpContent); | 645 event.dataTransfer.setData("text/plain", this._warmedUpContent); |
646 event.dataTransfer.effectAllowed = "copy"; | 646 event.dataTransfer.effectAllowed = "copy"; |
647 return true; | 647 return true; |
648 }, | 648 }, |
649 | 649 |
650 onspace: function() | 650 onspace: function() |
651 { | 651 { |
652 this._navigatorView._scriptSelected(this.uiSourceCode, true); | 652 this._navigatorView._sourceSelected(this.uiSourceCode, true); |
653 return true; | 653 return true; |
654 }, | 654 }, |
655 | 655 |
656 /** | 656 /** |
657 * @param {Event} event | 657 * @param {Event} event |
658 */ | 658 */ |
659 _onclick: function(event) | 659 _onclick: function(event) |
660 { | 660 { |
661 this._navigatorView._scriptSelected(this.uiSourceCode, false); | 661 this._navigatorView._sourceSelected(this.uiSourceCode, false); |
662 }, | 662 }, |
663 | 663 |
664 /** | 664 /** |
665 * @param {Event} event | 665 * @param {Event} event |
666 */ | 666 */ |
667 ondblclick: function(event) | 667 ondblclick: function(event) |
668 { | 668 { |
669 var middleClick = event.button === 1; | 669 var middleClick = event.button === 1; |
670 this._navigatorView._scriptSelected(this.uiSourceCode, !middleClick); | 670 this._navigatorView._sourceSelected(this.uiSourceCode, !middleClick); |
671 }, | 671 }, |
672 | 672 |
673 onenter: function() | 673 onenter: function() |
674 { | 674 { |
675 this._navigatorView._scriptSelected(this.uiSourceCode, true); | 675 this._navigatorView._sourceSelected(this.uiSourceCode, true); |
676 return true; | 676 return true; |
677 }, | 677 }, |
678 | 678 |
679 /** | 679 /** |
680 * @param {Event} event | 680 * @param {Event} event |
681 */ | 681 */ |
682 _handleContextMenuEvent: function(event) | 682 _handleContextMenuEvent: function(event) |
683 { | 683 { |
684 this.select(); | 684 this.select(); |
685 this._navigatorView.handleFileContextMenu(event, this._uiSourceCode); | 685 this._navigatorView.handleFileContextMenu(event, this._uiSourceCode); |
(...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1150 | 1150 |
1151 willRemoveChild: function(node) | 1151 willRemoveChild: function(node) |
1152 { | 1152 { |
1153 if (node._isMerged || !this.isPopulated()) | 1153 if (node._isMerged || !this.isPopulated()) |
1154 return; | 1154 return; |
1155 this._treeElement.removeChild(node._treeElement); | 1155 this._treeElement.removeChild(node._treeElement); |
1156 }, | 1156 }, |
1157 | 1157 |
1158 __proto__: WebInspector.NavigatorTreeNode.prototype | 1158 __proto__: WebInspector.NavigatorTreeNode.prototype |
1159 } | 1159 } |
OLD | NEW |