| 1 |
<tr valign="top"> |
| 2 |
<th scope="row" class="titledesc"> |
| 3 |
<label for="woocommerce_hyperpay_applepay_icon"> |
| 4 |
{{ data.title }} |
| 5 |
<span class="woocommerce-help-tip" data-tip="{{ data.tip }}"></span> |
| 6 |
</label> |
| 7 |
</th> |
| 8 |
<td class="forminp forminp-icon"> |
| 9 |
<img style="max-width: 238px;max-height: 50px;" id="hyperpay_applePay_action_preview" src="" /> |
| 10 |
</td> |
| 11 |
</tr> |
| 12 |
|
| 13 |
<script> |
| 14 |
document.addEventListener("DOMContentLoaded", function() { |
| 15 |
let hyperpay_applePay_action_type = document.getElementById("woocommerce_hyperpay_applepay_action_type"); |
| 16 |
let hyperpay_applePay_action_style = document.getElementById("woocommerce_hyperpay_applepay_action_style"); |
| 17 |
let hyperpay_applePay_action_preview = document.getElementById("hyperpay_applePay_action_preview"); |
| 18 |
let hyperpay_root_src = '{{ "#{constant('HYPERPAY_PLUGIN_DIR')}" }}'; |
| 19 |
let hyperpay_applePay_src = hyperpay_root_src + |
| 20 |
"/src/assets/images/applePayButtons/button-" + |
| 21 |
hyperpay_applePay_action_type.value + "-" + |
| 22 |
hyperpay_applePay_action_style.value + |
| 23 |
"-min.png" |
| 24 |
|
| 25 |
hyperpay_applePay_action_preview.setAttribute('src', hyperpay_applePay_src) |
| 26 |
|
| 27 |
hyperpay_applePay_action_type.addEventListener("change", function(e) { |
| 28 |
let style = hyperpay_applePay_action_style.value |
| 29 |
hyperpay_applePay_src = `${hyperpay_root_src}/src/assets/images/applePayButtons/button-${e.target.value}-${style}-min.png` |
| 30 |
hyperpay_applePay_action_preview.setAttribute('src', hyperpay_applePay_src) |
| 31 |
}) |
| 32 |
|
| 33 |
hyperpay_applePay_action_style.addEventListener("change", function(e) { |
| 34 |
let button = hyperpay_applePay_action_type.value |
| 35 |
hyperpay_applePay_src = `${hyperpay_root_src}/src/assets/images/applePayButtons/button-${button}-${e.target.value}-min.png` |
| 36 |
hyperpay_applePay_action_preview.setAttribute('src', hyperpay_applePay_src) |
| 37 |
}) |
| 38 |
}); |
| 39 |
</script> |
| 40 |
|