wp_back/wp-content/plugins/wp-asset-clean-up/assets/script.min.js

1 line
32 KiB
JavaScript
Raw Permalink Normal View History

2024-05-20 15:37:46 +03:00
!function(e){e.fn.wpAssetCleanUp=function(){let a="#wpacu_meta_box_content";return{cssJsManagerActions:function(){let a,t,c,s=".input-unload-on-this-page.wpacu-not-locked";e(document).on("click change",".input-unload-on-this-page",function(s){if(a=e(this).attr("data-handle"),t=e(this).hasClass("wpacu_unload_rule_for_style")?"style":"script",e(this).prop("checked")){if("click"===s.type&&!e.fn.wpAssetCleanUp().triggerAlertWhenAnyUnloadRuleIsChosen(a,t))return!1;e.fn.wpAssetCleanUp().uncheckAllOtherBulkUnloadRules(e(this),!1),e.fn.wpAssetCleanUp().showHandleLoadExceptionArea(t,a),e(this).closest("tr").addClass("wpacu_not_load")}else e(this).closest("tr").removeClass("wpacu_not_load"),c=e(this).parents(".wpacu_asset_row"),e.fn.wpAssetCleanUp().hideHandleLoadExceptionArea(c,a,t)}),e(".wpacu-area-check-all").on("click",function(a){a.preventDefault();let t=e(this).attr("data-wpacu-plugin");e('table.wpacu_list_by_location[data-wpacu-plugin="'+t+'"]').find(s).prop("checked",!0).closest("tr").addClass("wpacu_not_load")}),e(".wpacu-area-uncheck-all").on("click",function(a){a.preventDefault();let t=e(this).attr("data-wpacu-plugin");e('table.wpacu_list_by_location[data-wpacu-plugin="'+t+'"]').find(s).prop("checked",!1).closest("tr").removeClass("wpacu_not_load")}),e(".wpacu-area-check-load-all").on("click change",function(a){a.preventDefault();let t=e(this).attr("data-wpacu-plugin"),c=e('table.wpacu_list_by_location[data-wpacu-plugin="'+t+'"]');c.find(".wpacu_load_it_option_one.wpacu_load_exception").prop("checked",!0).closest("tr.wpacu_is_bulk_unloaded").removeClass("wpacu_not_load"),c.find(s).prop("checked",!1).trigger("change")}),e(".wpacu-area-uncheck-load-all").on("click change",function(a){a.preventDefault();let t=e(this).attr("data-wpacu-plugin"),c=e('table.wpacu_list_by_location[data-wpacu-plugin="'+t+'"]');c.find(".wpacu_load_it_option_one.wpacu_load_exception").prop("checked",!1).closest("tr.wpacu_is_bulk_unloaded").addClass("wpacu_not_load"),c.find(s).prop("checked",!1).trigger("change")}),e(document).on("click",".wpacu_keep_bulk_rule",function(){e(this).prop("checked")&&e(this).parents("li").next().removeClass("remove_rule")}),e(document).on("click",".wpacu_remove_bulk_rule",function(){e(this).prop("checked")&&e(this).parents("li").addClass("remove_rule")}),e(document).on("click change",".wpacu_bulk_unload",function(s){a=e(this).attr("data-handle"),t=e(this).attr("data-handle-for"),c=e("[data-"+t+'-handle-row="'+a+'"]');let n=e(this).parents("li");if(e(this).prop("checked")){if("click"===s.type&&!e.fn.wpAssetCleanUp().triggerAlertWhenAnyUnloadRuleIsChosen(a,t))return!1;(e(this).hasClass("wpacu_global_unload")||e(this).hasClass("wpacu_post_type_unload"))&&(e(this).parent("label").addClass("wpacu_input_load_checked"),e(this).closest("tr").addClass("wpacu_not_load")),e.fn.wpAssetCleanUp().showHandleLoadExceptionArea(t,a),e(this).hasClass("wpacu_global_unload")?(e.fn.wpAssetCleanUp().uncheckAllOtherBulkUnloadRules(e(this),!0),e('.input-unload-on-this-page[data-handle-for="'+t+'"][data-handle="'+a+'"]').prop("checked",!1)):e(this).hasClass("wpacu_post_type_unload")&&(e.fn.wpAssetCleanUp().uncheckAllOtherBulkUnloadRules(e(this),!1),e('.input-unload-on-this-page[data-handle-for="'+t+'"][data-handle="'+a+'"]').prop("checked",!1))}else e(this).hasClass("wpacu_unload_it_regex_checkbox")||e(this).hasClass("wpacu_unload_it_via_tax_checkbox")?e(this).hasClass("wpacu_unload_it_regex_checkbox")?(n.find("label").removeClass("wpacu_unload_checked"),n.find("textarea").blur().addClass("wpacu_disabled"),""===n.find("textarea").val().trim()&&(n.find("textarea").prop("disabled",!0).val(""),n.find(".wpacu_handle_unload_regex_input_wrap").addClass("wpacu_hide"))):e(this).hasClass("wpacu_unload_it_via_tax_checkbox")&&(n.find("label").removeClass("wpacu_unload_checked"),n.find(".wpacu_handle_unload_via_tax_input_wrap").addClass("wpacu_hide")):(e(this).parent("label").removeClass("wpacu_input_load_checked"),e(this).closest("tr").removeClass("wpacu_not_load")),e.fn.wpAssetCleanUp().hideHandleLoadExceptionArea(c,a,t);c.hasClass("wpacu_is_bulk_unload