* @class elFinder command "copy".
* Put files in filemanager clipboard.
* @author Dmitry (dio) Levashov
elFinder.prototype.commands.cut = function() {
pattern : 'ctrl+x shift+insert'
this.getstate = function(select) {
var sel = this.files(select),
filter = function(files) {
return $.grep(files, function(f) {
fres = fres && f.read && ! f.locked && ! fm.isRoot(f) ? true : false;
return cnt && filter(sel).length == cnt ? 0 : -1;
this.exec = function(hashes) {
$.each(this.files(hashes), function(i, file) {
if (!(file.read && ! file.locked && ! fm.isRoot(file)) ) {
return !dfrd.reject(['errCopy', file.name, 'errPerm']);
return !dfrd.reject(['errLocked', file.name]);
return dfrd.state() == 'rejected' ? dfrd : dfrd.resolve(fm.clipboard(this.hashes(hashes), true));