HEX
Server: Apache/2.4.59 (Debian)
System: Linux emory.shared.1984.is 6.1.0-27-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.115-1 (2024-11-01) x86_64
User: u11574 (1020)
PHP: 7.4.33
Disabled: exec,system,passthru,shell_exec,popen,show_source,shell,symlink,proc_open,pcntl_exec,pcntl_fork,pcntl_wait,pcntl_alarm,pcntl_signal,pcntl_signal_dispatch,pcntl_getpriority,proc_get_status,expect_popen,dl,putenv,mail
Upload Files
File: /var/www/virtual/mariaellingsen.com/htdocs/wp-content/plugins/soliloquy/assets/js/media-upload.js
/**
 * Hooks into the global Plupload instance ('uploader'), which is set when includes/admin/metaboxes.php calls media_form()
 * We hook into this global instance and apply our own changes during and after the upload.
 *
 * @since 1.3.1.3
 */
(function ($, window, document, soliloquy_media_uploader) {
	$(function () {
		if (typeof uploader !== 'undefined') {

			function isHeicUploadable(file) {
				if (file.name.toLowerCase().endsWith('.heic') && !soliloquy_media_uploader.is_imagick_enabled) {
					return false
				}
				return true
			}

			//soliloquy_media_uploader.uploader_files_computer
			$('input#plupload-browse-button').val(
				soliloquy_media_uploader.uploader_files_computer,
			);
			$('.drag-drop-info').text(
				soliloquy_media_uploader.uploader_info_text,
			);

			// Set a custom progress bar
			$('#soliloquy .drag-drop-inside').append(
				'<div class="soliloquy-progress-bar"><div></div></div>',
			);
			var soliloquy_bar = $('#soliloquy .soliloquy-progress-bar'),
				soliloquy_progress = $(
					'#soliloquy .soliloquy-progress-bar div',
				),
				soliloquy_output = $('#soliloquy-output');

			// Files Added for Uploading
			uploader.bind('FilesAdded', function (up, files) {
				up.files = files;
				$(soliloquy_bar).fadeIn();
			});

			uploader.bind('BeforeUpload', function(up, file) {
				if (!isHeicUploadable(file)) {
					$('#soliloquy-upload-error').html(
						`<div class="error fade"><p>${soliloquy_media_uploader.heic_error_text}</p></div>`
					);
					return false
				}
			});

			// File Uploading - show progress bar
			uploader.bind('UploadProgress', function (up, file) {
				$(soliloquy_progress).css({
					width: up.total.percent + '%',
				});
			});

			// File Uploaded - AJAX call to process image and add to screen.
			uploader.bind('FileUploaded', function (up, file, info) {
				// AJAX call to soliloquy to store the newly uploaded image in the meta against this Gallery
				$.post(
					soliloquy_media_uploader.ajax,
					{
						action: 'soliloquy_load_image',
						nonce: soliloquy_media_uploader.load_image,
						id: info.response,
						post_id: soliloquy_media_uploader.id,
					},
					function (res) {
						// Prepend or append the new image to the existing grid of images,
						// depending on the media_position setting
						switch (soliloquy_media_uploader.media_position) {
							case 'before':
								$(soliloquy_output).prepend(res);
								break;
							case 'after':
							default:
								$(soliloquy_output).append(res);
								break;
						}

						$(document).trigger('soliloquyUploaded');

						$(res)
							.find('.wp-editor-container')
							.each(function (i, el) {
								var id = $(el).attr('id').split('-')[4];
								quicktags({
									id: 'soliloquy-caption-' + id,
									buttons: 'strong,em,link,ul,ol,li,close',
								});
								QTags._buttonsInit(); // Force buttons to initialize.
							});

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

			// Files Uploaded
			uploader.bind('UploadComplete', function () {
				// Hide Progress Bar
				$(soliloquy_bar).fadeOut();
			});

			// File Upload Error
			uploader.bind('Error', function (up, err) {
				// Show message
				$('#soliloquy-upload-error').html(
					'<div class="error fade"><p>' +
					err.file.name +
					': ' +
					err.message +
					'</p></div>',
				);
				up.refresh();
			});
		}
	});
})(jQuery, window, document, soliloquy_media_uploader);