芝麻web文件管理V1.00
"):c.prepend(e),c.find(".input-text, select, input:checkbox").trigger("validate").trigger("blur"),F.scroll_to_notices()),F.init_payment_methods(),k(document.body).trigger("updated_checkout",[e]))}})}},handleUnloadEvent:function(e){return-1===navigator.userAgent.indexOf("MSIE")&&!document.documentMode||(e.preventDefault(),undefined)},attachUnloadEventsOnSubmit:function(){k(window).on("beforeunload",this.handleUnloadEvent)},detachUnloadEventsOnSubmit:function(){k(window).off("beforeunload",this.handleUnloadEvent)},blockOnSubmit:function(e){1!==e.data("blockUI.isBlocked")&&e.block({message:null,overlayCSS:{background:"#fff",opacity:.6}})},submitOrder:function(){F.blockOnSubmit(k(this))},submit:function(){F.reset_update_checkout_timer();var o=k(this);return o.is(".processing")||!1!==o.triggerHandler("checkout_place_order")&&!1!==o.triggerHandler("checkout_place_order_"+F.get_payment_method())&&(o.addClass("processing"),F.blockOnSubmit(o),F.attachUnloadEventsOnSubmit(),w.dataFilter=function(e,t){return"json"!==t||F.is_valid_json(e)||(null!==(t=e.match(/{"result.*}/))&&F.is_valid_json(t[0])?(console.log("Fixed malformed JSON. Original:"),console.log(e),e=t[0]):console.log("Unable to fix malformed JSON")),e},w({type:"POST",url:wc_checkout_params.checkout_url,data:new URLSearchParams(new FormData(o[0])).toString(),dataType:"json",success:function(e){F.detachUnloadEventsOnSubmit();try{if("success"!==e.result||!1===o.triggerHandler("checkout_place_order_success",e))throw"failure"===e.result?"Result failure":"Invalid response";-1===e.redirect.indexOf("https://")||-1===e.redirect.indexOf("http://")?window.location=e.redirect:window.location=decodeURI(e.redirect)}catch(t){!0===e.reload?window.location.reload():(!0===e.refresh&&k(document.body).trigger("update_checkout"),e.messages?F.submit_error(e.messages):F.submit_error(''+wc_checkout_params.i18n_checkout_error+"
"))}},error:function(e,t,o){F.detachUnloadEventsOnSubmit(),F.submit_error(''+(o||wc_checkout_params.i18n_checkout_error)+"
")}})),!1},submit_error:function(e){k(".woocommerce-NoticeGroup-checkout, .woocommerce-error, .woocommerce-message").remove(),F.$checkout_form.prepend(''+e+"
"),F.$checkout_form.removeClass("processing").unblock(),F.$checkout_form.find(".input-text, select, input:checkbox").trigger("validate").trigger("blur"),F.scroll_to_notices(),k(document.body).trigger("checkout_error",[e])},scroll_to_notices:function(){var e=k(".woocommerce-NoticeGroup-updateOrderReview, .woocommerce-NoticeGroup-checkout");e.length||(e=k("form.checkout")),k.scroll_to_notices(e)}},e={init:function(){k(document.body).on("click","a.showcoupon",this.show_coupon_form),k(document.body).on("click",".woocommerce-remove-coupon",this.remove_coupon),k("form.checkout_coupon").hide().on("submit",this.submit)},show_coupon_form:function(){return k(".checkout_coupon").slideToggle(400,function(){k(".checkout_coupon").find(":input:eq(0)").trigger("focus")}),!1},submit:function(){var t,o=k(this);return o.is(".processing")||(o.addClass("processing").block({message:null,overlayCSS:{background:"#fff",opacity:.6}}),t={security:wc_checkout_params.apply_coupon_nonce,coupon_code:o.find('input[name="coupon_code"]').val()},w({type:"POST",url:wc_checkout_params.wc_ajax_url.toString().replace("%%endpoint%%","apply_coupon"),data:new URLSearchParams(t).toString(),success:function(e){k(".woocommerce-error, .woocommerce-message").remove(),o.removeClass("processing").unblock(),e&&(o.before(e),o.slideUp(),k(document.body).trigger("applied_coupon_in_checkout",[t.coupon_code]),k(document.body).trigger("update_checkout",{update_shipping_method:!1}))},dataType:"html"})),!1},remove_coupon:function(e){e.preventDefault();var t=k(this).parents(".woocommerce-checkout-review-order"),e=k(this).data("coupon"),o=(t.addClass("processing").block({message:null,overlayCSS:{background:"#fff",opacity:.6}}),{security:wc_checkout_params.remove_coupon_nonce,coupon:e});w({type:"POST",url:wc_checkout_params.wc_ajax_url.toString().replace("%%endpoint%%","remove_coupon"),data:new URLSearchParams(o).toString(),success:function(e){k(".woocommerce-error, .woocommerce-message").remove(),t.removeClass("processing").unblock(),e&&(k("form.woocommerce-checkout").before(e),k(document.body).trigger("removed_coupon_in_checkout",[o.coupon]),k(document.body).trigger("update_checkout",{update_shipping_method:!1}),k("form.checkout_coupon").find('input[name="coupon_code"]').val(""))},error:function(e){wc_checkout_params.debug_mode&&console.log(e)},dataType:"html"})}},t={init:function(){k(document.body).on("click","a.showlogin",this.show_login_form)},show_login_form:function(){return k("form.login, form.woocommerce-form--login").slideToggle(),!1}},o={init:function(){k(document.body).on("click","a.woocommerce-terms-and-conditions-link",this.toggle_terms)},toggle_terms:function(){if(k(".woocommerce-terms-and-conditions").length)return k(".woocommerce-terms-and-conditions").slideToggle(function(){var e=k(".woocommerce-terms-and-conditions-link");k(".woocommerce-terms-and-conditions").is(":visible")?(e.addClass("woocommerce-terms-and-conditions-link--open"),e.removeClass("woocommerce-terms-and-conditions-link--closed")):(e.removeClass("woocommerce-terms-and-conditions-link--open"),e.addClass("woocommerce-terms-and-conditions-link--closed"))}),!1}};F.init(),e.init(),t.init(),o.init()});