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/ui
File: path.js
/**
[0] Fix | Delete
* @class elFinder ui
[1] Fix | Delete
* Display current folder path in statusbar.
[2] Fix | Delete
* Click on folder name in path - open folder
[3] Fix | Delete
*
[4] Fix | Delete
* @author Dmitry (dio) Levashov
[5] Fix | Delete
**/
[6] Fix | Delete
jQuery.fn.elfinderpath = function(fm, options) {
[7] Fix | Delete
"use strict";
[8] Fix | Delete
return this.each(function() {
[9] Fix | Delete
var query = '',
[10] Fix | Delete
target = '',
[11] Fix | Delete
mimes = [],
[12] Fix | Delete
place = 'statusbar',
[13] Fix | Delete
clHover= fm.res('class', 'hover'),
[14] Fix | Delete
prefix = 'path' + (elFinder.prototype.uniqueid? elFinder.prototype.uniqueid : '') + '-',
[15] Fix | Delete
wzbase = jQuery('<div class="ui-widget-header ui-helper-clearfix elfinder-workzone-path"></div>'),
[16] Fix | Delete
path = jQuery(this).addClass('elfinder-path').html('&nbsp;')
[17] Fix | Delete
.on('mousedown', 'span.elfinder-path-dir', function(e) {
[18] Fix | Delete
var hash = jQuery(this).attr('id').substr(prefix.length);
[19] Fix | Delete
e.preventDefault();
[20] Fix | Delete
if (hash != fm.cwd().hash) {
[21] Fix | Delete
jQuery(this).addClass(clHover);
[22] Fix | Delete
if (query) {
[23] Fix | Delete
fm.exec('search', query, { target: hash, mime: mimes.join(' ') });
[24] Fix | Delete
} else {
[25] Fix | Delete
fm.trigger('select', {selected : [hash]}).exec('open', hash);
[26] Fix | Delete
}
[27] Fix | Delete
}
[28] Fix | Delete
})
[29] Fix | Delete
.prependTo(fm.getUI('statusbar').show()),
[30] Fix | Delete
roots = jQuery('<div class="elfinder-path-roots"></div>').on('click', function(e) {
[31] Fix | Delete
e.stopPropagation();
[32] Fix | Delete
e.preventDefault();
[33] Fix | Delete
[34] Fix | Delete
var roots = jQuery.map(fm.roots, function(h) { return fm.file(h); }),
[35] Fix | Delete
raw = [];
[36] Fix | Delete
[37] Fix | Delete
jQuery.each(roots, function(i, f) {
[38] Fix | Delete
if (! f.phash && fm.root(fm.cwd().hash, true) !== f.hash) {
[39] Fix | Delete
raw.push({
[40] Fix | Delete
label : fm.escape(f.i18 || f.name),
[41] Fix | Delete
icon : 'home',
[42] Fix | Delete
callback : function() { fm.exec('open', f.hash); },
[43] Fix | Delete
options : {
[44] Fix | Delete
iconClass : f.csscls || '',
[45] Fix | Delete
iconImg : f.icon || ''
[46] Fix | Delete
}
[47] Fix | Delete
});
[48] Fix | Delete
}
[49] Fix | Delete
});
[50] Fix | Delete
fm.trigger('contextmenu', {
[51] Fix | Delete
raw: raw,
[52] Fix | Delete
x: e.pageX,
[53] Fix | Delete
y: e.pageY
[54] Fix | Delete
});
[55] Fix | Delete
}).append('<span class="elfinder-button-icon elfinder-button-icon-menu" ></span>').appendTo(wzbase),
[56] Fix | Delete
render = function(cwd) {
[57] Fix | Delete
var dirs = [],
[58] Fix | Delete
names = [];
[59] Fix | Delete
jQuery.each(fm.parents(cwd), function(i, hash) {
[60] Fix | Delete
var c = (cwd === hash)? 'elfinder-path-dir elfinder-path-cwd' : 'elfinder-path-dir',
[61] Fix | Delete
f = fm.file(hash),
[62] Fix | Delete
name = fm.escape(f.i18 || f.name);
[63] Fix | Delete
names.push(name);
[64] Fix | Delete
dirs.push('<span id="'+prefix+hash+'" class="'+c+'" title="'+names.join(fm.option('separator'))+'">'+name+'</span>');
[65] Fix | Delete
});
[66] Fix | Delete
return dirs.join('<span class="elfinder-path-other">'+fm.option('separator')+'</span>');
[67] Fix | Delete
},
[68] Fix | Delete
toWorkzone = function() {
[69] Fix | Delete
var prev;
[70] Fix | Delete
path.children('span.elfinder-path-dir').attr('style', '');
[71] Fix | Delete
prev = fm.direction === 'ltr'? jQuery('#'+prefix + fm.cwd().hash).prevAll('span.elfinder-path-dir:first') : jQuery();
[72] Fix | Delete
path.scrollLeft(prev.length? prev.position().left : 0);
[73] Fix | Delete
},
[74] Fix | Delete
fit = function() {
[75] Fix | Delete
if (fm.UA.CSS.flex) {
[76] Fix | Delete
return;
[77] Fix | Delete
}
[78] Fix | Delete
var dirs = path.children('span.elfinder-path-dir'),
[79] Fix | Delete
cnt = dirs.length,
[80] Fix | Delete
m, bg = 0, ids;
[81] Fix | Delete
[82] Fix | Delete
if (place === 'workzone' || cnt < 2) {
[83] Fix | Delete
dirs.attr('style', '');
[84] Fix | Delete
return;
[85] Fix | Delete
}
[86] Fix | Delete
path.width(path.css('max-width'));
[87] Fix | Delete
dirs.css({maxWidth: (100/cnt)+'%', display: 'inline-block'});
[88] Fix | Delete
m = path.width() - 9;
[89] Fix | Delete
path.children('span.elfinder-path-other').each(function() {
[90] Fix | Delete
m -= jQuery(this).width();
[91] Fix | Delete
});
[92] Fix | Delete
ids = [];
[93] Fix | Delete
dirs.each(function(i) {
[94] Fix | Delete
var dir = jQuery(this),
[95] Fix | Delete
w = dir.width();
[96] Fix | Delete
m -= w;
[97] Fix | Delete
if (w < this.scrollWidth) {
[98] Fix | Delete
ids.push(i);
[99] Fix | Delete
}
[100] Fix | Delete
});
[101] Fix | Delete
path.width('');
[102] Fix | Delete
if (ids.length) {
[103] Fix | Delete
if (m > 0) {
[104] Fix | Delete
m = m / ids.length;
[105] Fix | Delete
jQuery.each(ids, function(i, k) {
[106] Fix | Delete
var d = jQuery(dirs[k]);
[107] Fix | Delete
d.css('max-width', d.width() + m);
[108] Fix | Delete
});
[109] Fix | Delete
}
[110] Fix | Delete
dirs.last().attr('style', '');
[111] Fix | Delete
} else {
[112] Fix | Delete
dirs.attr('style', '');
[113] Fix | Delete
}
[114] Fix | Delete
},
[115] Fix | Delete
hasUiTree, hasUiStat;
[116] Fix | Delete
[117] Fix | Delete
fm.one('init', function() {
[118] Fix | Delete
hasUiTree = fm.getUI('tree').length;
[119] Fix | Delete
hasUiStat = fm.getUI('stat').length;
[120] Fix | Delete
if (! hasUiTree && options.toWorkzoneWithoutNavbar) {
[121] Fix | Delete
wzbase.append(path).insertBefore(fm.getUI('workzone'));
[122] Fix | Delete
place = 'workzone';
[123] Fix | Delete
fm.bind('open', toWorkzone)
[124] Fix | Delete
.one('opendone', function() {
[125] Fix | Delete
fm.getUI().trigger('resize');
[126] Fix | Delete
});
[127] Fix | Delete
}
[128] Fix | Delete
})
[129] Fix | Delete
.bind('open searchend parents', function() {
[130] Fix | Delete
var dirs = [];
[131] Fix | Delete
[132] Fix | Delete
query = '';
[133] Fix | Delete
target = '';
[134] Fix | Delete
mimes = [];
[135] Fix | Delete
[136] Fix | Delete
path.html(render(fm.cwd().hash));
[137] Fix | Delete
if (Object.keys(fm.roots).length > 1) {
[138] Fix | Delete
path.css('margin', '');
[139] Fix | Delete
roots.show();
[140] Fix | Delete
} else {
[141] Fix | Delete
path.css('margin', 0);
[142] Fix | Delete
roots.hide();
[143] Fix | Delete
}
[144] Fix | Delete
!hasUiStat && fit();
[145] Fix | Delete
})
[146] Fix | Delete
.bind('searchstart', function(e) {
[147] Fix | Delete
if (e.data) {
[148] Fix | Delete
query = e.data.query || '';
[149] Fix | Delete
target = e.data.target || '';
[150] Fix | Delete
mimes = e.data.mimes || [];
[151] Fix | Delete
}
[152] Fix | Delete
})
[153] Fix | Delete
.bind('search', function(e) {
[154] Fix | Delete
var dirs = [],
[155] Fix | Delete
html = '';
[156] Fix | Delete
if (target) {
[157] Fix | Delete
html = render(target);
[158] Fix | Delete
} else {
[159] Fix | Delete
html = fm.i18n('btnAll');
[160] Fix | Delete
}
[161] Fix | Delete
path.html('<span class="elfinder-path-other">'+fm.i18n('searcresult') + ': </span>' + html);
[162] Fix | Delete
fit();
[163] Fix | Delete
})
[164] Fix | Delete
// on swipe to navbar show/hide
[165] Fix | Delete
.bind('navbarshow navbarhide', function() {
[166] Fix | Delete
var wz = fm.getUI('workzone');
[167] Fix | Delete
if (this.type === 'navbarshow') {
[168] Fix | Delete
fm.unbind('open', toWorkzone);
[169] Fix | Delete
path.prependTo(fm.getUI('statusbar'));
[170] Fix | Delete
wzbase.detach();
[171] Fix | Delete
place = 'statusbar';
[172] Fix | Delete
} else {
[173] Fix | Delete
wzbase.append(path).insertBefore(wz);
[174] Fix | Delete
place = 'workzone';
[175] Fix | Delete
toWorkzone();
[176] Fix | Delete
fm.bind('open', toWorkzone);
[177] Fix | Delete
}
[178] Fix | Delete
fm.trigger('uiresize');
[179] Fix | Delete
})
[180] Fix | Delete
.bind('resize uistatchange', fit);
[181] Fix | Delete
});
[182] Fix | Delete
};
[183] Fix | Delete
[184] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function