File "klarna-checkout-for-woocommerce-admin.min.js"
Full Path: /home/siazco/grocery.siazco.se/wp-content/plugins/klarna-checkout-for-woocommerce/assets/js/klarna-checkout-for-woocommerce-admin.min.js
File size: 2.56 KB
MIME-type: text/html
Charset: utf-8
jQuery(function(a){"use strict";var e,s=kco_admin_params.location,t=a("h3.wc-settings-sub-title"),o=a("h3.wc-settings-sub-title + table.form-table"),c=a(".wrap.woocommerce p.submit");t.append(' <a href="#" class="collapsed" style="font-size:12px; font-weight: normal; text-decoration: none"><span class="dashicons dashicons-arrow-down-alt2"></span></a>'),o.css("marginLeft","20px").hide(),"EU"===s?((e=a("#woocommerce_kco_credentials_eu")).find("a").html('<span class="dashicons dashicons-arrow-up-alt2">'),e.next().show()):"US"===s?((e=a("#woocommerce_kco_credentials_us")).find("a").html('<span class="dashicons dashicons-arrow-up-alt2">'),e.next().show()):e=t,t.find("a").click(function(e){console.log("click"),e.preventDefault(),a(this).hasClass("collapsed")?(a(this).parent().next().show(),a(this).removeClass("collapsed"),a(this).html('<span class="dashicons dashicons-arrow-up-alt2"></span>')):(a(this).parent().next().hide(),a(this).addClass("collapsed"),a(this).html('<span class="dashicons dashicons-arrow-down-alt2"></span>'))}),t.before('<hr style="margin-top:2em;margin-bottom:2em" />'),c.before('<hr style="margin-top:2em;margin-bottom:2em" />');var r=a("#woocommerce_kco_testmode"),n=a("#woocommerce_kco_test_merchant_id_eu"),l=a("#woocommerce_kco_test_shared_secret_eu"),i=a("#woocommerce_kco_test_merchant_id_eu"),d=a("#woocommerce_kco_test_shared_secret_eu"),m=a(".button-primary, .woocommerce-save-button");r.click(function(){r.prop("checked")?"EU"===s?(m.prop("disabled",!0),n.val()||l.val()?l.val()?n.val()?m.prop("disabled",!1):(alert("Please enter a valid Test Merchant ID"),n.focus()):(alert("Please enter a valid Test Merchant Password"),l.focus()):(alert("Please enter valid Test Merchant information"),n.focus())):"US"===s&&(m.prop("disabled",!0),i.val()||d.val()?d.val()?i.val()?m.prop("disabled",!1):(alert("Please enter a valid Test Merchant ID"),i.focus()):(alert("Please enter a valid Test Merchant Password"),d.focus()):(alert("Please enter valid Test Merchant information"),i.focus())):m.prop("disabled",!1)}),a("body").on("change","input#woocommerce_kco_test_merchant_id_eu, input#woocommerce_kco_merchant_id_eu, input#woocommerce_kco_test_merchant_id_us, input#woocommerce_kco_merchant_id_us",function(){var e=a(this);e.removeClass("bad_credential"),a('button[name="save"]').removeAttr("disabled"),""===e.val()||/^([A-Za-z0-9]{1,2}[0-9]{5}|[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12})/.test(e.val())||(e.addClass("bad_credential"),a('button[name="save"]').attr("disabled","disabled"),window.alert("Please verify your Klarna Credentials."))})});