From 84abb974c8fc4cf74e929d8497b29771e7d9c84a Mon Sep 17 00:00:00 2001 From: luxagraf Date: Thu, 10 Oct 2024 15:18:00 -0500 Subject: deleted some old cruft --- .../email-integration/js/site/main.js | 99 ---------------------- 1 file changed, 99 deletions(-) delete mode 100644 bak/oldluxpages/house-demo/www.bumfuzzle.com/wp-content/plugins/x-email-mailchimp/email-integration/js/site/main.js (limited to 'bak/oldluxpages/house-demo/www.bumfuzzle.com/wp-content/plugins/x-email-mailchimp/email-integration/js') diff --git a/bak/oldluxpages/house-demo/www.bumfuzzle.com/wp-content/plugins/x-email-mailchimp/email-integration/js/site/main.js b/bak/oldluxpages/house-demo/www.bumfuzzle.com/wp-content/plugins/x-email-mailchimp/email-integration/js/site/main.js deleted file mode 100644 index 9bf74c3..0000000 --- a/bak/oldluxpages/house-demo/www.bumfuzzle.com/wp-content/plugins/x-email-mailchimp/email-integration/js/site/main.js +++ /dev/null @@ -1,99 +0,0 @@ -// ============================================================================= -// JS/SITE/MAIN.JS -// ----------------------------------------------------------------------------- -// Plugin site scripts. -// ============================================================================= - -// ============================================================================= -// TABLE OF CONTENTS -// ----------------------------------------------------------------------------- -// 01. Handle Form Submissions -// ============================================================================= - -// Handle Form Submissions -// ============================================================================= - -jQuery(document).ready(function($) { - - function confirm_subscription( form ) { - - var confirm_type = form.data('x-email-confirm'); - - if ( confirm_type === 'Message' ) { - make_alert( form.data('x-email-message'), 'x-alert-success' ).appendTo(form); - } - - if ( confirm_type === 'Redirect' ) { - window.location.href = form.data('x-email-redirect'); - } - - } - - function make_alert( content, class_name ) { - - return $('
' + - '
' + - '' + - content + - '
' + - '
').alert(); - - } - - $('.x-subscribe-form').submit(function(e) { - - // - // Prevent default behavior. - // - - e.preventDefault(); - - - // - // Make note of our form. - // - - $form = $(this); - - - // - // Prevent extra submissions. - // - - $form.find('input[type="submit"]').prop('disabled', true).addClass('btn-muted'); - - - // - // Craft data for AJAX request. - // - - postdata = { - action : 'x_subscribe', - data : { - form_id : $(this).find('input[name="x_subscribe_form[id]"]').val() || '', - first_name : $(this).find('input[name="x_subscribe_form[first-name]"]').val() || '', - last_name : $(this).find('input[name="x_subscribe_form[last-name]"]').val() || '', - full_name : $(this).find('input[name="x_subscribe_form[full-name]"]').val() || '', - email_address : $(this).find('input[name="x_subscribe_form[email]"]').val() || '', - } - }; - - - // - // Submit form. - // - - $.post(x_email_forms.ajaxurl, postdata, function(response) { - data = $.parseJSON(response); - if ( data.error ) { - console.log(data.log_message); - make_alert(data.message).appendTo($form); - } else { - console.log('subscribed'); - confirm_subscription($form); - } - }); - - }); - -}); \ No newline at end of file -- cgit v1.2.3-70-g09d2