/** * @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 t,_,c,i,s,o,a;e("#export_charset").select2({theme:"foundation",width:"100%"}),e("#export_charset").on("select2:open",function(){e(".select2-search--dropdown .select2-search__field").attr("placeholder",ACYM_JS_TXT.ACYM_SEARCH_ENCODING)}),e(".acym__users__import__from_database__fields").select2({theme:"foundation",minimumResultsForSearch:1/0,width:"100%"}),e(".acym__custom__fields__select__form").select2({theme:"foundation",width:"100%"}),e(".acym__custom__fields__select__multiple__form").select2({theme:"foundation",width:"100%",escapeMarkup:function(e){return e}}),e(".acym__select__country").select2({theme:"foundation",width:"100%"}),e(".fieldAssignment").select2({theme:"foundation"}),e("#acyencoding").select2({theme:"foundation",width:"100%"}),t=e("#acym_form"),e(".acym__user__action--subscribe").off("click").on("click",function(){e("#acym__modal__lists-selected").attr("value",e(this).attr("id")),t.find('[name="task"]').attr("value","subscribe"),t.submit()}),e(".acym__user__action--unsubscribe").off("click").on("click",function(){e("#acym__modal__lists-selected").attr("value",e(this).attr("id")),t.find('[name="task"]').attr("value","unsubscribe"),t.submit()}),o=e("#acym__users__listing__number_to_add_to_list"),a=e("#acym__users__listing__button--add-to-list"),"0"==o.html()&&a.attr("disabled","disabled"),o.off("DOMSubtreeModified").on("DOMSubtreeModified",function(){"0"==o.html()?a.attr("disabled","disabled"):a.removeAttr("disabled")}),e("#acym__user__listing__add-subscription__modal #modal__pagination__confirm").off("click").on("click",function(t){e('input[name="task"]').attr("value","addToList"),e("#formSubmit").click()}),_=e("#acym__users__export__select_lists"),c=e("#acym__users__export__select_all"),"lists"===(i=e("#acym__users__export__users-to-export input")).val()?_.show():_.hide(),i.on("change",function(){"list"===e(this).val()?(_.show(),c.hide()):(_.hide(),c.show(),e(".modal__pagination__listing__lists__list--checkbox").prop("checked",!1))}),s=e(".acym__users__export__export_fields"),e("#acym__users__export__check_all_field").off("click").on("click",function(){s.prop("checked",!0)}),e("#acym__users__export__check_default_field").off("click").on("click",function(){s.prop("checked",!1),e("#checkbox_email").prop("checked",!0),e("#checkbox_name").prop("checked",!0)}),function(){var t=e(".modal__pagination__listing__lists__list--checkbox");e("#acym__users__export__check_all_list").off("click").on("click",function(){t.prop("checked",!0)}),e("#acym__users__export__check_none_list").off("click").on("click",function(){t.prop("checked",!1)})}(),e("#acym__export__button").on("click",function(){setTimeout(function(){e("#formSubmit")[0].disabled=!1},5)}),e("#checkbox_all").off("change").on("change",function(){var t=e('[name="elements_checked[]"]');e(this).is(":checked")?t.prop("checked",!0):t.prop("checked",!1),t.trigger("change")}),e(".acym__user__show-subscription").off("click").on("click",function(){var t=e(this),_=t.closest(".acym__users__subscription"),c=_.find(".acym__user__show-subscription-bt");_=_.find(".acym_subscription_more"),0==t.attr("data-iscollapsed")?(t.attr("data-iscollapsed","1").hide(),c.text("<"),_.fadeIn("slow"),t.fadeIn("slow")):(t.attr("data-iscollapsed","0").hide(),_.fadeOut("slow",function(){c.text("+"+t.attr("value")),t.fadeIn("fast")}))})});