OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 var CommandUtil = {}; | 5 var CommandUtil = {}; |
6 | 6 |
7 /** | 7 /** |
8 * Extracts root on which command event was dispatched. | 8 * Extracts root on which command event was dispatched. |
9 * | 9 * |
10 * @param {Event} event Command event for which to retrieve root to operate on. | 10 * @param {Event} event Command event for which to retrieve root to operate on. |
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
299 * Focuses search input box. | 299 * Focuses search input box. |
300 */ | 300 */ |
301 Commands.searchCommand = { | 301 Commands.searchCommand = { |
302 execute: function(event, fileManager, elmnt) { | 302 execute: function(event, fileManager, elmnt) { |
303 elmnt.focus(); | 303 elmnt.focus(); |
304 }, | 304 }, |
305 canExecute: function(event, fileManager) { | 305 canExecute: function(event, fileManager) { |
306 event.canExecute = !fileManager.isRenamingInProgress(); | 306 event.canExecute = !fileManager.isRenamingInProgress(); |
307 } | 307 } |
308 }; | 308 }; |
| 309 |
| 310 /** |
| 311 * Creates zip file for current selection. |
| 312 */ |
| 313 Commands.zipSelectionCommand = { |
| 314 execute: function(event, fileManager) { |
| 315 var dirEntry = fileManager.directoryModel_.getCurrentDirEntry(); |
| 316 var selectionEntries = fileManager.getSelection().entries; |
| 317 fileManager.copyManager_.zipSelection(dirEntry, fileManager.isOnGData(), |
| 318 selectionEntries); |
| 319 }, |
| 320 canExecute: function(event, fileManager) { |
| 321 var selection = fileManager.getSelection(); |
| 322 event.canExecute = !fileManager.isOnGData() && selection && |
| 323 selection.totalCount > 0; |
| 324 } |
| 325 }; |
OLD | NEW |