403Webshell
Server IP : 172.67.159.97  /  Your IP : 216.73.217.154
Web Server : nginx/1.24.0
System : Linux wordpress-sites 6.8.0-134-generic #134-Ubuntu SMP PREEMPT_DYNAMIC Fri Jun 26 18:43:11 UTC 2026 x86_64
User : www-data ( 33)
PHP Version : 8.1.34
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /var/www/rebeccaone.com/wp-content/plugins/soliloquy/assets/js/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/rebeccaone.com/wp-content/plugins/soliloquy/assets/js//media-insert.js
/**
 * Creates and handles a wp.media instance for soliloquy Galleries, allowing
 * the user to insert images from the Media Library into their Gallery
 */
jQuery(document).ready(function ($) {
	// Add Images
	$('a.soliloquy-media-library').on('click', function (e) {
		// Prevent default action
		e.preventDefault();

		// If the wp.media.frames.soliloquy instance already exists, reopen it
		if (wp.media.frames.soliloquy) {
			wp.media.frames.soliloquy.open();

			return;
		} else {
			// Create the wp.media.frames.soliloquy instance (one time)
			wp.media.frames.soliloquy = wp.media({
				frame: 'post',
				title: wp.media.view.l10n.insertIntoPost,
				library: {
					type: ['image']
				},
				button: {
					text: wp.media.view.l10n.insertIntoPost
				},
				multiple: true
			});
		}

		// Mark existing Gallery images as selected when the modal is opened
		wp.media.frames.soliloquy.on('open', function () {
			// Get any previously selected images
			const selection = wp.media.frames.soliloquy.state().get('selection');

			if (typeof selection !== 'undefined') {
				// Get images that already exist in the gallery, and select each one in the modal
				$('ul#soliloquy-output li').each(function () {
					const attachment = wp.media.attachment($(this).attr('id'));

					selection.add(attachment ? [attachment] : []);
				});
			}
		});

		//Trigger Event when the frame is ready.
		wp.media.frames.soliloquy.on('ready', function (e) {});
		// Insert into Gallery Button Clicked
		wp.media.frames.soliloquy.on('insert', function (selection) {
			// Get state
			const state = wp.media.frames.soliloquy.state(),
				images = [];

			// Iterate through selected images, building an images array
			selection.each(function (attachment) {
				// Get the chosen options for this image (size, alignment, link type, link URL)
				const display = state.display(attachment).toJSON(),
					type = attachment.get('type');

				// Change the image link parameter based on the "Link To" setting the user chose in the media view
				switch (display.link) {
					case 'none':
						attachment.set('link', '');
						break;
					case 'file':
						attachment.set('link', attachment.get('url'));
						break;
					case 'post':
						// Already linked to post by default
						break;
					case 'custom':
						attachment.set('link', display.linkUrl);
						break;
				}

				//Only allow images selections to be inserted
				if (type === 'image') {
					// Add the image to the images array
					images.push(attachment.toJSON());
				}
			}, this);
			// Send the ajax request with our data to be processed.
			$.post(
				soliloquy_metabox.ajax,
				{
					action: 'soliloquy_insert_slides',
					nonce: soliloquy_metabox.insert_nonce,
					post_id: soliloquy_metabox.id,
					images: JSON.stringify(images)
				},
				function (response) {
					// Response should be a JSON success with the HTML for the image grid
					if (response) {
						// Set the image grid to the HTML we received
						$('#soliloquy-output').html(response.data);

						// Repopulate the Soliloquy Slide Collection
						SoliloquySlidesUpdate();

						$(document).trigger('insertSlides');
					}
				},
				'json'
			);
		});

		// Open the media frame
		wp.media.frames.soliloquy.open();
		// Remove the 'Create Gallery' left hand menu item in the modal, as we don't
		// want users inserting galleries!
		// Remove the 'Create Gallery' left hand menu item in the modal, as we don't
		// want users inserting galleries!
		$('div.media-menu #menu-item-gallery').css('display', 'none');
		$('div.media-menu #menu-item-embed').css('display', 'none');
		$('div.media-menu #menu-item-playlist').css('display', 'none');
		$('div.media-menu #menu-item-video-playlist').css('display', 'none');
		$('div.media-menu #menu-item-featured-image').css('display', 'none');

		return;
	});
});

Youez - 2016 - github.com/yon3zu
LinuXploit