(function ($) { $(function () { var AjaxUrl = edn_pro_script_variable.ajax_url; var admin_nonce = edn_pro_script_variable.ajax_nonce; var saving_data = edn_pro_script_variable.saving_msg; var saved_data = edn_pro_script_variable.saved_data; var plugin_pathinfo = edn_pro_script_variable.plugin_pathinfo; $('.apexnb-selection').selectbox(); /* * Tab Plugin Settings */ $( '.apexnb-tabs-trigger' ).click(function(){ $( '.apexnb-tabs-trigger' ).removeClass( 'nav-tab-active' ); $(this).addClass( 'nav-tab-active' ); var board_id = $(this).attr('data-tab'); $('.apexnb-lite-tab-content').hide().removeClass('current'); $('#'+board_id).fadeIn(300).addClass('current'); if(board_id == "optin_settings" || board_id == "how_to_use" || board_id == "about"){ $('.edn_submit_section').hide(); }else{ $('.edn_submit_section').show(); } }); $('#apexnb_lite_tabs').tabs().addClass('ui-tabs-vertical ui-helper-clearfix'); /* Bar layuout with preview images */ $('#edn_bar_template').change(function(){ var templateid = $(this).val(); $('.edn-template-preview').hide(); $('.edn-template-previewbox-'+templateid).fadeIn(500).show(); }); var current_templateid = $( "#edn_bar_template option:selected" ).val(); if(current_templateid != ''){ $('.edn-template-previewbox-'+current_templateid).show(); } /* Visibility Change */ $('.edn-visibility').change(function(){ var val = $(this).val(); if(val == "show-time"){ $('.edn-time-hide').find('.edn-visibility-hidetime').hide(); $('.edn-time').find('.edn-visibility-showtime').show(); }else if(val=="hide-time"){ $('.edn-time').find('.edn-visibility-showtime').hide(); $('.edn-time-hide').find('.edn-visibility-hidetime').show(); }else{ $('.edn-time').find('.edn-visibility-showtime').hide(); $('.edn-time-hide').find('.edn-visibility-hidetime').hide(); } }); var visibletype = $('.edn-visibility option:selected').val(); if(visibletype == "show-time"){ $('.edn-time-hide').find('.edn-visibility-hidetime').hide(); $('.edn-time').find('.edn-visibility-showtime').show(); }else if(visibletype=="hide-time"){ $('.edn-time').find('.edn-visibility-showtime').hide(); $('.edn-time-hide').find('.edn-visibility-hidetime').show(); }else{ $('.edn-time').find('.edn-visibility-showtime').hide(); $('.edn-time-hide').find('.edn-visibility-hidetime').hide(); } /* Controls On Change */ $('#edn-close-button').change(function(){ if($(this).val() == "user-can-close"){ $('.edn_close_once').show(); $('.edn_show_hide').hide(); $('.showhide_duration_time').hide(); if ($('#show_once').is(':checked')) { $('.duration_time').show(); }else{ $('.duration_time').hide(); } }else if($(this).val() == "show-hide"){ $('.edn_show_hide').show(); $('.edn_close_once').hide(); $('.duration_time').hide(); }else{ $('.edn_close_once').hide(); $('.duration_time').hide(); $('.edn_show_hide').hide(); } }); var selected_button = $('#edn-close-button option:selected').val(); if(selected_button== "user-can-close"){ $('.edn_close_once').show(); $('.edn_show_hide').hide(); if ($('#show_once').is(':checked')) { $('.duration_time').show(); }else{ $('.duration_time').hide(); } }else if(selected_button == "show-hide"){ $('.edn_show_hide').show(); $('.edn_close_once').hide(); $('.duration_time').hide(); }else{ $('.edn_close_once').hide(); $('.duration_time').hide(); $('.edn_show_hide').hide(); } $('#show_once').change(function () { if ($(this).is(':checked')) { $('.duration_time').show(); }else{ $('.duration_time').hide(); } }); /* added features for show/hide duration start*/ $('#show_once_hideshow').change(function () { if ($(this).is(':checked')) { $('.showhide_duration_time').show(); }else{ $('.showhide_duration_time').hide(); } }); /* added features for show/hide end*/ /* Social Icons Lists */ $('#edn-show-add-fields').click(function(){ $('.edn-social-empty').toggle(); }); //font awesome icons chooser $('.edn-font-icon-chooser').on('click',function () { $('.edn-font-awesome-icons').show(); }); //fontawesome icon chooser close $('.edn-close-font,.edn-lightbox').click(function () { $('.edn-font-awesome-icons').hide(); $('.edn-fa-icons-wrap').hide(); }); //Adding social icon to list $('#edn-social-add').click(function () { error_flag = 0; if ($('#edn-icon-title').val() == '') { error_flag = 1; var error_html = $('#edn-icon-title').attr('data-error-msg'); $('#edn-icon-title').closest('.edn-field-wrapper').find('.edn-error').html(error_html); } if ($('#edn-icon-link').val() == '') { error_flag = 1; var error_html = $('#edn-icon-link').attr('data-error-msg'); $('#edn-icon-link').closest('.edn-field-wrapper').find('.edn-error').html(error_html); } var bar_type2 = $('input[name="edn_bar_type"]:checked').val(); if(bar_type2 == 1){ //custom if ($('#edn-font-awesome-icon').val() == '' && $('#edn-custom-icon').val() == '') { error_flag = 1; var error_html = $('#edn-font-awesome-icon').attr('data-error-msg'); $('#edn-font-awesome-icon').closest('.edn-field-wrapper').find('.edn-error').html(error_html); } }else{ if ($('#edn-font-awesome-icon').val() == '') { error_flag = 1; var error_html = $('#edn-font-awesome-icon').attr('data-error-msg'); $('#edn-font-awesome-icon').closest('.edn-field-wrapper').find('.edn-error').html(error_html); } } if (error_flag == 0) { var icon_title = $('#edn-icon-title').val(); var bartype = $('input[name="edn_bar_type"]:checked').val(); var font_icon = $('.available-icons').find('#edn-font-awesome-icon').val(); var icon_link = $('#edn-icon-link').val(); var apsFontIconReference = 0; var append_html = '
  • ' + '
    ' + '
    ' + icon_title + '  
    ' + '' + '' + '' + '' + '
  • '; $('.edn-icon-list').append(append_html); if (!$('.edn-icon-theme-expand').is(':visible')) { $('.edn-icon-theme-expand').show(); } if ($('.edn-icon-list-wrapper p').is(':visible')) { $('.edn-icon-list-wrapper p').hide(); } $('.edn-social-empty input[type="text"]').each(function () { $(this).val(''); }); $('.edn-social-empty').hide(); } }); /* Icon each add */ $(document).keyup(function(e) { if (e.keyCode == 27) { // escape key maps to keycode `27` $('.edn-font-awesome-icons').hide(); $('.edn-fa-icons-wrap').hide(); } }); $('.edn-font-awesome-icons .fontawesome-icon-list a').click(function (e) { e.preventDefault(); var attr_class = $(this).find('i').attr('class').replace('fa-3x', ''); var append_html = ''; $('.edn-font-icon-preview').html(append_html); $('#edn-font-awesome-icon').val(attr_class); $('.edn-font-awesome-icons').hide(); }); //font awesome icons chooser show lightbox for edit $('.edn-edit-font-icon-chooser').click(function () { var id = this.id; $('.edn-fa-icons-wrap').addClass(id); $('.'+id).show(); }); /* Display choose icon on preview */ $('.edn-fa-icons-wrap .fontawesome-icon-list a').click(function (e) { e.preventDefault(); var attr_class = $(this).find('i').attr('class').replace('fa-3x', ''); var append_html = ''; $('.edn-font-icon-preview').html(append_html); $(this).closest('.edn-field').find('.edn-edit-font-awesome-icon').val(attr_class); $('.edn-fa-icons-wrap').hide(); }); /* hide error msg on keyup for social text*/ $('.edn-social-empty input').keyup(function () { $(this).closest('.edn-field-wrapper').find('.edn-error').html(''); }); /////////////////////////////////////////////////////////////////////////////////////////////////// //sortable initialization $('.edn-nb-list').sortable({ containment: "parent" }); //Add sortable posts list if selected display posts by id $("#edn_add_posts").click(function(){ var checkedval = $('input[name="edn_nb-add-check[]"]:checked').length; if (checkedval != 0) { $('#edn-nb-list-wrapper').show(); $('.nb-add-check').each(function(){ if($(this).is(':checked') ){ var list_val = $(this).val(); var list_text = $(this).data('postname'); if($('.edn-nb-list #end_pro-list-'+list_val).length==0){ $('.edn-nb-list').append('
    '+list_text+'
    '); } } }); } else { alert('Please Select Atleast One.'); } }); /* Display bar to specific pages/posts Notification bar settings page*/ $("#edn_add_pages").click(function(){ var checkedvall = $('input[name="edn_add_spage[]"]:checked').length; if (checkedvall != 0) { $('#edn-nb-list-wrapper').show(); $('.nb-add-check').each(function(){ if($(this).is(':checked') ){ var list_val = $(this).val(); var list_text = $(this).data('postname'); if($('.edn-nb-list2 #end_pro-list-'+list_val).length==0){ $('.edn-nb-list2').append('
    '+list_text+'
    '); } } }); } else { alert('Please Select Atleast One.'); } }); //Delete testimonial when selected display testimonial by id $('.edn-nb-list,.edn-nb-list2').on("click",".remove_field", function(e){ e.preventDefault(); var r = confirm("Do you want to delete this selection?"); if (r == true) { $(this).parent('div').remove(); } }); /* search by title */ var $block = $('.no-results'); $("#ednpro_filter").keyup(function() { var val = $(this).val(); var isMatch = false; $("a.row-title").each(function(i) { var content = $(this).text(); if(content.toLowerCase().indexOf(val) == -1) { $(this).closest('tr').fadeOut(); } else { isMatch = true; $(this).closest('tr').show(); } }); $block.toggle(!isMatch); }); // Notificaiton show on pages settings Options $('#edn-notify-on-pages').change(function () { if ($(this).val() == "specific_pages") { $('.show_pages_lists').show(); $('.show_cat_lists').hide(); }else if($(this).val() == "specific_categories"){ $('.show_cat_lists').show(); $('.show_pages_lists').hide(); }else{ $('.show_pages_lists').hide(); $('.show_cat_lists').hide(); } }); if ($( "#edn-notify-on-pages option:selected" ).val() == "specific_pages") { $('.show_pages_lists').show(); $('.show_cat_lists').hide(); }else if ($( "#edn-notify-on-pages option:selected" ).val() == "specific_categories") { $('.show_pages_lists').hide(); $('.show_cat_lists').show(); } else{ $('.show_pages_lists').hide(); $('.show_cat_lists').hide(); } //Notificaiton show on pages settings Options End $('#edn-add-button').click(function(){ var error_html = $('input[name="edn_bar_name"]').data('error-msg'); var error_flag = 0; if($('input[name="edn_bar_name"]').val() == ''){ error_flag = 1; $('input[name="edn_bar_name"]').closest('.edn-field-wrapper').find('.edn-error').html(error_html); } if (error_flag == 1) { return false; } else { return true; } }); $('.edn-add-trigger-button').click(function(){ $('#edn-add-button').click(); }); // Choose Notification bar type $('input:radio[name="edn_bar_type"]').click(function () { if($('.edn-hidden-bar-name').val() !==''){ if(confirm(edn_pro_script_variable.bar_warning)){ if ($(this).val() == 1) { //custom design $('.edn-template-chooser').hide(); $('.edn-hide-in-pre-tpl').show(); $('.apexnb_background_image_toggle').show(); if($("#edn-notification-comp").is(':checked')){ $('.edn-components-wrap').show(); }else{ $('.edn-components-wrap').hide(); } $('.edn-common-option-panel').show(); $('.edn-font-demo-wrap').show(); // $('.edn-custom-social-color').show(); $('.edn-custom-countdown-color').show(); //countdown design $('.edn-custom-hide').show(); // custom video design $('.edn-show-border-color').show();//open panel show border color var icon_type = $('.edn_icon_types option:selected').val(); if(icon_type == "custom_icon"){ $('.edn_icon_types').closest('.edn-col-icons').find('.customicons').show(); $('.edn_icon_types').closest('.edn-col-icons').find('.available-icons').hide(); }else if(icon_type == "available_font_icon"){ $('.edn_icon_types').closest('.edn-col-icons').find('.customicons').hide(); $('.edn_icon_types').closest('.edn-col-icons').find('.available-icons').show(); } $('.edn-template-preview').hide(); } else { var selectedprebar = $('.edn_bar_template option:selected').val(); $('.edn-template-preview').hide(); $('.edn-template-previewbox-'+selectedprebar).show(); $('.edn-hide-in-pre-tpl').hide(); $('.apexnb_background_image_toggle').hide(); $('.edn-template-chooser').show(); $('.edn-font-demo-wrap').hide(); // $('.edn-custom-social-color').hide(); $('.edn-custom-countdown-color').hide(); $('.edn-custom-hide').hide(); $('.edn-show-border-color').hide(); //open panel hide border color if($('input:radio[name="edn_bar_template"]#edn-template-3').is(':checked')){ $('.edn-components-wrap').hide(); $('.edn-common-option-panel').hide(); }else{ $('.edn-components-wrap').show(); $('.edn-common-option-panel').show(); } $('.available-icons').show(); $('.customicons').hide(); } }else{ return false; } }else{ if ($(this).val() == 1) { $('.edn-template-chooser').hide(); $('.edn-hide-in-pre-tpl').show(); $('.apexnb_background_image_toggle').show(); $('.edn-font-demo-wrap').show(); // $('.edn-custom-social-color').show(); $('.edn-custom-countdown-color').show(); $('.edn-custom-hide').show(); $('.edn-show-border-color').show(); var icon_type = $('.edn_icon_types option:selected').val(); if(icon_type == "custom_icon"){ $('.edn_icon_types').closest('.edn-col-icons').find('.customicons').show(); $('.edn_icon_types').closest('.edn-col-icons').find('.available-icons').hide(); }else if(icon_type == "available_font_icon"){ $('.edn_icon_types').closest('.edn-col-icons').find('.customicons').hide(); $('.edn_icon_types').closest('.edn-col-icons').find('.available-icons').show(); } } else { $('.edn-hide-in-pre-tpl').hide(); $('.apexnb_background_image_toggle').hide(); $('.edn-template-chooser').show(); $('.edn-font-demo-wrap').hide(); // $('.edn-custom-social-color').hide(); $('.edn-custom-countdown-color').show(); $('.edn-custom-hide').show(); $('.edn-show-border-color').hide(); $('.available-icons').show(); $('.customicons').hide(); } } }); $('.edn-template').click(function(){ if($(this).val()==3){ $('.edn-components-wrap').show(); $('.edn-common-option-panel').show(); }else{ $('.edn-components-wrap').show(); $('.edn-common-option-panel').show(); } }); if($('input:radio[name="edn_bar_type"]#edn_individual').is(':checked')){ $('.edn-row.edn-template-chooser').css('display','none'); $('.edn-hide-in-pre-tpl').show(); $('.apexnb_background_image_toggle').show(); $('.edn-font-demo-wrap').show(); //$('.edn-custom-social-color').show(); $('.edn-custom-countdown-color').show(); $('.edn-custom-hide').show(); $('.edn-show-border-color').show(); }else{ $('.edn-template-chooser').show(); $('.edn-hide-in-pre-tpl').hide(); $('.apexnb_background_image_toggle').hide(); //$('.edn-custom-social-color').hide(); $('.edn-custom-countdown-color').hide(); $('.edn-custom-hide').hide(); $('.available-icons').show(); $('.customicons').hide(); $('.edn-show-border-color').hide(); }//Choose Notification bar type end $('.edn-icon-list').on('click', '.edn-icon-head', function (e) { if ($(this).parent().find('.edn-arrow i').hasClass('dashicons-arrow-down')) { $(this).parent().find('i.dashicons-arrow-down').removeClass('dashicons-arrow-down').addClass('dashicons-arrow-up'); } else { $(this).parent().find('i.dashicons-arrow-up').removeClass('dashicons-arrow-up').addClass('dashicons-arrow-down'); } $(this).closest('.edn-sortable-icons').find('.edn-icon-body').slideToggle(500); //e.stopPropagation(); }); $('.edn-icon-list').on('click', '.edn-delete-icon', function () { if (confirm(edn_pro_script_variable.icon_delete_confirm)) { // var icon_counter = $('#edn-icon-counter').val(); //icon_counter--; //$('#edn-icon-counter').val(icon_counter); var selector = $(this); $(this).closest('.edn-sortable-icons').fadeOut(800, function () { selector.closest('.edn-sortable-icons').remove(); }); return false; } }); //sortable initialization $('.edn-icon-list').sortable({ containment: "parent" }); //Theme icons expand colledne trigger $('.edn-icon-theme-expand').click(function () { if ($(this).html() === edn_pro_script_variable.icon_expand) { $('.edn-icon-body').slideDown(500) $(this).html(edn_pro_script_variable.icon_collapse) $('i.dashicons-arrow-down').removeClass('dashicons-arrow-down').addClass('dashicons-arrow-up'); } else { $('.edn-icon-body').slideUp(500) $('i.dashicons-arrow-up').removeClass('dashicons-arrow-up').addClass('dashicons-arrow-down'); $(this).html(edn_pro_script_variable.icon_expand); } }); //icon width preview $('#edn-icon-width').keyup(function () { $('.edn-image-icon-preview img').css({ 'width': $(this).val() }); }); //border style preview $('#edn-icon-height').keyup(function () { $('.edn-image-icon-preview img').css({ 'height': $(this).val() }); }); /* End of Social Network Section */ //Choose Notification Components $('select[name="edn_cp_type"]').change(function(){ var val = $(this).val(); if(val=='text'){ $('.edn-cp-block').hide(); $('.edn-bar-effects').hide(); $('#edn-cp-text').show(); if ($('input[name="edn_text_display_mode"]:checked').val()=='static') { $('.edn-multiple-content-wrap').hide(); $('.edn-static-content-wrap').show(); $('.edn-bar-effects').hide(); }else{ $('.edn-static-content-wrap').hide(); $('.edn-multiple-content-wrap').show(); $('.edn-bar-effects').show(); }//Choose Content Display Mode end }else if(val=='email-subs'){ $('.edn-cp-block').hide(); $('.edn-bar-effects').hide(); $('#edn-cp-subscribe').show(); }else if(val=='post-title'){ $('.edn-cp-block').hide(); $('#edn-post-title').show(); $('.edn-bar-effects').show(); }else if(val=='search-form'){ $('.edn-cp-block').hide(); $('#edn-search-form-content').show(); $('.edn-bar-effects').hide(); }else if(val=='social-icons'){ $('.edn-cp-block').hide(); $('#edn-cp-social-icons').show(); $('.edn-bar-effects').hide(); }else{ $('.edn-cp-block').hide(); $('.edn-bar-effects').hide(); } }); // var edn_cp_type = $('input[name="edn_cp_type"]:checked').val(); var edn_cp_type = $('select[name="edn_cp_type"] option:selected').val(); if(edn_cp_type=='text'){ $('.edn-cp-block').hide(); $('.edn-bar-effects').hide(); $('#edn-cp-text').show(); }else if(edn_cp_type=='email-subs'){ $('.edn-cp-block').hide(); $('.edn-bar-effects').hide(); $('#edn-cp-subscribe').show(); }else if(edn_cp_type == 'post-title'){ $('.edn-cp-block').hide(); $('#edn-post-title').show(); $('.edn-bar-effects').show(); }else if(edn_cp_type=='search-form'){ $('.edn-cp-block').hide(); $('#edn-search-form-content').show(); $('.edn-bar-effects').hide(); }else if(edn_cp_type=='social-icons'){ $('.edn-cp-block').hide(); $('#edn-cp-social-icons').show(); $('.edn-bar-effects').hide(); } else{ $('.edn-cp-block').hide(); $('#edn-social-panel').hide(); $('.edn-bar-effects').hide(); }//Choose Notification Components end //multiple content button action $('#edn-add-mcontent').click(function(){ $('.edn-add-multiple-content').toggle(); }); //Choose Content Display Mode $('input[name="edn_text_display_mode"]').click(function () { if ($(this).val()=='static') { $('.edn-multiple-content-wrap').hide(); $('.edn-static-content-wrap').show(); $('.edn-bar-effects').hide(); $(this).attr('checked','checked'); }else{ $('.edn-static-content-wrap').hide(); $('.edn-multiple-content-wrap').show(); $('.edn-bar-effects').show(); $(this).attr('checked','checked'); } }); if(edn_cp_type=='text'){ if ($('input[name="edn_text_display_mode"]:checked').val()=='static') { $('.edn-multiple-content-wrap').hide(); $('.edn-static-content-wrap').show(); $('.edn-bar-effects').hide(); }else{ $('.edn-static-content-wrap').hide(); $('.edn-multiple-content-wrap').show(); $('.edn-bar-effects').show(); }//Choose Content Display Mode end } // Call to action button $('.edn-show-call-button').change(function () { if ($(this).is(':checked')) { $('.edn-call-to-action-type').show(); $('.end-call-to-action-block').show(); }else{ $('.edn-call-to-action-type').hide(); $('.end-call-to-action-block').hide(); } }); if ($('.edn-show-call-button').is(':checked')) { $('.edn-call-to-action-type').show(); $('.end-call-to-action-block').show(); }else{ $('.edn-call-to-action-type').hide(); $('.end-call-to-action-block').hide(); }//edn-show-m-call-button //Choose call to action type for static $('input[name="edn_static[call_action_button]"]').click(function(){ var val = $(this).val(); if(val=='custom'){ $('.edn-call-action').hide(); $('#edn-custom-button-block').show(); }else if(val=='contact'){ $('.edn-call-action').hide(); $('#edn-contact-button-block').show(); } else if(val=='shortcode-popup'){ $('.edn-call-action').hide(); $('#edn-shortcode-button-block').show(); } }); if($('.edn-call-action-type:checked').val()=='custom'){ $('.edn-call-action').hide(); $('#edn-custom-button-block').show(); }else if($('.edn-call-action-type:checked').val()=='contact'){ $('.edn-call-action').hide(); $('#edn-contact-button-block').show(); } else if($('.edn-call-action-type:checked').val()=='shortcode-popup'){ $('.edn-call-action').hide(); $('#edn-shortcode-button-block').show(); } //Choose Contact From for static $('input[name="edn_static[contact_choose]"]').click(function(){ var val = $(this).val(); if(val=='c-form'){ $('.edn-cotnact-from').hide(); $('#edn-contact-custom-form').show(); }else if(val=='form-7'){ $('.edn-cotnact-from').hide(); $('#edn-contact-form-7').show(); } }); if($('input[name="edn_static[contact_choose]"]:checked').val()=='c-form'){ $('.edn-cotnact-from').hide(); $('#edn-contact-custom-form').show(); }else{ $('.edn-cotnact-from').hide(); $('#edn-contact-form-7').show(); } // Multiple Call to action button $('.edn-show-m-call-button').change(function () { if ($(this).is(':checked')) { $('.edn-m-call-to-action-type').show(); $('.end-m-call-to-action-block').show(); }else{ $('.edn-m-call-to-action-type').hide(); $('.end-m-call-to-action-block').hide(); } }); //Choose call to action type for multiple $('input[name="edn_multi[action_button]"]').click(function(){ var val = $(this).val(); if(val=='custom'){ $('.edn-m-call-action').hide(); $('#edn-m-custom-button-block').show(); }else if(val=='contact'){ $('.edn-m-call-action').hide(); $('#edn-m-contact-button-block').show(); }else if(val=='shortcode-popup'){ $('.edn-m-call-action').hide(); $('#edn-m-shortcode-button-block').show(); } }); if($('input[name="edn_multi[action_button]"]:checked').val()=='custom'){ $('.edn-m-call-action').hide(); $('#edn-m-custom-button-block').show(); }else if($('input[name="edn_multi[action_button]"]:checked').val()=='contact'){ $('.edn-m-call-action').hide(); $('#edn-m-contact-button-block').show(); }else if($('input[name="edn_multi[action_button]"]:checked').val()=='shortcode-popup'){ $('.edn-m-call-action').hide(); $('#edn-m-shortcode-button-block').show(); } //Choose Contact From for multiple $('input[name="edn_multi[choose]"]').click(function(){ var val = $(this).val(); if(val=='c-form'){ $('.edn-m-cotnact-from').hide(); $('#edn-m-contact-custom-form').show(); }else if(val=='form-7'){ $('.edn-m-cotnact-from').hide(); $('#edn-m-contact-form-7').show(); } }); if($('input[name="edn_multi[choose]"]:checked').val()=='c-form'){ $('.edn-m-cotnact-from').hide(); $('#edn-m-contact-custom-form').show(); }else{ $('.edn-m-cotnact-from').hide(); $('#edn-m-contact-form-7').show(); } //add multiple content //add multiple content $('#edn-add-mcontent-but').click(function(){ //edn-append-mcontent-prevvar content; var inputid = 'edn-multiple-text'; var editor = tinyMCE.get(inputid); var textArea = jQuery('textarea#' + inputid); if (textArea.length>0 && textArea.is(':visible')) { content = textArea.val(); } else { content = editor.getContent(); } error_flag = 0; if (content == '') { error_flag = 1; var error_html = $('.edn-button-count').data('error-text-cont'); $('#edn-multiple-text').closest('.edn-field-wrapper').find('.edn-error').html(error_html); } if (error_flag == 0) { var content; var inputid = 'edn-multiple-text'; var editor = tinyMCE.get(inputid); var textArea = jQuery('textarea#' + inputid); if (textArea.length>0 && textArea.is(':visible')) { content = textArea.val(); } else { content = editor.getContent(); } var substr_content = content.substr(0,8); // var call_to_action = $('.edn-multiple-content-wrap .edn-show-m-call-button:checked').val(); if($(this).parent().parent().parent().parent().parent().find('.edn-show-m-call-button').is(':checked')){ var call_to_action = 1; } else { var call_to_action = 0; } var call_to_acction_type = $('.edn-multiple-content-wrap .edn-call-action-type:checked').val(); var link_but_text = $('.edn-multiple-content-wrap #edn-link-but-text').val(); var link_but_url = $('.edn-multiple-content-wrap #edn-link-url').val(); var link_target = $(this).parent().parent().parent().parent().parent().find('select option:selected').val(); var link_but_bg_color = $('.edn-multiple-content-wrap #edn-link-but-color').val(); var link_but_txt_color = $('.edn-multiple-content-wrap #edn-link-but-text-color').val(); var contact_form_type = $('.edn-multiple-content-wrap .edn-contact-choose:checked').val(); if(call_to_acction_type=='custom'){ contact_form_type = ''; }else if(call_to_acction_type=='contact'){ contact_form_type = contact_form_type; }else{ contact_form_type = ''; } var contact_bubtn_text = $('.edn-multiple-content-wrap #edn-cc-button-text').val(); var edn_cc_name_label = $('.edn-multiple-content-wrap #edn-cc-name-label').val(); var edn_cc_email_label = $('.edn-multiple-content-wrap #edn-cc-email-label').val(); var edn_cc_name_required = $('.edn-multiple-content-wrap #edn-cc-name-required').val(); var edn_cc_email_required = $('.edn-multiple-content-wrap #edn-cc-email-required').val(); var edn_cc_msg_required = $('.edn-multiple-content-wrap #edn-cc-msg-required').val(); var edn_cc_msg_label = $('.edn-multiple-content-wrap #edn-cc-msg-label').val(); var edn_cc_send_mail = $('.edn-multiple-content-wrap #edn-cc-send-mail').val(); //added extra fields var edn_cc_name_placeholder = $('.edn-multiple-content-wrap #edn-cc-name-placeholder').val(); var edn_cc_email_placeholder = $('.edn-multiple-content-wrap #edn-cc-email-placeholder').val(); var edn_cc_name_error_message = $('.edn-multiple-content-wrap #edn-cc-name-error').val(); var edn_cc_email_error_message = $('.edn-multiple-content-wrap #edn-cc-email-error').val(); var edn_cc_msg_error_message = $('.edn-multiple-content-wrap #edn-cc-msg-error').val(); var edn_cc_email_valid_error_message = $('.edn-multiple-content-wrap #edn-cc-email-valid-error').val(); var edn_cc_msg_placeholder = $('.edn-multiple-content-wrap #edn-cc-msg-placeholder').val(); var edn_cc_success_message = $('.edn-multiple-content-wrap #edn-cc-success-message').val(); var edn_cc_sendfail_msg = $('.edn-multiple-content-wrap #edn-cc-send-fail-msg').val(); var edn_form_shortcode = $('.edn-multiple-content-wrap #edn-form-shortcode').val(); var edn_custom_shortcode_text = $('.edn-multiple-content-wrap #edn-m-shortcode-button-text').val(); var edn_custom_shortcode = $('.edn-multiple-content-wrap #edn-m-custom-shortcode').val(); // var cnt = $("ul.edn-append-mcontent-prev").children().length; // if(cnt > 0){ // var count = parseInt(cnt)+1; // }else{ // var count = parseInt($('.edn-button-count').val())+1; // } var count = randomstring(5); if(call_to_action){ if(call_to_acction_type=='custom'){ var preview_content = ''+ ''+ ''+ ''; }else if(call_to_acction_type=='contact'){ if(contact_form_type=='c-form'){ var preview_content = ''+ ''+ ''+ ''+ ''+ ''+ ''+ ''; ''; ''; ''; ''; '