__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
/**
* @class elFinder command "hide".
* folders/files to hide as personal setting.
*
* @type elFinder.command
* @author Naoki Sawada
*/
elFinder.prototype.commands.hide = function() {
"use strict";
var self = this,
nameCache = {},
hideData, hideCnt, cMenuType, sOrigin;
this.syncTitleOnChange = true;
this.shortcuts = [{
pattern : 'ctrl+shift+dot',
description : this.fm.i18n('toggleHidden')
}];
this.init = function() {
var fm = this.fm;
hideData = fm.storage('hide') || {items: {}};
hideCnt = Object.keys(hideData.items).length;
this.title = fm.i18n(hideData.show? 'hideHidden' : 'showHidden');
self.update(void(0), self.title);
};
this.fm.bind('select contextmenucreate closecontextmenu', function(e, fm) {
var sel = (e.data? (e.data.selected || e.data.targets) : null) || fm.selected();
if (e.type === 'select' && e.data) {
sOrigin = e.data.origin;
} else if (e.type === 'contextmenucreate') {
cMenuType = e.data.type;
}
if (!sel.length || (((e.type !== 'contextmenucreate' && sOrigin !== 'navbar') || cMenuType === 'cwd') && sel[0] === fm.cwd().hash)) {
self.title = fm.i18n(hideData.show? 'hideHidden' : 'showHidden');
} else {
self.title = fm.i18n('cmdhide');
}
if (e.type !== 'closecontextmenu') {
self.update(cMenuType === 'cwd'? (hideCnt? 0 : -1) : void(0), self.title);
} else {
cMenuType = '';
requestAnimationFrame(function() {
self.update(void(0), self.title);
});
}
});
this.getstate = function(sel) {
return (this.fm.cookieEnabled && cMenuType !== 'cwd' && (sel || this.fm.selected()).length) || hideCnt? 0 : -1;
};
this.exec = function(hashes, opts) {
var fm = this.fm,
dfrd = jQuery.Deferred()
.done(function() {
fm.trigger('hide', {items: items, opts: opts});
})
.fail(function(error) {
fm.error(error);
}),
o = opts || {},
items = o.targets? o.targets : (hashes || fm.selected()),
added = [],
removed = [],
notifyto, files, res;
hideData = fm.storage('hide') || {};
if (!jQuery.isPlainObject(hideData)) {
hideData = {};
}
if (!jQuery.isPlainObject(hideData.items)) {
hideData.items = {};
}
if (opts._currentType === 'shortcut' || !items.length || (opts._currentType !== 'navbar' && sOrigin !=='navbar' && items[0] === fm.cwd().hash)) {
if (hideData.show) {
o.hide = true;
} else if (Object.keys(hideData.items).length) {
o.show = true;
}
}
if (o.reset) {
o.show = true;
hideCnt = 0;
}
if (o.show || o.hide) {
if (o.show) {
hideData.show = true;
} else {
delete hideData.show;
}
if (o.show) {
fm.storage('hide', o.reset? null : hideData);
self.title = fm.i18n('hideHidden');
self.update(o.reset? -1 : void(0), self.title);
jQuery.each(hideData.items, function(h) {
var f = fm.file(h, true);
if (f && (fm.searchStatus.state || !f.phash || fm.file(f.phash))) {
added.push(f);
}
});
if (added.length) {
fm.updateCache({added: added});
fm.add({added: added});
}
if (o.reset) {
hideData = {items: {}};
}
return dfrd.resolve();
}
items = Object.keys(hideData.items);
}
if (items.length) {
jQuery.each(items, function(i, h) {
var f;
if (!hideData.items[h]) {
f = fm.file(h);
if (f) {
nameCache[h] = f.i18 || f.name;
}
hideData.items[h] = nameCache[h]? nameCache[h] : h;
}
});
hideCnt = Object.keys(hideData.items).length;
files = this.files(items);
fm.storage('hide', hideData);
fm.remove({removed: items});
if (hideData.show) {
this.exec(void(0), {hide: true});
}
if (!o.hide) {
res = {};
res.undo = {
cmd : 'hide',
callback : function() {
var nData = fm.storage('hide');
if (nData) {
jQuery.each(items, function(i, h) {
delete nData.items[h];
});
hideCnt = Object.keys(nData.items).length;
fm.storage('hide', nData);
fm.trigger('hide', {items: items, opts: {}});
self.update(hideCnt? 0 : -1);
}
fm.updateCache({added: files});
fm.add({added: files});
}
};
res.redo = {
cmd : 'hide',
callback : function() {
return fm.exec('hide', void(0), {targets: items});
}
};
}
}
return dfrd.state() == 'rejected' ? dfrd : dfrd.resolve(res);
};
};
| 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 |
|