PluginProbe
HyperPay Payments / trunk
HyperPay Payments vtrunk
6.6.0 trunk 1.7 1.8 1.8.1 1.8.2 1.8.3 1.8.4 1.8.5 1.9.5 1.9.6 1.9.7 1.9.8 1.9.9 2.0.0 2.1.0 2.2.0 2.3.0 2.3.1 2.3.2 2.3.3 3.0.0 3.0.5 4.0.0 4.0.2 All 34 releases
hyperpay-gateways / src / assets / templates / fields / icon.html

icon.html in HyperPay Payments trunk, at src/assets/templates/fields/icon.html

40 lines 1.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
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