HEX
Server: Apache
System: Linux 162-240-236-42.bluehost.com 3.10.0-1160.114.2.el7.x86_64 #1 SMP Wed Mar 20 15:54:52 UTC 2024 x86_64
User: bt667 (1004)
PHP: 8.2.29
Disabled: NONE
Upload Files
File: /home/bt667/public_html/wp-content/plugins/mvp_upselling/public/main.js
(function($) {

    $(document).ready(function() {

        jQuery(".mvp_upseller_add_to_cart_button").on('click', function(e) {

            e.preventDefault();

            var product_id  = jQuery(this).attr('data-product_id');

            var product_name  = jQuery(this).attr('data-product_name');

            var product_price  = jQuery(this).attr('data-product_price');

            var product_quantity  = 1;

            $('.added_to_cart').remove();

            jQuery.ajax({

                url: mvp_upsellinbg_frontend_ajax_object.ajax_url,

                type: 'post',

                data:"action=mvp_upseller_addtocart&product_id="+product_id+"&product_name="+product_name+'&product_price='+product_price+'&product_quantity='+product_quantity,

                success: function(response) {

                    var result = JSON.parse(response);

                    console.log(result.success);

                    if(result.success == 1){

                        //$('#mvp_upseller_add_to_cart_button_'+product_id).after('<a href="'+result.agency_url+'" class="added_to_cart wc-forward" title="View cart">View cart</a>');

                        $('.success-container').removeClass('hide');

                        $('.success-container').addClass('show');

                        //$('html, body').animate({ scrollTop: 0 }, 'slow');

                    }

                }

            })

        })

        $('.popup-close').on('click', function() {

            $('.success-container').removeClass('show');

            $('.success-container').addClass('hide');

        });



        jQuery('form#mvp_aweber_form_upselling').on('submit',function(event){

            event.preventDefault();

            var name  = jQuery('.awf_field_text').val();

            var email  = jQuery('.awf_field_email').val();

            if(name ==''){

                jQuery('#awf_field-114827845').after('<span class="text_danger">Name is empty!</span>');

            }

            if(email ==''){

                jQuery('#awf_field-114827846').after('<span class="text_danger">Email is empty!</span>');

            }

            jQuery('.submit').before('<span class="text_success" id="subscriber_loader">Please wait!!</span>');

            jQuery('#presentation_setting_button_submit').attr('disabled', 'disabled');

            if (jQuery(document.body).find(".edd-loading").length == 0) {
                jQuery(document.body).append(
                    '<div class="edd-fullscreen-loader" style="position:fixed;top:0;left:0;width:100%;height:100%;                            background:rgba(0,0,0,0.5);z-index:9999;display:flex;align-items:center;justify-content:center;">' +
                        '<span class="edd-loading" style="width:40px;height:40px;border:4px solid #fff;border-top:4px solid transparent;border-radius:50%;animation:spin 1s linear infinite; opacity:1 !important;"></span>' +
                    "</div>"
                );
            }

            jQuery.ajax({
                url: mvp_upsellinbg_frontend_ajax_object.ajax_url,
                type:'post',
                data:"action=mvp_upseller_awberdetail&name="+name+"&email="+email,
                success:function(response){                                                            
                    jQuery('.edd-fullscreen-loader').remove();
                    var result = JSON.parse(response);
                    console.log(result);

                    if(result.autoresponder_success == 1){
                        setTimeout (function(){                           
                            setTimeout (function(){
                                window.location.href=result.redirect;
                            },2000);
                        },2000);
                    }else{
                        setTimeout (function(){
                            jQuery('.submit').before('<span class="text_danger" id="subscriber_msg">'+result.autoresponder_message+'</span>');
                        });
                    }

                    jQuery('#subscriber_loader').remove();

                    setTimeout (function(){
                        jQuery('#subscriber_msg').remove();
                        jQuery('#presentation_setting_button_submit').removeAttr('disabled', '');
                    },5000);
                }
            });
        });

        jQuery("#copyButtonlicense_key").on("click",function(e){
			e.preventDefault();
			copyvideocodelicense_key();
			jQuery("#copyButtonlicense_key").text("Copied");
		});
	});
})(jQuery);

function copyvideocodelicense_key() {

    var copyText = document.getElementById("copyClipboardVideolicense_key");

    copyText.select();

    copyText.setSelectionRange(0, 99999);

    document.execCommand("copy");



    jQuery("#copied-success").fadeIn(800);

    jQuery("#copied-success").fadeOut(800);

}