/** * @package AcyMailing for WordPress * @version 6.1.6 * @author acyba.com * @copyright (C) 2009-2019 ACYBA S.A.R.L. All rights reserved. * @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html */ jQuery(document).ready(function(e){var i,t,n;e(".intext_select").select2({theme:"foundation",minimumResultsForSearch:1/0}),e("#cronsavereport").select2({theme:"foundation",width:"100%",minimumResultsForSearch:1/0}),e("#cronsendreport").select2({theme:"foundation",width:"100%",minimumResultsForSearch:1/0}),e("#smtp_secured").select2({theme:"foundation",width:"100%",minimumResultsForSearch:1/0}),e("#config_encoding").select2({theme:"foundation",width:"100%",minimumResultsForSearch:1/0}),e("#configcharset").select2({theme:"foundation",width:"100%"}),e("#acym__config__bounce__connection").select2({theme:"foundation",width:"100%",minimumResultsForSearch:1/0}),e("#acym__config__bounce__secure_method").select2({theme:"foundation",width:"100%",minimumResultsForSearch:1/0}),e(".intext_select").select2({theme:"foundation",minimumResultsForSearch:1/0}),e("#cronsavereport").select2({theme:"foundation",width:"100%",minimumResultsForSearch:1/0}),e("#cronsendreport").select2({theme:"foundation",width:"100%",minimumResultsForSearch:1/0}),e("#smtp_secured").select2({theme:"foundation",width:"100%",minimumResultsForSearch:1/0}),e("#config_encoding").select2({theme:"foundation",width:"100%",minimumResultsForSearch:1/0}),e("#configcharset").select2({theme:"foundation",width:"100%"}),function(){var i=e('input[name="config[sending_platform]"]');i.on("change",function(){var i=e('input[name="config[sending_platform]"]:checked').val();"server"==i?(e('i[data-radio="config_mailer_methodelasticemail"], label[for="config_mailer_methodelasticemail"]').addClass("is-hidden"),e('i[data-radio="config_mailer_methodsmtp"], label[for="config_mailer_methodsmtp"]').addClass("is-hidden"),e('i[data-radio="config_mailer_methodqmail"], label[for="config_mailer_methodqmail"]').removeClass("is-hidden").show(),e('i[data-radio="config_mailer_methodsendmail"], label[for="config_mailer_methodsendmail"]').removeClass("is-hidden").show(),e('i[data-radio="config_mailer_methodphpmail"], label[for="config_mailer_methodphpmail"]').removeClass("is-hidden").show().click()):(e('i[data-radio="config_mailer_methodqmail"], label[for="config_mailer_methodqmail"]').addClass("is-hidden"),e('i[data-radio="config_mailer_methodsendmail"], label[for="config_mailer_methodsendmail"]').addClass("is-hidden"),e('i[data-radio="config_mailer_methodphpmail"], label[for="config_mailer_methodphpmail"]').addClass("is-hidden"),e('i[data-radio="config_mailer_methodelasticemail"], label[for="config_mailer_methodelasticemail"]').removeClass("is-hidden").show(),e('i[data-radio="config_mailer_methodsmtp"], label[for="config_mailer_methodsmtp"]').removeClass("is-hidden").show().click())});var t=e('input[name="config[mailer_method]"]:checked').val();"phpmail"==t||"sendmail"==t||"qmail"==t?e("#config_sending_platformserver").click():e("#config_sending_platformexternal").click(),i.trigger("change"),e("#config_mailer_method"+t).click()}(),(i=e('input[name="config[mailer_method]"]')).on("change",function(){e(".send_settings").hide();var i=e('input[name="config[mailer_method]"]:checked').val();"sendmail"==i&&e("#sendmail_settings").show(),"smtp"==i&&e("#smtp_settings").show(),"elasticemail"==i&&e("#elastic_settings").show()}),i.trigger("change"),e("#available_ports_check").off("click").on("click",function(i){i.preventDefault();var t=e(this).parent();t.html(''),e.get(AJAX_URL_ACYM+"&ctrl=configuration&task=ports",function(e){t.html(e)})}),e(".acym_autoselect").off("click").on("click",function(){this.select()}),e("#timeoutcheck_action").off("click").on("click",function(i){i.preventDefault();try{e("#timeoutcheck").html(''),e.get(AJAX_URL_ACYM+"&ctrl=configuration&task=detecttimeout",function(i){e("#timeoutcheck").html("Done!")})}catch(e){alert("Could not load the max execution time value : "+e)}}),e("#checkdb_button").off("click").on("click",function(i){i.preventDefault(),e("#checkdb_report").html(''),e.get(AJAX_URL_ACYM+"&ctrl=configuration&task=checkDB",function(i){e("#checkdb_report").html(i)})}),e('input[name="config[auto_bounce]"]').off("change").on("change",function(){e("#acym__configuration__bounce__auto_bounce__configuration").toggle()}),function i(){e(".acym__configuration__mail-settings").is(":visible")&&(e.introContent=[{element:".acym__configuration__mail-settings",text:ACYM_JS_TXT.ACYM_INTRO_MAIL_SETTINGS,position:"top"},{element:".acym__configuration__advanced",text:ACYM_JS_TXT.ACYM_INTRO_ADVANCED,position:"top"}],e.setIntrojs("configuration__mail-settings")),e('[name="config[dkim]"]').on("change",function(){e.introContent=[{element:".acym__configuration__dkim",text:ACYM_JS_TXT.ACYM_INTRO_DKIM,position:"top"}],e.setIntrojs("configuration__dkim")}),e(".acym__configuration__cron").is(":visible")&&(e.introContent=[{element:".acym__configuration__cron",text:ACYM_JS_TXT.ACYM_INTRO_CRON}],e.setIntrojs("configuration__cron")),e(".acym__configuration__subscription").is(":visible")&&(e.introContent=[{element:".acym__configuration__subscription",text:ACYM_JS_TXT.ACYM_INTRO_SUBSCRIPTION}],e.setIntrojs("configuration__subscription")),e(".acym__configuration__check-database").is(":visible")&&(e.introContent=[{element:".acym__configuration__check-database",text:ACYM_JS_TXT.ACYM_INTRO_CHECK_DATABASE}],e.setIntrojs("configuration__check-database")),e(".acym_tab").on("click",function(){setTimeout(function(){i()},500)})}(),e("#sendorderid").on("change",function(){"rand"==this.value&&alert(ACYM_JS_TXT.ACYM_NO_RAND_FOR_MULTQUEUE)}),t=e("#acym__configuration__cron__report--send-to"),n=t.attr("placeholder"),t.select2({width:"100%",placeholder:n,tags:!0,tokenSeparators:[","," "],createTag:function(i){var t=e.trim(i.term);return null===t.match(ACYM_REGEX_EMAIL)?null:{id:t,text:t,newTag:!0}}})});