GRAYBYTE WORDPRESS FILE MANAGER3161

Server IP : 198.54.121.189 / Your IP : 216.73.216.224
System : Linux premium69.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
PHP Version : 7.4.33
Disable Function : NONE
cURL : ON | WGET : ON | Sudo : OFF | Pkexec : OFF
Directory : /home/giriqfky/trustyourlawyer.com/wp-content/plugins/wp-file-manager/lib/js/commands/
Upload Files :
Current_dir [ Writeable ] Document_root [ Writeable ]

Command :


Current File : /home/giriqfky/trustyourlawyer.com/wp-content/plugins/wp-file-manager/lib/js/commands//sort.js
/**
 * @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>' : '') + '&nbsp;' + fm.i18n('sort'+name)]);
				}
			});
			self.variants.push('|');
			self.variants.push([
				'stick',
				(fm.sortStickFolders? '<span class="ui-icon ui-icon-check"></span>' : '') + '&nbsp;' + 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>' : '') + '&nbsp;' + 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();
		});
	};

};

[ Back ]
Name
Size
Last Modified
Owner / Group
Permissions
Options
..
--
July 10 2025 04:32:21
giriqfky / giriqfky
0755
.htaccess
0.41 KB
July 10 2025 04:32:21
giriqfky / giriqfky
0644
archive.js
2.471 KB
December 28 2021 14:26:10
giriqfky / giriqfky
0644
back.js
0.5 KB
May 14 2020 14:55:48
giriqfky / giriqfky
0644
chmod.js
9.366 KB
December 28 2021 14:26:10
giriqfky / giriqfky
0644
colwidth.js
0.469 KB
May 25 2020 10:48:08
giriqfky / giriqfky
0644
copy.js
0.963 KB
December 28 2021 14:26:10
giriqfky / giriqfky
0644
cut.js
1.119 KB
December 28 2021 14:26:10
giriqfky / giriqfky
0644
download.js
16.606 KB
December 28 2021 14:26:10
giriqfky / giriqfky
0644
duplicate.js
1.359 KB
December 28 2021 14:26:10
giriqfky / giriqfky
0644
edit.js
34.482 KB
April 19 2022 14:33:36
giriqfky / giriqfky
0644
empty.js
3.315 KB
December 28 2021 14:26:10
giriqfky / giriqfky
0644
extract.js
5.177 KB
December 28 2021 14:26:10
giriqfky / giriqfky
0644
forward.js
0.497 KB
May 14 2020 14:55:48
giriqfky / giriqfky
0644
fullscreen.js
1.049 KB
September 01 2020 13:09:26
giriqfky / giriqfky
0644
getfile.js
4.065 KB
December 28 2021 14:26:10
giriqfky / giriqfky
0644
help.js
14.206 KB
December 28 2021 14:26:10
giriqfky / giriqfky
0644
hidden.js
0.27 KB
May 14 2020 14:55:48
giriqfky / giriqfky
0644
hide.js
4.263 KB
May 25 2020 10:48:08
giriqfky / giriqfky
0644
home.js
0.516 KB
May 14 2020 14:55:48
giriqfky / giriqfky
0644
info.js
13.132 KB
April 19 2022 14:33:36
giriqfky / giriqfky
0644
mkdir.js
2.514 KB
December 28 2021 14:26:10
giriqfky / giriqfky
0644
mkfile.js
1.636 KB
April 19 2022 14:33:36
giriqfky / giriqfky
0644
netmount.js
10.431 KB
September 01 2020 13:09:26
giriqfky / giriqfky
0644
open.js
6.784 KB
December 28 2021 14:26:10
giriqfky / giriqfky
0644
opendir.js
0.865 KB
May 25 2020 10:48:08
giriqfky / giriqfky
0644
opennew.js
1.213 KB
May 25 2020 10:48:08
giriqfky / giriqfky
0644
paste.js
10.167 KB
May 25 2020 10:48:08
giriqfky / giriqfky
0644
places.js
0.755 KB
December 28 2021 14:26:10
giriqfky / giriqfky
0644
preference.js
21.367 KB
April 19 2022 14:33:36
giriqfky / giriqfky
0644
quicklook.js
23.872 KB
May 25 2020 10:48:08
giriqfky / giriqfky
0644
quicklook.plugins.js
58.508 KB
February 08 2021 12:11:18
giriqfky / giriqfky
0644
reload.js
1.859 KB
May 25 2020 10:48:08
giriqfky / giriqfky
0644
rename.js
15.917 KB
May 25 2020 10:48:08
giriqfky / giriqfky
0644
resize.js
52.169 KB
December 28 2021 14:26:10
giriqfky / giriqfky
0644
restore.js
7.446 KB
May 25 2020 10:48:08
giriqfky / giriqfky
0644
rm.js
14.416 KB
December 28 2021 14:26:10
giriqfky / giriqfky
0644
search.js
4.014 KB
May 25 2020 10:48:08
giriqfky / giriqfky
0644
selectall.js
0.592 KB
May 25 2020 10:48:08
giriqfky / giriqfky
0644
selectinvert.js
0.46 KB
May 25 2020 10:48:08
giriqfky / giriqfky
0644
selectnone.js
0.518 KB
May 25 2020 10:48:08
giriqfky / giriqfky
0644
sort.js
4.317 KB
May 25 2020 10:48:08
giriqfky / giriqfky
0644
undo.js
3.616 KB
May 25 2020 10:48:08
giriqfky / giriqfky
0644
up.js
0.693 KB
May 25 2020 10:48:08
giriqfky / giriqfky
0644
upload.js
12.398 KB
December 28 2021 14:26:10
giriqfky / giriqfky
0644
view.js
2.801 KB
May 25 2020 10:48:08
giriqfky / giriqfky
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025
CONTACT ME
Static GIF