| Server IP : 151.101.66.159 / Your IP : 216.73.216.66 Web Server : Flywheel/5.1.0 System : Linux wordpress 6.12.113+ #1 SMP Thu Oct 22 02:38:20 UTC 2026 x86_64 User : root ( ) PHP Version : 7.4.33.18 Disable Function : disk_free_space,diskfreespace,dl,exec,fpassthru,getmypid,getmyuid,highlight_file,link,opcache_compile_file,opcache_get_configuration,opcache_is_script_cached,passthru,pcntl_alarm,pcntl_exec,pcntl_fork,pcntl_get_last_error,pcntl_getpriority,pcntl_setpriority,pcntl_signal,pcntl_signal_dispatch,pcntl_sigprocmask,pcntl_sigtimedwait,pcntl_sigwaitinfo,pcntl_strerror,pcntl_wait,pcntl_waitpid,pcntl_wexitstatus,pcntl_wifcontinued,pcntl_wifexited,pcntl_wifsignaled,pcntl_wifstopped,pcntl_wstopsig,pcntl_wtermsig,phpinfo,popen,posix_ctermid,posix_getcwd,posix_getegid,posix_geteuid,posix_getgid,posix_getgrgid,posix_getgrnam,posix_getgroups,posix_getlogin,posix_getpgid,posix_getpgrp,posix_getpid,posix_getppid,posix_getpwnam,posix_getpwuid,posix_getrlimit,posix_getsid,posix_getuid,posix_isatty,posix_kill,posix_mkfifo,posix_setegid,posix_seteuid,posix_setgid,posix_setpgid,posix_setsid,posix_setuid,posix_times,posix_ttyname,posix_uname,proc_close,proc_get_status,proc_nice,proc_open,proc_terminate,shell_exec,show_source,socket_listen,source,system,virtual MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /www/wp-content/plugins/file-manager-advanced/application/library/js/commands/ |
Upload File : |
/**
* @class elFinder command "undo"
* Undo previous commands
*
* @author Naoki Sawada
**/
elFinder.prototype.commands.undo = function() {
"use strict";
var self = this,
fm = this.fm,
setTitle = function(undo) {
if (undo) {
self.title = fm.i18n('cmdundo') + ' ' + fm.i18n('cmd'+undo.cmd);
self.state = 0;
} else {
self.title = fm.i18n('cmdundo');
self.state = -1;
}
self.change();
},
cmds = [];
this.alwaysEnabled = true;
this.updateOnSelect = false;
this.shortcuts = [{
pattern : 'ctrl+z'
}];
this.syncTitleOnChange = true;
this.getstate = function() {
return cmds.length? 0 : -1;
};
this.setUndo = function(undo, redo) {
var _undo = {};
if (undo) {
if ($.isPlainObject(undo) && undo.cmd && undo.callback) {
Object.assign(_undo, undo);
if (redo) {
delete redo.undo;
_undo.redo = redo;
} else {
fm.getCommand('redo').setRedo(null);
}
cmds.push(_undo);
setTitle(_undo);
}
}
};
this.exec = function() {
var redo = fm.getCommand('redo'),
dfd = $.Deferred(),
undo, res, _redo = {};
if (cmds.length) {
undo = cmds.pop();
if (undo.redo) {
Object.assign(_redo, undo.redo);
delete undo.redo;
} else {
_redo = null;
}
dfd.done(function() {
if (_redo) {
redo.setRedo(_redo, undo);
}
});
setTitle(cmds.length? cmds[cmds.length-1] : void(0));
res = undo.callback();
if (res && res.done) {
res.done(function() {
dfd.resolve();
}).fail(function() {
dfd.reject();
});
} else {
dfd.resolve();
}
if (cmds.length) {
this.update(0, cmds[cmds.length - 1].name);
} else {
this.update(-1, '');
}
} else {
dfd.reject();
}
return dfd;
};
fm.bind('exec', function(e) {
var data = e.data || {};
if (data.opts && data.opts._userAction) {
if (data.dfrd && data.dfrd.done) {
data.dfrd.done(function(res) {
if (res && res.undo && res.redo) {
res.undo.redo = res.redo;
self.setUndo(res.undo);
}
});
}
}
});
};
/**
* @class elFinder command "redo"
* Redo previous commands
*
* @author Naoki Sawada
**/
elFinder.prototype.commands.redo = function() {
"use strict";
var self = this,
fm = this.fm,
setTitle = function(redo) {
if (redo && redo.callback) {
self.title = fm.i18n('cmdredo') + ' ' + fm.i18n('cmd'+redo.cmd);
self.state = 0;
} else {
self.title = fm.i18n('cmdredo');
self.state = -1;
}
self.change();
},
cmds = [];
this.alwaysEnabled = true;
this.updateOnSelect = false;
this.shortcuts = [{
pattern : 'shift+ctrl+z ctrl+y'
}];
this.syncTitleOnChange = true;
this.getstate = function() {
return cmds.length? 0 : -1;
};
this.setRedo = function(redo, undo) {
if (redo === null) {
cmds = [];
setTitle();
} else {
if (redo && redo.cmd && redo.callback) {
if (undo) {
redo.undo = undo;
}
cmds.push(redo);
setTitle(redo);
}
}
};
this.exec = function() {
var undo = fm.getCommand('undo'),
dfd = $.Deferred(),
redo, res, _undo = {}, _redo = {};
if (cmds.length) {
redo = cmds.pop();
if (redo.undo) {
Object.assign(_undo, redo.undo);
Object.assign(_redo, redo);
delete _redo.undo;
dfd.done(function() {
undo.setUndo(_undo, _redo);
});
}
setTitle(cmds.length? cmds[cmds.length-1] : void(0));
res = redo.callback();
if (res && res.done) {
res.done(function() {
dfd.resolve();
}).fail(function() {
dfd.reject();
});
} else {
dfd.resolve();
}
return dfd;
} else {
return dfd.reject();
}
};
};