__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
/**
* @class elFinder command "sort"
* Change sort files rule
*
* @author Dmitry (dio) Levashov
**/
elFinder.prototype.commands.sort = function() {
"use strict";
var self = this,
fm = self.fm,
setVar = function() {
self.variants = [];
jQuery.each(fm.sortRules, function(name, value) {
if (fm.sorters[name]) {
var arr = (name === fm.sortType)? (fm.sortOrder === 'asc'? 'n' : 's') : '';
self.variants.push([name, (arr? '<span class="ui-icon ui-icon-arrowthick-1-'+arr+'"></span>' : '') + ' ' + fm.i18n('sort'+name)]);
}
});
self.variants.push('|');
self.variants.push([
'stick',
(fm.sortStickFolders? '<span class="ui-icon ui-icon-check"></span>' : '') + ' ' + fm.i18n('sortFoldersFirst')
]);
if (fm.ui.tree && fm.options.sortAlsoTreeview !== null) {
self.variants.push('|');
self.variants.push([
'tree',
(fm.sortAlsoTreeview? '<span class="ui-icon ui-icon-check"></span>' : '') + ' ' + fm.i18n('sortAlsoTreeview')
]);
}
updateContextmenu();
},
updateContextmenu = function() {
var cm = fm.getUI('contextmenu'),
icon, sub;
if (cm.is(':visible')) {
icon = cm.find('span.elfinder-button-icon-sort');
sub = icon.siblings('div.elfinder-contextmenu-sub');
sub.find('span.ui-icon').remove();
sub.children('div.elfinder-contextsubmenu-item').each(function() {
var tgt = jQuery(this).children('span'),
name = tgt.text().trim(),
arr;
if (name === (i18Name.stick || (i18Name.stick = fm.i18n('sortFoldersFirst')))) {
if (fm.sortStickFolders) {
tgt.prepend('<span class="ui-icon ui-icon-check"></span>');
}
} else if (name === (i18Name.tree || (i18Name.tree = fm.i18n('sortAlsoTreeview')))) {
if (fm.sortAlsoTreeview) {
tgt.prepend('<span class="ui-icon ui-icon-check"></span>');
}
} else if (name === (i18Name[fm.sortType] || (i18Name[fm.sortType] = fm.i18n('sort' + fm.sortType)))) {
arr = fm.sortOrder === 'asc'? 'n' : 's';
tgt.prepend('<span class="ui-icon ui-icon-arrowthick-1-'+arr+'"></span>');
}
});
}
},
i18Name = {};
/**
* Command options
*
* @type Object
*/
this.options = {ui : 'sortbutton'};
this.keepContextmenu = true;
fm.bind('sortchange', setVar)
.bind('sorterupdate', function() {
setVar();
fm.getUI().children('.elfinder-button-sort-menu').children('.elfinder-button-menu-item').each(function() {
var tgt = jQuery(this),
rel = tgt.attr('rel');
tgt.toggle(!!(! rel || fm.sorters[rel]));
});
})
.bind('cwdrender', function() {
var cols = jQuery(fm.cwd).find('div.elfinder-cwd-wrapper-list table');
if (cols.length) {
jQuery.each(fm.sortRules, function(name, value) {
var td = cols.find('thead tr td.elfinder-cwd-view-th-'+name);
if (td.length) {
var current = ( name == fm.sortType),
sort = {
type : name,
order : current ? fm.sortOrder == 'asc' ? 'desc' : 'asc' : fm.sortOrder
},arr;
if (current) {
td.addClass('ui-state-active');
arr = fm.sortOrder == 'asc' ? 'n' : 's';
jQuery('<span class="ui-icon ui-icon-triangle-1-'+arr+'"></span>').appendTo(td);
}
jQuery(td).on('click', function(e){
if (! jQuery(this).data('dragging')) {
e.stopPropagation();
if (! fm.getUI('cwd').data('longtap')) {
fm.exec('sort', [], sort);
}
}
})
.on('mouseenter mouseleave', function(e) {
jQuery(this).toggleClass('ui-state-hover', e.type === 'mouseenter');
});
}
});
}
});
this.getstate = function() {
return 0;
};
this.exec = function(hashes, cOpt) {
var fm = this.fm,
sortopt = jQuery.isPlainObject(cOpt)? cOpt : (function() {
cOpt += '';
var sOpts = {};
if (cOpt === 'stick') {
sOpts.stick = !fm.sortStickFolders;
} else if (cOpt === 'tree') {
sOpts.tree = !fm.sortAlsoTreeview;
} else if (fm.sorters[cOpt]) {
if (fm.sortType === cOpt) {
sOpts.order = fm.sortOrder === 'asc'? 'desc' : 'asc';
} else {
sOpts.type = cOpt;
}
}
return sOpts;
})(),
sort = Object.assign({
type : fm.sortType,
order : fm.sortOrder,
stick : fm.sortStickFolders,
tree : fm.sortAlsoTreeview
}, sortopt);
return fm.lazy(function() {
fm.setSort(sort.type, sort.order, sort.stick, sort.tree);
this.resolve();
});
};
};
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| archive.js | File | 2.47 KB | 0640 |
|
| back.js | File | 512 B | 0640 |
|
| chmod.js | File | 9.37 KB | 0640 |
|
| colwidth.js | File | 480 B | 0640 |
|
| copy.js | File | 986 B | 0640 |
|
| cut.js | File | 1.12 KB | 0640 |
|
| download.js | File | 16.61 KB | 0640 |
|
| duplicate.js | File | 1.36 KB | 0640 |
|
| edit.js | File | 34.48 KB | 0640 |
|
| empty.js | File | 3.32 KB | 0640 |
|
| extract.js | File | 5.18 KB | 0640 |
|
| forward.js | File | 509 B | 0640 |
|
| fullscreen.js | File | 1.05 KB | 0640 |
|
| getfile.js | File | 4.07 KB | 0640 |
|
| help.js | File | 14.21 KB | 0640 |
|
| hidden.js | File | 276 B | 0640 |
|
| hide.js | File | 4.26 KB | 0640 |
|
| home.js | File | 528 B | 0640 |
|
| info.js | File | 13.13 KB | 0640 |
|
| mkdir.js | File | 2.51 KB | 0640 |
|
| mkfile.js | File | 1.64 KB | 0640 |
|
| netmount.js | File | 10.43 KB | 0640 |
|
| open.js | File | 6.78 KB | 0640 |
|
| opendir.js | File | 886 B | 0640 |
|
| opennew.js | File | 1.21 KB | 0640 |
|
| paste.js | File | 10.17 KB | 0640 |
|
| places.js | File | 773 B | 0640 |
|
| preference.js | File | 21.37 KB | 0640 |
|
| quicklook.js | File | 23.87 KB | 0640 |
|
| quicklook.plugins.js | File | 58.51 KB | 0640 |
|
| reload.js | File | 1.86 KB | 0640 |
|
| rename.js | File | 15.92 KB | 0640 |
|
| resize.js | File | 52.17 KB | 0640 |
|
| restore.js | File | 7.45 KB | 0640 |
|
| rm.js | File | 14.42 KB | 0640 |
|
| search.js | File | 4.01 KB | 0640 |
|
| selectall.js | File | 606 B | 0640 |
|
| selectinvert.js | File | 471 B | 0640 |
|
| selectnone.js | File | 530 B | 0640 |
|
| sort.js | File | 4.32 KB | 0640 |
|
| undo.js | File | 3.62 KB | 0640 |
|
| up.js | File | 710 B | 0640 |
|
| upload.js | File | 12.4 KB | 0640 |
|
| view.js | File | 2.8 KB | 0640 |
|