HEX
Server: nginx/1.27.1
System: Linux in-4 5.15.0-131-generic #141-Ubuntu SMP Fri Jan 10 21:18:28 UTC 2025 x86_64
User: ilikadirect (1186)
PHP: 7.4.33
Disabled: exec,passthru,shell_exec,system,proc_open,popen,parse_ini_file,show_source
Upload Files
File: /storage/v6964/mangomitra/public_html/wp-content/plugins/hunk-companion/top-store/widget/widget.js
jQuery(document).ready( function($) {

function media_upload(button_class) {

        var _custom_media = true,

        _orig_send_attachment = wp.media.editor.send.attachment;



        $('body').on('click', button_class, function(e) {

            var button_id ='#'+$(this).attr('id');

            var self = $(button_id);

            var send_attachment_bkp = wp.media.editor.send.attachment;

            var button = $(button_id);

            var id = button.attr('id').replace('_button', '');

            _custom_media = true;

            wp.media.editor.send.attachment = function(props, attachment){

                if ( _custom_media  ) {
                   $('#'+id).val(attachment.url);
                   $('.custom_media_url#'+id).val(attachment.url).trigger('change');
                   $('.custom_media_image#'+id).attr('src',attachment.url).css('display','block');
                } else {

                    return _orig_send_attachment.apply( button_id, [props, attachment] );

                }

            }

            wp.media.editor.open(button);

                return false;

        });
    }
    media_upload('.custom_media_button.button');
    $(document).on( 'widget-added widget-updated ready', function() {
        $('#widgets-right .color-picker').each( function() {
            if ( ! $(this).data('wpWpColorPicker') ) {
                $(this).wpColorPicker( {
                    change: _.throttle(function() {
                        $(this).trigger( 'change' );
                    }, 3000)
                });
            }
        });
    });

});