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 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
309 * @param {!WebInspector.Project} project | 309 * @param {!WebInspector.Project} project |
310 * @param {string} path | 310 * @param {string} path |
311 * @param {!WebInspector.UISourceCode=} uiSourceCode | 311 * @param {!WebInspector.UISourceCode=} uiSourceCode |
312 */ | 312 */ |
313 _handleContextMenuCreate: function(project, path, uiSourceCode) | 313 _handleContextMenuCreate: function(project, path, uiSourceCode) |
314 { | 314 { |
315 this.create(project, path, uiSourceCode); | 315 this.create(project, path, uiSourceCode); |
316 }, | 316 }, |
317 | 317 |
318 /** | 318 /** |
319 * @param {!WebInspector.UISourceCode} uiSourceCode | |
320 */ | |
321 _handleContextMenuRename: function(uiSourceCode) | |
322 { | |
323 this.rename(uiSourceCode, false); | |
324 }, | |
325 | |
326 /** | |
319 * @param {!WebInspector.Project} project | 327 * @param {!WebInspector.Project} project |
320 * @param {string} path | 328 * @param {string} path |
321 */ | 329 */ |
322 _handleContextMenuExclude: function(project, path) | 330 _handleContextMenuExclude: function(project, path) |
323 { | 331 { |
324 var shouldExclude = window.confirm(WebInspector.UIString("Are you sure y ou want to exclude this folder?")); | 332 var shouldExclude = window.confirm(WebInspector.UIString("Are you sure y ou want to exclude this folder?")); |
325 if (shouldExclude) { | 333 if (shouldExclude) { |
326 WebInspector.startBatchUpdate(); | 334 WebInspector.startBatchUpdate(); |
327 project.excludeFolder(path); | 335 project.excludeFolder(path); |
328 WebInspector.endBatchUpdate(); | 336 WebInspector.endBatchUpdate(); |
(...skipping 14 matching lines...) Expand all Loading... | |
343 * @param {!Event} event | 351 * @param {!Event} event |
344 * @param {!WebInspector.UISourceCode} uiSourceCode | 352 * @param {!WebInspector.UISourceCode} uiSourceCode |
345 */ | 353 */ |
346 handleFileContextMenu: function(event, uiSourceCode) | 354 handleFileContextMenu: function(event, uiSourceCode) |
347 { | 355 { |
348 var contextMenu = new WebInspector.ContextMenu(event); | 356 var contextMenu = new WebInspector.ContextMenu(event); |
349 contextMenu.appendApplicableItems(uiSourceCode); | 357 contextMenu.appendApplicableItems(uiSourceCode); |
350 contextMenu.appendSeparator(); | 358 contextMenu.appendSeparator(); |
351 | 359 |
352 var project = uiSourceCode.project(); | 360 var project = uiSourceCode.project(); |
353 var path = uiSourceCode.parentPath(); | 361 if (project.type() === WebInspector.projectTypes.FileSystem) { |
354 contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMe nuTitles() ? "Refresh parent" : "Refresh Parent"), this._handleContextMenuRefres h.bind(this, project, path)); | 362 var path = uiSourceCode.parentPath(); |
355 contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMe nuTitles() ? "Duplicate file" : "Duplicate File"), this._handleContextMenuCreate .bind(this, project, path, uiSourceCode)); | 363 contextMenu.appendItem(WebInspector.UIString("Rename\u2026"), this._ handleContextMenuRename.bind(this, uiSourceCode)); |
356 contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMe nuTitles() ? "Exclude parent folder" : "Exclude Parent Folder"), this._handleCon textMenuExclude.bind(this, project, path)); | 364 contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCa seMenuTitles() ? "Make a copy\u2026" : "Make a Copy\u2026"), this._handleContext MenuCreate.bind(this, project, path, uiSourceCode)); |
357 contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMe nuTitles() ? "Delete file" : "Delete File"), this._handleContextMenuDelete.bind( this, uiSourceCode)); | 365 contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCa seMenuTitles() ? "Delete" : "Delete"), this._handleContextMenuDelete.bind(this, uiSourceCode)); |
lushnikov
2014/06/06 16:26:19
WebInspector.useLowerCaseMenuTitles() ? "Delete" :
| |
358 contextMenu.appendSeparator(); | 366 contextMenu.appendSeparator(); |
367 } | |
368 | |
359 this._appendAddFolderItem(contextMenu); | 369 this._appendAddFolderItem(contextMenu); |
360 contextMenu.show(); | 370 contextMenu.show(); |
361 }, | 371 }, |
362 | 372 |
363 /** | 373 /** |
364 * @param {!Event} event | 374 * @param {!Event} event |
365 * @param {!WebInspector.NavigatorFolderTreeNode} node | 375 * @param {!WebInspector.NavigatorFolderTreeNode} node |
366 */ | 376 */ |
367 handleFolderContextMenu: function(event, node) | 377 handleFolderContextMenu: function(event, node) |
368 { | 378 { |
(...skipping 1042 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1411 | 1421 |
1412 willRemoveChild: function(node) | 1422 willRemoveChild: function(node) |
1413 { | 1423 { |
1414 if (node._isMerged || !this.isPopulated()) | 1424 if (node._isMerged || !this.isPopulated()) |
1415 return; | 1425 return; |
1416 this._treeElement.removeChild(node._treeElement); | 1426 this._treeElement.removeChild(node._treeElement); |
1417 }, | 1427 }, |
1418 | 1428 |
1419 __proto__: WebInspector.NavigatorTreeNode.prototype | 1429 __proto__: WebInspector.NavigatorTreeNode.prototype |
1420 } | 1430 } |
OLD | NEW |