| Server IP : 116.202.121.150 / Your IP : 216.73.217.103 Web Server : Apache System : Linux server5.febas.net 6.1.0-51-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.177-1 (2026-07-16) x86_64 User : k9887-1 ( 1171) PHP Version : 8.2.33 Disable Function : show_source, highlight_file, apache_child_terminate, apache_get_modules, apache_note, apache_setenv, virtual, dl, posix_getpwnam, posix_getpwuid, posix_mkfifo, posix_mknod, posix_setpgid, posix_setsid, posix_setuid, posix_uname, proc_nice, openlog, syslog, pfsockopen, system, shell_exec, passthru, popen, proc_open, exec MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /var/www/k9887-1/htdocs/_fisch/wp-content/plugins/kioken-blocks/widgets/js/ |
Upload File : |
jQuery(document).ready(function ($) {
"use strict";
var body = $('body');
var upl_btn = $('.btn_remove');
upl_btn.each(function() {
if ($(this).siblings('.image_src').val()) {
$(this).show();
}
});
/**
* Init Media Manager
*/
body.on('click', '.image_upl', function (e) {
e.preventDefault();
var button = $(this);
// Create new media manager instance
var frame = wp.media.frames.file_frame = wp.media({
title: translation.select_image,
button: {
text: translation.use_selected_image
},
library: {
type: 'image'
},
multiple: false
});
// Run callback when image selected
frame.on('select', function () {
var attachment = frame.state().get('selection').first().toJSON();
button.siblings('.image_src').val(attachment.id).trigger("change");
button.siblings('.kt_img_preview').attr('src', attachment.url);
button.siblings('.btn_remove').show();
});
// Open media manager
frame.open();
});
/**
* Remove selected image
*/
body.on('click', '.btn_remove', function (e) {
e.preventDefault();
var button = $(this);
button.siblings('.image_src').val('').trigger('change');
button.siblings('.kt_img_preview').attr('src', '');
button.hide();
});
});