Edit File by line
/home/barbar84/www/wp-conte.../plugins/file-man.../applicat.../library/js/commands
File: cut.js
/**
[0] Fix | Delete
* @class elFinder command "copy".
[1] Fix | Delete
* Put files in filemanager clipboard.
[2] Fix | Delete
*
[3] Fix | Delete
* @type elFinder.command
[4] Fix | Delete
* @author Dmitry (dio) Levashov
[5] Fix | Delete
*/
[6] Fix | Delete
elFinder.prototype.commands.cut = function() {
[7] Fix | Delete
"use strict";
[8] Fix | Delete
var fm = this.fm;
[9] Fix | Delete
[10] Fix | Delete
this.shortcuts = [{
[11] Fix | Delete
pattern : 'ctrl+x shift+insert'
[12] Fix | Delete
}];
[13] Fix | Delete
[14] Fix | Delete
this.getstate = function(select) {
[15] Fix | Delete
var sel = this.files(select),
[16] Fix | Delete
cnt = sel.length,
[17] Fix | Delete
filter = function(files) {
[18] Fix | Delete
var fres = true;
[19] Fix | Delete
return $.grep(files, function(f) {
[20] Fix | Delete
fres = fres && f.read && ! f.locked && ! fm.isRoot(f) ? true : false;
[21] Fix | Delete
return fres;
[22] Fix | Delete
});
[23] Fix | Delete
};
[24] Fix | Delete
[25] Fix | Delete
return cnt && filter(sel).length == cnt ? 0 : -1;
[26] Fix | Delete
};
[27] Fix | Delete
[28] Fix | Delete
this.exec = function(hashes) {
[29] Fix | Delete
var dfrd = $.Deferred()
[30] Fix | Delete
.fail(function(error) {
[31] Fix | Delete
fm.error(error);
[32] Fix | Delete
});
[33] Fix | Delete
[34] Fix | Delete
$.each(this.files(hashes), function(i, file) {
[35] Fix | Delete
if (!(file.read && ! file.locked && ! fm.isRoot(file)) ) {
[36] Fix | Delete
return !dfrd.reject(['errCopy', file.name, 'errPerm']);
[37] Fix | Delete
}
[38] Fix | Delete
if (file.locked) {
[39] Fix | Delete
return !dfrd.reject(['errLocked', file.name]);
[40] Fix | Delete
}
[41] Fix | Delete
});
[42] Fix | Delete
[43] Fix | Delete
return dfrd.state() == 'rejected' ? dfrd : dfrd.resolve(fm.clipboard(this.hashes(hashes), true));
[44] Fix | Delete
};
[45] Fix | Delete
[46] Fix | Delete
};
[47] Fix | Delete
[48] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function