Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../httpdocs/wp-conte.../plugins/wp-file-.../lib/js/commands
File: sort.js
/**
[0] Fix | Delete
* @class elFinder command "sort"
[1] Fix | Delete
* Change sort files rule
[2] Fix | Delete
*
[3] Fix | Delete
* @author Dmitry (dio) Levashov
[4] Fix | Delete
**/
[5] Fix | Delete
elFinder.prototype.commands.sort = function() {
[6] Fix | Delete
"use strict";
[7] Fix | Delete
var self = this,
[8] Fix | Delete
fm = self.fm,
[9] Fix | Delete
setVar = function() {
[10] Fix | Delete
self.variants = [];
[11] Fix | Delete
jQuery.each(fm.sortRules, function(name, value) {
[12] Fix | Delete
if (fm.sorters[name]) {
[13] Fix | Delete
var arr = (name === fm.sortType)? (fm.sortOrder === 'asc'? 'n' : 's') : '';
[14] Fix | Delete
self.variants.push([name, (arr? '<span class="ui-icon ui-icon-arrowthick-1-'+arr+'"></span>' : '') + '&nbsp;' + fm.i18n('sort'+name)]);
[15] Fix | Delete
}
[16] Fix | Delete
});
[17] Fix | Delete
self.variants.push('|');
[18] Fix | Delete
self.variants.push([
[19] Fix | Delete
'stick',
[20] Fix | Delete
(fm.sortStickFolders? '<span class="ui-icon ui-icon-check"></span>' : '') + '&nbsp;' + fm.i18n('sortFoldersFirst')
[21] Fix | Delete
]);
[22] Fix | Delete
if (fm.ui.tree && fm.options.sortAlsoTreeview !== null) {
[23] Fix | Delete
self.variants.push('|');
[24] Fix | Delete
self.variants.push([
[25] Fix | Delete
'tree',
[26] Fix | Delete
(fm.sortAlsoTreeview? '<span class="ui-icon ui-icon-check"></span>' : '') + '&nbsp;' + fm.i18n('sortAlsoTreeview')
[27] Fix | Delete
]);
[28] Fix | Delete
}
[29] Fix | Delete
updateContextmenu();
[30] Fix | Delete
},
[31] Fix | Delete
updateContextmenu = function() {
[32] Fix | Delete
var cm = fm.getUI('contextmenu'),
[33] Fix | Delete
icon, sub;
[34] Fix | Delete
if (cm.is(':visible')) {
[35] Fix | Delete
icon = cm.find('span.elfinder-button-icon-sort');
[36] Fix | Delete
sub = icon.siblings('div.elfinder-contextmenu-sub');
[37] Fix | Delete
sub.find('span.ui-icon').remove();
[38] Fix | Delete
sub.children('div.elfinder-contextsubmenu-item').each(function() {
[39] Fix | Delete
var tgt = jQuery(this).children('span'),
[40] Fix | Delete
name = tgt.text().trim(),
[41] Fix | Delete
arr;
[42] Fix | Delete
if (name === (i18Name.stick || (i18Name.stick = fm.i18n('sortFoldersFirst')))) {
[43] Fix | Delete
if (fm.sortStickFolders) {
[44] Fix | Delete
tgt.prepend('<span class="ui-icon ui-icon-check"></span>');
[45] Fix | Delete
}
[46] Fix | Delete
} else if (name === (i18Name.tree || (i18Name.tree = fm.i18n('sortAlsoTreeview')))) {
[47] Fix | Delete
if (fm.sortAlsoTreeview) {
[48] Fix | Delete
tgt.prepend('<span class="ui-icon ui-icon-check"></span>');
[49] Fix | Delete
}
[50] Fix | Delete
} else if (name === (i18Name[fm.sortType] || (i18Name[fm.sortType] = fm.i18n('sort' + fm.sortType)))) {
[51] Fix | Delete
arr = fm.sortOrder === 'asc'? 'n' : 's';
[52] Fix | Delete
tgt.prepend('<span class="ui-icon ui-icon-arrowthick-1-'+arr+'"></span>');
[53] Fix | Delete
}
[54] Fix | Delete
});
[55] Fix | Delete
}
[56] Fix | Delete
},
[57] Fix | Delete
i18Name = {};
[58] Fix | Delete
[59] Fix | Delete
/**
[60] Fix | Delete
* Command options
[61] Fix | Delete
*
[62] Fix | Delete
* @type Object
[63] Fix | Delete
*/
[64] Fix | Delete
this.options = {ui : 'sortbutton'};
[65] Fix | Delete
[66] Fix | Delete
this.keepContextmenu = true;
[67] Fix | Delete
[68] Fix | Delete
fm.bind('sortchange', setVar)
[69] Fix | Delete
.bind('sorterupdate', function() {
[70] Fix | Delete
setVar();
[71] Fix | Delete
fm.getUI().children('.elfinder-button-sort-menu').children('.elfinder-button-menu-item').each(function() {
[72] Fix | Delete
var tgt = jQuery(this),
[73] Fix | Delete
rel = tgt.attr('rel');
[74] Fix | Delete
tgt.toggle(!!(! rel || fm.sorters[rel]));
[75] Fix | Delete
});
[76] Fix | Delete
})
[77] Fix | Delete
.bind('cwdrender', function() {
[78] Fix | Delete
var cols = jQuery(fm.cwd).find('div.elfinder-cwd-wrapper-list table');
[79] Fix | Delete
if (cols.length) {
[80] Fix | Delete
jQuery.each(fm.sortRules, function(name, value) {
[81] Fix | Delete
var td = cols.find('thead tr td.elfinder-cwd-view-th-'+name);
[82] Fix | Delete
if (td.length) {
[83] Fix | Delete
var current = ( name == fm.sortType),
[84] Fix | Delete
sort = {
[85] Fix | Delete
type : name,
[86] Fix | Delete
order : current ? fm.sortOrder == 'asc' ? 'desc' : 'asc' : fm.sortOrder
[87] Fix | Delete
},arr;
[88] Fix | Delete
if (current) {
[89] Fix | Delete
td.addClass('ui-state-active');
[90] Fix | Delete
arr = fm.sortOrder == 'asc' ? 'n' : 's';
[91] Fix | Delete
jQuery('<span class="ui-icon ui-icon-triangle-1-'+arr+'"></span>').appendTo(td);
[92] Fix | Delete
}
[93] Fix | Delete
jQuery(td).on('click', function(e){
[94] Fix | Delete
if (! jQuery(this).data('dragging')) {
[95] Fix | Delete
e.stopPropagation();
[96] Fix | Delete
if (! fm.getUI('cwd').data('longtap')) {
[97] Fix | Delete
fm.exec('sort', [], sort);
[98] Fix | Delete
}
[99] Fix | Delete
}
[100] Fix | Delete
})
[101] Fix | Delete
.on('mouseenter mouseleave', function(e) {
[102] Fix | Delete
jQuery(this).toggleClass('ui-state-hover', e.type === 'mouseenter');
[103] Fix | Delete
});
[104] Fix | Delete
}
[105] Fix | Delete
[106] Fix | Delete
});
[107] Fix | Delete
}
[108] Fix | Delete
});
[109] Fix | Delete
[110] Fix | Delete
this.getstate = function() {
[111] Fix | Delete
return 0;
[112] Fix | Delete
};
[113] Fix | Delete
[114] Fix | Delete
this.exec = function(hashes, cOpt) {
[115] Fix | Delete
var fm = this.fm,
[116] Fix | Delete
sortopt = jQuery.isPlainObject(cOpt)? cOpt : (function() {
[117] Fix | Delete
cOpt += '';
[118] Fix | Delete
var sOpts = {};
[119] Fix | Delete
if (cOpt === 'stick') {
[120] Fix | Delete
sOpts.stick = !fm.sortStickFolders;
[121] Fix | Delete
} else if (cOpt === 'tree') {
[122] Fix | Delete
sOpts.tree = !fm.sortAlsoTreeview;
[123] Fix | Delete
} else if (fm.sorters[cOpt]) {
[124] Fix | Delete
if (fm.sortType === cOpt) {
[125] Fix | Delete
sOpts.order = fm.sortOrder === 'asc'? 'desc' : 'asc';
[126] Fix | Delete
} else {
[127] Fix | Delete
sOpts.type = cOpt;
[128] Fix | Delete
}
[129] Fix | Delete
}
[130] Fix | Delete
return sOpts;
[131] Fix | Delete
})(),
[132] Fix | Delete
sort = Object.assign({
[133] Fix | Delete
type : fm.sortType,
[134] Fix | Delete
order : fm.sortOrder,
[135] Fix | Delete
stick : fm.sortStickFolders,
[136] Fix | Delete
tree : fm.sortAlsoTreeview
[137] Fix | Delete
}, sortopt);
[138] Fix | Delete
[139] Fix | Delete
return fm.lazy(function() {
[140] Fix | Delete
fm.setSort(sort.type, sort.order, sort.stick, sort.tree);
[141] Fix | Delete
this.resolve();
[142] Fix | Delete
});
[143] Fix | Delete
};
[144] Fix | Delete
[145] Fix | Delete
};
[146] Fix | Delete
[147] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function