// source --> https://www.aidec-info.com/wp-content/cache/autoptimize/js/autoptimize_single_ad6b7a95a9fe7a2614792aa8def6a2ac.js?ver=4.9.8 var ddd_full_stop=0;var json_counters_array=[];jQuery(document).ready(function(e){e("#ddp-success-report").hide(),new Clipboard("#ddp-copy-report").on("success",function(){e("#ddp-success-report").show();});jQuery('.wrap.ddp-assistant:not(.activated) a.nav-tab:not(.divi_den_pro_dashboard):not(.ddp_assistant_system_status):not(.ddp_assistant_help_faq):not(.ddp_start_here)').addClass('disabled');jQuery('table.ddp-report-table td a, table.ddp-report-table th a').on('click touch',function(event){event.preventDefault();});jQuery('#wp-ddp_wp_content-wrap').appendTo('tr#wp-ddp-column td');setTimeout(function(){jQuery('.ddp-assistant>h1').insertBefore('h2.nav-tab-wrapper');},100);function ddp_get_tinymce_content(){if(jQuery(".ddp_wl_settings #wp-content-wrap").hasClass("tmce-active")){return tinyMCE.activeEditor.getContent();}else{return jQuery('#html_text_area_id').val();}} if(jQuery('.form-table.ddp_wl label input[name=ddp_plugin_name]').length>0){ddp_n=$('.form-table.ddp_wl label input[name=ddp_plugin_name]').val();ddp_n=ddp_n.replace(/\s+/g,'_').toLowerCase();ddp_url_path=window.location.pathname;$('.new_admin_url').html(window.location.protocol+'//'+window.location.hostname+ddp_url_path+'?page='+ddp_n+'_dashboard_wl');} jQuery('.form-table.ddp_wl label input[name=ddp_plugin_name]').on('keyup',function(){ddp_n=$(this).val();ddp_n=ddp_n.replace(/\s+/g,'_').toLowerCase();ddp_url_path=window.location.pathname;$('.new_admin_url').html(window.location.protocol+'//'+window.location.hostname+ddp_url_path+'?page='+ddp_n+'_dashboard_wl');});jQuery('p.submit.ddp_wl.save_settings input').on('click touch',function(event){event.preventDefault();ddd_full_stop=0;jQuery('.form-table.ddp_wl label input, .form-table.ddp_wl label textarea, #wp-ddp_wp_content-wrap').each(function(){if($(this).attr('id')!=='wp-ddp_wp_content-wrap'&&$(this).attr('name')!=='ddp_plugin_icon'){if($(this).val()===''){ddd_full_stop=1;$(this).addClass('not-filled');$(this).siblings('.ddp-error-message').remove();$(this).after('This field is required')}}});if(ddd_full_stop===0){$(this).next().hide();jQuery('.form-table.ddp_wl label input, .form-table.ddp_wl label textarea, #wp-ddp_wp_content-wrap').each(function(){if($(this).attr('id')==='wp-ddp_wp_content-wrap'){ajax_option='ddp_wp_content';ajax_val=tinyMCE.activeEditor.getContent();}else{ajax_option=$(this).attr('name');ajax_val=$(this).val();} if(ajax_option==='ddp_plugin_name'){var new_name=ajax_val;var new_link=ajax_val.replace(/\s+/g,'_').toLowerCase();if(jQuery('input[name=ddp_wl]').is(":checked")){redirect_link=window.location.pathname+'?page='+new_link+'_dashboard_wl&tab=ddp_wl'}else redirect_link=window.location.pathname+'?page=divi_den_pro_dashboard&tab=ddp_wl';if(jQuery('input[name=ddp_hide_menu]').is(":checked")){redirect_link=window.location.pathname.replace('admin.php','');}} jQuery.ajax({type:'POST',url:ajaxurl,data:'action=ddp_update_option&ddp_option='+ajax_option+'&ddp_option_val='+ajax_val,success:function(data){if(redirect_link)window.location.replace(redirect_link);else window.location.reload();},error:function(data){}});});}else{$(this).next().show();}});jQuery('p input#submit_wl.submit_wl_disabled,p input#submit_wl.submit_wl_enabled').on('click',function(event){event.preventDefault();ddd_full_stop=0;jQuery('.form-table.ddp_wl label input, .form-table.ddp_wl label textarea, #wp-ddp_wp_content-wrap').each(function(){if($(this).attr('id')!=='wp-ddp_wp_content-wrap'&&$(this).attr('name')!=='ddp_plugin_icon'){if($(this).val()===''){ddd_full_stop=1;$(this).addClass('not-filled');$(this).siblings('.ddp-error-message').remove();$(this).after('This field is required')}}});if(ddd_full_stop===0){$(this).next().hide();$('.ddp_wl_hidden .et-box-content .et_pb_button_slider').click();$('.submit.ddp_wl.save_settings input').click();}else{$(this).next().show();}});});jQuery(document).ready(function($){$('#ddp-preview-window').insertAfter('body > :last-child');jQuery.fn.center=function(){this.css("position","absolute");this.css("top",(jQuery(window).height()-this.height())/2+jQuery(window).scrollTop()+"px");this.css("left",(jQuery(window).width()-this.width())/2+jQuery(window).scrollLeft()+"px");return this;} $('#ddp-preview').on('click',function(){jQuery("#ddp-preview-window").center();$('#ddp-preview-window').show();});$('#ddp-preview-close').on('click',function(){$('#ddp-preview-window').hide();});function onIframeLoad(){setTimeout(function(){$('iframe#ondemanIframe').on('load',function(){var frame=document.getElementById('ondemanIframe');$('#et_pb_loading_animation').remove();jQuery.ajax({type:'GET',url:ajaxurl,data:'action=ddp_get_option',success:function(data){var ddp_sp_enable=data+'';if(ddp_sp_enable==='enabled'){frame.contentWindow.postMessage('pro_membership_activated','*');}else{frame.contentWindow.postMessage('pro_membership_deactivated','*');}}});function getUrlVars(){var vars=[],hash;var hashes=window.location.href.slice(window.location.href.indexOf('?')+1).split('&');for(var i=0;i0){$('ul.et_pb_saved_layouts_list li:not(.added_image)').each(function(){this_title=$(this).find('a').text();this_class=this_title.replace(/-+/g,'').replace(/\s+/g,'-').toLowerCase();$(this).addClass(this_class);jQuery.ajax({type:'POST',url:ajaxurl,data:'action=ddp_show_featured_image&ddp_title_image='+this_title,success:function(data){if(data!==''){img_link=data.substring(data.indexOf("|")+1);img_post_title=data.replace(img_link,'').replace('|','');$('ul.et_pb_saved_layouts_list li:not(.with-image)').each(function(){this_title=$(this).find('a').text();if(this_title===img_post_title){$(this).find('a').before('');$(this).addClass('with-image');}});}},error:function(data){}});$(this).addClass('added_image');});} setInterval(function(){if($('div.et-fb-settings-options-tab-modules_library ul:not(.ddp_images_sent)').length>0){$('div.et-fb-settings-options-tab-modules_library ul li:not(.added_image):not(.with-image)').each(function(){this_title=$(this).find('span.et_module_title').text().trim();this_class=this_title.replace(/-+/g,'').replace(/\s+/g,'-').toLowerCase();$(this).addClass(this_class);jQuery.ajax({type:'POST',url:ajaxurl,data:'action=ddp_show_featured_image&ddp_title_image='+this_title,success:function(data){if(data!==''){img_link=data.substring(data.indexOf("|")+1);img_post_title=data.replace(img_link,'').replace('|','');$('div.et-fb-settings-options-tab-modules_library ul li:not(.with-image)').each(function(){this_title=$(this).find('span.et_module_title').text().trim();if(this_title===img_post_title&&$(this).find('img.ddp_preview').length===0){$(this).find('span.et_module_title').after('');$(this).addClass('with-image');}});}},error:function(data){}});$(this).addClass('added_image');});}},1000);var global_json_counter=0;var json_counter=0;eventer(messageEvent,function(e){if(e.origin==='https://ondemand.divi-den.com'){var response;if(jQuery.type(e.data)==='string'){if(~e.data.indexOf('context')){var ddp_replace_content='off';if(jQuery('#et_pb_main_container > .et_pb_section .et_pb_module_block').length<=0){ddp_replace_content='on';} response=jQuery.parseJSON(e.data);if(response){if(!$(frame).hasClass('settingsIframe')&&!$(frame).hasClass('vbIframe')&&response.context=='et_builder'){layout=JSON.stringify(response);var ddp_list=jQuery('.et-pb-all-modules-tab .et-pb-load-layouts');var ddp_li=ddp_list.children('li').last().clone(true);ddp_li.addClass('layout_here');ddp_li.appendTo(ddp_list);jQuery('.layout_here').data('layout_id',{layout:layout,replace_content:ddp_replace_content});jQuery('.layout_here .et_pb_layout_button_load').click();}else if(response.context=='et_builder_layouts'||$(frame).hasClass('settingsIframe')){response_data=encodeURIComponent(JSON.stringify(response.data));jQuery.ajax({type:'POST',url:ajaxurl,data:'action=ddp_import_posts&posts='+response_data,success:function(data){if($("div.sectionSaved").length===0){$('.ddp-tab-section, .ddp-tab-module').html('
\

Success! Your section/module is being saved to your local Divi library.

\

Choose your next step...

\

1. Find new modules and save to your library

\ Find New Pro Modules\

2. Begin editing - Use the "Add From Library" tab to load sections/modules from local Divi Library

\ To Continue - Save and Reload Page\ (please do it manually if you are in Divi Visual Builder)\
');$('body .ddp-tab-section a.ddp_reload, body .ddp-tab-module a.ddp_reload').on('click',function(e){e.preventDefault();$('div.sectionSaved').html('

Reloading...

');$('input.button-primary#publish').click();$('button.et-fb-button--publish').click();$('li#wp-admin-bar-et-disable-visual-builder a.ab-item').click();});var ddp_rand=Math.floor((Math.random()*1000000)+1);if(ddp_wl_options_for_js.ddp_status==='enabled'){ddp_sections_link='https://ondemand.divi-den.com/sections-search-api-ljljdfre935/?uid='+ddp_rand;ddp_modules_link='https://ondemand.divi-den.com/modules-search-api-fdge43y/?uid='+ddp_rand;}else{ddp_sections_link='https://ondemand.divi-den.com/sections-search-no-api-asdfv324/?uid='+ddp_rand;ddp_modules_link='https://ondemand.divi-den.com/modules-search-no-api-33jwer3/?uid='+ddp_rand;} $('body .ddp-tab-section a.ddp_close').on('click',function(e){e.preventDefault();$('div.sectionSaved').html('

Loading...

');$('.ddp-tab-section').html('');onIframeLoad();});$('body .ddp-tab-module a.ddp_close').on('click',function(e){e.preventDefault();$('div.sectionSaved').html('

Loading...

');$('.ddp-tab-module').html('');onIframeLoad();});} $('body .ddp-assistant .loaded_message').show();setTimeout(function(){$('body .ddp-assistant .loaded_message').hide();},5500);},error:function(data){console.log(data);}});}}} else if(~e.data.indexOf('.')){console.log('CSS');$('input#_et_pb_custom_css').val(e.data);}else if(~e.data.indexOf(',jpg')||~e.data.indexOf(',png')){console.log('IMAGE');ddp_featured_image_url=e.data.replace(/\,/g,'.') setTimeout(function(){jQuery.ajax({type:'POST',url:ajaxurl,data:'action=ddp_import_featured_image&ddp_featured_image='+ddp_featured_image_url,success:function(data){},error:function(data){}});},1000);}}}},false);});},200);} $('body .ddp-assistant .loaded_message span.close').on('click',function(){$('body .ddp-assistant .loaded_message').hide();});jQuery(document).on('keyup',function(evt){if(evt.keyCode==27){$('body .ddp-assistant .loaded_message').hide();}});if(typeof ajaxurl==='undefined'){ajaxurl=ddp_wl_options_for_js.ddp_ajax_url;} if($('body').hasClass('et-fb')||$('body').hasClass('wp-admin')){jQuery.ajax({type:'GET',url:ajaxurl,data:'action=ddp_get_option_wl',success:function(data){var ddp_enable=data+'';if(ddp_enable==='disabled'){onIframeLoad();$(document).on('mouseup','.et-pb-layout-buttons-load',function(){setTimeout(function(){var ddp_rand=Math.floor((Math.random()*1000000)+1);if(ddp_wl_options_for_js.ddp_status==='enabled'){ddp_layouts_link='https://ondemand.divi-den.com/new-api-layouts-search-ghaser65/?uid='+ddp_rand;}else{ddp_layouts_link='https://ondemand.divi-den.com/new-no-api-layouts-search-dngfh4q2/?uid='+ddp_rand;} var tabbar=$('.et-pb-saved-modules-switcher');if(ddp_wl_options_for_js.ddp_plugin_setting_tab_position==='on'){if(tabbar.length){tabbar.append('
  • '+ddp_wl_options_for_js.ddp_wl_pn_for_js+'
  • ');$(".et_pb_modal_settings").append('
    \

    \ Important: if you\'re replacing the content, please manually clear the layout and update the page, then load the new layout.

    \
    ');}}else{$('li.et-pb-options-tabs-links-active').removeClass('et-pb-options-tabs-links-active');$('div.active-container').removeClass('active-container').css('opacity',0);tabbar.prepend('');$(".et_pb_modal_settings").append('
    \

    \ Important: if you\'re replacing the content, please manually clear the layout and update the page, then load the new layout.

    \
    ');}},200);onIframeLoad();});$(document).on('mouseup','.et-pb-section-add-saved',function(){setTimeout(function(){jQuery('.et_pb_modal_settings.et_pb_modal_no_tabs').removeClass('et_pb_modal_no_tabs');var ddp_rand=Math.floor((Math.random()*1000000)+1);if(ddp_wl_options_for_js.ddp_status==='enabled'){ddp_sections_link='https://ondemand.divi-den.com/sections-search-api-ljljdfre935/?uid='+ddp_rand;}else ddp_sections_link='https://ondemand.divi-den.com/sections-search-no-api-asdfv324/?uid='+ddp_rand;if(ddp_wl_options_for_js.ddp_plugin_setting_tab_position==='on'){jQuery('.et_pb_modal_settings_container h3').after(' \ \
    ');} else{$('li.et-pb-options-tabs-links-active').removeClass('et-pb-options-tabs-links-active');$('div.active-container').removeClass('active-container').css('opacity',0);jQuery('.et_pb_modal_settings_container h3').after(' \ \
    ');}},200);onIframeLoad();});$(document).on('mouseup','.et-pb-column .et-pb-insert-module',function(){setTimeout(function(){jQuery('.et_pb_modal_settings.et_pb_modal_no_tabs').removeClass('et_pb_modal_no_tabs');var ddp_rand=Math.floor((Math.random()*1000000)+1);if(ddp_wl_options_for_js.ddp_status==='enabled'){ddp_modules_link='https://ondemand.divi-den.com/modules-search-api-fdge43y/?uid='+ddp_rand;}else ddp_modules_link='https://ondemand.divi-den.com/modules-search-no-api-33jwer3/?uid='+ddp_rand;$('.et-pb-options-tabs-links.et-pb-saved-modules-switcher').remove();if(ddp_wl_options_for_js.ddp_plugin_setting_tab_position==='on'){jQuery('.et_pb_modal_settings_container h3').after(' \ \
    \ ');}else{$('li.et-pb-options-tabs-links-active').removeClass('et-pb-options-tabs-links-active');$('div.active-container').removeClass('active-container').css('opacity',0);jQuery('.et_pb_modal_settings_container h3').after(' \ \
    \ ');}},200);onIframeLoad();});setInterval(function(){if(($('a.modules_all').text()=='New Section'||$('a.modules_all').text()=='New Module')&&$('.ddp').length<=0){$('#et-fb-settings-column').css('overflow','hidden');var ddp_rand=Math.floor((Math.random()*1000000)+1);if(ddp_wl_options_for_js.ddp_status==='enabled'){ddp_sections_link='https://ondemand.divi-den.com/sections-search-api-ljljdfre935/?uid='+ddp_rand;ddp_modules_link='https://ondemand.divi-den.com/modules-search-api-fdge43y/?uid='+ddp_rand;}else{ddp_sections_link='https://ondemand.divi-den.com/sections-search-no-api-asdfv324/?uid='+ddp_rand;ddp_modules_link='https://ondemand.divi-den.com/modules-search-no-api-33jwer3/?uid='+ddp_rand;} if(ddp_wl_options_for_js.ddp_plugin_setting_tab_position==='on'){$('a.modules_all').parents('.et-fb-settings-tabs-nav').append('
  • \ '+ddp_wl_options_for_js.ddp_wl_pn_for_js+'
  • ');if($('a.modules_all').text()=='New Section'){$(".et-fb-settings-options-wrap > .et-fb-settings-options").append('
    \
    ');} if($('a.modules_all').text()=='New Module'){$(".et-fb-settings-options-wrap > .et-fb-settings-options").append('
    \
    ');} var attr_style=$('a.modules_all').parents('#et-fb-settings-column').attr('style');$('a.modules_all').parents('#et-fb-settings-column').attr('style',attr_style+' width: 400px; min-height: auto; left: 38%;')}else{$('a.modules_all').parents('.et-fb-settings-tabs-nav').prepend('
  • \ '+ddp_wl_options_for_js.ddp_wl_pn_for_js+'
  • ');if($('a.modules_all').text()=='New Section'){$(".et-fb-settings-options-wrap > .et-fb-settings-options").prepend('
    \
    ');} if($('a.modules_all').text()=='New Module'){$(".et-fb-settings-options-wrap > .et-fb-settings-options").prepend('
    \
    ');} $(".ddp-tab-section").siblings('div').removeClass('et-fb-settings-options-tab--active');$('.et-fb-settings-tabs-nav li.ddp a').parent('li').siblings().removeClass('et-fb-settings-tabs-nav-item--active');$('.et-fb-settings-options-wrap').attr('style','max-height: 100% !important; max-height: 100% !important; height: 100% !important;');var attr_style=$('a.modules_all').parents('#et-fb-settings-column').attr('style');$('a.modules_all').parents('#et-fb-settings-column').attr('style',attr_style+' width: 80%; min-height: 650px; left: 10%;') $('.ddp').parents('.et-fb-settings-tabs-nav').addClass('ddp-tab-parent');$('.ddp-tab-section').parents('div.et-fb-settings-options').removeClass('ddp-option-parent');} $('.et-fb-settings-options-wrap').attr('style','max-height: 100% !important; max-height: 100% !important; height: 100% !important;');$('.et-fb-main-settings--add_new_module .et-fb-settings-tabs-nav li:not(.ddp) a').on('click',function(){$(".ddp-tab-section").removeClass('et-fb-settings-options-tab--active');$(this).parent('li').siblings('li').removeClass('et-fb-settings-tabs-nav-item--active');$(this).parent('li').addClass('et-fb-settings-tabs-nav-item--active');$(this).parents('div.et-fb-settings-options').removeClass('ddp-option-parent');$('.et-fb-settings-options-wrap').removeAttr('style');var attr_style=$('a.modules_all').parents('#et-fb-settings-column').attr('style');$('a.modules_all').parents('#et-fb-settings-column').attr('style',attr_style+' width: 400px; min-height: auto; left: 38%;') $(this).parents('.et-fb-settings-tabs-nav').removeClass('ddp-tab-parent');});$('.et-fb-main-settings--add_new_module .et-fb-settings-tabs-nav li.ddp a').on('click',function(e){e.preventDefault();$(this).parent('li').siblings().removeClass('et-fb-settings-tabs-nav-item--active');$(".ddp-tab-section").siblings('div').removeClass('et-fb-settings-options-tab--active');$(this).parent('li').addClass('et-fb-settings-tabs-nav-item--active');$(".ddp-tab-section").addClass('et-fb-settings-options-tab--active');$(".ddp-tab-section").parents('div.et-fb-settings-options-wrap').addClass('ddp-option-parent');var attr_style=$('a.modules_all').parents('#et-fb-settings-column').attr('style');$('a.modules_all').parents('#et-fb-settings-column').attr('style',attr_style+' width: 80%; min-height: 650px; left: 10%;');$('.et-fb-settings-options-wrap').attr('style','max-height: 100% !important; height: 100% !important;');$(this).parents('.et-fb-settings-tabs-nav').addClass('ddp-tab-parent');});onIframeLoad();} if($('.et-fb-module-settings li[data-open_tab="ddp-tab"]').length>0){if(!$('.et-fb-module-settings li[data-open_tab="ddp-tab"]').hasClass('et-fb-settings-tabs-nav-item--active')){var new_style=" width: 400px; min-height: auto; left: 38%;";var attr_style=$('a.modules_all').parents('#et-fb-settings-column').attr('style');if(attr_style&&~attr_style.indexOf(new_style)){attr_style=attr_style.replace(/ width: 400px; min-height: auto; left: 38%;/,'');attr_style=attr_style.replace(/ width: 80%; min-height: 650px; left: 10%;/g,'');} $('a.modules_all').parents('#et-fb-settings-column').attr('style',attr_style+new_style);$('.et-fb-settings-options-wrap').removeAttr('style');$('.et-fb-settings-tabs-nav').removeClass('ddp-tab-parent');this_tab_text=$('li.et-fb-settings-tabs-nav-item--active').text();if(this_tab_text==='New Section'){$('.et-fb-settings-options-wrap .et-fb-settings-options .et-fb-settings-options-tab-modules_all').show();$('.et-fb-settings-options-wrap .et-fb-settings-options .et-fb-settings-options-tab-modules_library').hide();$('.et-fb-settings-options-wrap').attr('style','max-height: 130px !important; height: 100% !important;');var attr_style=$('a.modules_all').parents('#et-fb-settings-column').attr('style');attr_style=attr_style.replace(/min-height: auto;/g,'');attr_style=attr_style.replace(/min-height: 400px;/g,'');if(attr_style&&attr_style.indexOf('min-height: 130px')<1) $('a.modules_all').parents('#et-fb-settings-column').attr('style',attr_style+' min-height: 130px;')} if(this_tab_text==='Add From Library'){$('.et-fb-settings-options-wrap .et-fb-settings-options .et-fb-settings-options-tab-modules_all').hide();$('.et-fb-settings-options-wrap .et-fb-settings-options .et-fb-settings-options-tab-modules_library').show();$('.et-fb-settings-options-wrap').css('overflow-y','auto');$('.et-fb-settings-options-wrap').attr('style','max-height: 500px !important; height: 100% !important;');var attr_style=$('a.modules_all').parents('#et-fb-settings-column').attr('style');attr_style=attr_style.replace(/min-height: auto;/g,'');attr_style=attr_style.replace(/min-height: 130px;/g,'');if(attr_style&&attr_style.indexOf('min-height: 400px')<1) $('a.modules_all').parents('#et-fb-settings-column').attr('style',attr_style+' min-height: 400px;')} if(this_tab_text==='New Module'){$('.et-fb-settings-options-wrap .et-fb-settings-options .et-fb-settings-options-tab-modules_all').show();$('.et-fb-settings-options-wrap .et-fb-settings-options .et-fb-settings-options-tab-modules_library').hide();$('.et-fb-settings-options-wrap').css('overflow-y','auto');$('.et-fb-settings-options-wrap').attr('style','max-height: 500px !important; height: 100% !important;');var attr_style=$('a.modules_all').parents('#et-fb-settings-column').attr('style');attr_style=attr_style.replace(/min-height: auto;/g,'');attr_style=attr_style.replace(/min-height: 130px;/g,'');if(attr_style&&attr_style.indexOf('min-height: 400px')<1) $('a.modules_all').parents('#et-fb-settings-column').attr('style',attr_style+' min-height: 400px;')}}else{var attr_style=$('a.modules_all').parents('#et-fb-settings-column').attr('style');var new_style=" width: 80%; min-height: 650px; left: 10%;";attr_style=attr_style.replace(/ width: 400px; min-height: auto; left: 38%;/g,'');if(attr_style&&~attr_style.indexOf(new_style)){attr_style=attr_style.replace(/ width: 80%; min-height: 650px; left: 10%;/,'');} $('a.modules_all').parents('#et-fb-settings-column').attr('style',attr_style+' width: 80%; min-height: 650px; left: 10%;') $('.et-fb-settings-options-wrap').attr('style','max-height: 100% !important; min-height: 100% !important; height: 100% !important;');$(this).parents('.et-fb-settings-tabs-nav').addClass('ddp-tab-parent');$('.et-fb-settings-options-wrap .et-fb-settings-options .et-fb-settings-options-tab-modules_all').hide();$('.et-fb-settings-options-wrap .et-fb-settings-options .et-fb-settings-options-tab-modules_library').hide();}}},500);}else onIframeLoad();},error:function(data){}});} setInterval(function(){if($('iframe#ondemandIframe.settingsIframe').length){onIframeLoad();}},1000);$('.ddp-assistant .yes_no_button').each(function(){var $checkbox=$(this);var value=$checkbox.is(':checked');var state=value?'et_pb_on_state':'et_pb_off_state';var $template=$($('#epanel-yes-no-button-template').html()).find('.et_pb_yes_no_button').addClass(state);$checkbox.hide().after($template);if('et_pb_static_css_file'===$checkbox.attr('id')){$checkbox.parent().addClass(state).next().addClass('et_pb_clear_static_css').on('click',function(){epanel_clear_static_css(false,true);});if(!value){$checkbox.parents('.et-epanel-box').next().hide();}}});$('.ddp_settings.save_settings input#submit').on('click',function(e){e.preventDefault();$(".ddp-archive-settings .et-epanel-box select").each(function(){var this_option=$(this).attr('id');var this_val=$(this).val();jQuery.ajax({type:'POST',url:ajaxurl,data:'action=ddp_update_option&ddp_option='+this_option+'&ddp_option_val='+this_val,success:function(data){window.location.reload();},error:function(data){}});});});$('.ddp-assistant .et-box-content').on('click','.et_pb_yes_no_button',function(e){e.preventDefault();var $click_area=$(this),$box_content=$click_area.parents('.et-box-content'),$checkbox=$box_content.find('input[type="checkbox"]'),$state=$box_content.find('.et_pb_yes_no_button');$ddp_option=$box_content.find('input').attr('name');$state.toggleClass('et_pb_on_state et_pb_off_state');if($checkbox.is(':checked')){$checkbox.prop('checked',false);}else{$checkbox.prop('checked',true);} if($click_area.hasClass('et_pb_on_state')){ajax_value='enabled';if($click_area.hasClass('ddp_enable')){var ddp_rand=Math.floor((Math.random()*1000000)+1);if(ddp_wl_options_for_js.ddp_status==='enabled'){ddp_layouts_link='https://ondemand.divi-den.com/new-api-layouts-search-ghaser65/?uid='+ddp_rand;}else{ddp_layouts_link='https://ondemand.divi-den.com/new-no-api-layouts-search-dngfh4q2/?uid='+ddp_rand;} $('').insertAfter('.ddp-assistant hr');onIframeLoad();}}else{ajax_value='disabled';} if(ddd_full_stop===0){jQuery.ajax({type:'POST',url:ajaxurl,data:'action=ddp_update_option&ddp_option='+$ddp_option+'&ddp_option_val='+ajax_value,success:function(data){},error:function(data){}});}});$('.ddp-accordion .ddp-accordion-header').click(function(){$(this).next('.ddp-accordion-content').slideToggle('fast');$(this).parent('.ddp-accordion').toggleClass('closed').toggleClass('opened');$('.ddp-accordion.opened h3 span').html('-');$('.ddp-accordion.closed h3 span').html('+');});setTimeout(function(){if($('.ddp-assistant.activated h2.nav-tab-wrapper').length>0){$('div[data-dismissible=disable-ddpro-cache-notice-forever]').insertAfter('.ddp-assistant.activated h2.nav-tab-wrapper');$('div[data-dismissible=disable-ddpro-cache-notice-forever]').show();}},300);setInterval(function(){if($('iframe#ondemanIframe').length>0){$('div[data-dismissible=disable-ddpro-cache-notice-forever]:not(.shown)').insertBefore('iframe#ondemanIframe');$('div[data-dismissible=disable-ddpro-cache-notice-forever]:not(.shown)').show();$('div[data-dismissible=disable-ddpro-cache-notice-forever]').addClass('shown');}},100);$('input[name="ddp_plugin_name"]').alphanum({allowSpace:true,allowUpper:true});if($("input#ddp_plugin_setting_tab_position").length>0){jQuery.ajax({type:'GET',url:ajaxurl,data:'action=ddp_get_option_ddp_plugin_setting_tab_position',success:function(data){if((data)==='on')$("input#ddp_plugin_setting_tab_position").attr('checked','checked');else $("input#ddp_plugin_setting_tab_position").removeAttr('checked');},error:function(data){}});$("input#ddp_plugin_setting_tab_position").on('change',function(){var this_option=$(this).attr('id');if($(this).attr('checked')==='checked')$(this).val('on');else $(this).val('off');var this_val=$(this).val();jQuery.ajax({type:'POST',url:ajaxurl,data:'action=ddp_update_option&ddp_option='+this_option+'&ddp_option_val='+this_val,success:function(data){},error:function(data){}});});}});