Version Description
- Fix: address fields trigger shipping total change
- Fix: make sure guest users include their email in order to download products
Download this release
Release Info
Developer | quadlayers |
Plugin | WooCommerce Checkout Manager |
Version | 5.3.9 |
Comparing to | |
See all releases |
Code changes from version 5.3.7 to 5.3.9
- assets/backend/css/admin.css +198 -1
- assets/backend/js/admin-field.asset.php +1 -1
- assets/backend/js/admin-field.js +653 -1
- assets/backend/js/admin.asset.php +1 -1
- assets/backend/js/admin.js +416 -1
- assets/frontend/css/checkout.css +116 -1
- assets/frontend/js/checkout.asset.php +1 -1
- assets/frontend/js/checkout.js +693 -1
- assets/frontend/js/order-upload.asset.php +1 -1
- assets/frontend/js/order-upload.js +244 -1
- includes/view/frontend/class-wooccm-fields-disable.php +14 -0
- includes/view/frontend/class-wooccm-fields-handler.php +30 -0
- readme.txt +8 -1
- woocommerce-checkout-manager.php +1 -1
assets/backend/css/admin.css
CHANGED
@@ -1 +1,198 @@
|
|
1 |
-
.select2-container
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.select2-container {
|
2 |
+
z-index: 9999999; }
|
3 |
+
.select2-container .select2-selection--single,
|
4 |
+
.select2-container .select2-selection--single .select2-selection__rendered,
|
5 |
+
.select2-container .select2-selection--single .select2-selection__arrow {
|
6 |
+
height: 30px !important;
|
7 |
+
line-height: 30px !important; }
|
8 |
+
|
9 |
+
.wooccm-premium {
|
10 |
+
opacity: 0.5;
|
11 |
+
pointer-events: none;
|
12 |
+
/* .description {
|
13 |
+
&.premium {
|
14 |
+
//display: none;
|
15 |
+
}
|
16 |
+
|
17 |
+
&.hidden {
|
18 |
+
//display: none;
|
19 |
+
}
|
20 |
+
}*/ }
|
21 |
+
|
22 |
+
.button.fileinput-button {
|
23 |
+
position: relative;
|
24 |
+
overflow: hidden !important; }
|
25 |
+
.button.fileinput-button input {
|
26 |
+
position: absolute;
|
27 |
+
top: 0;
|
28 |
+
right: 0;
|
29 |
+
margin: 0;
|
30 |
+
opacity: 0;
|
31 |
+
-ms-filter: 'alpha(opacity=0)';
|
32 |
+
font-size: 200px;
|
33 |
+
direction: ltr;
|
34 |
+
cursor: pointer; }
|
35 |
+
|
36 |
+
table.wc_gateways > tbody > tr > td select {
|
37 |
+
line-height: 1 !important; }
|
38 |
+
|
39 |
+
table.wc_gateways > tbody > tr > td.label {
|
40 |
+
font-weight: 600; }
|
41 |
+
|
42 |
+
table.wooccm-enhanced-options {
|
43 |
+
border: none;
|
44 |
+
box-shadow: none; }
|
45 |
+
table.wooccm-enhanced-options > thead > th .woocommerce-help-tip {
|
46 |
+
margin: -1px 0 0 0.25em; }
|
47 |
+
table.wooccm-enhanced-options > tbody > tr > td input.label {
|
48 |
+
width: 100%; }
|
49 |
+
table.wooccm-enhanced-options > tbody > tr > td select.add-price-type {
|
50 |
+
margin: 0 0 0 10px; }
|
51 |
+
table.wooccm-enhanced-options > tbody > tr > td input.check {
|
52 |
+
margin: 0 9px; }
|
53 |
+
table.wooccm-enhanced-options > tbody > tr > td.sort .wc-item-reorder-nav {
|
54 |
+
width: auto; }
|
55 |
+
|
56 |
+
#wooccm_modal.processing {
|
57 |
+
pointer-events: none; }
|
58 |
+
#wooccm_modal.processing:before {
|
59 |
+
content: '';
|
60 |
+
position: absolute;
|
61 |
+
top: 0;
|
62 |
+
bottom: 0;
|
63 |
+
left: 0;
|
64 |
+
right: 0;
|
65 |
+
background-color: #ffffff;
|
66 |
+
z-index: 99999999;
|
67 |
+
opacity: 0.8; }
|
68 |
+
|
69 |
+
#wooccm_modal select {
|
70 |
+
min-height: 30px; }
|
71 |
+
|
72 |
+
#wooccm_modal .form-field .wrap {
|
73 |
+
padding: 0; }
|
74 |
+
|
75 |
+
#wooccm_modal .attachment-info .details,
|
76 |
+
#wooccm_modal .attachment-info .settings {
|
77 |
+
width: 100%; }
|
78 |
+
|
79 |
+
#wooccm_modal .attachment-info .woocommerce_options_panel label,
|
80 |
+
#wooccm_modal .attachment-info .woocommerce_options_panel legend {
|
81 |
+
width: 75px;
|
82 |
+
margin: 0 0 0 -90px;
|
83 |
+
font-weight: 600; }
|
84 |
+
|
85 |
+
#wooccm_modal .attachment-info .woocommerce_options_panel fieldset.form-field,
|
86 |
+
#wooccm_modal .attachment-info .woocommerce_options_panel p.form-field {
|
87 |
+
padding: 0 20px 0 92px !important; }
|
88 |
+
|
89 |
+
#wooccm_modal .attachment-info .woocommerce_options_panel input[type=email],
|
90 |
+
#wooccm_modal .attachment-info .woocommerce_options_panel input[type=number],
|
91 |
+
#wooccm_modal .attachment-info .woocommerce_options_panel input[type=password],
|
92 |
+
#wooccm_modal .attachment-info .woocommerce_options_panel input[type=text],
|
93 |
+
#wooccm_modal .attachment-info .woocommerce_options_panel select,
|
94 |
+
#wooccm_modal .attachment-info .woocommerce_options_panel .select2-container {
|
95 |
+
width: 100% !important; }
|
96 |
+
|
97 |
+
#wooccm_modal #woocommerce-product-data .woocommerce_options_panel {
|
98 |
+
width: 100%;
|
99 |
+
/* input,
|
100 |
+
select,
|
101 |
+
textarea {
|
102 |
+
margin: 0;
|
103 |
+
}*/ }
|
104 |
+
#wooccm_modal #woocommerce-product-data .woocommerce_options_panel .premium {
|
105 |
+
display: block;
|
106 |
+
clear: both; }
|
107 |
+
#wooccm_modal #woocommerce-product-data .woocommerce_options_panel .woocommerce-help-tip {
|
108 |
+
margin: 0 0 0 0.5em; }
|
109 |
+
#wooccm_modal #woocommerce-product-data .woocommerce_options_panel .select2-container {
|
110 |
+
width: 50% !important;
|
111 |
+
line-height: 16px; }
|
112 |
+
#wooccm_modal #woocommerce-product-data .woocommerce_options_panel .select2-container .select2-selection {
|
113 |
+
box-shadow: none;
|
114 |
+
border-radius: 3px;
|
115 |
+
padding: 0 24px 0 8px; }
|
116 |
+
#wooccm_modal #woocommerce-product-data .woocommerce_options_panel .select2-container .select2-selection--multiple {
|
117 |
+
line-height: 16px;
|
118 |
+
min-height: 30px; }
|
119 |
+
@media only screen and (max-width: 1280px) {
|
120 |
+
#wooccm_modal #woocommerce-product-data .woocommerce_options_panel .select2-container {
|
121 |
+
width: 80% !important; } }
|
122 |
+
#wooccm_modal #woocommerce-product-data .woocommerce_options_panel .select2-container--default .select2-selection--multiple .select2-selection__rendered li {
|
123 |
+
margin: 3px 3px 0 0; }
|
124 |
+
#wooccm_modal #woocommerce-product-data .woocommerce_options_panel .select2-container--default.select2-container--focus .select2-selection--multiple {
|
125 |
+
border-color: #5b9dd9 !important;
|
126 |
+
box-shadow: 0 0 2px rgba(30, 140, 190, 0.8) !important;
|
127 |
+
outline: 2px solid transparent !important; }
|
128 |
+
|
129 |
+
#wooccm-order-files .inside {
|
130 |
+
margin: 0;
|
131 |
+
padding: 0;
|
132 |
+
background: #fefefe;
|
133 |
+
display: block !important; }
|
134 |
+
|
135 |
+
#wooccm-order-files .handlediv,
|
136 |
+
#wooccm-order-files .hndle {
|
137 |
+
display: none; }
|
138 |
+
|
139 |
+
#wooccm-order-files .wooccm_upload_results {
|
140 |
+
display: inline-block;
|
141 |
+
margin: 0 10px; }
|
142 |
+
|
143 |
+
#wooccm-order-files .wooccm_order_attachments_wrapper {
|
144 |
+
margin: 0;
|
145 |
+
overflow-x: auto; }
|
146 |
+
#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments {
|
147 |
+
width: 100%;
|
148 |
+
background: #fff; }
|
149 |
+
#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments thead th:first-child {
|
150 |
+
padding-left: 2em; }
|
151 |
+
#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments thead th.sortable {
|
152 |
+
cursor: pointer; }
|
153 |
+
#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments .item {
|
154 |
+
min-width: 200px; }
|
155 |
+
#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments thead th {
|
156 |
+
text-align: left;
|
157 |
+
padding: 1em;
|
158 |
+
font-weight: 400;
|
159 |
+
color: #999;
|
160 |
+
background: #f8f8f8;
|
161 |
+
user-select: none; }
|
162 |
+
#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments tbody#order_line_items tr:first-child td {
|
163 |
+
border-top: none; }
|
164 |
+
#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments tbody tr:last-child td {
|
165 |
+
border-bottom: 1px solid #dfdfdf; }
|
166 |
+
#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments td.thumb {
|
167 |
+
text-align: left;
|
168 |
+
width: 38px;
|
169 |
+
padding-bottom: 1.5em; }
|
170 |
+
#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments td.thumb .wc-order-item-thumbnail {
|
171 |
+
width: 38px;
|
172 |
+
height: 38px;
|
173 |
+
border: 2px solid #e8e8e8;
|
174 |
+
background: #f8f8f8;
|
175 |
+
color: #ccc;
|
176 |
+
position: relative;
|
177 |
+
font-size: 21px;
|
178 |
+
display: block;
|
179 |
+
text-align: center; }
|
180 |
+
#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments tbody th:first-child,
|
181 |
+
#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments td:first-child {
|
182 |
+
padding-left: 2em; }
|
183 |
+
#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments tbody th,
|
184 |
+
#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments td {
|
185 |
+
padding: 1.5em 1em 1em;
|
186 |
+
text-align: left;
|
187 |
+
line-height: 1.5em;
|
188 |
+
vertical-align: top;
|
189 |
+
border-bottom: 1px solid #f8f8f8; }
|
190 |
+
|
191 |
+
#wooccm-order-files .wc-order-data-row {
|
192 |
+
border-bottom: 1px solid #dfdfdf;
|
193 |
+
padding: 1.5em 2em;
|
194 |
+
background: #f8f8f8;
|
195 |
+
line-height: 2em;
|
196 |
+
text-align: left; }
|
197 |
+
|
198 |
+
/*# sourceMappingURL=admin.css.map*/
|
assets/backend/js/admin-field.asset.php
CHANGED
@@ -1 +1 @@
|
|
1 |
-
<?php return array('dependencies' => array('backbone', 'jquery', 'jquery-ui-datepicker', 'wp-util'), 'version' => '
|
1 |
+
<?php return array('dependencies' => array('backbone', 'jquery', 'jquery-ui-datepicker', 'wp-util'), 'version' => 'e3adc601cfa8dccf8153e6a574beb644');
|
assets/backend/js/admin-field.js
CHANGED
@@ -1 +1,653 @@
|
|
1 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/******/ (function(modules) { // webpackBootstrap
|
2 |
+
/******/ // The module cache
|
3 |
+
/******/ var installedModules = {};
|
4 |
+
/******/
|
5 |
+
/******/ // The require function
|
6 |
+
/******/ function __webpack_require__(moduleId) {
|
7 |
+
/******/
|
8 |
+
/******/ // Check if module is in cache
|
9 |
+
/******/ if(installedModules[moduleId]) {
|
10 |
+
/******/ return installedModules[moduleId].exports;
|
11 |
+
/******/ }
|
12 |
+
/******/ // Create a new module (and put it into the cache)
|
13 |
+
/******/ var module = installedModules[moduleId] = {
|
14 |
+
/******/ i: moduleId,
|
15 |
+
/******/ l: false,
|
16 |
+
/******/ exports: {}
|
17 |
+
/******/ };
|
18 |
+
/******/
|
19 |
+
/******/ // Execute the module function
|
20 |
+
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
21 |
+
/******/
|
22 |
+
/******/ // Flag the module as loaded
|
23 |
+
/******/ module.l = true;
|
24 |
+
/******/
|
25 |
+
/******/ // Return the exports of the module
|
26 |
+
/******/ return module.exports;
|
27 |
+
/******/ }
|
28 |
+
/******/
|
29 |
+
/******/
|
30 |
+
/******/ // expose the modules object (__webpack_modules__)
|
31 |
+
/******/ __webpack_require__.m = modules;
|
32 |
+
/******/
|
33 |
+
/******/ // expose the module cache
|
34 |
+
/******/ __webpack_require__.c = installedModules;
|
35 |
+
/******/
|
36 |
+
/******/ // define getter function for harmony exports
|
37 |
+
/******/ __webpack_require__.d = function(exports, name, getter) {
|
38 |
+
/******/ if(!__webpack_require__.o(exports, name)) {
|
39 |
+
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
|
40 |
+
/******/ }
|
41 |
+
/******/ };
|
42 |
+
/******/
|
43 |
+
/******/ // define __esModule on exports
|
44 |
+
/******/ __webpack_require__.r = function(exports) {
|
45 |
+
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
46 |
+
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
47 |
+
/******/ }
|
48 |
+
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
49 |
+
/******/ };
|
50 |
+
/******/
|
51 |
+
/******/ // create a fake namespace object
|
52 |
+
/******/ // mode & 1: value is a module id, require it
|
53 |
+
/******/ // mode & 2: merge all properties of value into the ns
|
54 |
+
/******/ // mode & 4: return value when already ns object
|
55 |
+
/******/ // mode & 8|1: behave like require
|
56 |
+
/******/ __webpack_require__.t = function(value, mode) {
|
57 |
+
/******/ if(mode & 1) value = __webpack_require__(value);
|
58 |
+
/******/ if(mode & 8) return value;
|
59 |
+
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
|
60 |
+
/******/ var ns = Object.create(null);
|
61 |
+
/******/ __webpack_require__.r(ns);
|
62 |
+
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
|
63 |
+
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
|
64 |
+
/******/ return ns;
|
65 |
+
/******/ };
|
66 |
+
/******/
|
67 |
+
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
68 |
+
/******/ __webpack_require__.n = function(module) {
|
69 |
+
/******/ var getter = module && module.__esModule ?
|
70 |
+
/******/ function getDefault() { return module['default']; } :
|
71 |
+
/******/ function getModuleExports() { return module; };
|
72 |
+
/******/ __webpack_require__.d(getter, 'a', getter);
|
73 |
+
/******/ return getter;
|
74 |
+
/******/ };
|
75 |
+
/******/
|
76 |
+
/******/ // Object.prototype.hasOwnProperty.call
|
77 |
+
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
78 |
+
/******/
|
79 |
+
/******/ // __webpack_public_path__
|
80 |
+
/******/ __webpack_require__.p = "";
|
81 |
+
/******/
|
82 |
+
/******/
|
83 |
+
/******/ // Load entry module and return exports
|
84 |
+
/******/ return __webpack_require__(__webpack_require__.s = "./src/backend/admin-field.js");
|
85 |
+
/******/ })
|
86 |
+
/************************************************************************/
|
87 |
+
/******/ ({
|
88 |
+
|
89 |
+
/***/ "./src/backend/admin-field.js":
|
90 |
+
/*!************************************!*\
|
91 |
+
!*** ./src/backend/admin-field.js ***!
|
92 |
+
\************************************/
|
93 |
+
/*! no exports provided */
|
94 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
95 |
+
|
96 |
+
"use strict";
|
97 |
+
__webpack_require__.r(__webpack_exports__);
|
98 |
+
/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery");
|
99 |
+
/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);
|
100 |
+
/* harmony import */ var wp_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! wp-util */ "wp-util");
|
101 |
+
/* harmony import */ var wp_util__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(wp_util__WEBPACK_IMPORTED_MODULE_1__);
|
102 |
+
/* harmony import */ var backbone__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! backbone */ "backbone");
|
103 |
+
/* harmony import */ var backbone__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(backbone__WEBPACK_IMPORTED_MODULE_2__);
|
104 |
+
/* harmony import */ var jquery_ui_datepicker__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! jquery-ui-datepicker */ "jquery-ui-datepicker");
|
105 |
+
/* harmony import */ var jquery_ui_datepicker__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(jquery_ui_datepicker__WEBPACK_IMPORTED_MODULE_3__);
|
106 |
+
|
107 |
+
|
108 |
+
|
109 |
+
|
110 |
+
|
111 |
+
(function ($) {
|
112 |
+
"use strict";
|
113 |
+
|
114 |
+
var count = 0,
|
115 |
+
timer;
|
116 |
+
|
117 |
+
var is_blocked = function is_blocked($node) {
|
118 |
+
return $node.is('.processing') || $node.parents('.processing').length;
|
119 |
+
};
|
120 |
+
|
121 |
+
var block = function block() {
|
122 |
+
$('#wooccm_modal').addClass('processing');
|
123 |
+
};
|
124 |
+
|
125 |
+
var unblock = function unblock() {
|
126 |
+
$('#wooccm_modal').removeClass('processing');
|
127 |
+
};
|
128 |
+
|
129 |
+
_.mixin({
|
130 |
+
sortOptions: function sortOptions(object) {
|
131 |
+
return _.sortBy(object, function (o) {
|
132 |
+
return o.order;
|
133 |
+
});
|
134 |
+
},
|
135 |
+
escapeHtml: function escapeHtml(attribute) {
|
136 |
+
return attribute.replace('&', /&/g).replace(/>/g, ">").replace(/</g, "<").replace(/"/g, '"').replace(/'/g, "'");
|
137 |
+
},
|
138 |
+
getFormData: function getFormData($form) {
|
139 |
+
var form = $form.serializeJSON({
|
140 |
+
checkboxUncheckedValue: 'false',
|
141 |
+
parseBooleans: true,
|
142 |
+
parseNulls: true
|
143 |
+
});
|
144 |
+
var defaults = Object.assign({}, wooccm_field.args);
|
145 |
+
var merged = Object.assign(defaults, form);
|
146 |
+
return merged;
|
147 |
+
}
|
148 |
+
});
|
149 |
+
|
150 |
+
var FieldModel = Backbone.Model.extend({
|
151 |
+
defaults: Object.create(wooccm_field.args)
|
152 |
+
});
|
153 |
+
var FieldModal = Backbone.View.extend({
|
154 |
+
initialize: function initialize(e) {
|
155 |
+
var $button = $(e.target),
|
156 |
+
field_id = $button.closest('[data-field_id]').data('field_id');
|
157 |
+
var model = new FieldModel();
|
158 |
+
model.set({
|
159 |
+
id: field_id
|
160 |
+
});
|
161 |
+
new FieldView({
|
162 |
+
model: model
|
163 |
+
}).render();
|
164 |
+
}
|
165 |
+
});
|
166 |
+
var FieldView = Backbone.View.extend({
|
167 |
+
events: {
|
168 |
+
'change input': 'enableSave',
|
169 |
+
'change textarea': 'enableSave',
|
170 |
+
'change select': 'enableSave',
|
171 |
+
'click .media-modal-backdrop': 'close',
|
172 |
+
'click .media-modal-close': 'close',
|
173 |
+
'click .media-modal-prev': 'edit',
|
174 |
+
'click .media-modal-next': 'edit',
|
175 |
+
'click .media-modal-tab': 'tab',
|
176 |
+
'change .media-modal-parent': 'parent',
|
177 |
+
'change .media-modal-render-tabs': 'renderTabs',
|
178 |
+
'change .media-modal-render-panels': 'renderPanels',
|
179 |
+
'change .media-modal-render-info': 'renderInfo',
|
180 |
+
'submit .media-modal-form': 'submit'
|
181 |
+
},
|
182 |
+
templates: {},
|
183 |
+
initialize: function initialize() {
|
184 |
+
_.bindAll(this, 'open', 'tab', 'edit', 'load', 'render', 'close', 'submit', 'parent');
|
185 |
+
|
186 |
+
this.init();
|
187 |
+
this.open();
|
188 |
+
},
|
189 |
+
init: function init() {
|
190 |
+
this.templates.window = wp.template('wooccm-modal-main');
|
191 |
+
},
|
192 |
+
assign: function assign(view, selector) {
|
193 |
+
view.setElement(this.$(selector)).render();
|
194 |
+
},
|
195 |
+
updateModel: function updateModel(e) {
|
196 |
+
e.preventDefault();
|
197 |
+
var modal = this,
|
198 |
+
$form = modal.$el.find('#wooccm_modal').find('form');
|
199 |
+
|
200 |
+
var model = _.getFormData($form); // console.log('getFormData', model);
|
201 |
+
|
202 |
+
|
203 |
+
this.model.set(model);
|
204 |
+
},
|
205 |
+
reload: function reload(e) {
|
206 |
+
if (this.$el.find('#wooccm_modal').hasClass('reload')) {
|
207 |
+
location.reload();
|
208 |
+
return;
|
209 |
+
}
|
210 |
+
|
211 |
+
this.remove();
|
212 |
+
return;
|
213 |
+
},
|
214 |
+
close: function close(e) {
|
215 |
+
e.preventDefault();
|
216 |
+
this.undelegateEvents();
|
217 |
+
$(document).off('focusin');
|
218 |
+
$('body').removeClass('modal-open'); // if necesary reload...
|
219 |
+
|
220 |
+
this.$el.find('#wooccm_modal').addClass('reload');
|
221 |
+
this.reload(e);
|
222 |
+
return;
|
223 |
+
},
|
224 |
+
enableSave: function enableSave(e) {
|
225 |
+
$('.media-modal-submit').prop('disabled', false);
|
226 |
+
this.updateModel(e);
|
227 |
+
},
|
228 |
+
disableSave: function disableSave(e) {
|
229 |
+
$('.media-modal-submit').prop('disabled', true);
|
230 |
+
},
|
231 |
+
tab: function tab(e) {
|
232 |
+
e.preventDefault();
|
233 |
+
var modal = this,
|
234 |
+
$modal = modal.$el.find('#wooccm_modal'),
|
235 |
+
$tab = $(e.currentTarget),
|
236 |
+
$tabs = $modal.find('ul.wc-tabs'),
|
237 |
+
panel = $tab.find('a').attr('href').replace('#', '');
|
238 |
+
$tabs.find('.active').removeClass('active');
|
239 |
+
$tab.addClass('active');
|
240 |
+
this.model.attributes['panel'] = panel;
|
241 |
+
this.model.changed['panel'] = panel;
|
242 |
+
this.renderPanels(e);
|
243 |
+
},
|
244 |
+
renderTabs: function renderTabs(e) {
|
245 |
+
this.renderPanels(e);
|
246 |
+
this.tabs.render();
|
247 |
+
},
|
248 |
+
renderPanels: function renderPanels(e) {
|
249 |
+
this.updateModel(e);
|
250 |
+
this.panels.render();
|
251 |
+
},
|
252 |
+
render: function render() {
|
253 |
+
var modal = this;
|
254 |
+
modal.$el.html(modal.templates.window(modal.model.attributes));
|
255 |
+
this.tabs = new FieldViewTabs({
|
256 |
+
model: modal.model
|
257 |
+
});
|
258 |
+
this.panels = new FieldViewPanels({
|
259 |
+
model: modal.model
|
260 |
+
});
|
261 |
+
this.info = new FieldViewInfo({
|
262 |
+
model: modal.model
|
263 |
+
});
|
264 |
+
this.assign(this.tabs, '#wooccm-modal-tabs');
|
265 |
+
this.assign(this.panels, '#wooccm-modal-panels');
|
266 |
+
this.assign(this.info, '#wooccm-modal-info');
|
267 |
+
},
|
268 |
+
open: function open(e) {
|
269 |
+
$('body').addClass('modal-open').append(this.$el);
|
270 |
+
|
271 |
+
if (this.model.attributes.id == undefined) {
|
272 |
+
_.delay(function () {
|
273 |
+
unblock();
|
274 |
+
}, 100);
|
275 |
+
|
276 |
+
return;
|
277 |
+
}
|
278 |
+
|
279 |
+
this.load();
|
280 |
+
},
|
281 |
+
load: function load() {
|
282 |
+
var modal = this;
|
283 |
+
|
284 |
+
if (modal.model.attributes.id == undefined) {
|
285 |
+
modal.render();
|
286 |
+
return;
|
287 |
+
}
|
288 |
+
|
289 |
+
$.ajax({
|
290 |
+
url: wooccm_field.ajax_url,
|
291 |
+
data: {
|
292 |
+
action: 'wooccm_load_field',
|
293 |
+
nonce: wooccm_field.nonce,
|
294 |
+
field_id: this.model.attributes.id
|
295 |
+
},
|
296 |
+
dataType: 'json',
|
297 |
+
type: 'POST',
|
298 |
+
// beforeSend: function () {
|
299 |
+
// },
|
300 |
+
complete: function complete() {
|
301 |
+
unblock();
|
302 |
+
},
|
303 |
+
error: function error() {
|
304 |
+
alert('Error!');
|
305 |
+
},
|
306 |
+
success: function success(response) {
|
307 |
+
console.log('response', response);
|
308 |
+
|
309 |
+
if (response.success) {
|
310 |
+
modal.model.set(response.data);
|
311 |
+
modal.render();
|
312 |
+
} else {
|
313 |
+
alert(response.data);
|
314 |
+
}
|
315 |
+
}
|
316 |
+
});
|
317 |
+
},
|
318 |
+
edit: function edit(e) {
|
319 |
+
e.preventDefault();
|
320 |
+
var modal = this,
|
321 |
+
$button = $(e.target),
|
322 |
+
field_count = parseInt($('.wc_gateways tr[data-field_id]').length),
|
323 |
+
order = parseInt(modal.model.get('order'));
|
324 |
+
count++;
|
325 |
+
|
326 |
+
if (timer) {
|
327 |
+
clearTimeout(timer);
|
328 |
+
}
|
329 |
+
|
330 |
+
timer = setTimeout(function () {
|
331 |
+
if ($button.hasClass('media-modal-next')) {
|
332 |
+
order = Math.min(order + count, field_count);
|
333 |
+
} else {
|
334 |
+
order = Math.max(order - count, 1);
|
335 |
+
}
|
336 |
+
|
337 |
+
modal.model.set({
|
338 |
+
id: parseInt($('.wc_gateways tr[data-field_order=' + order + ']').data('field_id'))
|
339 |
+
});
|
340 |
+
count = 0;
|
341 |
+
modal.load();
|
342 |
+
}, 300);
|
343 |
+
},
|
344 |
+
submit: function submit(e) {
|
345 |
+
e.preventDefault();
|
346 |
+
var modal = this,
|
347 |
+
$modal = modal.$el.find('#wooccm_modal'),
|
348 |
+
$spinner = $modal.find('.settings-save-status .spinner'),
|
349 |
+
$saved = $modal.find('.settings-save-status .saved'); // console.log('modal.model.attributes', modal.model.attributes);
|
350 |
+
|
351 |
+
$.ajax({
|
352 |
+
url: wooccm_field.ajax_url,
|
353 |
+
data: {
|
354 |
+
action: 'wooccm_save_field',
|
355 |
+
nonce: wooccm_field.nonce,
|
356 |
+
field_data: JSON.stringify(modal.model.attributes)
|
357 |
+
},
|
358 |
+
dataType: 'json',
|
359 |
+
type: 'POST',
|
360 |
+
beforeSend: function beforeSend() {
|
361 |
+
$('.media-modal-submit').prop('disabled', true);
|
362 |
+
$spinner.addClass('is-active');
|
363 |
+
},
|
364 |
+
complete: function complete() {
|
365 |
+
$saved.addClass('is-active');
|
366 |
+
$spinner.removeClass('is-active');
|
367 |
+
|
368 |
+
_.delay(function () {
|
369 |
+
$saved.removeClass('is-active');
|
370 |
+
}, 1000);
|
371 |
+
},
|
372 |
+
error: function error(response) {
|
373 |
+
alert('Error!');
|
374 |
+
},
|
375 |
+
success: function success(response) {
|
376 |
+
if (response.success) {
|
377 |
+
if (modal.model.attributes.id == undefined) {
|
378 |
+
$modal.addClass('reload');
|
379 |
+
modal.reload(e);
|
380 |
+
modal.close(e);
|
381 |
+
}
|
382 |
+
} else {
|
383 |
+
alert(response.data);
|
384 |
+
}
|
385 |
+
}
|
386 |
+
});
|
387 |
+
return false;
|
388 |
+
},
|
389 |
+
renderInfo: function renderInfo() {
|
390 |
+
this.info.render();
|
391 |
+
},
|
392 |
+
parent: function parent(e) {
|
393 |
+
e.preventDefault();
|
394 |
+
var modal = this,
|
395 |
+
$modal = modal.$el.find('#wooccm_modal'),
|
396 |
+
$details = $modal.find('.attachment-details');
|
397 |
+
this.updateModel(e);
|
398 |
+
$.ajax({
|
399 |
+
url: wooccm_field.ajax_url,
|
400 |
+
data: {
|
401 |
+
action: 'wooccm_load_parent',
|
402 |
+
nonce: wooccm_field.nonce,
|
403 |
+
conditional_parent_key: modal.model.attributes.conditional_parent_key
|
404 |
+
},
|
405 |
+
dataType: 'json',
|
406 |
+
type: 'POST',
|
407 |
+
beforeSend: function beforeSend() {
|
408 |
+
modal.disableSave();
|
409 |
+
$details.addClass('save-waiting');
|
410 |
+
},
|
411 |
+
complete: function complete() {
|
412 |
+
$details.addClass('save-complete');
|
413 |
+
$details.removeClass('save-waiting');
|
414 |
+
modal.enableSave();
|
415 |
+
},
|
416 |
+
error: function error() {
|
417 |
+
alert('Error!');
|
418 |
+
},
|
419 |
+
success: function success(response) {
|
420 |
+
if (response.success) {
|
421 |
+
modal.model.attributes['parent'] = response.data;
|
422 |
+
modal.model.changed['parent'] = response.data;
|
423 |
+
modal.renderInfo();
|
424 |
+
} else {
|
425 |
+
alert(response.data);
|
426 |
+
}
|
427 |
+
}
|
428 |
+
});
|
429 |
+
return false;
|
430 |
+
}
|
431 |
+
}); // Parts
|
432 |
+
// -------------------------------------------------------------
|
433 |
+
|
434 |
+
var FieldViewTabs = Backbone.View.extend({
|
435 |
+
templates: {},
|
436 |
+
initialize: function initialize() {
|
437 |
+
this.templates.window = wp.template('wooccm-modal-tabs');
|
438 |
+
},
|
439 |
+
render: function render() {
|
440 |
+
this.model.attributes.panel = 'general';
|
441 |
+
this.$el.html(this.templates.window(this.model.attributes)); //this.$el.trigger('wooccm-tab-panels');
|
442 |
+
}
|
443 |
+
});
|
444 |
+
var FieldViewPanels = Backbone.View.extend({
|
445 |
+
templates: {},
|
446 |
+
initialize: function initialize() {
|
447 |
+
this.templates.window = wp.template('wooccm-modal-panels');
|
448 |
+
},
|
449 |
+
render: function render() {
|
450 |
+
this.$el.html(this.templates.window(this.model.attributes));
|
451 |
+
this.$el.trigger('wooccm-enhanced-options');
|
452 |
+
this.$el.trigger('wooccm-enhanced-select');
|
453 |
+
this.$el.trigger('init_tooltips');
|
454 |
+
}
|
455 |
+
});
|
456 |
+
var FieldViewInfo = Backbone.View.extend({
|
457 |
+
templates: {},
|
458 |
+
initialize: function initialize() {
|
459 |
+
this.templates.window = wp.template('wooccm-modal-info');
|
460 |
+
},
|
461 |
+
render: function render() {
|
462 |
+
this.$el.html(this.templates.window(this.model.attributes));
|
463 |
+
this.$el.trigger('wooccm-enhanced-select');
|
464 |
+
this.$el.trigger('init_tooltips');
|
465 |
+
}
|
466 |
+
});
|
467 |
+
$('#wooccm_billing_settings_add, #wooccm_shipping_settings_add, #wooccm_additional_settings_add').on('click', function (e) {
|
468 |
+
e.preventDefault();
|
469 |
+
new FieldModal(e);
|
470 |
+
});
|
471 |
+
$('#wooccm_billing_settings_reset, #wooccm_shipping_settings_reset, #wooccm_additional_settings_reset').on('click', function (e) {
|
472 |
+
e.preventDefault();
|
473 |
+
var $button = $(e.target);
|
474 |
+
var c = confirm(wooccm_field.message.reset);
|
475 |
+
|
476 |
+
if (!c) {
|
477 |
+
return false;
|
478 |
+
}
|
479 |
+
|
480 |
+
$.ajax({
|
481 |
+
url: wooccm_field.ajax_url,
|
482 |
+
data: {
|
483 |
+
action: 'wooccm_reset_fields',
|
484 |
+
nonce: wooccm_field.nonce
|
485 |
+
},
|
486 |
+
dataType: 'json',
|
487 |
+
type: 'POST',
|
488 |
+
beforeSend: function beforeSend() {},
|
489 |
+
complete: function complete() {},
|
490 |
+
error: function error() {
|
491 |
+
alert('Error!');
|
492 |
+
},
|
493 |
+
success: function success(response) {
|
494 |
+
if (response.success) {
|
495 |
+
location.reload();
|
496 |
+
} else {
|
497 |
+
alert(response.data);
|
498 |
+
}
|
499 |
+
}
|
500 |
+
});
|
501 |
+
return false;
|
502 |
+
});
|
503 |
+
$('.wooccm_billing_settings_edit, .wooccm_shipping_settings_edit, .wooccm_additional_settings_edit').on('click', function (e) {
|
504 |
+
e.preventDefault();
|
505 |
+
new FieldModal(e);
|
506 |
+
});
|
507 |
+
$('.wooccm_billing_settings_delete, .wooccm_shipping_settings_delete, .wooccm_additional_settings_delete').on('click', function (e) {
|
508 |
+
e.preventDefault();
|
509 |
+
var $button = $(e.target),
|
510 |
+
$field = $button.closest('[data-field_id]'),
|
511 |
+
field_id = $field.data('field_id');
|
512 |
+
var c = confirm(wooccm_field.message.remove);
|
513 |
+
|
514 |
+
if (!c) {
|
515 |
+
return false;
|
516 |
+
}
|
517 |
+
|
518 |
+
$.ajax({
|
519 |
+
url: wooccm_field.ajax_url,
|
520 |
+
data: {
|
521 |
+
action: 'wooccm_delete_field',
|
522 |
+
nonce: wooccm_field.nonce,
|
523 |
+
field_id: field_id
|
524 |
+
},
|
525 |
+
dataType: 'json',
|
526 |
+
type: 'POST',
|
527 |
+
beforeSend: function beforeSend() {},
|
528 |
+
complete: function complete() {},
|
529 |
+
error: function error() {
|
530 |
+
alert('Error!');
|
531 |
+
},
|
532 |
+
success: function success(response) {
|
533 |
+
if (response.success) {
|
534 |
+
$field.remove();
|
535 |
+
} else {
|
536 |
+
alert(response.data);
|
537 |
+
}
|
538 |
+
}
|
539 |
+
});
|
540 |
+
return false;
|
541 |
+
});
|
542 |
+
$(document).on('click', '.wooccm-field-toggle-attribute', function (e) {
|
543 |
+
e.preventDefault();
|
544 |
+
var $link = $(this),
|
545 |
+
$tr = $link.closest('tr'),
|
546 |
+
$toggle = $link.find('.woocommerce-input-toggle');
|
547 |
+
$.ajax({
|
548 |
+
url: wooccm_field.ajax_url,
|
549 |
+
data: {
|
550 |
+
action: 'wooccm_toggle_field_attribute',
|
551 |
+
nonce: wooccm_field.nonce,
|
552 |
+
field_attr: $(this).data('field_attr'),
|
553 |
+
field_id: $tr.data('field_id')
|
554 |
+
},
|
555 |
+
dataType: 'json',
|
556 |
+
type: 'POST',
|
557 |
+
beforeSend: function beforeSend(response) {
|
558 |
+
$toggle.addClass('woocommerce-input-toggle--loading');
|
559 |
+
},
|
560 |
+
success: function success(response) {
|
561 |
+
if (true === response.data) {
|
562 |
+
$toggle.removeClass('woocommerce-input-toggle--enabled, woocommerce-input-toggle--disabled');
|
563 |
+
$toggle.addClass('woocommerce-input-toggle--enabled');
|
564 |
+
$toggle.removeClass('woocommerce-input-toggle--loading');
|
565 |
+
} else if (true !== response.data) {
|
566 |
+
$toggle.removeClass('woocommerce-input-toggle--enabled, woocommerce-input-toggle--disabled');
|
567 |
+
$toggle.addClass('woocommerce-input-toggle--disabled');
|
568 |
+
$toggle.removeClass('woocommerce-input-toggle--loading');
|
569 |
+
} //else if ('needs_setup' === response.data) {
|
570 |
+
//window.location.href = $link.attr('href');
|
571 |
+
//}
|
572 |
+
|
573 |
+
}
|
574 |
+
});
|
575 |
+
return false;
|
576 |
+
});
|
577 |
+
$(document).on('change', '.wooccm-field-change-attribute', function (e) {
|
578 |
+
e.preventDefault();
|
579 |
+
var $change = $(this),
|
580 |
+
$tr = $change.closest('tr');
|
581 |
+
$.ajax({
|
582 |
+
url: wooccm_field.ajax_url,
|
583 |
+
data: {
|
584 |
+
action: 'wooccm_change_field_attribute',
|
585 |
+
nonce: wooccm_field.nonce,
|
586 |
+
field_attr: $change.data('field_attr'),
|
587 |
+
field_value: $change.val(),
|
588 |
+
field_id: $tr.data('field_id')
|
589 |
+
},
|
590 |
+
dataType: 'json',
|
591 |
+
type: 'POST',
|
592 |
+
beforeSend: function beforeSend(response) {
|
593 |
+
$change.prop('disabled', true);
|
594 |
+
},
|
595 |
+
success: function success(response) {
|
596 |
+
console.log(response.data);
|
597 |
+
},
|
598 |
+
complete: function complete(response) {
|
599 |
+
$change.prop('disabled', false);
|
600 |
+
}
|
601 |
+
});
|
602 |
+
return false;
|
603 |
+
});
|
604 |
+
})(jQuery);
|
605 |
+
|
606 |
+
/***/ }),
|
607 |
+
|
608 |
+
/***/ "backbone":
|
609 |
+
/*!***********************************************!*\
|
610 |
+
!*** external {"this":["window","Backbone"]} ***!
|
611 |
+
\***********************************************/
|
612 |
+
/*! no static exports found */
|
613 |
+
/***/ (function(module, exports) {
|
614 |
+
|
615 |
+
(function() { module.exports = this["window"]["Backbone"]; }());
|
616 |
+
|
617 |
+
/***/ }),
|
618 |
+
|
619 |
+
/***/ "jquery":
|
620 |
+
/*!**********************************!*\
|
621 |
+
!*** external {"this":"jQuery"} ***!
|
622 |
+
\**********************************/
|
623 |
+
/*! no static exports found */
|
624 |
+
/***/ (function(module, exports) {
|
625 |
+
|
626 |
+
(function() { module.exports = this["jQuery"]; }());
|
627 |
+
|
628 |
+
/***/ }),
|
629 |
+
|
630 |
+
/***/ "jquery-ui-datepicker":
|
631 |
+
/*!***************************************************!*\
|
632 |
+
!*** external {"this":["window","uiDatepicker"]} ***!
|
633 |
+
\***************************************************/
|
634 |
+
/*! no static exports found */
|
635 |
+
/***/ (function(module, exports) {
|
636 |
+
|
637 |
+
(function() { module.exports = this["window"]["uiDatepicker"]; }());
|
638 |
+
|
639 |
+
/***/ }),
|
640 |
+
|
641 |
+
/***/ "wp-util":
|
642 |
+
/*!***************************************!*\
|
643 |
+
!*** external {"this":["wp","util"]} ***!
|
644 |
+
\***************************************/
|
645 |
+
/*! no static exports found */
|
646 |
+
/***/ (function(module, exports) {
|
647 |
+
|
648 |
+
(function() { module.exports = this["wp"]["util"]; }());
|
649 |
+
|
650 |
+
/***/ })
|
651 |
+
|
652 |
+
/******/ });
|
653 |
+
//# sourceMappingURL=admin-field.js.map
|
assets/backend/js/admin.asset.php
CHANGED
@@ -1 +1 @@
|
|
1 |
-
<?php return array('dependencies' => array('jquery', 'jquery-serializejson'), 'version' => '
|
1 |
+
<?php return array('dependencies' => array('jquery', 'jquery-serializejson'), 'version' => 'b6b4fccea7fc19d92a2bbb32d2ae1248');
|
assets/backend/js/admin.js
CHANGED
@@ -1 +1,416 @@
|
|
1 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/******/ (function(modules) { // webpackBootstrap
|
2 |
+
/******/ // The module cache
|
3 |
+
/******/ var installedModules = {};
|
4 |
+
/******/
|
5 |
+
/******/ // The require function
|
6 |
+
/******/ function __webpack_require__(moduleId) {
|
7 |
+
/******/
|
8 |
+
/******/ // Check if module is in cache
|
9 |
+
/******/ if(installedModules[moduleId]) {
|
10 |
+
/******/ return installedModules[moduleId].exports;
|
11 |
+
/******/ }
|
12 |
+
/******/ // Create a new module (and put it into the cache)
|
13 |
+
/******/ var module = installedModules[moduleId] = {
|
14 |
+
/******/ i: moduleId,
|
15 |
+
/******/ l: false,
|
16 |
+
/******/ exports: {}
|
17 |
+
/******/ };
|
18 |
+
/******/
|
19 |
+
/******/ // Execute the module function
|
20 |
+
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
21 |
+
/******/
|
22 |
+
/******/ // Flag the module as loaded
|
23 |
+
/******/ module.l = true;
|
24 |
+
/******/
|
25 |
+
/******/ // Return the exports of the module
|
26 |
+
/******/ return module.exports;
|
27 |
+
/******/ }
|
28 |
+
/******/
|
29 |
+
/******/
|
30 |
+
/******/ // expose the modules object (__webpack_modules__)
|
31 |
+
/******/ __webpack_require__.m = modules;
|
32 |
+
/******/
|
33 |
+
/******/ // expose the module cache
|
34 |
+
/******/ __webpack_require__.c = installedModules;
|
35 |
+
/******/
|
36 |
+
/******/ // define getter function for harmony exports
|
37 |
+
/******/ __webpack_require__.d = function(exports, name, getter) {
|
38 |
+
/******/ if(!__webpack_require__.o(exports, name)) {
|
39 |
+
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
|
40 |
+
/******/ }
|
41 |
+
/******/ };
|
42 |
+
/******/
|
43 |
+
/******/ // define __esModule on exports
|
44 |
+
/******/ __webpack_require__.r = function(exports) {
|
45 |
+
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
46 |
+
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
47 |
+
/******/ }
|
48 |
+
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
49 |
+
/******/ };
|
50 |
+
/******/
|
51 |
+
/******/ // create a fake namespace object
|
52 |
+
/******/ // mode & 1: value is a module id, require it
|
53 |
+
/******/ // mode & 2: merge all properties of value into the ns
|
54 |
+
/******/ // mode & 4: return value when already ns object
|
55 |
+
/******/ // mode & 8|1: behave like require
|
56 |
+
/******/ __webpack_require__.t = function(value, mode) {
|
57 |
+
/******/ if(mode & 1) value = __webpack_require__(value);
|
58 |
+
/******/ if(mode & 8) return value;
|
59 |
+
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
|
60 |
+
/******/ var ns = Object.create(null);
|
61 |
+
/******/ __webpack_require__.r(ns);
|
62 |
+
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
|
63 |
+
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
|
64 |
+
/******/ return ns;
|
65 |
+
/******/ };
|
66 |
+
/******/
|
67 |
+
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
68 |
+
/******/ __webpack_require__.n = function(module) {
|
69 |
+
/******/ var getter = module && module.__esModule ?
|
70 |
+
/******/ function getDefault() { return module['default']; } :
|
71 |
+
/******/ function getModuleExports() { return module; };
|
72 |
+
/******/ __webpack_require__.d(getter, 'a', getter);
|
73 |
+
/******/ return getter;
|
74 |
+
/******/ };
|
75 |
+
/******/
|
76 |
+
/******/ // Object.prototype.hasOwnProperty.call
|
77 |
+
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
78 |
+
/******/
|
79 |
+
/******/ // __webpack_public_path__
|
80 |
+
/******/ __webpack_require__.p = "";
|
81 |
+
/******/
|
82 |
+
/******/
|
83 |
+
/******/ // Load entry module and return exports
|
84 |
+
/******/ return __webpack_require__(__webpack_require__.s = "./src/backend/admin.js");
|
85 |
+
/******/ })
|
86 |
+
/************************************************************************/
|
87 |
+
/******/ ({
|
88 |
+
|
89 |
+
/***/ "./src/backend/admin.js":
|
90 |
+
/*!******************************!*\
|
91 |
+
!*** ./src/backend/admin.js ***!
|
92 |
+
\******************************/
|
93 |
+
/*! no exports provided */
|
94 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
95 |
+
|
96 |
+
"use strict";
|
97 |
+
__webpack_require__.r(__webpack_exports__);
|
98 |
+
/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "jquery");
|
99 |
+
/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);
|
100 |
+
/* harmony import */ var _scss_editor_scss__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./scss/editor.scss */ "./src/backend/scss/editor.scss");
|
101 |
+
/* harmony import */ var _scss_editor_scss__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_scss_editor_scss__WEBPACK_IMPORTED_MODULE_1__);
|
102 |
+
/* harmony import */ var jquery_serializejson__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! jquery-serializejson */ "jquery-serializejson");
|
103 |
+
/* harmony import */ var jquery_serializejson__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(jquery_serializejson__WEBPACK_IMPORTED_MODULE_2__);
|
104 |
+
|
105 |
+
|
106 |
+
|
107 |
+
/* (function ($) {*/
|
108 |
+
|
109 |
+
"use strict";
|
110 |
+
|
111 |
+
jquery__WEBPACK_IMPORTED_MODULE_0___default()('.wooccm-premium-field').closest('tr').addClass('wooccm-premium');
|
112 |
+
|
113 |
+
function date_picker_select(datepicker) {
|
114 |
+
var option = jquery__WEBPACK_IMPORTED_MODULE_0___default()(datepicker).next().is('.hasDatepicker') ? 'minDate' : 'maxDate',
|
115 |
+
otherDateField = 'minDate' === option ? jquery__WEBPACK_IMPORTED_MODULE_0___default()(datepicker).next() : jquery__WEBPACK_IMPORTED_MODULE_0___default()(datepicker).prev(),
|
116 |
+
date = jquery__WEBPACK_IMPORTED_MODULE_0___default()(datepicker).datepicker('getDate');
|
117 |
+
jquery__WEBPACK_IMPORTED_MODULE_0___default()(otherDateField).datepicker('option', option, date);
|
118 |
+
jquery__WEBPACK_IMPORTED_MODULE_0___default()(datepicker).change();
|
119 |
+
}
|
120 |
+
|
121 |
+
function getEnhancedSelectFormatString() {
|
122 |
+
return {
|
123 |
+
'language': {
|
124 |
+
errorLoading: function errorLoading() {
|
125 |
+
// Workaround for https://github.com/select2/select2/issues/4355 instead of i18n_ajax_error.
|
126 |
+
return wc_enhanced_select_params.i18n_searching;
|
127 |
+
},
|
128 |
+
inputTooLong: function inputTooLong(args) {
|
129 |
+
var overChars = args.input.length - args.maximum;
|
130 |
+
|
131 |
+
if (1 === overChars) {
|
132 |
+
return wc_enhanced_select_params.i18n_input_too_long_1;
|
133 |
+
}
|
134 |
+
|
135 |
+
return wc_enhanced_select_params.i18n_input_too_long_n.replace('%qty%', overChars);
|
136 |
+
},
|
137 |
+
inputTooShort: function inputTooShort(args) {
|
138 |
+
var remainingChars = args.minimum - args.input.length;
|
139 |
+
|
140 |
+
if (1 === remainingChars) {
|
141 |
+
return wc_enhanced_select_params.i18n_input_too_short_1;
|
142 |
+
}
|
143 |
+
|
144 |
+
return wc_enhanced_select_params.i18n_input_too_short_n.replace('%qty%', remainingChars);
|
145 |
+
},
|
146 |
+
loadingMore: function loadingMore() {
|
147 |
+
return wc_enhanced_select_params.i18n_load_more;
|
148 |
+
},
|
149 |
+
maximumSelected: function maximumSelected(args) {
|
150 |
+
if (args.maximum === 1) {
|
151 |
+
return wc_enhanced_select_params.i18n_selection_too_long_1;
|
152 |
+
}
|
153 |
+
|
154 |
+
return wc_enhanced_select_params.i18n_selection_too_long_n.replace('%qty%', args.maximum);
|
155 |
+
},
|
156 |
+
noResults: function noResults() {
|
157 |
+
return wc_enhanced_select_params.i18n_no_matches;
|
158 |
+
},
|
159 |
+
searching: function searching() {
|
160 |
+
return wc_enhanced_select_params.i18n_searching;
|
161 |
+
}
|
162 |
+
}
|
163 |
+
};
|
164 |
+
}
|
165 |
+
|
166 |
+
jquery__WEBPACK_IMPORTED_MODULE_0___default()(document).on('wooccm-enhanced-between-dates', function (e) {
|
167 |
+
jquery__WEBPACK_IMPORTED_MODULE_0___default()('.wooccm-enhanced-between-dates').filter(':not(.enhanced)').each(function () {
|
168 |
+
jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).find('input').datepicker({
|
169 |
+
defaultDate: '',
|
170 |
+
dateFormat: 'yy-mm-dd',
|
171 |
+
numberOfMonths: 1,
|
172 |
+
showButtonPanel: true,
|
173 |
+
onSelect: function onSelect() {
|
174 |
+
date_picker_select(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this));
|
175 |
+
}
|
176 |
+
});
|
177 |
+
jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).find('input').each(function () {
|
178 |
+
date_picker_select(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this));
|
179 |
+
});
|
180 |
+
});
|
181 |
+
});
|
182 |
+
jquery__WEBPACK_IMPORTED_MODULE_0___default()(document).on('wooccm-enhanced-options', function (e) {
|
183 |
+
jquery__WEBPACK_IMPORTED_MODULE_0___default()('table.wc_gateways tbody').sortable({
|
184 |
+
items: 'tr',
|
185 |
+
cursor: 'move',
|
186 |
+
axis: 'y',
|
187 |
+
handle: 'td.sort',
|
188 |
+
scrollSensitivity: 40,
|
189 |
+
helper: function helper(event, ui) {
|
190 |
+
ui.children().each(function () {
|
191 |
+
jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).width(jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).width());
|
192 |
+
});
|
193 |
+
ui.css('left', '0');
|
194 |
+
return ui;
|
195 |
+
},
|
196 |
+
start: function start(event, ui) {
|
197 |
+
ui.item.css('background-color', '#f6f6f6');
|
198 |
+
},
|
199 |
+
stop: function stop(event, ui) {
|
200 |
+
ui.item.removeAttr('style');
|
201 |
+
ui.item.trigger('updateMoveButtons');
|
202 |
+
},
|
203 |
+
update: function update(event, ui) {
|
204 |
+
jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).find('tr').each(function (i, tr) {
|
205 |
+
jquery__WEBPACK_IMPORTED_MODULE_0___default()(tr).find('input.add-order').val(i).trigger('change');
|
206 |
+
});
|
207 |
+
}
|
208 |
+
});
|
209 |
+
jquery__WEBPACK_IMPORTED_MODULE_0___default()('.wooccm-enhanced-options').each(function () {
|
210 |
+
var $table = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this),
|
211 |
+
$add = $table.find('.add-option'),
|
212 |
+
$remove = $table.find('.remove-options');
|
213 |
+
$add.on('click', function (e) {
|
214 |
+
var $tr = $table.find('tbody > tr'),
|
215 |
+
id = $tr.length,
|
216 |
+
tr = $tr.first().clone().html().replace(/options\[([0-9]+)\]/g, 'options[' + id + ']').replace('disabled="disabled"', '').replace('checked="checked"', '').replace('<input value="0"', '<input value="' + id + '"').replace('<input value="0"', '<input value="' + id + '"');
|
217 |
+
$tr.last().after(jquery__WEBPACK_IMPORTED_MODULE_0___default()('<tr>' + tr + '</tr>')).find('input').trigger('change');
|
218 |
+
$remove.removeProp('disabled');
|
219 |
+
});
|
220 |
+
$remove.on('click', function (e) {
|
221 |
+
$table.find('tr > td.check-column input:checked').closest('tr').remove();
|
222 |
+
var $tr = $table.find('tbody > tr');
|
223 |
+
$tr.first().find('input').trigger('change');
|
224 |
+
|
225 |
+
if ($tr.length < 2) {
|
226 |
+
jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).prop('disabled', true);
|
227 |
+
}
|
228 |
+
});
|
229 |
+
});
|
230 |
+
});
|
231 |
+
jquery__WEBPACK_IMPORTED_MODULE_0___default()(document).on('wooccm-enhanced-select', function (e) {
|
232 |
+
jquery__WEBPACK_IMPORTED_MODULE_0___default()('.wooccm-enhanced-select').filter(':not(.enhanced)').each(function () {
|
233 |
+
var select2_args = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend({
|
234 |
+
minimumResultsForSearch: 10,
|
235 |
+
allowClear: jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).data('allow_clear') ? true : false,
|
236 |
+
placeholder: jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).data('placeholder')
|
237 |
+
}, getEnhancedSelectFormatString());
|
238 |
+
var name = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).attr('name'); // fix serializeJSON empty select and multiselect
|
239 |
+
//if (name.indexOf('[]') >= 0) {
|
240 |
+
// $(this).prepend('<input type="hidden" name="' + name + '" value="[]" />');
|
241 |
+
//}
|
242 |
+
|
243 |
+
jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).selectWoo(select2_args).addClass('enhanced');
|
244 |
+
});
|
245 |
+
jquery__WEBPACK_IMPORTED_MODULE_0___default()('.wooccm-product-search').filter(':not(.enhanced)').each(function () {
|
246 |
+
var select2_args = {
|
247 |
+
allowClear: jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).data('allow_clear') ? true : false,
|
248 |
+
placeholder: jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).data('placeholder'),
|
249 |
+
minimumInputLength: jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).data('minimum_input_length') ? jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).data('minimum_input_length') : '3',
|
250 |
+
escapeMarkup: function escapeMarkup(m) {
|
251 |
+
return m;
|
252 |
+
},
|
253 |
+
ajax: {
|
254 |
+
url: wc_enhanced_select_params.ajax_url,
|
255 |
+
dataType: 'json',
|
256 |
+
delay: 250,
|
257 |
+
data: function data(params) {
|
258 |
+
return {
|
259 |
+
term: params.term,
|
260 |
+
action: jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).data('action') || 'wooccm_select_search_products',
|
261 |
+
//nonce: wooccm_admin.nonce,
|
262 |
+
security: wc_enhanced_select_params.search_products_nonce,
|
263 |
+
selected: jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).select2('val') || 0,
|
264 |
+
exclude: jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).data('exclude'),
|
265 |
+
include: jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).data('include'),
|
266 |
+
limit: jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).data('limit'),
|
267 |
+
display_stock: jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).data('display_stock')
|
268 |
+
};
|
269 |
+
},
|
270 |
+
processResults: function processResults(data) {
|
271 |
+
var terms = [];
|
272 |
+
|
273 |
+
if (data) {
|
274 |
+
jquery__WEBPACK_IMPORTED_MODULE_0___default.a.each(data, function (id, text) {
|
275 |
+
terms.push({
|
276 |
+
id: id,
|
277 |
+
text: text
|
278 |
+
});
|
279 |
+
});
|
280 |
+
}
|
281 |
+
|
282 |
+
return {
|
283 |
+
results: terms
|
284 |
+
};
|
285 |
+
},
|
286 |
+
cache: true
|
287 |
+
}
|
288 |
+
};
|
289 |
+
select2_args = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend(select2_args, getEnhancedSelectFormatString());
|
290 |
+
var name = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).attr('name'); // fix serializeJSON empty select and multiselect
|
291 |
+
//if (name.indexOf('[]') >= 0) {
|
292 |
+
// $(this).prepend('<input type="hidden" name="' + name + '" value="[]" />');
|
293 |
+
//}
|
294 |
+
|
295 |
+
jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).selectWoo(select2_args).addClass('enhanced');
|
296 |
+
|
297 |
+
if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).data('sortable')) {
|
298 |
+
var $select = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this);
|
299 |
+
var $list = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).next('.select2-container').find('ul.select2-selection__rendered');
|
300 |
+
$list.sortable({
|
301 |
+
placeholder: 'ui-state-highlight select2-selection__choice',
|
302 |
+
forcePlaceholderSize: true,
|
303 |
+
items: 'li:not(.select2-search__field)',
|
304 |
+
tolerance: 'pointer',
|
305 |
+
stop: function stop() {
|
306 |
+
jquery__WEBPACK_IMPORTED_MODULE_0___default()($list.find('.select2-selection__choice').get().reverse()).each(function () {
|
307 |
+
var id = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).data('data').id;
|
308 |
+
var option = $select.find('option[value="' + id + '"]')[0];
|
309 |
+
$select.prepend(option);
|
310 |
+
});
|
311 |
+
}
|
312 |
+
}); // Keep multiselects ordered alphabetically if they are not sortable.
|
313 |
+
} else if (jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).prop('multiple')) {
|
314 |
+
jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).on('change', function () {
|
315 |
+
var $children = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).children(); //filter option fix appended input hidden
|
316 |
+
|
317 |
+
$children.filter('option').sort(function (a, b) {
|
318 |
+
var atext = a.text.toLowerCase();
|
319 |
+
var btext = b.text.toLowerCase();
|
320 |
+
|
321 |
+
if (atext > btext) {
|
322 |
+
return 1;
|
323 |
+
}
|
324 |
+
|
325 |
+
if (atext < btext) {
|
326 |
+
return -1;
|
327 |
+
}
|
328 |
+
|
329 |
+
return 0;
|
330 |
+
});
|
331 |
+
jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).html($children);
|
332 |
+
});
|
333 |
+
}
|
334 |
+
});
|
335 |
+
});
|
336 |
+
jquery__WEBPACK_IMPORTED_MODULE_0___default()('.wooccm-enhanced-search').filter(':not(.enhanced)').each(function () {
|
337 |
+
var select2_args = {
|
338 |
+
allowClear: jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).data('allow_clear') ? true : false,
|
339 |
+
placeholder: jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).data('placeholder'),
|
340 |
+
minimumInputLength: jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).data('minimum_input_length') || '3',
|
341 |
+
escapeMarkup: function escapeMarkup(m) {
|
342 |
+
return m;
|
343 |
+
},
|
344 |
+
ajax: {
|
345 |
+
url: wooccm_admin.ajax_url,
|
346 |
+
dataType: 'json',
|
347 |
+
cache: true,
|
348 |
+
delay: 250,
|
349 |
+
data: function data(params) {
|
350 |
+
return {
|
351 |
+
term: params.term,
|
352 |
+
key: jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).data('key'),
|
353 |
+
action: 'wooccm_search_field',
|
354 |
+
nonce: wooccm_admin.nonce
|
355 |
+
};
|
356 |
+
},
|
357 |
+
processResults: function processResults(data, params) {
|
358 |
+
var terms = [];
|
359 |
+
|
360 |
+
if (data) {
|
361 |
+
jquery__WEBPACK_IMPORTED_MODULE_0___default.a.each(data, function (id, text) {
|
362 |
+
terms.push({
|
363 |
+
id: id,
|
364 |
+
text: text
|
365 |
+
});
|
366 |
+
});
|
367 |
+
}
|
368 |
+
|
369 |
+
return {
|
370 |
+
results: terms
|
371 |
+
};
|
372 |
+
}
|
373 |
+
}
|
374 |
+
};
|
375 |
+
select2_args = jquery__WEBPACK_IMPORTED_MODULE_0___default.a.extend(select2_args, getEnhancedSelectFormatString());
|
376 |
+
jquery__WEBPACK_IMPORTED_MODULE_0___default()(this).select2(select2_args).addClass('enhanced');
|
377 |
+
});
|
378 |
+
/* })(jQuery); */
|
379 |
+
|
380 |
+
/***/ }),
|
381 |
+
|
382 |
+
/***/ "./src/backend/scss/editor.scss":
|
383 |
+
/*!**************************************!*\
|
384 |
+
!*** ./src/backend/scss/editor.scss ***!
|
385 |
+
\**************************************/
|
386 |
+
/*! no static exports found */
|
387 |
+
/***/ (function(module, exports) {
|
388 |
+
|
389 |
+
// removed by extract-text-webpack-plugin
|
390 |
+
|
391 |
+
/***/ }),
|
392 |
+
|
393 |
+
/***/ "jquery":
|
394 |
+
/*!**********************************!*\
|
395 |
+
!*** external {"this":"jQuery"} ***!
|
396 |
+
\**********************************/
|
397 |
+
/*! no static exports found */
|
398 |
+
/***/ (function(module, exports) {
|
399 |
+
|
400 |
+
(function() { module.exports = this["jQuery"]; }());
|
401 |
+
|
402 |
+
/***/ }),
|
403 |
+
|
404 |
+
/***/ "jquery-serializejson":
|
405 |
+
/*!****************************************************!*\
|
406 |
+
!*** external {"this":["window","serializeJSON"]} ***!
|
407 |
+
\****************************************************/
|
408 |
+
/*! no static exports found */
|
409 |
+
/***/ (function(module, exports) {
|
410 |
+
|
411 |
+
(function() { module.exports = this["window"]["serializeJSON"]; }());
|
412 |
+
|
413 |
+
/***/ })
|
414 |
+
|
415 |
+
/******/ });
|
416 |
+
//# sourceMappingURL=admin.js.map
|
assets/frontend/css/checkout.css
CHANGED
@@ -1 +1,116 @@
|
|
1 |
-
.woocommerce form
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|