Easy Forms for MailChimp - Version 6.3.9.1

Version Description

Download this release

Release Info

Developer yikesitskevin
Plugin Icon 128x128 Easy Forms for MailChimp
Version 6.3.9.1
Comparing to
See all releases

Code changes from version 6.3.9 to 6.3.9.1

admin/class-yikes-inc-easy-mailchimp-extender-admin.php CHANGED
@@ -2693,6 +2693,7 @@ class Yikes_Inc_Easy_Mailchimp_Forms_Admin {
2693
  'redirect_on_submission' => $_POST['redirect-user-on-submission'],
2694
  'redirect_page' => $_POST['redirect-user-to-selection'],
2695
  'custom_redirect_url' => esc_url( $_POST['custom-redirect-url'] ),
 
2696
  'hide_form_post_signup' => $_POST['hide-form-post-signup'],
2697
  'replace_interests' => $_POST['replace-interest-groups'],
2698
  );
2693
  'redirect_on_submission' => $_POST['redirect-user-on-submission'],
2694
  'redirect_page' => $_POST['redirect-user-to-selection'],
2695
  'custom_redirect_url' => esc_url( $_POST['custom-redirect-url'] ),
2696
+ 'redirect_new_window' => $_POST['redirect_new_window'],
2697
  'hide_form_post_signup' => $_POST['hide-form-post-signup'],
2698
  'replace_interests' => $_POST['replace-interest-groups'],
2699
  );
admin/js/min/yikes-inc-easy-mailchimp-extender-edit-form.min.js CHANGED
@@ -1 +1 @@
1
- function togglePageRedirection(a){1==a.value?jQuery("#redirect-user-to-selection-label").fadeIn():jQuery("#redirect-user-to-selection-label").fadeOut()}function storeGlobalClicked(a){var b=a.parents("td").find("input").attr("name");jQuery(".clicked-input").val(b)}function populateDefaultValue(a){var b=jQuery(".clicked-input").val();jQuery(".clicked-input").val(""),tb_remove(),jQuery('input[name="'+b+'"]').val(a)}function toggle_nested_section(a){var b=jQuery(a).val();switch(b){case"image":jQuery(".submit-button-type-text").fadeOut("fast",function(){jQuery(".submit-button-type-image").fadeIn("fast")});break;case"text":jQuery(".submit-button-type-image").fadeOut("fast",function(){jQuery(".submit-button-type-text").fadeIn("fast")});break;default:case"1":"yikes-easy-mc-form-schedule"==jQuery(a).attr("name")?jQuery(".date-restirction-section").fadeToggle():jQuery(".login-restirction-section").fadeToggle()}return!1}function initialize_form_schedule_time_pickers(){jQuery(".date-picker").datepicker({numberOfMonths:1,showButtonPanel:!0,closeText:window.yikes_mailchimp_edit_form.closeText,currentText:window.yikes_mailchimp_edit_form.currentText,monthNames:window.yikes_mailchimp_edit_form.monthNames,monthNamesShort:window.yikes_mailchimp_edit_form.monthNamesShort,dayNames:window.yikes_mailchimp_edit_form.dayNames,dayNamesShort:window.yikes_mailchimp_edit_form.dayNamesShort,dayNamesMin:window.yikes_mailchimp_edit_form.dayNamesMin,dateFormat:window.yikes_mailchimp_edit_form.dateFormat,firstDay:window.yikes_mailchimp_edit_form.firstDay,isRTL:window.yikes_mailchimp_edit_form.isRTL,onSelect:function(a,b){var c=b.lastVal,d=b.id;yikes_check_valid_date(a,c,d)}}),jQuery(".time-picker").timepicker({scrollDefault:"now",timeFormat:"h:i A"}),jQuery(".time-picker").on("changeTime",function(){var a=jQuery(this).attr("id"),b=jQuery("#yikes-easy-mc-form-restriction-start-date").val(),c=jQuery("#yikes-easy-mc-form-restriction-end-date").val();yikes_check_valid_date(b,c,a)})}function yikes_check_valid_date(a,b,c){var d=jQuery("#yikes-easy-mc-form-restriction-start-date").val(),e=jQuery("#yikes-easy-mc-form-restriction-end-date").val(),f=yikes_12_to_24_hour_time_conversion(jQuery("#yikes-easy-mc-form-restriction-start-time").val()),g=yikes_12_to_24_hour_time_conversion(jQuery("#yikes-easy-mc-form-restriction-end-time").val()),h=new Date(d+" "+f),i=new Date(e+" "+g);if(h>i){if("yikes-easy-mc-form-restriction-start-date"!=c&&"yikes-easy-mc-form-restriction-end-date"!=c||jQuery("#"+c).val(b),jQuery(".date-restirction-section").find("p.description.error").length)return;jQuery(".date-restirction-section").first().find("p.description").after('<p class="description error">'+window.yikes_mailchimp_edit_form.start_date_exceeds_end_date_error+"</p>")}else jQuery(".date-restirction-section").find("p.description.error").remove()}function yikes_12_to_24_hour_time_conversion(a){var b=Number(a.match(/^(\d+)/)[1]),c=Number(a.match(/:(\d+)/)[1]),d=a.match(/\s(.*)$/)[1];"PM"==d&&b<12&&(b+=12),"AM"==d&&12==b&&(b-=12);var e=b.toString(),f=c.toString();return b<10&&(e="0"+e),c<10&&(f="0"+f),e+":"+f}function toggleUpdateEmailContainer(a){jQuery(".send-update-email").stop().fadeToggle()}function yikes_mc_prevent_default_stop_prop(a){a.preventDefault(),a.stopPropagation()}function yikes_mc_toggle_field_label_edit(a){jQuery(a).siblings(".yikes-mc-edit-field-label-input").val(jQuery(a).parents(".expansion-section-title").siblings(".yikes-mc-settings-expansion-section").children(".yikes-mc-merge-field-label").val());var b=jQuery(a).siblings(".yikes-mc-expansion-section-field-label, .field-type-text"),c=jQuery(a).siblings(".yikes-mc-edit-field-label-input, .yikes-mc-save-field-label-edits-icon");jQuery(a).hasClass("dashicons-no")?(b=jQuery(a).siblings(".yikes-mc-edit-field-label-input, .yikes-mc-save-field-label-edits-icon"),c=jQuery(a).siblings(".yikes-mc-expansion-section-field-label, .field-type-text"),a.title=yikes_mailchimp_edit_form.edit_field_label_pencil_title):a.title=yikes_mailchimp_edit_form.edit_field_label_cancel_title,jQuery(a).toggleClass("dashicons-no dashicons-edit"),b.fadeToggle().promise().done(function(){c.fadeToggle()})}function yikes_mc_save_field_label_name(a,b,c){var d={action:"save_field_label_edits",list_id:b,field_data:c,nonce:yikes_mailchimp_edit_form.save_field_label_nonce};jQuery.post(yikes_mailchimp_edit_form.ajax_url,d,function(b){if("undefined"!==b&&"undefined"!==b.success){var d=b.success;if(d===!0){var e=c.field_name;yikes_mc_update_field_label(a,e),yikes_mc_toggle_field_label_edit(jQuery(a).siblings(".dashicons-no"))}else{var f="";"undefined"!==b.data&&"undefined"!==b.data.message&&(f=b.data.message,yikes_mc_display_field_label_error_message(a,f))}}})}function yikes_mc_update_field_label(a,b){jQuery(a).parents(".expansion-section-title").siblings(".yikes-mc-settings-expansion-section").children(".yikes-mc-merge-field-label").val(b),jQuery(a).siblings(".yikes-mc-expansion-section-field-label").text(b)}function yikes_mc_display_field_label_error_message(a,b){jQuery(a).siblings(".yikes-mc-edit-field-label-message").fadeOut(function(){jQuery(this).text(b).fadeIn()})}window.Yikes_MailChimp_Edit_Form=window.Yikes_MailChimp_Edit_Form||{},window.yikes_mailchimp_edit_form=window.yikes_mailchimp_edit_form||{},function(a,b,c,d,e){"use strict";d.l10n=a.yikes_mailchimp_edit_form||{},c(b).ready(function(){c("body").find("#form-builder-container").sortable({items:".draggable:not(.non-draggable-yikes)",axis:"y",placeholder:"form-builder-placeholder",update:function(){var a=1;jQuery("#form-builder-container").find(".draggable").each(function(){jQuery(this).find(".position-input").val(a),a++})}}),c("body").on("click",".remove-field",function(){var a=jQuery(this).attr("alt"),b=jQuery(this);return c(this).parents(".yikes-mc-settings-expansion-section").prev().find(".yikes-mc-expansion-toggle").toggleClass("dashicons-minus"),c(this).parents(".yikes-mc-settings-expansion-section").slideToggle(450,function(){b.parents(".draggable").find(".expansion-section-title").css("background","rgb(255, 134, 134)"),b.parents(".draggable").fadeOut("slow",function(){jQuery("#available-fields").find('li[alt="'+a+'"]').removeClass("not-available"),jQuery("#available-interest-groups").find('li[alt="'+a+'"]').removeClass("not-available"),jQuery(this).remove(),c("#form-builder-container").find(".draggable").length<1&&(c(".clear-form-fields").hide(),c(".clear-form-fields").next().hide(),c("#form-builder-container").html('<h4 class="no-fields-assigned-notice non-draggable-yikes"><em>'+d.l10n.no_fields_assigned+"</em></h4>"))})}),!1}),c("body").on("click",".hide-field",function(){return c(this).parents(".yikes-mc-settings-expansion-section").slideToggle(450).prev().find(".yikes-mc-expansion-toggle").toggleClass("dashicons-minus"),!1}),c("body").on("click",".add-field-to-editor",function(){return c(".field-to-add-to-form").each(function(){var a=c("#form-builder-container").find(".draggable").length,b=c(this),e=b.attr("alt");c("#available-fields").children("li").removeClass("available-form-field");var f=c(this);f.attr("disabled","disabled").attr("onclick","return false;").removeClass("add-field-to-editor");var g={action:"add_field_to_form",field_name:b.attr("data-attr-field-name"),merge_tag:e,field_type:b.attr("data-attr-field-type"),list_id:b.attr("data-attr-form-id")};c.ajax({url:d.l10n.ajax_url,type:"POST",data:g,dataType:"html",success:function(d,f,g){b.removeClass("field-to-add-to-form").addClass("not-available"),c(".add-field-to-editor").hide(),c(".no-fields-assigned-notice").is(":visible")&&c("#form-builder-container").html(""),c("#form-builder-container").append(d),c(".clear-form-fields").show(),c(".clear-form-fields").next().show(),c(".field-"+e+"-position").val(parseInt(a+1))},error:function(a,b,c){alert(b+a.status+a.responseText+"...")},complete:function(a,b){c("#available-fields").children("li").addClass("available-form-field"),f.removeAttr("disabled").removeAttr("onclick"),c(".add-field-to-editor").hide()}})}),!1}),c("body").on("click",".add-interest-group-to-editor",function(){var a=c("#form-builder-container").find(".draggable").length,b=[];c(".group-to-add-to-form").each(function(){b.push({group_id:c(this).attr("alt"),field_type:c(this).attr("data-attr-field-type"),field_name:c(this).attr("data-attr-field-name")})}),c("#available-interest-groups").children("li").removeClass("available-interest-group");var e=c(this);e.attr("disabled","disabled").attr("onclick","return false;").removeClass("add-interest-group-to-editor");var f={action:"add_interest_group_to_form",interest_groups:b,list_id:c(".group-to-add-to-form").attr("data-attr-form-id")};return c.ajax({url:d.l10n.ajax_url,type:"POST",data:f,dataType:"html",success:function(b,d,e){c(".group-to-add-to-form").removeClass("group-to-add-to-form").addClass("not-available"),c(".add-interest-group-to-editor").hide(),a<1?(c("#form-builder-container").html("").append(b),c(".clear-form-fields").show(),c(".clear-form-fields").next().show()):c("#form-builder-container").append(b)},error:function(a,b,c){alert(b+a.status+a.responseText+"...")},complete:function(a,b){c("#available-interest-groups").children("li").addClass("available-interest-group"),e.removeAttr("disabled").removeAttr("onclick").addClass("add-interest-group-to-editor"),c(".add-interest-group-to-editor").hide()}}),!1}),c(".color-picker").each(function(){c(this).wpColorPicker()}),c("body").on("click",".expansion-section-title",function(){return c(this).next().stop().slideToggle(),c(this).find(".yikes-mc-expansion-toggle").toggleClass("dashicons-minus"),!1}),c("body").on("click",".available-form-field",function(){return!c(this).hasClass("not-available")&&void(c(this).hasClass("field-to-add-to-form")?(c(this).removeClass("field-to-add-to-form"),c(".add-field-to-editor").stop().fadeOut()):(c(this).toggleClass("field-to-add-to-form"),c(".add-field-to-editor").stop().fadeIn()))}),c("body").on("click",".available-interest-group",function(){return!c(this).hasClass("not-available")&&(c(this).hasClass("group-to-add-to-form")?c(this).removeClass("group-to-add-to-form"):c(this).toggleClass("group-to-add-to-form"),void(c(".group-to-add-to-form").length>0?c(".add-interest-group-to-editor").stop().fadeIn():c(".add-interest-group-to-editor").stop().fadeOut()))}),c("body").on("click",".hidden_setting",function(){c(".hidden_setting").removeClass("selected_hidden_setting"),c(".selected_setting_triangle").remove(),c(this).addClass("selected_hidden_setting").append('<div class="selected_setting_triangle"></div>');var a=c(this).attr("data-attr-container");c(".hidden-setting-label").hide(),c("#"+a).show()}),c("body").on("click",".close-form-expansion",function(){var a=c(this).parents(".yikes-mc-settings-expansion-section").slideToggle();return a.prev().find(".yikes-mc-expansion-toggle").toggleClass("dashicons-minus"),!1}),c("body").on("click",".mv_ig_list .nav-tab",function(){if(c(this).hasClass("nav-tab-active"))return!1;if(c(this).hasClass("nav-tab-disabled"))return!1;c(".mv_ig_list .nav-tab").removeClass("nav-tab-active"),c(".arrow-down").remove(),c(this).addClass("nav-tab-active").prepend('<div class="arrow-down"></div>'),c(".mv_ig_list .nav-tab").addClass("nav-tab-disabled");var a=c(this).attr("alt");return"merge-variables"==a?(c("#merge-variables-container").stop().animate({left:"0px"},function(){c(".mv_ig_list .nav-tab").removeClass("nav-tab-disabled")}),c("#interest-groups-container").stop().animate({left:"+=278px"},function(){c(".mv_ig_list .nav-tab").removeClass("nav-tab-disabled")})):(c("#merge-variables-container").stop().animate({left:"-=278px"},function(){c(".mv_ig_list .nav-tab").removeClass("nav-tab-disabled")}),c("#interest-groups-container").stop().animate({left:"-=278px"},function(){c(".mv_ig_list .nav-tab").removeClass("nav-tab-disabled")})),!1}),c("body").on("click",".clear-form-fields",function(){return confirm(d.l10n.bulk_delete_alert)&&c("#form-builder").find(".draggable").find(".expansion-section-title").each(function(){c(this).css("background","rgb(255, 134, 134)");var a=c(this).parents(".draggable").find(".remove-field").attr("alt");c(this).fadeOut("slow",function(){c("#available-fields").find('li[alt="'+a+'"]').removeClass("not-available"),c("#available-interest-groups").find('li[alt="'+a+'"]').removeClass("not-available"),c(this).remove(),c(".clear-form-fields").hide(),c(".clear-form-fields").next().hide(),c(".available-form-field").each(function(){c(this).removeClass("not-available")}),c("#form-builder-container").html('<h4 class="no-fields-assigned-notice non-draggable-yikes"><em>'+d.l10n.no_fields_assigned+"</em></h4>")})}),!1}),c(".yikes-mc-edit-field-label-icon").click(function(a){yikes_mc_prevent_default_stop_prop(a),jQuery(this).siblings(".yikes-mc-edit-field-label-message").fadeOut();var b=this;yikes_mc_toggle_field_label_edit(b)}),c(".yikes-mc-edit-field-label-input").click(function(a){yikes_mc_prevent_default_stop_prop(a)}),c(".yikes-mc-save-field-label-edits-icon").click(function(a){yikes_mc_prevent_default_stop_prop(a),jQuery(this).siblings(".yikes-mc-edit-field-label-message").fadeOut();var b=this,c=jQuery("#form-builder-div").data("list-id"),d=jQuery(this).siblings(".yikes-mc-edit-field-label-input").val(),e=jQuery(this).parents(".expansion-section-title").siblings(".yikes-mc-settings-expansion-section").children(".yikes-mc-merge-field-id").val(),f={field_name:d,field_id:e},g=jQuery(this).parents(".expansion-section-title").siblings(".yikes-mc-settings-expansion-section").children(".yikes-mc-merge-field-label").val();return g===d?void yikes_mc_toggle_field_label_edit(jQuery(this).siblings(".yikes-mc-edit-field-label-icon")):void yikes_mc_save_field_label_name(b,c,f)}),initialize_form_schedule_time_pickers()})}(window,document,jQuery,Yikes_MailChimp_Edit_Form);
1
+ function togglePageRedirection(a){var b=jQuery("#enable-ajax").is(":checked");1==a.value?(jQuery("#redirect-user-to-selection-label").fadeIn(),b===!0&&jQuery(".redirect-new-window-div").fadeIn()):jQuery("#redirect-user-to-selection-label, .redirect-new-window-div").fadeOut()}function storeGlobalClicked(a){var b=a.parents("td").find("input").attr("name");jQuery(".clicked-input").val(b)}function populateDefaultValue(a){var b=jQuery(".clicked-input").val();jQuery(".clicked-input").val(""),tb_remove(),jQuery('input[name="'+b+'"]').val(a)}function toggle_nested_section(a){var b=jQuery(a).val();switch(b){case"image":jQuery(".submit-button-type-text").fadeOut("fast",function(){jQuery(".submit-button-type-image").fadeIn("fast")});break;case"text":jQuery(".submit-button-type-image").fadeOut("fast",function(){jQuery(".submit-button-type-text").fadeIn("fast")});break;default:case"1":"yikes-easy-mc-form-schedule"==jQuery(a).attr("name")?jQuery(".date-restirction-section").fadeToggle():jQuery(".login-restirction-section").fadeToggle()}return!1}function initialize_form_schedule_time_pickers(){jQuery(".date-picker").datepicker({numberOfMonths:1,showButtonPanel:!0,closeText:window.yikes_mailchimp_edit_form.closeText,currentText:window.yikes_mailchimp_edit_form.currentText,monthNames:window.yikes_mailchimp_edit_form.monthNames,monthNamesShort:window.yikes_mailchimp_edit_form.monthNamesShort,dayNames:window.yikes_mailchimp_edit_form.dayNames,dayNamesShort:window.yikes_mailchimp_edit_form.dayNamesShort,dayNamesMin:window.yikes_mailchimp_edit_form.dayNamesMin,dateFormat:window.yikes_mailchimp_edit_form.dateFormat,firstDay:window.yikes_mailchimp_edit_form.firstDay,isRTL:window.yikes_mailchimp_edit_form.isRTL,onSelect:function(a,b){var c=b.lastVal,d=b.id;yikes_check_valid_date(a,c,d)}}),jQuery(".time-picker").timepicker({scrollDefault:"now",timeFormat:"h:i A"}),jQuery(".time-picker").on("changeTime",function(){var a=jQuery(this).attr("id"),b=jQuery("#yikes-easy-mc-form-restriction-start-date").val(),c=jQuery("#yikes-easy-mc-form-restriction-end-date").val();yikes_check_valid_date(b,c,a)})}function yikes_check_valid_date(a,b,c){var d=jQuery("#yikes-easy-mc-form-restriction-start-date").val(),e=jQuery("#yikes-easy-mc-form-restriction-end-date").val(),f=yikes_12_to_24_hour_time_conversion(jQuery("#yikes-easy-mc-form-restriction-start-time").val()),g=yikes_12_to_24_hour_time_conversion(jQuery("#yikes-easy-mc-form-restriction-end-time").val()),h=new Date(d+" "+f),i=new Date(e+" "+g);if(h>i){if("yikes-easy-mc-form-restriction-start-date"!=c&&"yikes-easy-mc-form-restriction-end-date"!=c||jQuery("#"+c).val(b),jQuery(".date-restirction-section").find("p.description.error").length)return;jQuery(".date-restirction-section").first().find("p.description").after('<p class="description error">'+window.yikes_mailchimp_edit_form.start_date_exceeds_end_date_error+"</p>")}else jQuery(".date-restirction-section").find("p.description.error").remove()}function yikes_12_to_24_hour_time_conversion(a){var b=Number(a.match(/^(\d+)/)[1]),c=Number(a.match(/:(\d+)/)[1]),d=a.match(/\s(.*)$/)[1];"PM"==d&&b<12&&(b+=12),"AM"==d&&12==b&&(b-=12);var e=b.toString(),f=c.toString();return b<10&&(e="0"+e),c<10&&(f="0"+f),e+":"+f}function toggleUpdateEmailContainer(a){jQuery(".send-update-email").stop().fadeToggle()}function yikes_mc_prevent_default_stop_prop(a){a.preventDefault(),a.stopPropagation()}function yikes_mc_toggle_field_label_edit(a){jQuery(a).siblings(".yikes-mc-edit-field-label-input").val(jQuery(a).parents(".expansion-section-title").siblings(".yikes-mc-settings-expansion-section").children(".yikes-mc-merge-field-label").val());var b=jQuery(a).siblings(".yikes-mc-expansion-section-field-label, .field-type-text"),c=jQuery(a).siblings(".yikes-mc-edit-field-label-input, .yikes-mc-save-field-label-edits-icon");jQuery(a).hasClass("dashicons-no")?(b=jQuery(a).siblings(".yikes-mc-edit-field-label-input, .yikes-mc-save-field-label-edits-icon"),c=jQuery(a).siblings(".yikes-mc-expansion-section-field-label, .field-type-text"),a.title=yikes_mailchimp_edit_form.edit_field_label_pencil_title):a.title=yikes_mailchimp_edit_form.edit_field_label_cancel_title,jQuery(a).toggleClass("dashicons-no dashicons-edit"),b.fadeToggle().promise().done(function(){c.fadeToggle()})}function yikes_mc_save_field_label_name(a,b,c){var d={action:"save_field_label_edits",list_id:b,field_data:c,nonce:yikes_mailchimp_edit_form.save_field_label_nonce};jQuery.post(yikes_mailchimp_edit_form.ajax_url,d,function(b){if("undefined"!==b&&"undefined"!==b.success){var d=b.success;if(d===!0){var e=c.field_name;yikes_mc_update_field_label(a,e),yikes_mc_toggle_field_label_edit(jQuery(a).siblings(".dashicons-no"))}else{var f="";"undefined"!==b.data&&"undefined"!==b.data.message&&(f=b.data.message,yikes_mc_display_field_label_error_message(a,f))}}})}function yikes_mc_update_field_label(a,b){jQuery(a).parents(".expansion-section-title").siblings(".yikes-mc-settings-expansion-section").children(".yikes-mc-merge-field-label").val(b),jQuery(a).siblings(".yikes-mc-expansion-section-field-label").text(b)}function yikes_mc_display_field_label_error_message(a,b){jQuery(a).siblings(".yikes-mc-edit-field-label-message").fadeOut(function(){jQuery(this).text(b).fadeIn()})}window.Yikes_MailChimp_Edit_Form=window.Yikes_MailChimp_Edit_Form||{},window.yikes_mailchimp_edit_form=window.yikes_mailchimp_edit_form||{},function(a,b,c,d,e){"use strict";d.l10n=a.yikes_mailchimp_edit_form||{},c(b).ready(function(){c("body").find("#form-builder-container").sortable({items:".draggable:not(.non-draggable-yikes)",axis:"y",placeholder:"form-builder-placeholder",update:function(){var a=1;jQuery("#form-builder-container").find(".draggable").each(function(){jQuery(this).find(".position-input").val(a),a++})}}),c("body").on("click",".remove-field",function(){var a=jQuery(this).attr("alt"),b=jQuery(this);return c(this).parents(".yikes-mc-settings-expansion-section").prev().find(".yikes-mc-expansion-toggle").toggleClass("dashicons-minus"),c(this).parents(".yikes-mc-settings-expansion-section").slideToggle(450,function(){b.parents(".draggable").find(".expansion-section-title").css("background","rgb(255, 134, 134)"),b.parents(".draggable").fadeOut("slow",function(){jQuery("#available-fields").find('li[alt="'+a+'"]').removeClass("not-available"),jQuery("#available-interest-groups").find('li[alt="'+a+'"]').removeClass("not-available"),jQuery(this).remove(),c("#form-builder-container").find(".draggable").length<1&&(c(".clear-form-fields").hide(),c(".clear-form-fields").next().hide(),c("#form-builder-container").html('<h4 class="no-fields-assigned-notice non-draggable-yikes"><em>'+d.l10n.no_fields_assigned+"</em></h4>"))})}),!1}),c("body").on("click",".hide-field",function(){return c(this).parents(".yikes-mc-settings-expansion-section").slideToggle(450).prev().find(".yikes-mc-expansion-toggle").toggleClass("dashicons-minus"),!1}),c("body").on("click",".add-field-to-editor",function(){return c(".field-to-add-to-form").each(function(){var a=c("#form-builder-container").find(".draggable").length,b=c(this),e=b.attr("alt");c("#available-fields").children("li").removeClass("available-form-field");var f=c(this);f.attr("disabled","disabled").attr("onclick","return false;").removeClass("add-field-to-editor");var g={action:"add_field_to_form",field_name:b.attr("data-attr-field-name"),merge_tag:e,field_type:b.attr("data-attr-field-type"),list_id:b.attr("data-attr-form-id")};c.ajax({url:d.l10n.ajax_url,type:"POST",data:g,dataType:"html",success:function(d,f,g){b.removeClass("field-to-add-to-form").addClass("not-available"),c(".add-field-to-editor").hide(),c(".no-fields-assigned-notice").is(":visible")&&c("#form-builder-container").html(""),c("#form-builder-container").append(d),c(".clear-form-fields").show(),c(".clear-form-fields").next().show(),c(".field-"+e+"-position").val(parseInt(a+1))},error:function(a,b,c){alert(b+a.status+a.responseText+"...")},complete:function(a,b){c("#available-fields").children("li").addClass("available-form-field"),f.removeAttr("disabled").removeAttr("onclick"),c(".add-field-to-editor").hide()}})}),!1}),c("body").on("click",".add-interest-group-to-editor",function(){var a=c("#form-builder-container").find(".draggable").length,b=[];c(".group-to-add-to-form").each(function(){b.push({group_id:c(this).attr("alt"),field_type:c(this).attr("data-attr-field-type"),field_name:c(this).attr("data-attr-field-name")})}),c("#available-interest-groups").children("li").removeClass("available-interest-group");var e=c(this);e.attr("disabled","disabled").attr("onclick","return false;").removeClass("add-interest-group-to-editor");var f={action:"add_interest_group_to_form",interest_groups:b,list_id:c(".group-to-add-to-form").attr("data-attr-form-id")};return c.ajax({url:d.l10n.ajax_url,type:"POST",data:f,dataType:"html",success:function(b,d,e){c(".group-to-add-to-form").removeClass("group-to-add-to-form").addClass("not-available"),c(".add-interest-group-to-editor").hide(),a<1?(c("#form-builder-container").html("").append(b),c(".clear-form-fields").show(),c(".clear-form-fields").next().show()):c("#form-builder-container").append(b)},error:function(a,b,c){alert(b+a.status+a.responseText+"...")},complete:function(a,b){c("#available-interest-groups").children("li").addClass("available-interest-group"),e.removeAttr("disabled").removeAttr("onclick").addClass("add-interest-group-to-editor"),c(".add-interest-group-to-editor").hide()}}),!1}),c(".color-picker").each(function(){c(this).wpColorPicker()}),c("body").on("click",".expansion-section-title",function(){return c(this).next().stop().slideToggle(),c(this).find(".yikes-mc-expansion-toggle").toggleClass("dashicons-minus"),!1}),c("body").on("click",".available-form-field",function(){return!c(this).hasClass("not-available")&&void(c(this).hasClass("field-to-add-to-form")?(c(this).removeClass("field-to-add-to-form"),c(".add-field-to-editor").stop().fadeOut()):(c(this).toggleClass("field-to-add-to-form"),c(".add-field-to-editor").stop().fadeIn()))}),c("body").on("click",".available-interest-group",function(){return!c(this).hasClass("not-available")&&(c(this).hasClass("group-to-add-to-form")?c(this).removeClass("group-to-add-to-form"):c(this).toggleClass("group-to-add-to-form"),void(c(".group-to-add-to-form").length>0?c(".add-interest-group-to-editor").stop().fadeIn():c(".add-interest-group-to-editor").stop().fadeOut()))}),c("body").on("click",".hidden_setting",function(){c(".hidden_setting").removeClass("selected_hidden_setting"),c(".selected_setting_triangle").remove(),c(this).addClass("selected_hidden_setting").append('<div class="selected_setting_triangle"></div>');var a=c(this).attr("data-attr-container");c(".hidden-setting-label").hide(),c("#"+a).show()}),c("body").on("click",".close-form-expansion",function(){var a=c(this).parents(".yikes-mc-settings-expansion-section").slideToggle();return a.prev().find(".yikes-mc-expansion-toggle").toggleClass("dashicons-minus"),!1}),c("body").on("click",".mv_ig_list .nav-tab",function(){if(c(this).hasClass("nav-tab-active"))return!1;if(c(this).hasClass("nav-tab-disabled"))return!1;c(".mv_ig_list .nav-tab").removeClass("nav-tab-active"),c(".arrow-down").remove(),c(this).addClass("nav-tab-active").prepend('<div class="arrow-down"></div>'),c(".mv_ig_list .nav-tab").addClass("nav-tab-disabled");var a=c(this).attr("alt");return"merge-variables"==a?(c("#merge-variables-container").stop().animate({left:"0px"},function(){c(".mv_ig_list .nav-tab").removeClass("nav-tab-disabled")}),c("#interest-groups-container").stop().animate({left:"+=278px"},function(){c(".mv_ig_list .nav-tab").removeClass("nav-tab-disabled")})):(c("#merge-variables-container").stop().animate({left:"-=278px"},function(){c(".mv_ig_list .nav-tab").removeClass("nav-tab-disabled")}),c("#interest-groups-container").stop().animate({left:"-=278px"},function(){c(".mv_ig_list .nav-tab").removeClass("nav-tab-disabled")})),!1}),c("body").on("click",".clear-form-fields",function(){return confirm(d.l10n.bulk_delete_alert)&&c("#form-builder").find(".draggable").find(".expansion-section-title").each(function(){c(this).css("background","rgb(255, 134, 134)");var a=c(this).parents(".draggable").find(".remove-field").attr("alt");c(this).fadeOut("slow",function(){c("#available-fields").find('li[alt="'+a+'"]').removeClass("not-available"),c("#available-interest-groups").find('li[alt="'+a+'"]').removeClass("not-available"),c(this).remove(),c(".clear-form-fields").hide(),c(".clear-form-fields").next().hide(),c(".available-form-field").each(function(){c(this).removeClass("not-available")}),c("#form-builder-container").html('<h4 class="no-fields-assigned-notice non-draggable-yikes"><em>'+d.l10n.no_fields_assigned+"</em></h4>")})}),!1}),c(".yikes-mc-edit-field-label-icon").click(function(a){yikes_mc_prevent_default_stop_prop(a),jQuery(this).siblings(".yikes-mc-edit-field-label-message").fadeOut();var b=this;yikes_mc_toggle_field_label_edit(b)}),c(".yikes-mc-edit-field-label-input").click(function(a){yikes_mc_prevent_default_stop_prop(a)}),c(".yikes-mc-save-field-label-edits-icon").click(function(a){yikes_mc_prevent_default_stop_prop(a),jQuery(this).siblings(".yikes-mc-edit-field-label-message").fadeOut();var b=this,c=jQuery("#form-builder-div").data("list-id"),d=jQuery(this).siblings(".yikes-mc-edit-field-label-input").val(),e=jQuery(this).parents(".expansion-section-title").siblings(".yikes-mc-settings-expansion-section").children(".yikes-mc-merge-field-id").val(),f={field_name:d,field_id:e},g=jQuery(this).parents(".expansion-section-title").siblings(".yikes-mc-settings-expansion-section").children(".yikes-mc-merge-field-label").val();return g===d?void yikes_mc_toggle_field_label_edit(jQuery(this).siblings(".yikes-mc-edit-field-label-icon")):void yikes_mc_save_field_label_name(b,c,f)}),initialize_form_schedule_time_pickers(),c(".yikes-enable-disable-ajax").click(function(){var a=c("#enable-ajax").is(":checked"),b=c("#redirect-user").is(":checked");a===!0&&b===!0?c(".redirect-new-window-div").fadeIn():c(".redirect-new-window-div").fadeOut()})})}(window,document,jQuery,Yikes_MailChimp_Edit_Form);
admin/js/yikes-inc-easy-mailchimp-extender-edit-form.js CHANGED
@@ -396,6 +396,19 @@ window.yikes_mailchimp_edit_form = window.yikes_mailchimp_edit_form || {};
396
  */
397
  initialize_form_schedule_time_pickers();
398
 
 
 
 
 
 
 
 
 
 
 
 
 
 
399
  });
400
 
401
 
@@ -406,10 +419,18 @@ window.yikes_mailchimp_edit_form = window.yikes_mailchimp_edit_form || {};
406
 
407
  /* Toggle Page Slection for form submission redirection */
408
  function togglePageRedirection( e ) {
 
 
 
409
  if( e.value == 1 ) {
410
  jQuery( '#redirect-user-to-selection-label' ).fadeIn();
 
 
 
 
 
411
  } else {
412
- jQuery( '#redirect-user-to-selection-label' ).fadeOut();
413
  }
414
  }
415
  /* Pass the clicked element for proper populating */
396
  */
397
  initialize_form_schedule_time_pickers();
398
 
399
+ // If ajax is disabled, hide the 'redirect-new-window' option
400
+ // Is ajax is enabled and redirect is enabled, show the 'redirect-new-window' option
401
+ $( '.yikes-enable-disable-ajax' ).click( function() {
402
+ var is_ajax = $( '#enable-ajax' ).is( ':checked' );
403
+ var redirect = $( '#redirect-user' ).is( ':checked' );
404
+ if ( is_ajax === true && redirect === true ) {
405
+ $( '.redirect-new-window-div' ).fadeIn();
406
+ } else {
407
+ $( '.redirect-new-window-div' ).fadeOut();
408
+ }
409
+
410
+ });
411
+
412
  });
413
 
414
 
419
 
420
  /* Toggle Page Slection for form submission redirection */
421
  function togglePageRedirection( e ) {
422
+
423
+ var is_ajax = jQuery( '#enable-ajax' ).is( ':checked' );
424
+
425
  if( e.value == 1 ) {
426
  jQuery( '#redirect-user-to-selection-label' ).fadeIn();
427
+
428
+ if ( is_ajax === true ) {
429
+ jQuery( '.redirect-new-window-div' ).fadeIn();
430
+ }
431
+
432
  } else {
433
+ jQuery( '#redirect-user-to-selection-label, .redirect-new-window-div' ).fadeOut();
434
  }
435
  }
436
  /* Pass the clicked element for proper populating */
admin/partials/edit-form.php CHANGED
@@ -789,8 +789,8 @@
789
  ?>
790
  <p class="form-field-container"><!-- necessary to prevent skipping on slideToggle(); --><label for="form-ajax-submission"><strong><?php _e( 'Enable AJAX Submission' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
791
  <span class="form-field-container-span">
792
- <label for="enable-ajax"><input type="radio" id="enable-ajax" name="form-ajax-submission" value="1" <?php checked( $submission_settings['ajax'] , '1' ); ?>><?php _e( 'Yes' , 'yikes-inc-easy-mailchimp-extender' ); ?></label>
793
- &nbsp;<label for="disable-ajax"><input type="radio" id="disable-ajax" name="form-ajax-submission" value="0" <?php checked( $submission_settings['ajax'] , '0' ); ?>><?php _e( 'No' , 'yikes-inc-easy-mailchimp-extender' ); ?></label>
794
  </span>
795
  <p class="description"><?php _e( "AJAX form submissions transmit data without requiring the page to refresh." , 'yikes-inc-easy-mailchimp-extender' ); ?></p>
796
  </label></p>
@@ -811,6 +811,25 @@
811
  <p class="description"><?php _e( "When the user signs up would you like to redirect them to another page?" , 'yikes-inc-easy-mailchimp-extender' ); ?></p>
812
  </label></p>
813
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
814
  <!-- Hide Form On Submission -->
815
  <?php
816
  if( !isset( $submission_settings['hide_form_post_signup'] ) ) {
789
  ?>
790
  <p class="form-field-container"><!-- necessary to prevent skipping on slideToggle(); --><label for="form-ajax-submission"><strong><?php _e( 'Enable AJAX Submission' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong>
791
  <span class="form-field-container-span">
792
+ <label for="enable-ajax"><input type="radio" id="enable-ajax" name="form-ajax-submission" class="yikes-enable-disable-ajax" value="1" <?php checked( $submission_settings['ajax'] , '1' ); ?>><?php _e( 'Yes' , 'yikes-inc-easy-mailchimp-extender' ); ?></label>
793
+ &nbsp;<label for="disable-ajax"><input type="radio" id="disable-ajax" name="form-ajax-submission" class="yikes-enable-disable-ajax" value="0" <?php checked( $submission_settings['ajax'] , '0' ); ?>><?php _e( 'No' , 'yikes-inc-easy-mailchimp-extender' ); ?></label>
794
  </span>
795
  <p class="description"><?php _e( "AJAX form submissions transmit data without requiring the page to refresh." , 'yikes-inc-easy-mailchimp-extender' ); ?></p>
796
  </label></p>
811
  <p class="description"><?php _e( "When the user signs up would you like to redirect them to another page?" , 'yikes-inc-easy-mailchimp-extender' ); ?></p>
812
  </label></p>
813
 
814
+ <?php
815
+ if ( ! isset( $submission_settings['redirect_new_window'] ) ) {
816
+ $submission_settings['redirect_new_window'] = '0';
817
+ }
818
+ ?>
819
+
820
+ <!-- Option to open the redirect URL in a new window -->
821
+ <div class="redirect-new-window-div" <?php if ( ( ! isset( $submission_settings['redirect_on_submission'] ) || $submission_settings['redirect_on_submission'] === '0' ) || ( ! isset( $submission_settings['ajax'] ) || $submission_settings['ajax'] !== '1' ) ) { echo 'style="display:none;"'; } ?>>
822
+ <p><strong><?php _e( "Open Redirect URL in a New Window" , 'yikes-inc-easy-mailchimp-extender' ); ?></strong></p>
823
+ <label for="redirect-new-window-yes">
824
+ <input type="radio" class="widefat custom-redirect-new-window" id="redirect-new-window-yes" name="redirect_new_window" value="1" <?php checked( $submission_settings['redirect_new_window'], '1' ); ?>/><?php _e( 'Yes' , 'yikes-inc-easy-mailchimp-extender' ); ?>
825
+ </label>
826
+ &nbsp;
827
+ <label for="redirect-new-window-no">
828
+ <input type="radio" class="widefat redirect-new-window" id="redirect-new-window-no" name="redirect_new_window" value="0" <?php checked( $submission_settings['redirect_new_window'] , '0' ); ?>/><?php _e( 'No' , 'yikes-inc-easy-mailchimp-extender' ); ?>
829
+ </label>
830
+ <p class="description"><?php _e( "Should the redirect URL open in a new window/tab?" , 'yikes-inc-easy-mailchimp-extender' ); ?></p>
831
+ </div>
832
+
833
  <!-- Hide Form On Submission -->
834
  <?php
835
  if( !isset( $submission_settings['hide_form_post_signup'] ) ) {
public/classes/process/class.process_form_submission_handler.php CHANGED
@@ -504,7 +504,7 @@ class Yikes_Inc_Easy_MailChimp_Extender_Process_Submission_Handler {
504
  */
505
  public function get_default_interest_groups( $replace_interests, $list_class ) {
506
 
507
- // If $replace_interests flag is true then loop through interst groups and set them all to false to start.
508
  // If $replace_interests flag is false, return an empty array
509
 
510
  // Set up our return array
@@ -582,7 +582,7 @@ class Yikes_Inc_Easy_MailChimp_Extender_Process_Submission_Handler {
582
  /**** Functions to Handle Subscribe API Response ****/
583
 
584
  /**
585
- * Handle a successful subscribe request
586
  *
587
  * @since 6.3.0
588
  *
@@ -595,7 +595,7 @@ class Yikes_Inc_Easy_MailChimp_Extender_Process_Submission_Handler {
595
  */
596
  public function handle_submission_response_success( $submission_settings, $page_data, $merge_variables, $notifications, $optin_settings, $new_subscriber ) {
597
 
598
- // Check if we should redirect
599
  $redirect_array = $this->handle_submission_response_success_redirect( $submission_settings, $page_data );
600
 
601
  // Fire off our actions
@@ -656,11 +656,13 @@ class Yikes_Inc_Easy_MailChimp_Extender_Process_Submission_Handler {
656
 
657
  // Construct our success array variables
658
  $return_success_array = array(
659
- 'hide' => $submission_settings['hide_form_post_signup'],
660
- 'error' => 0,
661
- 'response' => $response_message,
662
- 'redirection' => $redirect_array['redirection'],
663
- 'redirect' => $redirect_array['redirect']
 
 
664
  );
665
 
666
  // Return success array
@@ -723,8 +725,10 @@ class Yikes_Inc_Easy_MailChimp_Extender_Process_Submission_Handler {
723
 
724
  // Set up our return array with default values
725
  $redirect_array = array(
726
- 'redirection' => 0,
727
- 'redirect' => ''
 
 
728
  );
729
 
730
  // Let's confirm we have a value before trying to use it
@@ -733,15 +737,15 @@ class Yikes_Inc_Easy_MailChimp_Extender_Process_Submission_Handler {
733
  // Check the redirect flag
734
  if ( '1' === $redirect_setting ) {
735
 
736
- // Set up our return array
737
- $redirect_array = array();
738
-
739
  // Supply return array with default value of 1
740
  $redirect_array['redirection'] = 1;
741
 
742
- // Let's confirm we have redirect_page/custom_redirect_url values
743
  $redirect_page_setting = isset( $submission_settings['redirect_page'] ) ? $submission_settings['redirect_page'] : false;
744
  $custom_redirect_setting = isset( $submission_settings['custom_redirect_url'] ) ? $submission_settings['custom_redirect_url'] : false;
 
 
 
745
 
746
  // Check if we're redirecting to a custom_url or just the redirect_page
747
  $redirect_url = ( 'custom_url' !== $redirect_page_setting ) ? get_permalink( $redirect_page_setting ) : $custom_redirect_setting;
@@ -766,8 +770,10 @@ class Yikes_Inc_Easy_MailChimp_Extender_Process_Submission_Handler {
766
  */
767
  $redirect_timer = apply_filters( 'yikes-mailchimp-redirect-timer', $this->default_redirect_time_ms, $this->form_id );
768
 
 
 
769
  // Well this definitely has to change... why are we writing JavaScript in PHP?
770
- $redirect_array['redirect'] = '<script type="text/javascript">setTimeout(function() { window.location="' . $redirect_url . '"; }, ' . $redirect_timer . ');</script>';
771
  }
772
 
773
  return $redirect_array;
504
  */
505
  public function get_default_interest_groups( $replace_interests, $list_class ) {
506
 
507
+ // If $replace_interests flag is true then loop through interest groups and set them all to false to start.
508
  // If $replace_interests flag is false, return an empty array
509
 
510
  // Set up our return array
582
  /**** Functions to Handle Subscribe API Response ****/
583
 
584
  /**
585
+ * Handle the response to a successful subscribe request
586
  *
587
  * @since 6.3.0
588
  *
595
  */
596
  public function handle_submission_response_success( $submission_settings, $page_data, $merge_variables, $notifications, $optin_settings, $new_subscriber ) {
597
 
598
+ // Check if we should redirect, and collect the redirect info in an array
599
  $redirect_array = $this->handle_submission_response_success_redirect( $submission_settings, $page_data );
600
 
601
  // Fire off our actions
656
 
657
  // Construct our success array variables
658
  $return_success_array = array(
659
+ 'hide' => $submission_settings['hide_form_post_signup'],
660
+ 'error' => 0,
661
+ 'response' => $response_message,
662
+ 'redirection' => $redirect_array['redirection'],
663
+ 'redirect' => $redirect_array['redirect'],
664
+ 'new_window' => $redirect_array['new_window'],
665
+ 'redirect_timer' => $redirect_array['redirect_timer'],
666
  );
667
 
668
  // Return success array
725
 
726
  // Set up our return array with default values
727
  $redirect_array = array(
728
+ 'redirection' => 0,
729
+ 'redirect' => '',
730
+ 'new_window' => false,
731
+ 'redirect_timer' => 1500,
732
  );
733
 
734
  // Let's confirm we have a value before trying to use it
737
  // Check the redirect flag
738
  if ( '1' === $redirect_setting ) {
739
 
 
 
 
740
  // Supply return array with default value of 1
741
  $redirect_array['redirection'] = 1;
742
 
743
+ // Let's confirm we have redirect_page/custom_redirect_url/new_window values
744
  $redirect_page_setting = isset( $submission_settings['redirect_page'] ) ? $submission_settings['redirect_page'] : false;
745
  $custom_redirect_setting = isset( $submission_settings['custom_redirect_url'] ) ? $submission_settings['custom_redirect_url'] : false;
746
+ $redirect_new_window = isset( $submission_settings['redirect_new_window'] ) ? $submission_settings['redirect_new_window'] : false;
747
+
748
+ $redirect_array['new_window'] = $redirect_new_window;
749
 
750
  // Check if we're redirecting to a custom_url or just the redirect_page
751
  $redirect_url = ( 'custom_url' !== $redirect_page_setting ) ? get_permalink( $redirect_page_setting ) : $custom_redirect_setting;
770
  */
771
  $redirect_timer = apply_filters( 'yikes-mailchimp-redirect-timer', $this->default_redirect_time_ms, $this->form_id );
772
 
773
+ $redirect_array['redirect_timer'] = $redirect_timer;
774
+
775
  // Well this definitely has to change... why are we writing JavaScript in PHP?
776
+ $redirect_array['redirect'] = $redirect_url;
777
  }
778
 
779
  return $redirect_array;
public/js/yikes-mc-ajax-forms.js CHANGED
@@ -138,8 +138,19 @@ window.Yikes_Mailchimp_Ajax = window.Yikes_Mailchimp_Ajax || {};
138
  $( '.yikes-mailchimp-required-interest-group-error' ).remove();
139
 
140
  /* redirect if setup */
141
- if( response.redirection == 1 ) {
142
- submitted_form.before( response.redirect );
 
 
 
 
 
 
 
 
 
 
 
143
  }
144
  /* clear the inputs - but don't clear submit button, radio, select, list_id, or form */
145
  submitted_form.find( 'input' ).not( '.yikes-easy-mc-submit-button, input[type="radio"], input[type="select"], input[type="checkbox"], #yikes-mailchimp-associated-list-id, #yikes-mailchimp-submitted-form' ).val( '' );
138
  $( '.yikes-mailchimp-required-interest-group-error' ).remove();
139
 
140
  /* redirect if setup */
141
+ if( response.redirection === 1 ) {
142
+
143
+ var redirect_url = response.redirect;
144
+ var redirect_timer = response.redirect_timer;
145
+ var new_window = response.new_window;
146
+ var new_window_code = new_window === '1' ? '_blank' : '_self';
147
+
148
+ setTimeout(
149
+ function() {
150
+ window.open( redirect_url, new_window_code );
151
+ },
152
+ redirect_timer
153
+ );
154
  }
155
  /* clear the inputs - but don't clear submit button, radio, select, list_id, or form */
156
  submitted_form.find( 'input' ).not( '.yikes-easy-mc-submit-button, input[type="radio"], input[type="select"], input[type="checkbox"], #yikes-mailchimp-associated-list-id, #yikes-mailchimp-submitted-form' ).val( '' );
public/js/yikes-mc-ajax-forms.min.js CHANGED
@@ -1 +1 @@
1
- window.Yikes_Mailchimp_Ajax=window.Yikes_Mailchimp_Ajax||{},function(a,b,c,d,e){"use strict";function f(a,b){"undefined"!=typeof a&&c.each(a,function(a,d){b===!0?c("span."+a+"-label").length>0?c("span."+a+"-label").addClass("yikes-mc-required-field-not-filled"):c("."+a+"-label").addClass("yikes-mc-required-field-not-filled"):c('label[for="'+a+'"]').children("input").addClass("yikes-mc-required-field-not-filled")})}d.l10n=a.yikes_mailchimp_ajax||{},c(b).ready(function(){var a=c("body");a.on("submit",".yikes-easy-mc-form",function(){var a=c(this);a.addClass("yikes-mc-submitted-form-loading"),a.find("input, label, button").not(":hidden").fadeTo("fast",.5),a.append('<img src="'+d.l10n.preloader_url+'" class="yikes-mailchimp-preloader" />'),c(".yikes-mc-required-field-not-filled").removeClass("yikes-mc-required-field-not-filled"),c(".yikes-mailchimp-submit-button-span-text").hide(),a.find(".yikes-easy-mc-submit-button").append('<img src="'+d.l10n.loading_dots+'" class="loading-dots yikes-mc-loading-dots" />');var b=a.attr("data-attr-form-id"),e=[];if(a.find(".yikes-interest-group-required").length>0&&a.find(".yikes-interest-group-required").each(function(){var b=jQuery(this).attr("name"),c=b.replace("[]","");0==a.find('input[name="'+c+'[]"]:checked').length&&(e[c]=a.find("span."+c+"-label").text())}),e.length>0){if(a.find(".yikes-mailchimp-required-interest-group-error").length>0)a.find(".yikes-mailchimp-required-interest-group-error").fadeOut("fast",function(){a.find(".yikes-mailchimp-required-interest-group-error").remove();for(var b in e)a.find("span."+b+"-label").after('<p class="yikes-mailchimp-required-interest-group-error">'+d.l10n.interest_group_checkbox_error+"</p>")});else for(var g in e)a.find("span."+g+"-label").after('<p class="yikes-mailchimp-required-interest-group-error">'+d.l10n.interest_group_checkbox_error+"</p>");return a.find(".yikes-easy-mc-submit-button").removeAttr("disabled","disabled"),a.find("input, label, button").not(":hidden").fadeTo("fast",1),a.find(".yikes-mailchimp-preloader").remove(),c(".yikes-mc-loading-dots").remove(),c(".yikes-mailchimp-submit-button-span-text").show(),a.removeClass("yikes-mc-submitted-form-loading"),!1}a.find(".yikes-easy-mc-submit-button").attr("disabled","disabled"),c(".yikes-easy-mc-error-message").remove(),c(".yikes-easy-mc-success-message").remove();var h={action:"process_form_submission",form_data:a.serialize(),form_id:b,page_data:d.l10n.page_data,ajax_security_nonce:d.l10n.ajax_security_nonce};return c.ajax({url:d.l10n.ajax_url,type:"POST",data:h,success:function(e,g,h){if(a.find("input, label, button").not(":hidden").fadeTo("fast",1),a.find(".yikes-mailchimp-preloader").remove(),c(".yikes-mc-loading-dots").remove(),c(".yikes-mailchimp-submit-button-span-text").show(),a.removeClass("yikes-mc-submitted-form-loading"),e.success){e=e.data,1==e.hide&&(c(".yikes-easy-mc-form-description-"+b).length>0&&c(".yikes-easy-mc-form-description-"+b).hide(),a.hide()),c(".yikes-easy-mc-form-description-"+b).length>0?c(".yikes-easy-mc-form-description-"+b).before('<p class="yikes-easy-mc-success-message yikes-easy-mc-success-message-'+b+' yikes-easy-mc-hidden">'+e.response+"</p>"):a.before('<p class="yikes-easy-mc-success-message yikes-easy-mc-success-message-'+b+' yikes-easy-mc-hidden">'+e.response+"</p>"),c(".yikes-easy-mc-success-message-"+b).fadeIn(),c(".yikes-mailchimp-required-interest-group-error").remove(),1==e.redirection&&a.before(e.redirect),a.find("input").not('.yikes-easy-mc-submit-button, input[type="radio"], input[type="select"], input[type="checkbox"], #yikes-mailchimp-associated-list-id, #yikes-mailchimp-submitted-form').val("");var i={action:"increase_submission_count",form_id:b};c.ajax({url:d.l10n.ajax_url,type:"POST",data:i,success:function(a,b,c){},error:function(a,b,c){console.error(c)}})}else{if(e=e.data,c(".yikes-easy-mc-form-description-"+b).length>0)c(".yikes-easy-mc-form-description-"+b).before('<p class="yikes-easy-mc-error-message yikes-easy-mc-error-message-'+b+'" yikes-easy-mc-hidden"> '+e.response+"</p>");else{var j="undefined"!=typeof e&&"undefined"!=typeof e.response?e.response:"Error collecting the API response.";a.before('<p class="yikes-easy-mc-error-message yikes-easy-mc-error-message-'+b+' yikes-easy-mc-hidden">'+j+"</p>")}if("undefined"!=typeof e&&"undefined"!=typeof e.missing_required_field&&e.missing_required_field===!0&&"undefined"!=typeof e.missing_required_field_data){var k=e.missing_required_field_data,l="undefined"!=typeof e.is_interest_group&&e.is_interest_group;f(k,l)}c(".yikes-easy-mc-error-message").fadeIn()}},error:function(a,b,c){console.error(c),console.log(a),console.log(b)},complete:function(b,c){a.find(".yikes-easy-mc-submit-button").removeAttr("disabled","disabled")}}),!1})})}(window,document,jQuery,Yikes_Mailchimp_Ajax);
1
+ window.Yikes_Mailchimp_Ajax=window.Yikes_Mailchimp_Ajax||{},function(a,b,c,d,e){"use strict";function f(a,b){"undefined"!=typeof a&&c.each(a,function(a,d){b===!0?c("span."+a+"-label").length>0?c("span."+a+"-label").addClass("yikes-mc-required-field-not-filled"):c("."+a+"-label").addClass("yikes-mc-required-field-not-filled"):c('label[for="'+a+'"]').children("input").addClass("yikes-mc-required-field-not-filled")})}d.l10n=a.yikes_mailchimp_ajax||{},c(b).ready(function(){var b=c("body");b.on("submit",".yikes-easy-mc-form",function(){var b=c(this);b.addClass("yikes-mc-submitted-form-loading"),b.find("input, label, button").not(":hidden").fadeTo("fast",.5),b.append('<img src="'+d.l10n.preloader_url+'" class="yikes-mailchimp-preloader" />'),c(".yikes-mc-required-field-not-filled").removeClass("yikes-mc-required-field-not-filled"),c(".yikes-mailchimp-submit-button-span-text").hide(),b.find(".yikes-easy-mc-submit-button").append('<img src="'+d.l10n.loading_dots+'" class="loading-dots yikes-mc-loading-dots" />');var e=b.attr("data-attr-form-id"),g=[];if(b.find(".yikes-interest-group-required").length>0&&b.find(".yikes-interest-group-required").each(function(){var a=jQuery(this).attr("name"),c=a.replace("[]","");0==b.find('input[name="'+c+'[]"]:checked').length&&(g[c]=b.find("span."+c+"-label").text())}),g.length>0){if(b.find(".yikes-mailchimp-required-interest-group-error").length>0)b.find(".yikes-mailchimp-required-interest-group-error").fadeOut("fast",function(){b.find(".yikes-mailchimp-required-interest-group-error").remove();for(var a in g)b.find("span."+a+"-label").after('<p class="yikes-mailchimp-required-interest-group-error">'+d.l10n.interest_group_checkbox_error+"</p>")});else for(var h in g)b.find("span."+h+"-label").after('<p class="yikes-mailchimp-required-interest-group-error">'+d.l10n.interest_group_checkbox_error+"</p>");return b.find(".yikes-easy-mc-submit-button").removeAttr("disabled","disabled"),b.find("input, label, button").not(":hidden").fadeTo("fast",1),b.find(".yikes-mailchimp-preloader").remove(),c(".yikes-mc-loading-dots").remove(),c(".yikes-mailchimp-submit-button-span-text").show(),b.removeClass("yikes-mc-submitted-form-loading"),!1}b.find(".yikes-easy-mc-submit-button").attr("disabled","disabled"),c(".yikes-easy-mc-error-message").remove(),c(".yikes-easy-mc-success-message").remove();var i={action:"process_form_submission",form_data:b.serialize(),form_id:e,page_data:d.l10n.page_data,ajax_security_nonce:d.l10n.ajax_security_nonce};return c.ajax({url:d.l10n.ajax_url,type:"POST",data:i,success:function(g,h,i){if(b.find("input, label, button").not(":hidden").fadeTo("fast",1),b.find(".yikes-mailchimp-preloader").remove(),c(".yikes-mc-loading-dots").remove(),c(".yikes-mailchimp-submit-button-span-text").show(),b.removeClass("yikes-mc-submitted-form-loading"),g.success){if(g=g.data,1==g.hide&&(c(".yikes-easy-mc-form-description-"+e).length>0&&c(".yikes-easy-mc-form-description-"+e).hide(),b.hide()),c(".yikes-easy-mc-form-description-"+e).length>0?c(".yikes-easy-mc-form-description-"+e).before('<p class="yikes-easy-mc-success-message yikes-easy-mc-success-message-'+e+' yikes-easy-mc-hidden">'+g.response+"</p>"):b.before('<p class="yikes-easy-mc-success-message yikes-easy-mc-success-message-'+e+' yikes-easy-mc-hidden">'+g.response+"</p>"),c(".yikes-easy-mc-success-message-"+e).fadeIn(),c(".yikes-mailchimp-required-interest-group-error").remove(),1===g.redirection){var j=g.redirect,k=g.redirect_timer,l=g.new_window,m="1"===l?"_blank":"_self";setTimeout(function(){a.open(j,m)},k)}b.find("input").not('.yikes-easy-mc-submit-button, input[type="radio"], input[type="select"], input[type="checkbox"], #yikes-mailchimp-associated-list-id, #yikes-mailchimp-submitted-form').val("");var n={action:"increase_submission_count",form_id:e};c.ajax({url:d.l10n.ajax_url,type:"POST",data:n,success:function(a,b,c){},error:function(a,b,c){console.error(c)}})}else{if(g=g.data,c(".yikes-easy-mc-form-description-"+e).length>0)c(".yikes-easy-mc-form-description-"+e).before('<p class="yikes-easy-mc-error-message yikes-easy-mc-error-message-'+e+'" yikes-easy-mc-hidden"> '+g.response+"</p>");else{var o="undefined"!=typeof g&&"undefined"!=typeof g.response?g.response:"Error collecting the API response.";b.before('<p class="yikes-easy-mc-error-message yikes-easy-mc-error-message-'+e+' yikes-easy-mc-hidden">'+o+"</p>")}if("undefined"!=typeof g&&"undefined"!=typeof g.missing_required_field&&g.missing_required_field===!0&&"undefined"!=typeof g.missing_required_field_data){var p=g.missing_required_field_data,q="undefined"!=typeof g.is_interest_group&&g.is_interest_group;f(p,q)}c(".yikes-easy-mc-error-message").fadeIn()}},error:function(a,b,c){console.error(c),console.log(a),console.log(b)},complete:function(a,c){b.find(".yikes-easy-mc-submit-button").removeAttr("disabled","disabled")}}),!1})})}(window,document,jQuery,Yikes_Mailchimp_Ajax);
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://yikesplugins.com/?utm_source=wp_plugin_repo&utm_medium=dona
4
  Tags: MailChimp, MailChimp forms, MailChimp lists, opt-in forms, sign up form, MailChimp, email, forms, mailing lists, marketing, newsletter, sign up
5
  Requires at least: 4.0
6
  Tested up to: 4.7.3
7
- Stable tag: 6.3.9
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -247,6 +247,10 @@ Below you'll find a complete list of the hooks and filters available in Easy For
247
 
248
  == Changelog ==
249
 
 
 
 
 
250
  = Easy Forms for MailChimp 6.3.9 - March 10th, 2017 =
251
  * The dismiss button for the "Please Review Us" box now redirects you to your current page instead of the admin home page.
252
 
4
  Tags: MailChimp, MailChimp forms, MailChimp lists, opt-in forms, sign up form, MailChimp, email, forms, mailing lists, marketing, newsletter, sign up
5
  Requires at least: 4.0
6
  Tested up to: 4.7.3
7
+ Stable tag: 6.3.9.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
247
 
248
  == Changelog ==
249
 
250
+ = Easy Forms for MailChimp 6.3.9.1 - March 14th, 2017 =
251
+ * Added a new option for AJAX submissions with redirect set: open in new window/tab. (Note: some browsers may detect the redirect as a popup and block it by default)
252
+ * Refactored the way the redirect logic worked
253
+
254
  = Easy Forms for MailChimp 6.3.9 - March 10th, 2017 =
255
  * The dismiss button for the "Please Review Us" box now redirects you to your current page instead of the admin home page.
256
 
yikes-inc-easy-mailchimp-extender.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Easy Forms for MailChimp
4
  * Plugin URI: https://yikesplugins.com/plugin/easy-forms-for-mailchimp/
5
  * Description: The ultimate MailChimp WordPress plugin. Easily build <strong>unlimited forms for your MailChimp lists</strong>, add them to your site and track subscriber activity. To get started, go to the settings page and enter your <a href="https://yikesplugins.com/support/knowledge-base/finding-your-mailchimp-api-key/" target="_blank">MailChimp API key</a>.
6
- * Version: 6.3.9
7
  * Author: YIKES, Inc.
8
  * Author URI: https://www.yikesplugins.com/
9
  * License: GPL-3.0+
@@ -42,7 +42,7 @@ if ( ! defined( 'WPINC' ) ) {
42
  * @since 6.1.3
43
  */
44
  if ( ! defined( 'YIKES_MC_VERSION' ) ) {
45
- define( 'YIKES_MC_VERSION' , '6.3.9' );
46
  }
47
 
48
  /**
3
  * Plugin Name: Easy Forms for MailChimp
4
  * Plugin URI: https://yikesplugins.com/plugin/easy-forms-for-mailchimp/
5
  * Description: The ultimate MailChimp WordPress plugin. Easily build <strong>unlimited forms for your MailChimp lists</strong>, add them to your site and track subscriber activity. To get started, go to the settings page and enter your <a href="https://yikesplugins.com/support/knowledge-base/finding-your-mailchimp-api-key/" target="_blank">MailChimp API key</a>.
6
+ * Version: 6.3.9.1
7
  * Author: YIKES, Inc.
8
  * Author URI: https://www.yikesplugins.com/
9
  * License: GPL-3.0+
42
  * @since 6.1.3
43
  */
44
  if ( ! defined( 'YIKES_MC_VERSION' ) ) {
45
+ define( 'YIKES_MC_VERSION' , '6.3.9.1' );
46
  }
47
 
48
  /**