| Server IP : 5.144.175.180 / Your IP : 216.73.216.191 Web Server : Apache/2.4.63 (Unix) OpenSSL/1.1.1 System : Linux vpsgpz1.itsimplycom.it 4.15.0-20-generic #21-Ubuntu SMP Tue Apr 24 06:16:15 UTC 2018 x86_64 User : edilchimica ( ) PHP Version : 7.4.33 Disable Function : getmyuid,passthru,leak,listen,diskfreespace,tmpfile,link,shell_exec,dl,exec,system,highlight_file,source,show_source,fpassthru,virtual,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_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_open,proc_close,proc_nice,proc_terminate,escapeshellcmd,ini_alter,popen,pcntl_exec,socket_accept,socket_bind,socket_clear_error,socket_close,socket_connect,symlink,posix_geteuid,ini_alter,socket_listen,socket_create_listen,socket_read,socket_create_pair,stream_socket_server MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /home/edilchimica/webapps/edilchimica/wp-content/plugins/wp-file-manager/lib/js/ui/ |
Upload File : |
/**
* @class elFinder ui
* Display number of files/selected files and its size in statusbar
*
* @author Dmitry (dio) Levashov
**/
jQuery.fn.elfinderstat = function(fm) {
"use strict";
return this.each(function() {
var size = jQuery(this).addClass('elfinder-stat-size'),
sel = jQuery('<div class="elfinder-stat-selected"></div>')
.on('click', 'a', function(e) {
var hash = jQuery(this).data('hash');
e.preventDefault();
fm.exec('opendir', [ hash ]);
}),
titleitems = fm.i18n('items'),
titlesel = fm.i18n('selected'),
titlesize = fm.i18n('size'),
setstat = function(files) {
var c = 0,
s = 0,
cwd = fm.cwd(),
calc = true,
hasSize = true;
if (cwd.sizeInfo || cwd.size) {
s = cwd.size;
calc = false;
}
jQuery.each(files, function(i, file) {
c++;
if (calc) {
s += parseInt(file.size) || 0;
if (hasSize === true && file.mime === 'directory' && !file.sizeInfo) {
hasSize = false;
}
}
});
size.html(titleitems+': <span class="elfinder-stat-incsearch"></span>'+c+', <span class="elfinder-stat-size'+(hasSize? ' elfinder-stat-size-recursive' : '')+'">'+fm.i18n(hasSize? 'sum' : 'size')+': '+fm.formatSize(s)+'</span>')
.attr('title', size.text());
fm.trigger('uistatchange');
},
setIncsearchStat = function(data) {
size.find('span.elfinder-stat-incsearch').html(data? data.hashes.length + ' / ' : '');
size.attr('title', size.text());
fm.trigger('uistatchange');
},
setSelect = function(files) {
var s = 0,
c = 0,
dirs = [],
path, file;
if (files.length === 1) {
file = files[0];
s = file.size;
if (fm.searchStatus.state === 2) {
path = fm.escape(file.path? file.path.replace(/\/[^\/]*$/, '') : '..');
dirs.push('<a href="#elf_'+file.phash+'" data-hash="'+file.hash+'" title="'+path+'">'+path+'</a>');
}
dirs.push(fm.escape(file.i18 || file.name));
sel.html(dirs.join('/') + (s > 0 ? ', '+fm.formatSize(s) : ''));
} else if (files.length) {
jQuery.each(files, function(i, file) {
c++;
s += parseInt(file.size)||0;
});
sel.html(c ? titlesel+': '+c+', '+titlesize+': '+fm.formatSize(s) : ' ');
} else {
sel.html('');
}
sel.attr('title', sel.text());
fm.trigger('uistatchange');
};
fm.getUI('statusbar').prepend(size).append(sel).show();
if (fm.UA.Mobile && jQuery.fn.tooltip) {
fm.getUI('statusbar').tooltip({
classes: {
'ui-tooltip': 'elfinder-ui-tooltip ui-widget-shadow'
},
tooltipClass: 'elfinder-ui-tooltip ui-widget-shadow',
track: true
});
}
fm
.bind('cwdhasheschange', function(e) {
setstat(jQuery.map(e.data, function(h) { return fm.file(h); }));
})
.change(function(e) {
var files = e.data.changed || [],
cwdHash = fm.cwd().hash;
jQuery.each(files, function() {
if (this.hash === cwdHash) {
if (this.size) {
size.children('.elfinder-stat-size').addClass('elfinder-stat-size-recursive').html(fm.i18n('sum')+': '+fm.formatSize(this.size));
size.attr('title', size.text());
}
return false;
}
});
})
.select(function() {
setSelect(fm.selectedFiles());
})
.bind('open', function() {
setSelect([]);
})
.bind('incsearch', function(e) {
setIncsearchStat(e.data);
})
.bind('incsearchend', function() {
setIncsearchStat();
})
;
});
};