| Server IP : 104.21.74.147 / 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 : |
/* eslint-disable no-undef */
/**
* 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>'
);
const 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) {
$(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) {
const 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);