Version Description
- Fix: select options order
- Fix: woocommerce modal field filter
Download this release
Release Info
Developer | quadlayers |
Plugin | WooCommerce Checkout Manager |
Version | 5.3.5 |
Comparing to | |
See all releases |
Code changes from version 5.3.4 to 5.3.5
- assets/backend/css/admin.css +1 -0
- assets/backend/css/wooccm-admin.css +0 -226
- assets/backend/css/wooccm-admin.css.map +0 -1
- assets/backend/css/wooccm-admin.min.css +0 -1
- assets/backend/js/admin-field.asset.php +1 -0
- assets/backend/js/admin-field.js +1 -0
- assets/backend/js/admin.asset.php +1 -0
- assets/backend/js/admin.js +1 -0
- assets/backend/js/wooccm-admin-field.js +0 -489
- assets/backend/js/wooccm-admin-field.min.js +0 -1
- assets/backend/js/wooccm-admin.js +0 -297
- assets/backend/js/wooccm-admin.min.js +0 -1
- assets/frontend/css/checkout.css +1 -0
- assets/frontend/css/wooccm.css +0 -128
- assets/frontend/css/wooccm.css.map +0 -1
- assets/frontend/css/wooccm.min.css +0 -1
- assets/frontend/js/checkout.asset.php +1 -0
- assets/frontend/js/checkout.js +1 -0
- assets/frontend/js/order-upload.asset.php +1 -0
- assets/frontend/js/order-upload.js +1 -0
- assets/frontend/js/wooccm-checkout.js +0 -610
- assets/frontend/js/wooccm-checkout.min.js +0 -1
- assets/frontend/js/wooccm-order-upload.js +0 -136
- assets/frontend/js/wooccm-order-upload.min.js +0 -1
- includes/class-wooccm-backend.php +5 -3
- includes/class-wooccm.php +8 -3
- includes/controller/class-wooccm-field.php +3 -1
- includes/view/backend/pages/modals/parts/panel-options.php +1 -1
- readme.txt +8 -3
- woocommerce-checkout-manager.php +3 -3
assets/backend/css/admin.css
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
.select2-container{z-index:9999999}.select2-container .select2-selection--single,.select2-container .select2-selection--single .select2-selection__rendered,.select2-container .select2-selection--single .select2-selection__arrow{height:30px !important;line-height:30px !important}.wooccm-premium{opacity:0.5;pointer-events:none}.button.fileinput-button{position:relative;overflow:hidden !important}.button.fileinput-button input{position:absolute;top:0;right:0;margin:0;opacity:0;-ms-filter:'alpha(opacity=0)';font-size:200px;direction:ltr;cursor:pointer}table.wc_gateways>tbody>tr>td select{line-height:1 !important}table.wc_gateways>tbody>tr>td.label{font-weight:600}table.wooccm-enhanced-options{border:none;box-shadow:none}table.wooccm-enhanced-options>thead>th .woocommerce-help-tip{margin:-1px 0 0 0.25em}table.wooccm-enhanced-options>tbody>tr>td input.label{width:100%}table.wooccm-enhanced-options>tbody>tr>td select.add-price-type{margin:0 0 0 10px}table.wooccm-enhanced-options>tbody>tr>td input.check{margin:0 9px}table.wooccm-enhanced-options>tbody>tr>td.sort .wc-item-reorder-nav{width:auto}#wooccm_modal.processing{pointer-events:none}#wooccm_modal.processing:before{content:'';position:absolute;top:0;bottom:0;left:0;right:0;background-color:#ffffff;z-index:99999999;opacity:0.8}#wooccm_modal select{min-height:30px}#wooccm_modal .form-field .wrap{padding:0}#wooccm_modal .attachment-info .details,#wooccm_modal .attachment-info .settings{width:100%}#wooccm_modal .attachment-info .woocommerce_options_panel label,#wooccm_modal .attachment-info .woocommerce_options_panel legend{width:75px;margin:0 0 0 -90px;font-weight:600}#wooccm_modal .attachment-info .woocommerce_options_panel fieldset.form-field,#wooccm_modal .attachment-info .woocommerce_options_panel p.form-field{padding:0 20px 0 92px !important}#wooccm_modal .attachment-info .woocommerce_options_panel input[type=email],#wooccm_modal .attachment-info .woocommerce_options_panel input[type=number],#wooccm_modal .attachment-info .woocommerce_options_panel input[type=password],#wooccm_modal .attachment-info .woocommerce_options_panel input[type=text],#wooccm_modal .attachment-info .woocommerce_options_panel select,#wooccm_modal .attachment-info .woocommerce_options_panel .select2-container{width:100% !important}#wooccm_modal #woocommerce-product-data .woocommerce_options_panel{width:100%}#wooccm_modal #woocommerce-product-data .woocommerce_options_panel .premium{display:block;clear:both}#wooccm_modal #woocommerce-product-data .woocommerce_options_panel .woocommerce-help-tip{margin:0 0 0 0.5em}#wooccm_modal #woocommerce-product-data .woocommerce_options_panel .select2-container{width:50% !important;line-height:16px}#wooccm_modal #woocommerce-product-data .woocommerce_options_panel .select2-container .select2-selection{box-shadow:none;border-radius:3px;padding:0 24px 0 8px}#wooccm_modal #woocommerce-product-data .woocommerce_options_panel .select2-container .select2-selection--multiple{line-height:16px;min-height:30px}@media only screen and (max-width: 1280px){#wooccm_modal #woocommerce-product-data .woocommerce_options_panel .select2-container{width:80% !important}}#wooccm_modal #woocommerce-product-data .woocommerce_options_panel .select2-container--default .select2-selection--multiple .select2-selection__rendered li{margin:3px 3px 0 0}#wooccm_modal #woocommerce-product-data .woocommerce_options_panel .select2-container--default.select2-container--focus .select2-selection--multiple{border-color:#5b9dd9 !important;box-shadow:0 0 2px rgba(30,140,190,0.8) !important;outline:2px solid transparent !important}#wooccm-order-files .inside{margin:0;padding:0;background:#fefefe;display:block !important}#wooccm-order-files .handlediv,#wooccm-order-files .hndle{display:none}#wooccm-order-files .wooccm_upload_results{display:inline-block;margin:0 10px}#wooccm-order-files .wooccm_order_attachments_wrapper{margin:0;overflow-x:auto}#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments{width:100%;background:#fff}#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments thead th:first-child{padding-left:2em}#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments thead th.sortable{cursor:pointer}#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments .item{min-width:200px}#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments thead th{text-align:left;padding:1em;font-weight:400;color:#999;background:#f8f8f8;user-select:none}#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments tbody#order_line_items tr:first-child td{border-top:none}#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments tbody tr:last-child td{border-bottom:1px solid #dfdfdf}#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments td.thumb{text-align:left;width:38px;padding-bottom:1.5em}#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments td.thumb .wc-order-item-thumbnail{width:38px;height:38px;border:2px solid #e8e8e8;background:#f8f8f8;color:#ccc;position:relative;font-size:21px;display:block;text-align:center}#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments tbody th:first-child,#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments td:first-child{padding-left:2em}#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments tbody th,#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments td{padding:1.5em 1em 1em;text-align:left;line-height:1.5em;vertical-align:top;border-bottom:1px solid #f8f8f8}#wooccm-order-files .wc-order-data-row{border-bottom:1px solid #dfdfdf;padding:1.5em 2em;background:#f8f8f8;line-height:2em;text-align:left}
|
assets/backend/css/wooccm-admin.css
DELETED
@@ -1,226 +0,0 @@
|
|
1 |
-
.select2-container {
|
2 |
-
z-index: 9999999;
|
3 |
-
}
|
4 |
-
.select2-container .select2-selection--single,
|
5 |
-
.select2-container .select2-selection--single .select2-selection__rendered,
|
6 |
-
.select2-container .select2-selection--single .select2-selection__arrow {
|
7 |
-
height: 30px!important;
|
8 |
-
line-height: 30px!important;
|
9 |
-
}
|
10 |
-
.wooccm-premium {
|
11 |
-
opacity: 0.5;
|
12 |
-
pointer-events: none;
|
13 |
-
/* .description {
|
14 |
-
&.premium {
|
15 |
-
//display: none;
|
16 |
-
}
|
17 |
-
|
18 |
-
&.hidden {
|
19 |
-
//display: none;
|
20 |
-
}
|
21 |
-
}*/
|
22 |
-
}
|
23 |
-
.button.fileinput-button {
|
24 |
-
position: relative;
|
25 |
-
overflow: hidden!important;
|
26 |
-
}
|
27 |
-
.button.fileinput-button input {
|
28 |
-
position: absolute;
|
29 |
-
top: 0;
|
30 |
-
right: 0;
|
31 |
-
margin: 0;
|
32 |
-
opacity: 0;
|
33 |
-
-ms-filter: 'alpha(opacity=0)';
|
34 |
-
font-size: 200px;
|
35 |
-
direction: ltr;
|
36 |
-
cursor: pointer;
|
37 |
-
}
|
38 |
-
table.wc_gateways > tbody > tr > td select {
|
39 |
-
line-height: 1!important;
|
40 |
-
}
|
41 |
-
table.wc_gateways > tbody > tr > td.label {
|
42 |
-
font-weight: 600;
|
43 |
-
}
|
44 |
-
table.wooccm-enhanced-options {
|
45 |
-
border: none;
|
46 |
-
box-shadow: none;
|
47 |
-
}
|
48 |
-
table.wooccm-enhanced-options > thead > th .woocommerce-help-tip {
|
49 |
-
margin: -1px 0 0 0.25em;
|
50 |
-
}
|
51 |
-
table.wooccm-enhanced-options > tbody > tr > td input.label {
|
52 |
-
width: 100%;
|
53 |
-
}
|
54 |
-
table.wooccm-enhanced-options > tbody > tr > td select.add-price-type {
|
55 |
-
margin: 0 0 0 10px;
|
56 |
-
}
|
57 |
-
table.wooccm-enhanced-options > tbody > tr > td input.check {
|
58 |
-
margin: 0 9px;
|
59 |
-
}
|
60 |
-
table.wooccm-enhanced-options > tbody > tr > td.sort .wc-item-reorder-nav {
|
61 |
-
width: auto;
|
62 |
-
}
|
63 |
-
#wooccm_modal.processing {
|
64 |
-
pointer-events: none;
|
65 |
-
}
|
66 |
-
#wooccm_modal.processing:before {
|
67 |
-
content: '';
|
68 |
-
position: absolute;
|
69 |
-
top: 0;
|
70 |
-
bottom: 0;
|
71 |
-
left: 0;
|
72 |
-
right: 0;
|
73 |
-
background-color: #ffffff;
|
74 |
-
z-index: 99999999;
|
75 |
-
opacity: 0.8;
|
76 |
-
}
|
77 |
-
#wooccm_modal select {
|
78 |
-
min-height: 30px;
|
79 |
-
}
|
80 |
-
#wooccm_modal .form-field .wrap {
|
81 |
-
padding: 0;
|
82 |
-
}
|
83 |
-
#wooccm_modal .attachment-info .details,
|
84 |
-
#wooccm_modal .attachment-info .settings {
|
85 |
-
width: 100%;
|
86 |
-
}
|
87 |
-
#wooccm_modal .attachment-info .woocommerce_options_panel label,
|
88 |
-
#wooccm_modal .attachment-info .woocommerce_options_panel legend {
|
89 |
-
width: 75px;
|
90 |
-
margin: 0 0 0 -90px;
|
91 |
-
font-weight: 600;
|
92 |
-
}
|
93 |
-
#wooccm_modal .attachment-info .woocommerce_options_panel fieldset.form-field,
|
94 |
-
#wooccm_modal .attachment-info .woocommerce_options_panel p.form-field {
|
95 |
-
padding: 0 20px 0 92px!important;
|
96 |
-
}
|
97 |
-
#wooccm_modal .attachment-info .woocommerce_options_panel input[type=email],
|
98 |
-
#wooccm_modal .attachment-info .woocommerce_options_panel input[type=number],
|
99 |
-
#wooccm_modal .attachment-info .woocommerce_options_panel input[type=password],
|
100 |
-
#wooccm_modal .attachment-info .woocommerce_options_panel input[type=text],
|
101 |
-
#wooccm_modal .attachment-info .woocommerce_options_panel select,
|
102 |
-
#wooccm_modal .attachment-info .woocommerce_options_panel .select2-container {
|
103 |
-
width: 100%!important;
|
104 |
-
}
|
105 |
-
#wooccm_modal #woocommerce-product-data .woocommerce_options_panel {
|
106 |
-
width: 100%;
|
107 |
-
/* input,
|
108 |
-
select,
|
109 |
-
textarea {
|
110 |
-
margin: 0;
|
111 |
-
}*/
|
112 |
-
}
|
113 |
-
#wooccm_modal #woocommerce-product-data .woocommerce_options_panel .premium {
|
114 |
-
display: block;
|
115 |
-
clear: both;
|
116 |
-
}
|
117 |
-
#wooccm_modal #woocommerce-product-data .woocommerce_options_panel .woocommerce-help-tip {
|
118 |
-
margin: 0 0 0 0.5em;
|
119 |
-
}
|
120 |
-
#wooccm_modal #woocommerce-product-data .woocommerce_options_panel .select2-container {
|
121 |
-
width: 50%!important;
|
122 |
-
line-height: 16px;
|
123 |
-
}
|
124 |
-
#wooccm_modal #woocommerce-product-data .woocommerce_options_panel .select2-container .select2-selection {
|
125 |
-
box-shadow: none;
|
126 |
-
border-radius: 3px;
|
127 |
-
padding: 0 24px 0 8px;
|
128 |
-
}
|
129 |
-
#wooccm_modal #woocommerce-product-data .woocommerce_options_panel .select2-container .select2-selection--multiple {
|
130 |
-
line-height: 16px;
|
131 |
-
min-height: 30px;
|
132 |
-
}
|
133 |
-
@media only screen and (max-width: 1280px) {
|
134 |
-
#wooccm_modal #woocommerce-product-data .woocommerce_options_panel .select2-container {
|
135 |
-
width: 80%!important;
|
136 |
-
}
|
137 |
-
}
|
138 |
-
#wooccm_modal #woocommerce-product-data .woocommerce_options_panel .select2-container--default .select2-selection--multiple .select2-selection__rendered li {
|
139 |
-
margin: 3px 3px 0 0;
|
140 |
-
}
|
141 |
-
#wooccm_modal #woocommerce-product-data .woocommerce_options_panel .select2-container--default.select2-container--focus .select2-selection--multiple {
|
142 |
-
border-color: #5b9dd9!important;
|
143 |
-
box-shadow: 0 0 2px rgba(30, 140, 190, 0.8) !important;
|
144 |
-
outline: 2px solid transparent!important;
|
145 |
-
}
|
146 |
-
#wooccm-order-files .inside {
|
147 |
-
margin: 0;
|
148 |
-
padding: 0;
|
149 |
-
background: #fefefe;
|
150 |
-
display: block!important;
|
151 |
-
}
|
152 |
-
#wooccm-order-files .handlediv,
|
153 |
-
#wooccm-order-files .hndle {
|
154 |
-
display: none;
|
155 |
-
}
|
156 |
-
#wooccm-order-files .wooccm_upload_results {
|
157 |
-
display: inline-block;
|
158 |
-
margin: 0 10px;
|
159 |
-
}
|
160 |
-
#wooccm-order-files .wooccm_order_attachments_wrapper {
|
161 |
-
margin: 0;
|
162 |
-
overflow-x: auto;
|
163 |
-
}
|
164 |
-
#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments {
|
165 |
-
width: 100%;
|
166 |
-
background: #fff;
|
167 |
-
}
|
168 |
-
#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments thead th:first-child {
|
169 |
-
padding-left: 2em;
|
170 |
-
}
|
171 |
-
#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments thead th.sortable {
|
172 |
-
cursor: pointer;
|
173 |
-
}
|
174 |
-
#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments .item {
|
175 |
-
min-width: 200px;
|
176 |
-
}
|
177 |
-
#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments thead th {
|
178 |
-
text-align: left;
|
179 |
-
padding: 1em;
|
180 |
-
font-weight: 400;
|
181 |
-
color: #999;
|
182 |
-
background: #f8f8f8;
|
183 |
-
user-select: none;
|
184 |
-
}
|
185 |
-
#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments tbody#order_line_items tr:first-child td {
|
186 |
-
border-top: none;
|
187 |
-
}
|
188 |
-
#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments tbody tr:last-child td {
|
189 |
-
border-bottom: 1px solid #dfdfdf;
|
190 |
-
}
|
191 |
-
#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments td.thumb {
|
192 |
-
text-align: left;
|
193 |
-
width: 38px;
|
194 |
-
padding-bottom: 1.5em;
|
195 |
-
}
|
196 |
-
#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments td.thumb .wc-order-item-thumbnail {
|
197 |
-
width: 38px;
|
198 |
-
height: 38px;
|
199 |
-
border: 2px solid #e8e8e8;
|
200 |
-
background: #f8f8f8;
|
201 |
-
color: #ccc;
|
202 |
-
position: relative;
|
203 |
-
font-size: 21px;
|
204 |
-
display: block;
|
205 |
-
text-align: center;
|
206 |
-
}
|
207 |
-
#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments tbody th:first-child,
|
208 |
-
#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments td:first-child {
|
209 |
-
padding-left: 2em;
|
210 |
-
}
|
211 |
-
#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments tbody th,
|
212 |
-
#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments td {
|
213 |
-
padding: 1.5em 1em 1em;
|
214 |
-
text-align: left;
|
215 |
-
line-height: 1.5em;
|
216 |
-
vertical-align: top;
|
217 |
-
border-bottom: 1px solid #f8f8f8;
|
218 |
-
}
|
219 |
-
#wooccm-order-files .wc-order-data-row {
|
220 |
-
border-bottom: 1px solid #dfdfdf;
|
221 |
-
padding: 1.5em 2em;
|
222 |
-
background: #f8f8f8;
|
223 |
-
line-height: 2em;
|
224 |
-
text-align: left;
|
225 |
-
}
|
226 |
-
/*# sourceMappingURL=wooccm-admin.css.map */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/backend/css/wooccm-admin.css.map
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
{"version":3,"sources":["../../less/wooccm-admin.less"],"names":[],"mappings":"AAAA;EACE,gBAAA;;AADF,kBAGE;AAHF,kBAIE,2BAA2B;AAJ7B,kBAKE,2BAA2B;EACzB,sBAAA;EACA,2BAAA;;AAIJ;EACE,YAAA;EACA,oBAAA;;;;;;;;;;;AAeA,OAAC;EACC,kBAAA;EACA,0BAAA;;AAFF,OAAC,iBAIC;EACE,kBAAA;EACA,MAAA;EACA,QAAA;EACA,SAAA;EACA,UAAA;EACA,YAAW,kBAAX;EACA,gBAAA;EACA,cAAA;EACA,eAAA;;AAOJ,KAAC,YAEC,QAEE,KACE,KAEE;EACE,wBAAA;;AAGF,KAXP,YAEC,QAEE,KACE,KAMG;EACC,gBAAA;;AAQV,KAAC;EACC,YAAA;EACA,gBAAA;;AAFF,KAAC,wBAIC,QACE,KACE;EACE,uBAAA;;AAPR,KAAC,wBAYC,QACE,KACE,KACE,MAAK;EACH,WAAA;;AAhBV,KAAC,wBAYC,QACE,KACE,KAIE,OAAM;EACJ,kBAAA;;AAnBV,KAAC,wBAYC,QACE,KACE,KAOE,MAAK;EACH,aAAA;;AAGF,KAzBP,wBAYC,QACE,KACE,KAWG,KAAM;EACL,WAAA;;AAUV,aAAC;EACC,oBAAA;;AACA,aAFD,WAEE;EACC,SAAS,EAAT;EACA,kBAAA;EACA,MAAA;EAAO,SAAA;EAAW,OAAA;EAAS,QAAA;EAC3B,yBAAA;EACA,iBAAA;EACA,YAAA;;AAVN,aAcE;EACE,gBAAA;;AAfJ,aAkBE,YACE;EACE,UAAA;;AApBN,aAwBE,iBACE;AAzBJ,aAwBE,iBAEE;EACE,WAAA;;AA3BN,aAwBE,iBAME,2BAA2B;AA9B/B,aAwBE,iBAOE,2BAA2B;EACzB,WAAA;EACA,mBAAA;EACA,gBAAA;;AAlCN,aAwBE,iBAaE,2BAA2B,SAAQ;AArCvC,aAwBE,iBAcE,2BAA2B,EAAC;EAC1B,gCAAA;;AAvCN,aAwBE,iBAkBE,2BAA2B,MAAK;AA1CpC,aAwBE,iBAmBE,2BAA2B,MAAK;AA3CpC,aAwBE,iBAoBE,2BAA2B,MAAK;AA5CpC,aAwBE,iBAqBE,2BAA2B,MAAK;AA7CpC,aAwBE,iBAsBE,2BAA2B;AA9C/B,aAwBE,iBAuBE,2BAA2B;EACzB,qBAAA;;AAhDN,aAqDE,0BAEE;EACE,WAAA;;;;;;;AAxDN,aAqDE,0BAEE,2BAGE;EACE,cAAA;EACA,WAAA;;AA5DR,aAqDE,0BAEE,2BAcE;EACE,mBAAA;;AAtER,aAqDE,0BAEE,2BAkBE;EACE,oBAAA;EACA,iBAAA;;AA3ER,aAqDE,0BAEE,2BAkBE,mBAIE;EACE,gBAAA;EACA,kBAAA;EACA,qBAAA;;AAhFV,aAqDE,0BAEE,2BAkBE,mBAUE;EACE,iBAAA;EACA,gBAAA;;AAGF,wBAA2C;EA0HlD,aA7JC,0BAEE,2BAkBE;IAgBI,oBAAA;;;AAzFV,aAqDE,0BAEE,2BAsCE,4BAEE,6BAA6B,6BAA6B;EACxD,mBAAA;;AAGF,aA9CN,0BAEE,2BAsCE,4BAMG,yBAA0B;EACzB,+BAAA;EACA,2CAAA;EACA,wCAAA;;AASV,mBAEE;EACE,SAAA;EACA,UAAA;EACA,mBAAA;EACA,wBAAA;;AANJ,mBASE;AATF,mBAUE;EACE,aAAA;;AAXJ,mBAcE;EACE,qBAAA;EACA,cAAA;;AAhBJ,mBAmBE;EACE,SAAA;EACA,gBAAA;;AAGE,mBALJ,kCAIE,MACG;EACC,WAAA;EACA,gBAAA;;AAFF,mBALJ,kCAIE,MACG,yBAIC,MAAM,GAAE;EACN,iBAAA;;AALJ,mBALJ,kCAIE,MACG,yBAQC,MAAM,GAAE;EACN,eAAA;;AATJ,mBALJ,kCAIE,MACG,yBAYC;EACE,gBAAA;;AAbJ,mBALJ,kCAIE,MACG,yBAgBC,MAAM;EACJ,gBAAA;EACA,YAAA;EACA,gBAAA;EACA,WAAA;EACA,mBAAA;EACA,iBAAA;;AAtBJ,mBALJ,kCAIE,MACG,yBAyBC,MAAK,iBAAkB,GAAE,YAAa;EACpC,gBAAA;;AA1BJ,mBALJ,kCAIE,MACG,yBA6BC,MAAM,GAAE,WAAY;EAClB,gCAAA;;AA9BJ,mBALJ,kCAIE,MACG,yBAiCC,GAAE;EACA,gBAAA;EACA,WAAA;EACA,qBAAA;;AApCJ,mBALJ,kCAIE,MACG,yBAiCC,GAAE,MAKA;EACE,WAAA;EACA,YAAA;EACA,yBAAA;EACA,mBAAA;EACA,WAAA;EACA,kBAAA;EACA,eAAA;EACA,cAAA;EACA,kBAAA;;AA/CN,mBALJ,kCAIE,MACG,yBAmDC,MAAM,GAAE;AAnDV,mBALJ,kCAIE,MACG,yBAoDG,GAAE;EACF,iBAAA;;AArDJ,mBALJ,kCAIE,MACG,yBAuDC,MAAM;AAvDR,mBALJ,kCAIE,MACG,yBAwDC;EACE,sBAAA;EACA,gBAAA;EACA,kBAAA;EACA,mBAAA;EACA,gCAAA;;AArFV,mBA4FE;EACE,gCAAA;EACA,kBAAA;EACA,mBAAA;EACA,gBAAA;EACA,gBAAA","file":"wooccm-admin.css"}
|
|
assets/backend/css/wooccm-admin.min.css
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
.select2-container{z-index:9999999}.select2-container .select2-selection--single,.select2-container .select2-selection--single .select2-selection__arrow,.select2-container .select2-selection--single .select2-selection__rendered{height:30px!important;line-height:30px!important}.wooccm-premium{opacity:.5;pointer-events:none}.button.fileinput-button{position:relative;overflow:hidden!important}.button.fileinput-button input{position:absolute;top:0;right:0;margin:0;opacity:0;-ms-filter:'alpha(opacity=0)';font-size:200px;direction:ltr;cursor:pointer}table.wc_gateways>tbody>tr>td select{line-height:1!important}table.wc_gateways>tbody>tr>td.label{font-weight:600}table.wooccm-enhanced-options{border:none;box-shadow:none}table.wooccm-enhanced-options>thead>th .woocommerce-help-tip{margin:-1px 0 0 .25em}table.wooccm-enhanced-options>tbody>tr>td input.label{width:100%}table.wooccm-enhanced-options>tbody>tr>td select.add-price-type{margin:0 0 0 10px}table.wooccm-enhanced-options>tbody>tr>td input.check{margin:0 9px}table.wooccm-enhanced-options>tbody>tr>td.sort .wc-item-reorder-nav{width:auto}#wooccm_modal.processing{pointer-events:none}#wooccm_modal.processing:before{content:'';position:absolute;top:0;bottom:0;left:0;right:0;background-color:#fff;z-index:99999999;opacity:.8}#wooccm_modal select{min-height:30px}#wooccm_modal .form-field .wrap{padding:0}#wooccm_modal .attachment-info .details,#wooccm_modal .attachment-info .settings{width:100%}#wooccm_modal .attachment-info .woocommerce_options_panel label,#wooccm_modal .attachment-info .woocommerce_options_panel legend{width:75px;margin:0 0 0 -90px;font-weight:600}#wooccm_modal .attachment-info .woocommerce_options_panel fieldset.form-field,#wooccm_modal .attachment-info .woocommerce_options_panel p.form-field{padding:0 20px 0 92px!important}#wooccm_modal .attachment-info .woocommerce_options_panel .select2-container,#wooccm_modal .attachment-info .woocommerce_options_panel input[type=email],#wooccm_modal .attachment-info .woocommerce_options_panel input[type=number],#wooccm_modal .attachment-info .woocommerce_options_panel input[type=password],#wooccm_modal .attachment-info .woocommerce_options_panel input[type=text],#wooccm_modal .attachment-info .woocommerce_options_panel select{width:100%!important}#wooccm_modal #woocommerce-product-data .woocommerce_options_panel{width:100%}#wooccm_modal #woocommerce-product-data .woocommerce_options_panel .premium{display:block;clear:both}#wooccm_modal #woocommerce-product-data .woocommerce_options_panel .woocommerce-help-tip{margin:0 0 0 .5em}#wooccm_modal #woocommerce-product-data .woocommerce_options_panel .select2-container{width:50%!important;line-height:16px}#wooccm_modal #woocommerce-product-data .woocommerce_options_panel .select2-container .select2-selection{box-shadow:none;border-radius:3px;padding:0 24px 0 8px}#wooccm_modal #woocommerce-product-data .woocommerce_options_panel .select2-container .select2-selection--multiple{line-height:16px;min-height:30px}@media only screen and (max-width:1280px){#wooccm_modal #woocommerce-product-data .woocommerce_options_panel .select2-container{width:80%!important}}#wooccm_modal #woocommerce-product-data .woocommerce_options_panel .select2-container--default .select2-selection--multiple .select2-selection__rendered li{margin:3px 3px 0 0}#wooccm_modal #woocommerce-product-data .woocommerce_options_panel .select2-container--default.select2-container--focus .select2-selection--multiple{border-color:#5b9dd9!important;box-shadow:0 0 2px rgba(30,140,190,.8)!important;outline:2px solid transparent!important}#wooccm-order-files .inside{margin:0;padding:0;background:#fefefe;display:block!important}#wooccm-order-files .handlediv,#wooccm-order-files .hndle{display:none}#wooccm-order-files .wooccm_upload_results{display:inline-block;margin:0 10px}#wooccm-order-files .wooccm_order_attachments_wrapper{margin:0;overflow-x:auto}#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments{width:100%;background:#fff}#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments thead th:first-child{padding-left:2em}#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments thead th.sortable{cursor:pointer}#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments .item{min-width:200px}#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments thead th{text-align:left;padding:1em;font-weight:400;color:#999;background:#f8f8f8;user-select:none}#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments tbody#order_line_items tr:first-child td{border-top:none}#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments tbody tr:last-child td{border-bottom:1px solid #dfdfdf}#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments td.thumb{text-align:left;width:38px;padding-bottom:1.5em}#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments td.thumb .wc-order-item-thumbnail{width:38px;height:38px;border:2px solid #e8e8e8;background:#f8f8f8;color:#ccc;position:relative;font-size:21px;display:block;text-align:center}#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments tbody th:first-child,#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments td:first-child{padding-left:2em}#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments tbody th,#wooccm-order-files .wooccm_order_attachments_wrapper table.wooccm_order_attachments td{padding:1.5em 1em 1em;text-align:left;line-height:1.5em;vertical-align:top;border-bottom:1px solid #f8f8f8}#wooccm-order-files .wc-order-data-row{border-bottom:1px solid #dfdfdf;padding:1.5em 2em;background:#f8f8f8;line-height:2em;text-align:left}
|
|
assets/backend/js/admin-field.asset.php
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
<?php return array('dependencies' => array('backbone', 'jquery', 'jquery-ui-datepicker', 'wp-util'), 'version' => '3b35ab2a74c16fe901f6d1895971b4b0');
|
assets/backend/js/admin-field.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
!function(e){var t={};function o(n){if(t[n])return t[n].exports;var a=t[n]={i:n,l:!1,exports:{}};return e[n].call(a.exports,a,a.exports,o),a.l=!0,a.exports}o.m=e,o.c=t,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)o.d(n,a,function(t){return e[t]}.bind(null,a));return n},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s=0)}([function(e,t,o){"use strict";o.r(t);o(1),o(2),o(3),o(4);!function(e){var t,o=0,n=function(){e("#wooccm_modal").removeClass("processing")};_.mixin({sortOptions:function(e){return _.sortBy(e,(function(e){return e.order}))},escapeHtml:function(e){return e.replace("&",/&/g).replace(/>/g,">").replace(/</g,"<").replace(/"/g,'"').replace(/'/g,"'")},getFormData:function(e){var t=e.serializeJSON({checkboxUncheckedValue:"false",parseBooleans:!0,parseNulls:!0}),o=Object.assign({},wooccm_field.args);return Object.assign(o,t)}});var a=Backbone.Model.extend({defaults:Object.create(wooccm_field.args)}),i=Backbone.View.extend({initialize:function(t){var o=e(t.target).closest("[data-field_id]").data("field_id"),n=new a;n.set({id:o}),new l({model:n}).render()}}),l=Backbone.View.extend({events:{"change input":"enableSave","change textarea":"enableSave","change select":"enableSave","click .media-modal-backdrop":"close","click .media-modal-close":"close","click .media-modal-prev":"edit","click .media-modal-next":"edit","click .media-modal-tab":"tab","change .media-modal-parent":"parent","change .media-modal-render-tabs":"renderTabs","change .media-modal-render-panels":"renderPanels","change .media-modal-render-info":"renderInfo","submit .media-modal-form":"submit"},templates:{},initialize:function(){_.bindAll(this,"open","tab","edit","load","render","close","submit","parent"),this.init(),this.open()},init:function(){this.templates.window=wp.template("wooccm-modal-main")},assign:function(e,t){e.setElement(this.$(t)).render()},updateModel:function(e){e.preventDefault();var t=this.$el.find("#wooccm_modal").find("form"),o=_.getFormData(t);this.model.set(o)},reload:function(e){this.$el.find("#wooccm_modal").hasClass("reload")?location.reload():this.remove()},close:function(t){t.preventDefault(),this.undelegateEvents(),e(document).off("focusin"),e("body").removeClass("modal-open"),this.$el.find("#wooccm_modal").addClass("reload"),this.reload(t)},enableSave:function(t){e(".media-modal-submit").prop("disabled",!1),this.updateModel(t)},disableSave:function(t){e(".media-modal-submit").prop("disabled",!0)},tab:function(t){t.preventDefault();var o=this.$el.find("#wooccm_modal"),n=e(t.currentTarget),a=o.find("ul.wc-tabs"),i=n.find("a").attr("href").replace("#","");a.find(".active").removeClass("active"),n.addClass("active"),this.model.attributes.panel=i,this.model.changed.panel=i,this.renderPanels(t)},renderTabs:function(e){this.renderPanels(e),this.tabs.render()},renderPanels:function(e){this.updateModel(e),this.panels.render()},render:function(){this.$el.html(this.templates.window(this.model.attributes)),this.tabs=new c({model:this.model}),this.panels=new d({model:this.model}),this.info=new s({model:this.model}),this.assign(this.tabs,"#wooccm-modal-tabs"),this.assign(this.panels,"#wooccm-modal-panels"),this.assign(this.info,"#wooccm-modal-info")},open:function(t){e("body").addClass("modal-open").append(this.$el),null!=this.model.attributes.id?this.load():_.delay((function(){n()}),100)},load:function(){var t=this;null!=t.model.attributes.id?e.ajax({url:wooccm_field.ajax_url,data:{action:"wooccm_load_field",nonce:wooccm_field.nonce,field_id:this.model.attributes.id},dataType:"json",type:"POST",complete:function(){n()},error:function(){alert("Error!")},success:function(e){console.log("response",e),e.success?(t.model.set(e.data),t.render()):alert(e.data)}}):t.render()},edit:function(n){n.preventDefault();var a=this,i=e(n.target),l=parseInt(e(".wc_gateways tr[data-field_id]").length),c=parseInt(a.model.get("order"));o++,t&&clearTimeout(t),t=setTimeout((function(){c=i.hasClass("media-modal-next")?Math.min(c+o,l):Math.max(c-o,1),a.model.set({id:parseInt(e(".wc_gateways tr[data-field_order="+c+"]").data("field_id"))}),o=0,a.load()}),300)},submit:function(t){t.preventDefault();var o=this,n=o.$el.find("#wooccm_modal"),a=n.find(".settings-save-status .spinner"),i=n.find(".settings-save-status .saved");return e.ajax({url:wooccm_field.ajax_url,data:{action:"wooccm_save_field",nonce:wooccm_field.nonce,field_data:JSON.stringify(o.model.attributes)},dataType:"json",type:"POST",beforeSend:function(){e(".media-modal-submit").prop("disabled",!0),a.addClass("is-active")},complete:function(){i.addClass("is-active"),a.removeClass("is-active"),_.delay((function(){i.removeClass("is-active")}),1e3)},error:function(e){alert("Error!")},success:function(e){e.success?null==o.model.attributes.id&&(n.addClass("reload"),o.reload(t),o.close(t)):alert(e.data)}}),!1},renderInfo:function(){this.info.render()},parent:function(t){t.preventDefault();var o=this,n=o.$el.find("#wooccm_modal").find(".attachment-details");return this.updateModel(t),e.ajax({url:wooccm_field.ajax_url,data:{action:"wooccm_load_parent",nonce:wooccm_field.nonce,conditional_parent_key:o.model.attributes.conditional_parent_key},dataType:"json",type:"POST",beforeSend:function(){o.disableSave(),n.addClass("save-waiting")},complete:function(){n.addClass("save-complete"),n.removeClass("save-waiting"),o.enableSave()},error:function(){alert("Error!")},success:function(e){e.success?(o.model.attributes.parent=e.data,o.model.changed.parent=e.data,o.renderInfo()):alert(e.data)}}),!1}}),c=Backbone.View.extend({templates:{},initialize:function(){this.templates.window=wp.template("wooccm-modal-tabs")},render:function(){this.model.attributes.panel="general",this.$el.html(this.templates.window(this.model.attributes))}}),d=Backbone.View.extend({templates:{},initialize:function(){this.templates.window=wp.template("wooccm-modal-panels")},render:function(){this.$el.html(this.templates.window(this.model.attributes)),this.$el.trigger("wooccm-enhanced-options"),this.$el.trigger("wooccm-enhanced-select"),this.$el.trigger("init_tooltips")}}),s=Backbone.View.extend({templates:{},initialize:function(){this.templates.window=wp.template("wooccm-modal-info")},render:function(){this.$el.html(this.templates.window(this.model.attributes)),this.$el.trigger("wooccm-enhanced-select"),this.$el.trigger("init_tooltips")}});e("#wooccm_billing_settings_add, #wooccm_shipping_settings_add, #wooccm_additional_settings_add").on("click",(function(e){e.preventDefault(),new i(e)})),e("#wooccm_billing_settings_reset, #wooccm_shipping_settings_reset, #wooccm_additional_settings_reset").on("click",(function(t){t.preventDefault();e(t.target);return!!confirm(wooccm_field.message.reset)&&(e.ajax({url:wooccm_field.ajax_url,data:{action:"wooccm_reset_fields",nonce:wooccm_field.nonce},dataType:"json",type:"POST",beforeSend:function(){},complete:function(){},error:function(){alert("Error!")},success:function(e){e.success?location.reload():alert(e.data)}}),!1)})),e(".wooccm_billing_settings_edit, .wooccm_shipping_settings_edit, .wooccm_additional_settings_edit").on("click",(function(e){e.preventDefault(),new i(e)})),e(".wooccm_billing_settings_delete, .wooccm_shipping_settings_delete, .wooccm_additional_settings_delete").on("click",(function(t){t.preventDefault();var o=e(t.target).closest("[data-field_id]"),n=o.data("field_id");return!!confirm(wooccm_field.message.remove)&&(e.ajax({url:wooccm_field.ajax_url,data:{action:"wooccm_delete_field",nonce:wooccm_field.nonce,field_id:n},dataType:"json",type:"POST",beforeSend:function(){},complete:function(){},error:function(){alert("Error!")},success:function(e){e.success?o.remove():alert(e.data)}}),!1)})),e(document).on("click",".wooccm-field-toggle-attribute",(function(t){t.preventDefault();var o=e(this),n=o.closest("tr"),a=o.find(".woocommerce-input-toggle");return e.ajax({url:wooccm_field.ajax_url,data:{action:"wooccm_toggle_field_attribute",nonce:wooccm_field.nonce,field_attr:e(this).data("field_attr"),field_id:n.data("field_id")},dataType:"json",type:"POST",beforeSend:function(e){a.addClass("woocommerce-input-toggle--loading")},success:function(e){!0===e.data?(a.removeClass("woocommerce-input-toggle--enabled, woocommerce-input-toggle--disabled"),a.addClass("woocommerce-input-toggle--enabled"),a.removeClass("woocommerce-input-toggle--loading")):!0!==e.data&&(a.removeClass("woocommerce-input-toggle--enabled, woocommerce-input-toggle--disabled"),a.addClass("woocommerce-input-toggle--disabled"),a.removeClass("woocommerce-input-toggle--loading"))}}),!1})),e(document).on("change",".wooccm-field-change-attribute",(function(t){t.preventDefault();var o=e(this),n=o.closest("tr");return e.ajax({url:wooccm_field.ajax_url,data:{action:"wooccm_change_field_attribute",nonce:wooccm_field.nonce,field_attr:o.data("field_attr"),field_value:o.val(),field_id:n.data("field_id")},dataType:"json",type:"POST",beforeSend:function(e){o.prop("disabled",!0)},success:function(e){console.log(e.data)},complete:function(e){o.prop("disabled",!1)}}),!1}))}(jQuery)},function(e,t){!function(){e.exports=this.jQuery}()},function(e,t){!function(){e.exports=this.wp.util}()},function(e,t){!function(){e.exports=this.window.Backbone}()},function(e,t){!function(){e.exports=this.window.uiDatepicker}()}]);
|
assets/backend/js/admin.asset.php
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
<?php return array('dependencies' => array('jquery', 'jquery-serializejson'), 'version' => 'f389cc2bea7176abd765911bfcb7c116');
|
assets/backend/js/admin.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
!function(e){var t={};function n(a){if(t[a])return t[a].exports;var c=t[a]={i:a,l:!1,exports:{}};return e[a].call(c.exports,c,c.exports,n),c.l=!0,c.exports}n.m=e,n.c=t,n.d=function(e,t,a){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var a=Object.create(null);if(n.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var c in e)n.d(a,c,function(t){return e[t]}.bind(null,c));return a},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=1)}([function(e,t){!function(){e.exports=this.jQuery}()},function(e,t,n){"use strict";n.r(t);var a=n(0),c=n.n(a);n(3),n(2);function i(e){var t=c()(e).next().is(".hasDatepicker")?"minDate":"maxDate",n="minDate"===t?c()(e).next():c()(e).prev(),a=c()(e).datepicker("getDate");c()(n).datepicker("option",t,a),c()(e).change()}function o(){return{language:{errorLoading:function(){return wc_enhanced_select_params.i18n_searching},inputTooLong:function(e){var t=e.input.length-e.maximum;return 1===t?wc_enhanced_select_params.i18n_input_too_long_1:wc_enhanced_select_params.i18n_input_too_long_n.replace("%qty%",t)},inputTooShort:function(e){var t=e.minimum-e.input.length;return 1===t?wc_enhanced_select_params.i18n_input_too_short_1:wc_enhanced_select_params.i18n_input_too_short_n.replace("%qty%",t)},loadingMore:function(){return wc_enhanced_select_params.i18n_load_more},maximumSelected:function(e){return 1===e.maximum?wc_enhanced_select_params.i18n_selection_too_long_1:wc_enhanced_select_params.i18n_selection_too_long_n.replace("%qty%",e.maximum)},noResults:function(){return wc_enhanced_select_params.i18n_no_matches},searching:function(){return wc_enhanced_select_params.i18n_searching}}}}c()(".wooccm-premium-field").closest("tr").addClass("wooccm-premium"),c()(document).on("wooccm-enhanced-between-dates",(function(e){c()(".wooccm-enhanced-between-dates").filter(":not(.enhanced)").each((function(){c()(this).find("input").datepicker({defaultDate:"",dateFormat:"yy-mm-dd",numberOfMonths:1,showButtonPanel:!0,onSelect:function(){i(c()(this))}}),c()(this).find("input").each((function(){i(c()(this))}))}))})),c()(document).on("wooccm-enhanced-options",(function(e){c()("table.wc_gateways tbody").sortable({items:"tr",cursor:"move",axis:"y",handle:"td.sort",scrollSensitivity:40,helper:function(e,t){return t.children().each((function(){c()(this).width(c()(this).width())})),t.css("left","0"),t},start:function(e,t){t.item.css("background-color","#f6f6f6")},stop:function(e,t){t.item.removeAttr("style"),t.item.trigger("updateMoveButtons")},update:function(e,t){c()(this).find("tr").each((function(e,t){c()(t).find("input.add-order").val(e).trigger("change")}))}}),c()(".wooccm-enhanced-options").each((function(){var e=c()(this),t=e.find(".add-option"),n=e.find(".remove-options");t.on("click",(function(t){var a=e.find("tbody > tr"),i=a.length,o=a.first().clone().html().replace(/options\[([0-9]+)\]/g,"options["+i+"]").replace('disabled="disabled"',"").replace('checked="checked"',"").replace('<input value="0"','<input value="'+i+'"').replace('<input value="0"','<input value="'+i+'"');a.last().after(c()("<tr>"+o+"</tr>")).find("input").trigger("change"),n.removeProp("disabled")})),n.on("click",(function(t){e.find("tr > td.check-column input:checked").closest("tr").remove();var n=e.find("tbody > tr");n.first().find("input").trigger("change"),n.length<2&&c()(this).prop("disabled",!0)}))}))})),c()(document).on("wooccm-enhanced-select",(function(e){c()(".wooccm-enhanced-select").filter(":not(.enhanced)").each((function(){var e=c.a.extend({minimumResultsForSearch:10,allowClear:!!c()(this).data("allow_clear"),placeholder:c()(this).data("placeholder")},o());c()(this).attr("name");c()(this).selectWoo(e).addClass("enhanced")})),c()(".wooccm-product-search").filter(":not(.enhanced)").each((function(){var e={allowClear:!!c()(this).data("allow_clear"),placeholder:c()(this).data("placeholder"),minimumInputLength:c()(this).data("minimum_input_length")?c()(this).data("minimum_input_length"):"3",escapeMarkup:function(e){return e},ajax:{url:wc_enhanced_select_params.ajax_url,dataType:"json",delay:250,data:function(e){return{term:e.term,action:c()(this).data("action")||"wooccm_select_search_products",security:wc_enhanced_select_params.search_products_nonce,selected:c()(this).select2("val")||0,exclude:c()(this).data("exclude"),include:c()(this).data("include"),limit:c()(this).data("limit"),display_stock:c()(this).data("display_stock")}},processResults:function(e){var t=[];return e&&c.a.each(e,(function(e,n){t.push({id:e,text:n})})),{results:t}},cache:!0}};e=c.a.extend(e,o());c()(this).attr("name");if(c()(this).selectWoo(e).addClass("enhanced"),c()(this).data("sortable")){var t=c()(this),n=c()(this).next(".select2-container").find("ul.select2-selection__rendered");n.sortable({placeholder:"ui-state-highlight select2-selection__choice",forcePlaceholderSize:!0,items:"li:not(.select2-search__field)",tolerance:"pointer",stop:function(){c()(n.find(".select2-selection__choice").get().reverse()).each((function(){var e=c()(this).data("data").id,n=t.find('option[value="'+e+'"]')[0];t.prepend(n)}))}})}else c()(this).prop("multiple")&&c()(this).on("change",(function(){var e=c()(this).children();e.filter("option").sort((function(e,t){var n=e.text.toLowerCase(),a=t.text.toLowerCase();return n>a?1:n<a?-1:0})),c()(this).html(e)}))}))})),c()(".wooccm-enhanced-search").filter(":not(.enhanced)").each((function(){var e={allowClear:!!c()(this).data("allow_clear"),placeholder:c()(this).data("placeholder"),minimumInputLength:c()(this).data("minimum_input_length")||"3",escapeMarkup:function(e){return e},ajax:{url:wooccm_admin.ajax_url,dataType:"json",cache:!0,delay:250,data:function(e){return{term:e.term,key:c()(this).data("key"),action:"wooccm_search_field",nonce:wooccm_admin.nonce}},processResults:function(e,t){var n=[];return e&&c.a.each(e,(function(e,t){n.push({id:e,text:t})})),{results:n}}}};e=c.a.extend(e,o()),c()(this).select2(e).addClass("enhanced")}))},function(e,t){!function(){e.exports=this.window.serializeJSON}()},function(e,t){}]);
|
assets/backend/js/wooccm-admin-field.js
DELETED
@@ -1,489 +0,0 @@
|
|
1 |
-
(function ($) {
|
2 |
-
"use strict";
|
3 |
-
|
4 |
-
var count = 0,
|
5 |
-
timer;
|
6 |
-
|
7 |
-
var is_blocked = function ($node) {
|
8 |
-
return $node.is('.processing') || $node.parents('.processing').length;
|
9 |
-
};
|
10 |
-
var block = function () {
|
11 |
-
$('#wooccm_modal').addClass('processing');
|
12 |
-
};
|
13 |
-
var unblock = function () {
|
14 |
-
$('#wooccm_modal').removeClass('processing');
|
15 |
-
};
|
16 |
-
|
17 |
-
_.mixin({
|
18 |
-
sortOptions: function (object) {
|
19 |
-
return _.sortBy(object, function (o) {
|
20 |
-
return o.order;
|
21 |
-
});
|
22 |
-
},
|
23 |
-
escapeHtml: function (attribute) {
|
24 |
-
return attribute.replace('&', /&/g)
|
25 |
-
.replace(/>/g, ">")
|
26 |
-
.replace(/</g, "<")
|
27 |
-
.replace(/"/g, '"')
|
28 |
-
.replace(/'/g, "'");
|
29 |
-
},
|
30 |
-
getFormData: function ($form) {
|
31 |
-
let form = $form.serializeJSON({ checkboxUncheckedValue: 'false', parseBooleans: true, parseNulls: true });
|
32 |
-
let defaults = Object.assign({}, wooccm_field.args);
|
33 |
-
let merged = Object.assign(defaults, form)
|
34 |
-
return merged
|
35 |
-
}
|
36 |
-
});
|
37 |
-
|
38 |
-
var FieldModel = Backbone.Model.extend({
|
39 |
-
defaults: Object.create(wooccm_field.args)
|
40 |
-
});
|
41 |
-
|
42 |
-
var FieldModal = Backbone.View.extend({
|
43 |
-
initialize: function (e) {
|
44 |
-
var $button = $(e.target),
|
45 |
-
field_id = $button.closest('[data-field_id]').data('field_id');
|
46 |
-
var model = new FieldModel();
|
47 |
-
model.set({
|
48 |
-
id: field_id
|
49 |
-
});
|
50 |
-
new FieldView({
|
51 |
-
model: model
|
52 |
-
}).render();
|
53 |
-
},
|
54 |
-
});
|
55 |
-
|
56 |
-
var FieldView = Backbone.View.extend({
|
57 |
-
events: {
|
58 |
-
'change input': 'enableSave',
|
59 |
-
'change textarea': 'enableSave',
|
60 |
-
'change select': 'enableSave',
|
61 |
-
'click .media-modal-backdrop': 'close',
|
62 |
-
'click .media-modal-close': 'close',
|
63 |
-
'click .media-modal-prev': 'edit',
|
64 |
-
'click .media-modal-next': 'edit',
|
65 |
-
'click .media-modal-tab': 'tab',
|
66 |
-
'change .media-modal-parent': 'parent',
|
67 |
-
'change .media-modal-render-tabs': 'renderTabs',
|
68 |
-
'change .media-modal-render-panels': 'renderPanels',
|
69 |
-
'change .media-modal-render-info': 'renderInfo',
|
70 |
-
'submit .media-modal-form': 'submit',
|
71 |
-
},
|
72 |
-
templates: {},
|
73 |
-
initialize: function () {
|
74 |
-
_.bindAll(this, 'open', 'tab', 'edit', 'load', 'render', 'close', 'submit', 'parent');
|
75 |
-
this.init();
|
76 |
-
this.open();
|
77 |
-
},
|
78 |
-
init: function () {
|
79 |
-
this.templates.window = wp.template('wooccm-modal-main');
|
80 |
-
},
|
81 |
-
assign: function (view, selector) {
|
82 |
-
view.setElement(this.$(selector)).render();
|
83 |
-
},
|
84 |
-
updateModel: function (e) {
|
85 |
-
e.preventDefault();
|
86 |
-
var modal = this,
|
87 |
-
$form = modal.$el.find('#wooccm_modal').find('form');
|
88 |
-
var model = _.getFormData($form);
|
89 |
-
this.model.set(model);
|
90 |
-
},
|
91 |
-
reload: function (e) {
|
92 |
-
if (this.$el.find('#wooccm_modal').hasClass('reload')) {
|
93 |
-
location.reload();
|
94 |
-
return;
|
95 |
-
}
|
96 |
-
this.remove();
|
97 |
-
return;
|
98 |
-
},
|
99 |
-
close: function (e) {
|
100 |
-
e.preventDefault();
|
101 |
-
this.undelegateEvents();
|
102 |
-
$(document).off('focusin');
|
103 |
-
$('body').removeClass('modal-open');
|
104 |
-
// if necesary reload...
|
105 |
-
this.$el.find('#wooccm_modal').addClass('reload');
|
106 |
-
this.reload(e);
|
107 |
-
return;
|
108 |
-
},
|
109 |
-
enableSave: function (e) {
|
110 |
-
$('.media-modal-submit').prop('disabled', false);
|
111 |
-
this.updateModel(e);
|
112 |
-
},
|
113 |
-
disableSave: function (e) {
|
114 |
-
$('.media-modal-submit').prop('disabled', true);
|
115 |
-
},
|
116 |
-
tab: function (e) {
|
117 |
-
e.preventDefault();
|
118 |
-
var modal = this,
|
119 |
-
$modal = modal.$el.find('#wooccm_modal'),
|
120 |
-
$tab = $(e.currentTarget),
|
121 |
-
$tabs = $modal.find('ul.wc-tabs'),
|
122 |
-
panel = $tab.find('a').attr('href').replace('#', '');
|
123 |
-
$tabs.find('.active').removeClass('active');
|
124 |
-
$tab.addClass('active');
|
125 |
-
this.model.attributes['panel'] = panel;
|
126 |
-
this.model.changed['panel'] = panel;
|
127 |
-
this.renderPanels(e);
|
128 |
-
},
|
129 |
-
renderTabs: function (e) {
|
130 |
-
this.renderPanels(e);
|
131 |
-
this.tabs.render();
|
132 |
-
},
|
133 |
-
renderPanels: function (e) {
|
134 |
-
this.updateModel(e);
|
135 |
-
this.panels.render();
|
136 |
-
},
|
137 |
-
render: function () {
|
138 |
-
var modal = this;
|
139 |
-
modal.$el.html(modal.templates.window(modal.model.attributes));
|
140 |
-
this.tabs = new FieldViewTabs({ model: modal.model });
|
141 |
-
this.panels = new FieldViewPanels({ model: modal.model });
|
142 |
-
this.info = new FieldViewInfo({ model: modal.model });
|
143 |
-
this.assign(this.tabs, '#wooccm-modal-tabs');
|
144 |
-
this.assign(this.panels, '#wooccm-modal-panels');
|
145 |
-
this.assign(this.info, '#wooccm-modal-info');
|
146 |
-
},
|
147 |
-
open: function (e) {
|
148 |
-
$('body').addClass('modal-open').append(this.$el);
|
149 |
-
if (this.model.attributes.id == undefined) {
|
150 |
-
_.delay(function () {
|
151 |
-
unblock();
|
152 |
-
}, 100);
|
153 |
-
return;
|
154 |
-
}
|
155 |
-
this.load();
|
156 |
-
},
|
157 |
-
load: function () {
|
158 |
-
var modal = this;
|
159 |
-
if (modal.model.attributes.id == undefined) {
|
160 |
-
modal.render();
|
161 |
-
return;
|
162 |
-
}
|
163 |
-
$.ajax({
|
164 |
-
url: wooccm_field.ajax_url,
|
165 |
-
data: {
|
166 |
-
action: 'wooccm_load_field',
|
167 |
-
nonce: wooccm_field.nonce,
|
168 |
-
field_id: this.model.attributes.id
|
169 |
-
},
|
170 |
-
dataType: 'json',
|
171 |
-
type: 'POST',
|
172 |
-
// beforeSend: function () {
|
173 |
-
// },
|
174 |
-
complete: function () {
|
175 |
-
unblock();
|
176 |
-
},
|
177 |
-
error: function () {
|
178 |
-
alert('Error!');
|
179 |
-
},
|
180 |
-
success: function (response) {
|
181 |
-
console.log('response', response)
|
182 |
-
if (response.success) {
|
183 |
-
modal.model.set(response.data);
|
184 |
-
modal.render();
|
185 |
-
} else {
|
186 |
-
alert(response.data);
|
187 |
-
}
|
188 |
-
}
|
189 |
-
});
|
190 |
-
},
|
191 |
-
edit: function (e) {
|
192 |
-
e.preventDefault();
|
193 |
-
var modal = this,
|
194 |
-
$button = $(e.target),
|
195 |
-
field_count = parseInt($('.wc_gateways tr[data-field_id]').length),
|
196 |
-
order = parseInt(modal.model.get('order'));
|
197 |
-
count++;
|
198 |
-
if (timer) {
|
199 |
-
clearTimeout(timer);
|
200 |
-
}
|
201 |
-
|
202 |
-
timer = setTimeout(function () {
|
203 |
-
|
204 |
-
if ($button.hasClass('media-modal-next')) {
|
205 |
-
order = Math.min(order + count, field_count);
|
206 |
-
} else {
|
207 |
-
order = Math.max(order - count, 1);
|
208 |
-
}
|
209 |
-
|
210 |
-
modal.model.set({
|
211 |
-
id: parseInt($('.wc_gateways tr[data-field_order=' + order + ']').data('field_id'))
|
212 |
-
});
|
213 |
-
count = 0;
|
214 |
-
modal.load();
|
215 |
-
}, 300);
|
216 |
-
},
|
217 |
-
submit: function (e) {
|
218 |
-
e.preventDefault();
|
219 |
-
var modal = this,
|
220 |
-
$modal = modal.$el.find('#wooccm_modal'),
|
221 |
-
$spinner = $modal.find('.settings-save-status .spinner'),
|
222 |
-
$saved = $modal.find('.settings-save-status .saved');
|
223 |
-
|
224 |
-
console.log('modal.model.attributes', modal.model.attributes)
|
225 |
-
|
226 |
-
$.ajax({
|
227 |
-
url: wooccm_field.ajax_url,
|
228 |
-
data: {
|
229 |
-
action: 'wooccm_save_field',
|
230 |
-
nonce: wooccm_field.nonce,
|
231 |
-
field_data: JSON.stringify(modal.model.attributes)
|
232 |
-
},
|
233 |
-
dataType: 'json',
|
234 |
-
type: 'POST',
|
235 |
-
beforeSend: function () {
|
236 |
-
$('.media-modal-submit').prop('disabled', true);
|
237 |
-
$spinner.addClass('is-active');
|
238 |
-
},
|
239 |
-
complete: function () {
|
240 |
-
$saved.addClass('is-active');
|
241 |
-
$spinner.removeClass('is-active');
|
242 |
-
_.delay(function () {
|
243 |
-
$saved.removeClass('is-active');
|
244 |
-
}, 1000);
|
245 |
-
},
|
246 |
-
error: function (response) {
|
247 |
-
alert('Error!');
|
248 |
-
},
|
249 |
-
success: function (response) {
|
250 |
-
if (response.success) {
|
251 |
-
|
252 |
-
if (modal.model.attributes.id == undefined) {
|
253 |
-
$modal.addClass('reload');
|
254 |
-
modal.reload(e);
|
255 |
-
modal.close(e);
|
256 |
-
}
|
257 |
-
|
258 |
-
} else {
|
259 |
-
alert(response.data);
|
260 |
-
}
|
261 |
-
}
|
262 |
-
});
|
263 |
-
return false;
|
264 |
-
},
|
265 |
-
renderInfo: function () {
|
266 |
-
this.info.render();
|
267 |
-
},
|
268 |
-
parent: function (e) {
|
269 |
-
e.preventDefault();
|
270 |
-
var modal = this,
|
271 |
-
$modal = modal.$el.find('#wooccm_modal'),
|
272 |
-
$details = $modal.find('.attachment-details');
|
273 |
-
this.updateModel(e);
|
274 |
-
$.ajax({
|
275 |
-
url: wooccm_field.ajax_url,
|
276 |
-
data: {
|
277 |
-
action: 'wooccm_load_parent',
|
278 |
-
nonce: wooccm_field.nonce,
|
279 |
-
conditional_parent_key: modal.model.attributes.conditional_parent_key
|
280 |
-
},
|
281 |
-
dataType: 'json',
|
282 |
-
type: 'POST',
|
283 |
-
beforeSend: function () {
|
284 |
-
modal.disableSave();
|
285 |
-
$details.addClass('save-waiting');
|
286 |
-
},
|
287 |
-
complete: function () {
|
288 |
-
$details.addClass('save-complete');
|
289 |
-
$details.removeClass('save-waiting');
|
290 |
-
modal.enableSave();
|
291 |
-
},
|
292 |
-
error: function () {
|
293 |
-
alert('Error!');
|
294 |
-
},
|
295 |
-
success: function (response) {
|
296 |
-
if (response.success) {
|
297 |
-
modal.model.attributes['parent'] = response.data;
|
298 |
-
modal.model.changed['parent'] = response.data;
|
299 |
-
modal.renderInfo();
|
300 |
-
} else {
|
301 |
-
alert(response.data);
|
302 |
-
}
|
303 |
-
}
|
304 |
-
});
|
305 |
-
return false;
|
306 |
-
},
|
307 |
-
});
|
308 |
-
|
309 |
-
// Parts
|
310 |
-
// -------------------------------------------------------------
|
311 |
-
|
312 |
-
var FieldViewTabs = Backbone.View.extend({
|
313 |
-
templates: {},
|
314 |
-
initialize: function () {
|
315 |
-
this.templates.window = wp.template('wooccm-modal-tabs');
|
316 |
-
},
|
317 |
-
render: function () {
|
318 |
-
this.model.attributes.panel = 'general';
|
319 |
-
this.$el.html(this.templates.window(this.model.attributes));
|
320 |
-
//this.$el.trigger('wooccm-tab-panels');
|
321 |
-
}
|
322 |
-
});
|
323 |
-
var FieldViewPanels = Backbone.View.extend({
|
324 |
-
templates: {},
|
325 |
-
initialize: function () {
|
326 |
-
this.templates.window = wp.template('wooccm-modal-panels');
|
327 |
-
},
|
328 |
-
render: function () {
|
329 |
-
this.$el.html(this.templates.window(this.model.attributes));
|
330 |
-
this.$el.trigger('wooccm-enhanced-options');
|
331 |
-
this.$el.trigger('wooccm-enhanced-select');
|
332 |
-
this.$el.trigger('init_tooltips');
|
333 |
-
}
|
334 |
-
});
|
335 |
-
var FieldViewInfo = Backbone.View.extend({
|
336 |
-
templates: {},
|
337 |
-
initialize: function () {
|
338 |
-
this.templates.window = wp.template('wooccm-modal-info');
|
339 |
-
},
|
340 |
-
render: function () {
|
341 |
-
this.$el.html(this.templates.window(this.model.attributes));
|
342 |
-
this.$el.trigger('wooccm-enhanced-select');
|
343 |
-
this.$el.trigger('init_tooltips');
|
344 |
-
}
|
345 |
-
});
|
346 |
-
|
347 |
-
$('#wooccm_billing_settings_add, #wooccm_shipping_settings_add, #wooccm_additional_settings_add').on('click', function (e) {
|
348 |
-
e.preventDefault();
|
349 |
-
new FieldModal(e);
|
350 |
-
});
|
351 |
-
$('#wooccm_billing_settings_reset, #wooccm_shipping_settings_reset, #wooccm_additional_settings_reset').on('click', function (e) {
|
352 |
-
e.preventDefault();
|
353 |
-
var $button = $(e.target);
|
354 |
-
var c = confirm(wooccm_field.message.reset);
|
355 |
-
if (!c) {
|
356 |
-
return false;
|
357 |
-
}
|
358 |
-
|
359 |
-
$.ajax({
|
360 |
-
url: wooccm_field.ajax_url,
|
361 |
-
data: {
|
362 |
-
action: 'wooccm_reset_fields',
|
363 |
-
nonce: wooccm_field.nonce
|
364 |
-
},
|
365 |
-
dataType: 'json',
|
366 |
-
type: 'POST',
|
367 |
-
beforeSend: function () {
|
368 |
-
},
|
369 |
-
complete: function () {
|
370 |
-
},
|
371 |
-
error: function () {
|
372 |
-
alert('Error!');
|
373 |
-
},
|
374 |
-
success: function (response) {
|
375 |
-
if (response.success) {
|
376 |
-
|
377 |
-
location.reload();
|
378 |
-
} else {
|
379 |
-
alert(response.data);
|
380 |
-
}
|
381 |
-
}
|
382 |
-
});
|
383 |
-
return false;
|
384 |
-
});
|
385 |
-
$('.wooccm_billing_settings_edit, .wooccm_shipping_settings_edit, .wooccm_additional_settings_edit').on('click', function (e) {
|
386 |
-
e.preventDefault();
|
387 |
-
new FieldModal(e);
|
388 |
-
});
|
389 |
-
$('.wooccm_billing_settings_delete, .wooccm_shipping_settings_delete, .wooccm_additional_settings_delete').on('click', function (e) {
|
390 |
-
e.preventDefault();
|
391 |
-
var $button = $(e.target),
|
392 |
-
$field = $button.closest('[data-field_id]'),
|
393 |
-
field_id = $field.data('field_id');
|
394 |
-
var c = confirm(wooccm_field.message.remove);
|
395 |
-
if (!c) {
|
396 |
-
return false;
|
397 |
-
}
|
398 |
-
|
399 |
-
$.ajax({
|
400 |
-
url: wooccm_field.ajax_url,
|
401 |
-
data: {
|
402 |
-
action: 'wooccm_delete_field',
|
403 |
-
nonce: wooccm_field.nonce,
|
404 |
-
field_id: field_id,
|
405 |
-
},
|
406 |
-
dataType: 'json',
|
407 |
-
type: 'POST',
|
408 |
-
beforeSend: function () {
|
409 |
-
},
|
410 |
-
complete: function () {
|
411 |
-
},
|
412 |
-
error: function () {
|
413 |
-
alert('Error!');
|
414 |
-
},
|
415 |
-
success: function (response) {
|
416 |
-
if (response.success) {
|
417 |
-
|
418 |
-
$field.remove();
|
419 |
-
} else {
|
420 |
-
alert(response.data);
|
421 |
-
}
|
422 |
-
}
|
423 |
-
});
|
424 |
-
return false;
|
425 |
-
});
|
426 |
-
$(document).on('click', '.wooccm-field-toggle-attribute', function (e) {
|
427 |
-
e.preventDefault();
|
428 |
-
var $link = $(this),
|
429 |
-
$tr = $link.closest('tr'),
|
430 |
-
$toggle = $link.find('.woocommerce-input-toggle');
|
431 |
-
$.ajax({
|
432 |
-
url: wooccm_field.ajax_url,
|
433 |
-
data: {
|
434 |
-
action: 'wooccm_toggle_field_attribute',
|
435 |
-
nonce: wooccm_field.nonce,
|
436 |
-
field_attr: $(this).data('field_attr'),
|
437 |
-
field_id: $tr.data('field_id')
|
438 |
-
},
|
439 |
-
dataType: 'json',
|
440 |
-
type: 'POST',
|
441 |
-
beforeSend: function (response) {
|
442 |
-
$toggle.addClass('woocommerce-input-toggle--loading');
|
443 |
-
},
|
444 |
-
success: function (response) {
|
445 |
-
|
446 |
-
if (true === response.data) {
|
447 |
-
$toggle.removeClass('woocommerce-input-toggle--enabled, woocommerce-input-toggle--disabled');
|
448 |
-
$toggle.addClass('woocommerce-input-toggle--enabled');
|
449 |
-
$toggle.removeClass('woocommerce-input-toggle--loading');
|
450 |
-
} else if (true !== response.data) {
|
451 |
-
$toggle.removeClass('woocommerce-input-toggle--enabled, woocommerce-input-toggle--disabled');
|
452 |
-
$toggle.addClass('woocommerce-input-toggle--disabled');
|
453 |
-
$toggle.removeClass('woocommerce-input-toggle--loading');
|
454 |
-
} //else if ('needs_setup' === response.data) {
|
455 |
-
//window.location.href = $link.attr('href');
|
456 |
-
//}
|
457 |
-
}
|
458 |
-
|
459 |
-
});
|
460 |
-
return false;
|
461 |
-
});
|
462 |
-
$(document).on('change', '.wooccm-field-change-attribute', function (e) {
|
463 |
-
e.preventDefault();
|
464 |
-
var $change = $(this),
|
465 |
-
$tr = $change.closest('tr');
|
466 |
-
$.ajax({
|
467 |
-
url: wooccm_field.ajax_url,
|
468 |
-
data: {
|
469 |
-
action: 'wooccm_change_field_attribute',
|
470 |
-
nonce: wooccm_field.nonce,
|
471 |
-
field_attr: $change.data('field_attr'),
|
472 |
-
field_value: $change.val(),
|
473 |
-
field_id: $tr.data('field_id'),
|
474 |
-
},
|
475 |
-
dataType: 'json',
|
476 |
-
type: 'POST',
|
477 |
-
beforeSend: function (response) {
|
478 |
-
$change.prop('disabled', true);
|
479 |
-
},
|
480 |
-
success: function (response) {
|
481 |
-
console.log(response.data);
|
482 |
-
},
|
483 |
-
complete: function (response) {
|
484 |
-
$change.prop('disabled', false);
|
485 |
-
},
|
486 |
-
});
|
487 |
-
return false;
|
488 |
-
});
|
489 |
-
})(jQuery);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/backend/js/wooccm-admin-field.min.js
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
!function($){"use strict";var count=0,timer,is_blocked=function($node){return $node.is(".processing")||$node.parents(".processing").length},block=function(){$("#wooccm_modal").addClass("processing")},unblock=function(){$("#wooccm_modal").removeClass("processing")};_.mixin({sortOptions:function(object){return _.sortBy(object,(function(o){return o.order}))},escapeHtml:function(attribute){return attribute.replace("&",/&/g).replace(/>/g,">").replace(/</g,"<").replace(/"/g,'"').replace(/'/g,"'")},getFormData:function($form){let form=$form.serializeJSON({checkboxUncheckedValue:"false",parseBooleans:!0,parseNulls:!0}),defaults=Object.assign({},wooccm_field.args),merged;return Object.assign(defaults,form)}});var FieldModel=Backbone.Model.extend({defaults:Object.create(wooccm_field.args)}),FieldModal=Backbone.View.extend({initialize:function(e){var $button,field_id=$(e.target).closest("[data-field_id]").data("field_id"),model=new FieldModel;model.set({id:field_id}),new FieldView({model:model}).render()}}),FieldView=Backbone.View.extend({events:{"change input":"enableSave","change textarea":"enableSave","change select":"enableSave","click .media-modal-backdrop":"close","click .media-modal-close":"close","click .media-modal-prev":"edit","click .media-modal-next":"edit","click .media-modal-tab":"tab","change .media-modal-parent":"parent","change .media-modal-render-tabs":"renderTabs","change .media-modal-render-panels":"renderPanels","change .media-modal-render-info":"renderInfo","submit .media-modal-form":"submit"},templates:{},initialize:function(){_.bindAll(this,"open","tab","edit","load","render","close","submit","parent"),this.init(),this.open()},init:function(){this.templates.window=wp.template("wooccm-modal-main")},assign:function(view,selector){view.setElement(this.$(selector)).render()},updateModel:function(e){e.preventDefault();var modal=this,$form=this.$el.find("#wooccm_modal").find("form"),model=_.getFormData($form);this.model.set(model)},reload:function(e){this.$el.find("#wooccm_modal").hasClass("reload")?location.reload():this.remove()},close:function(e){e.preventDefault(),this.undelegateEvents(),$(document).off("focusin"),$("body").removeClass("modal-open"),this.$el.find("#wooccm_modal").addClass("reload"),this.reload(e)},enableSave:function(e){$(".media-modal-submit").prop("disabled",!1),this.updateModel(e)},disableSave:function(e){$(".media-modal-submit").prop("disabled",!0)},tab:function(e){e.preventDefault();var modal=this,$modal=this.$el.find("#wooccm_modal"),$tab=$(e.currentTarget),$tabs=$modal.find("ul.wc-tabs"),panel=$tab.find("a").attr("href").replace("#","");$tabs.find(".active").removeClass("active"),$tab.addClass("active"),this.model.attributes.panel=panel,this.model.changed.panel=panel,this.renderPanels(e)},renderTabs:function(e){this.renderPanels(e),this.tabs.render()},renderPanels:function(e){this.updateModel(e),this.panels.render()},render:function(){var modal=this;this.$el.html(this.templates.window(this.model.attributes)),this.tabs=new FieldViewTabs({model:this.model}),this.panels=new FieldViewPanels({model:this.model}),this.info=new FieldViewInfo({model:this.model}),this.assign(this.tabs,"#wooccm-modal-tabs"),this.assign(this.panels,"#wooccm-modal-panels"),this.assign(this.info,"#wooccm-modal-info")},open:function(e){$("body").addClass("modal-open").append(this.$el),null!=this.model.attributes.id?this.load():_.delay((function(){unblock()}),100)},load:function(){var modal=this;null!=modal.model.attributes.id?$.ajax({url:wooccm_field.ajax_url,data:{action:"wooccm_load_field",nonce:wooccm_field.nonce,field_id:this.model.attributes.id},dataType:"json",type:"POST",complete:function(){unblock()},error:function(){alert("Error!")},success:function(response){console.log("response",response),response.success?(modal.model.set(response.data),modal.render()):alert(response.data)}}):modal.render()},edit:function(e){e.preventDefault();var modal=this,$button=$(e.target),field_count=parseInt($(".wc_gateways tr[data-field_id]").length),order=parseInt(modal.model.get("order"));count++,timer&&clearTimeout(timer),timer=setTimeout((function(){order=$button.hasClass("media-modal-next")?Math.min(order+count,field_count):Math.max(order-count,1),modal.model.set({id:parseInt($(".wc_gateways tr[data-field_order="+order+"]").data("field_id"))}),count=0,modal.load()}),300)},submit:function(e){e.preventDefault();var modal=this,$modal=modal.$el.find("#wooccm_modal"),$spinner=$modal.find(".settings-save-status .spinner"),$saved=$modal.find(".settings-save-status .saved");return console.log("modal.model.attributes",modal.model.attributes),$.ajax({url:wooccm_field.ajax_url,data:{action:"wooccm_save_field",nonce:wooccm_field.nonce,field_data:JSON.stringify(modal.model.attributes)},dataType:"json",type:"POST",beforeSend:function(){$(".media-modal-submit").prop("disabled",!0),$spinner.addClass("is-active")},complete:function(){$saved.addClass("is-active"),$spinner.removeClass("is-active"),_.delay((function(){$saved.removeClass("is-active")}),1e3)},error:function(response){alert("Error!")},success:function(response){response.success?null==modal.model.attributes.id&&($modal.addClass("reload"),modal.reload(e),modal.close(e)):alert(response.data)}}),!1},renderInfo:function(){this.info.render()},parent:function(e){e.preventDefault();var modal=this,$modal,$details=modal.$el.find("#wooccm_modal").find(".attachment-details");return this.updateModel(e),$.ajax({url:wooccm_field.ajax_url,data:{action:"wooccm_load_parent",nonce:wooccm_field.nonce,conditional_parent_key:modal.model.attributes.conditional_parent_key},dataType:"json",type:"POST",beforeSend:function(){modal.disableSave(),$details.addClass("save-waiting")},complete:function(){$details.addClass("save-complete"),$details.removeClass("save-waiting"),modal.enableSave()},error:function(){alert("Error!")},success:function(response){response.success?(modal.model.attributes.parent=response.data,modal.model.changed.parent=response.data,modal.renderInfo()):alert(response.data)}}),!1}}),FieldViewTabs=Backbone.View.extend({templates:{},initialize:function(){this.templates.window=wp.template("wooccm-modal-tabs")},render:function(){this.model.attributes.panel="general",this.$el.html(this.templates.window(this.model.attributes))}}),FieldViewPanels=Backbone.View.extend({templates:{},initialize:function(){this.templates.window=wp.template("wooccm-modal-panels")},render:function(){this.$el.html(this.templates.window(this.model.attributes)),this.$el.trigger("wooccm-enhanced-options"),this.$el.trigger("wooccm-enhanced-select"),this.$el.trigger("init_tooltips")}}),FieldViewInfo=Backbone.View.extend({templates:{},initialize:function(){this.templates.window=wp.template("wooccm-modal-info")},render:function(){this.$el.html(this.templates.window(this.model.attributes)),this.$el.trigger("wooccm-enhanced-select"),this.$el.trigger("init_tooltips")}});$("#wooccm_billing_settings_add, #wooccm_shipping_settings_add, #wooccm_additional_settings_add").on("click",(function(e){e.preventDefault(),new FieldModal(e)})),$("#wooccm_billing_settings_reset, #wooccm_shipping_settings_reset, #wooccm_additional_settings_reset").on("click",(function(e){e.preventDefault();var $button=$(e.target),c;return!!confirm(wooccm_field.message.reset)&&($.ajax({url:wooccm_field.ajax_url,data:{action:"wooccm_reset_fields",nonce:wooccm_field.nonce},dataType:"json",type:"POST",beforeSend:function(){},complete:function(){},error:function(){alert("Error!")},success:function(response){response.success?location.reload():alert(response.data)}}),!1)})),$(".wooccm_billing_settings_edit, .wooccm_shipping_settings_edit, .wooccm_additional_settings_edit").on("click",(function(e){e.preventDefault(),new FieldModal(e)})),$(".wooccm_billing_settings_delete, .wooccm_shipping_settings_delete, .wooccm_additional_settings_delete").on("click",(function(e){e.preventDefault();var $button,$field=$(e.target).closest("[data-field_id]"),field_id=$field.data("field_id"),c;return!!confirm(wooccm_field.message.remove)&&($.ajax({url:wooccm_field.ajax_url,data:{action:"wooccm_delete_field",nonce:wooccm_field.nonce,field_id:field_id},dataType:"json",type:"POST",beforeSend:function(){},complete:function(){},error:function(){alert("Error!")},success:function(response){response.success?$field.remove():alert(response.data)}}),!1)})),$(document).on("click",".wooccm-field-toggle-attribute",(function(e){e.preventDefault();var $link=$(this),$tr=$link.closest("tr"),$toggle=$link.find(".woocommerce-input-toggle");return $.ajax({url:wooccm_field.ajax_url,data:{action:"wooccm_toggle_field_attribute",nonce:wooccm_field.nonce,field_attr:$(this).data("field_attr"),field_id:$tr.data("field_id")},dataType:"json",type:"POST",beforeSend:function(response){$toggle.addClass("woocommerce-input-toggle--loading")},success:function(response){!0===response.data?($toggle.removeClass("woocommerce-input-toggle--enabled, woocommerce-input-toggle--disabled"),$toggle.addClass("woocommerce-input-toggle--enabled"),$toggle.removeClass("woocommerce-input-toggle--loading")):!0!==response.data&&($toggle.removeClass("woocommerce-input-toggle--enabled, woocommerce-input-toggle--disabled"),$toggle.addClass("woocommerce-input-toggle--disabled"),$toggle.removeClass("woocommerce-input-toggle--loading"))}}),!1})),$(document).on("change",".wooccm-field-change-attribute",(function(e){e.preventDefault();var $change=$(this),$tr=$change.closest("tr");return $.ajax({url:wooccm_field.ajax_url,data:{action:"wooccm_change_field_attribute",nonce:wooccm_field.nonce,field_attr:$change.data("field_attr"),field_value:$change.val(),field_id:$tr.data("field_id")},dataType:"json",type:"POST",beforeSend:function(response){$change.prop("disabled",!0)},success:function(response){console.log(response.data)},complete:function(response){$change.prop("disabled",!1)}}),!1}))}(jQuery);
|
|
assets/backend/js/wooccm-admin.js
DELETED
@@ -1,297 +0,0 @@
|
|
1 |
-
(function ($) {
|
2 |
-
"use strict";
|
3 |
-
|
4 |
-
$('.wooccm-premium-field').closest('tr').addClass('wooccm-premium');
|
5 |
-
|
6 |
-
function date_picker_select(datepicker) {
|
7 |
-
var option = $(datepicker).next().is('.hasDatepicker') ? 'minDate' : 'maxDate',
|
8 |
-
otherDateField = 'minDate' === option ? $(datepicker).next() : $(datepicker).prev(),
|
9 |
-
date = $(datepicker).datepicker('getDate');
|
10 |
-
|
11 |
-
$(otherDateField).datepicker('option', option, date);
|
12 |
-
$(datepicker).change();
|
13 |
-
}
|
14 |
-
|
15 |
-
function getEnhancedSelectFormatString() {
|
16 |
-
return {
|
17 |
-
'language': {
|
18 |
-
errorLoading: function () {
|
19 |
-
// Workaround for https://github.com/select2/select2/issues/4355 instead of i18n_ajax_error.
|
20 |
-
return wc_enhanced_select_params.i18n_searching;
|
21 |
-
},
|
22 |
-
inputTooLong: function (args) {
|
23 |
-
var overChars = args.input.length - args.maximum;
|
24 |
-
|
25 |
-
if (1 === overChars) {
|
26 |
-
return wc_enhanced_select_params.i18n_input_too_long_1;
|
27 |
-
}
|
28 |
-
|
29 |
-
return wc_enhanced_select_params.i18n_input_too_long_n.replace('%qty%', overChars);
|
30 |
-
},
|
31 |
-
inputTooShort: function (args) {
|
32 |
-
var remainingChars = args.minimum - args.input.length;
|
33 |
-
|
34 |
-
if (1 === remainingChars) {
|
35 |
-
return wc_enhanced_select_params.i18n_input_too_short_1;
|
36 |
-
}
|
37 |
-
|
38 |
-
return wc_enhanced_select_params.i18n_input_too_short_n.replace('%qty%', remainingChars);
|
39 |
-
},
|
40 |
-
loadingMore: function () {
|
41 |
-
return wc_enhanced_select_params.i18n_load_more;
|
42 |
-
},
|
43 |
-
maximumSelected: function (args) {
|
44 |
-
if (args.maximum === 1) {
|
45 |
-
return wc_enhanced_select_params.i18n_selection_too_long_1;
|
46 |
-
}
|
47 |
-
|
48 |
-
return wc_enhanced_select_params.i18n_selection_too_long_n.replace('%qty%', args.maximum);
|
49 |
-
},
|
50 |
-
noResults: function () {
|
51 |
-
return wc_enhanced_select_params.i18n_no_matches;
|
52 |
-
},
|
53 |
-
searching: function () {
|
54 |
-
return wc_enhanced_select_params.i18n_searching;
|
55 |
-
}
|
56 |
-
}
|
57 |
-
};
|
58 |
-
}
|
59 |
-
|
60 |
-
$(document).on('wooccm-enhanced-between-dates', function (e) {
|
61 |
-
|
62 |
-
$('.wooccm-enhanced-between-dates').filter(':not(.enhanced)').each(function () {
|
63 |
-
|
64 |
-
$(this).find('input').datepicker({
|
65 |
-
defaultDate: '',
|
66 |
-
dateFormat: 'yy-mm-dd',
|
67 |
-
numberOfMonths: 1,
|
68 |
-
showButtonPanel: true,
|
69 |
-
onSelect: function () {
|
70 |
-
date_picker_select($(this));
|
71 |
-
}
|
72 |
-
});
|
73 |
-
|
74 |
-
$(this).find('input').each(function () {
|
75 |
-
date_picker_select($(this));
|
76 |
-
});
|
77 |
-
|
78 |
-
});
|
79 |
-
|
80 |
-
});
|
81 |
-
|
82 |
-
$(document).on('wooccm-enhanced-options', function (e) {
|
83 |
-
|
84 |
-
$('table.wc_gateways tbody').sortable({
|
85 |
-
items: 'tr',
|
86 |
-
cursor: 'move',
|
87 |
-
axis: 'y',
|
88 |
-
handle: 'td.sort',
|
89 |
-
scrollSensitivity: 40,
|
90 |
-
helper: function (event, ui) {
|
91 |
-
ui.children().each(function () {
|
92 |
-
$(this).width($(this).width());
|
93 |
-
});
|
94 |
-
ui.css('left', '0');
|
95 |
-
return ui;
|
96 |
-
},
|
97 |
-
start: function (event, ui) {
|
98 |
-
ui.item.css('background-color', '#f6f6f6');
|
99 |
-
},
|
100 |
-
stop: function (event, ui) {
|
101 |
-
ui.item.removeAttr('style');
|
102 |
-
ui.item.trigger('updateMoveButtons');
|
103 |
-
},
|
104 |
-
update: function (event, ui) {
|
105 |
-
$(this).find('tr').each(function (i, tr) {
|
106 |
-
$(tr).find('input.add-order').val(i).trigger('change');
|
107 |
-
});
|
108 |
-
}
|
109 |
-
});
|
110 |
-
|
111 |
-
$('.wooccm-enhanced-options').each(function () {
|
112 |
-
|
113 |
-
var $table = $(this),
|
114 |
-
$add = $table.find('.add-option'),
|
115 |
-
$remove = $table.find('.remove-options');
|
116 |
-
|
117 |
-
$add.on('click', function (e) {
|
118 |
-
|
119 |
-
var $tr = $table.find('tbody > tr'),
|
120 |
-
id = $tr.length,
|
121 |
-
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 + '"');
|
122 |
-
|
123 |
-
$tr.last().after($('<tr>' + tr + '</tr>')).find('input').trigger('change');
|
124 |
-
|
125 |
-
$remove.removeProp('disabled');
|
126 |
-
|
127 |
-
});
|
128 |
-
|
129 |
-
$remove.on('click', function (e) {
|
130 |
-
|
131 |
-
$table.find('tr > td.check-column input:checked').closest('tr').remove();
|
132 |
-
|
133 |
-
var $tr = $table.find('tbody > tr');
|
134 |
-
|
135 |
-
if ($tr.length < 2) {
|
136 |
-
$(this).prop('disabled', true);
|
137 |
-
}
|
138 |
-
});
|
139 |
-
|
140 |
-
});
|
141 |
-
|
142 |
-
});
|
143 |
-
|
144 |
-
$(document).on('wooccm-enhanced-select', function (e) {
|
145 |
-
|
146 |
-
$('.wooccm-enhanced-select').filter(':not(.enhanced)').each(function () {
|
147 |
-
var select2_args = $.extend({
|
148 |
-
minimumResultsForSearch: 10,
|
149 |
-
allowClear: $(this).data('allow_clear') ? true : false,
|
150 |
-
placeholder: $(this).data('placeholder')
|
151 |
-
}, getEnhancedSelectFormatString());
|
152 |
-
|
153 |
-
var name = $(this).attr('name');
|
154 |
-
|
155 |
-
// fix serializeJSON empty select and multiselect
|
156 |
-
//if (name.indexOf('[]') >= 0) {
|
157 |
-
// $(this).prepend('<input type="hidden" name="' + name + '" value="[]" />');
|
158 |
-
//}
|
159 |
-
|
160 |
-
$(this).selectWoo(select2_args).addClass('enhanced');
|
161 |
-
});
|
162 |
-
|
163 |
-
$('.wooccm-product-search').filter(':not(.enhanced)').each(function () {
|
164 |
-
|
165 |
-
var select2_args = {
|
166 |
-
allowClear: $(this).data('allow_clear') ? true : false,
|
167 |
-
placeholder: $(this).data('placeholder'),
|
168 |
-
minimumInputLength: $(this).data('minimum_input_length') ? $(this).data('minimum_input_length') : '3',
|
169 |
-
escapeMarkup: function (m) {
|
170 |
-
return m;
|
171 |
-
},
|
172 |
-
ajax: {
|
173 |
-
url: wc_enhanced_select_params.ajax_url,
|
174 |
-
dataType: 'json',
|
175 |
-
delay: 250,
|
176 |
-
data: function (params) {
|
177 |
-
return {
|
178 |
-
term: params.term,
|
179 |
-
action: $(this).data('action') || 'wooccm_select_search_products',
|
180 |
-
//nonce: wooccm_admin.nonce,
|
181 |
-
security: wc_enhanced_select_params.search_products_nonce,
|
182 |
-
selected: $(this).select2('val') || 0,
|
183 |
-
exclude: $(this).data('exclude'),
|
184 |
-
include: $(this).data('include'),
|
185 |
-
limit: $(this).data('limit'),
|
186 |
-
display_stock: $(this).data('display_stock')
|
187 |
-
};
|
188 |
-
},
|
189 |
-
processResults: function (data) {
|
190 |
-
var terms = [];
|
191 |
-
if (data) {
|
192 |
-
$.each(data, function (id, text) {
|
193 |
-
terms.push({ id: id, text: text });
|
194 |
-
});
|
195 |
-
}
|
196 |
-
return {
|
197 |
-
results: terms
|
198 |
-
};
|
199 |
-
},
|
200 |
-
cache: true
|
201 |
-
}
|
202 |
-
};
|
203 |
-
|
204 |
-
select2_args = $.extend(select2_args, getEnhancedSelectFormatString());
|
205 |
-
|
206 |
-
var name = $(this).attr('name');
|
207 |
-
|
208 |
-
// fix serializeJSON empty select and multiselect
|
209 |
-
//if (name.indexOf('[]') >= 0) {
|
210 |
-
// $(this).prepend('<input type="hidden" name="' + name + '" value="[]" />');
|
211 |
-
//}
|
212 |
-
|
213 |
-
$(this).selectWoo(select2_args).addClass('enhanced');
|
214 |
-
|
215 |
-
if ($(this).data('sortable')) {
|
216 |
-
var $select = $(this);
|
217 |
-
var $list = $(this).next('.select2-container').find('ul.select2-selection__rendered');
|
218 |
-
|
219 |
-
$list.sortable({
|
220 |
-
placeholder: 'ui-state-highlight select2-selection__choice',
|
221 |
-
forcePlaceholderSize: true,
|
222 |
-
items: 'li:not(.select2-search__field)',
|
223 |
-
tolerance: 'pointer',
|
224 |
-
stop: function () {
|
225 |
-
$($list.find('.select2-selection__choice').get().reverse()).each(function () {
|
226 |
-
var id = $(this).data('data').id;
|
227 |
-
var option = $select.find('option[value="' + id + '"]')[0];
|
228 |
-
$select.prepend(option);
|
229 |
-
});
|
230 |
-
}
|
231 |
-
});
|
232 |
-
// Keep multiselects ordered alphabetically if they are not sortable.
|
233 |
-
} else if ($(this).prop('multiple')) {
|
234 |
-
|
235 |
-
$(this).on('change', function () {
|
236 |
-
var $children = $(this).children();
|
237 |
-
//filter option fix appended input hidden
|
238 |
-
$children.filter('option').sort(function (a, b) {
|
239 |
-
var atext = a.text.toLowerCase();
|
240 |
-
var btext = b.text.toLowerCase();
|
241 |
-
|
242 |
-
if (atext > btext) {
|
243 |
-
return 1;
|
244 |
-
}
|
245 |
-
if (atext < btext) {
|
246 |
-
return -1;
|
247 |
-
}
|
248 |
-
return 0;
|
249 |
-
});
|
250 |
-
|
251 |
-
$(this).html($children);
|
252 |
-
});
|
253 |
-
}
|
254 |
-
});
|
255 |
-
|
256 |
-
});
|
257 |
-
|
258 |
-
$('.wooccm-enhanced-search').filter(':not(.enhanced)').each(function () {
|
259 |
-
|
260 |
-
var select2_args = {
|
261 |
-
allowClear: $(this).data('allow_clear') ? true : false,
|
262 |
-
placeholder: $(this).data('placeholder'),
|
263 |
-
minimumInputLength: $(this).data('minimum_input_length') || '3',
|
264 |
-
escapeMarkup: function (m) {
|
265 |
-
return m;
|
266 |
-
},
|
267 |
-
ajax: {
|
268 |
-
url: wooccm_admin.ajax_url,
|
269 |
-
dataType: 'json',
|
270 |
-
cache: true,
|
271 |
-
delay: 250,
|
272 |
-
data: function (params) {
|
273 |
-
return {
|
274 |
-
term: params.term,
|
275 |
-
key: $(this).data('key'),
|
276 |
-
action: 'wooccm_search_field',
|
277 |
-
nonce: wooccm_admin.nonce,
|
278 |
-
};
|
279 |
-
},
|
280 |
-
processResults: function (data, params) {
|
281 |
-
var terms = [];
|
282 |
-
if (data) {
|
283 |
-
$.each(data, function (id, text) {
|
284 |
-
terms.push({ id: id, text: text });
|
285 |
-
});
|
286 |
-
}
|
287 |
-
return { results: terms };
|
288 |
-
}
|
289 |
-
}
|
290 |
-
};
|
291 |
-
|
292 |
-
select2_args = $.extend(select2_args, getEnhancedSelectFormatString());
|
293 |
-
|
294 |
-
$(this).select2(select2_args).addClass('enhanced');
|
295 |
-
});
|
296 |
-
|
297 |
-
})(jQuery);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/backend/js/wooccm-admin.min.js
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
!function($){"use strict";function date_picker_select(datepicker){var option=$(datepicker).next().is(".hasDatepicker")?"minDate":"maxDate",otherDateField="minDate"===option?$(datepicker).next():$(datepicker).prev(),date=$(datepicker).datepicker("getDate");$(otherDateField).datepicker("option",option,date),$(datepicker).change()}function getEnhancedSelectFormatString(){return{language:{errorLoading:function(){return wc_enhanced_select_params.i18n_searching},inputTooLong:function(args){var overChars=args.input.length-args.maximum;return 1===overChars?wc_enhanced_select_params.i18n_input_too_long_1:wc_enhanced_select_params.i18n_input_too_long_n.replace("%qty%",overChars)},inputTooShort:function(args){var remainingChars=args.minimum-args.input.length;return 1===remainingChars?wc_enhanced_select_params.i18n_input_too_short_1:wc_enhanced_select_params.i18n_input_too_short_n.replace("%qty%",remainingChars)},loadingMore:function(){return wc_enhanced_select_params.i18n_load_more},maximumSelected:function(args){return 1===args.maximum?wc_enhanced_select_params.i18n_selection_too_long_1:wc_enhanced_select_params.i18n_selection_too_long_n.replace("%qty%",args.maximum)},noResults:function(){return wc_enhanced_select_params.i18n_no_matches},searching:function(){return wc_enhanced_select_params.i18n_searching}}}}$(".wooccm-premium-field").closest("tr").addClass("wooccm-premium"),$(document).on("wooccm-enhanced-between-dates",(function(e){$(".wooccm-enhanced-between-dates").filter(":not(.enhanced)").each((function(){$(this).find("input").datepicker({defaultDate:"",dateFormat:"yy-mm-dd",numberOfMonths:1,showButtonPanel:!0,onSelect:function(){date_picker_select($(this))}}),$(this).find("input").each((function(){date_picker_select($(this))}))}))})),$(document).on("wooccm-enhanced-options",(function(e){$("table.wc_gateways tbody").sortable({items:"tr",cursor:"move",axis:"y",handle:"td.sort",scrollSensitivity:40,helper:function(event,ui){return ui.children().each((function(){$(this).width($(this).width())})),ui.css("left","0"),ui},start:function(event,ui){ui.item.css("background-color","#f6f6f6")},stop:function(event,ui){ui.item.removeAttr("style"),ui.item.trigger("updateMoveButtons")},update:function(event,ui){$(this).find("tr").each((function(i,tr){$(tr).find("input.add-order").val(i).trigger("change")}))}}),$(".wooccm-enhanced-options").each((function(){var $table=$(this),$add=$table.find(".add-option"),$remove=$table.find(".remove-options");$add.on("click",(function(e){var $tr=$table.find("tbody > tr"),id=$tr.length,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+'"');$tr.last().after($("<tr>"+tr+"</tr>")).find("input").trigger("change"),$remove.removeProp("disabled")})),$remove.on("click",(function(e){var $tr;$table.find("tr > td.check-column input:checked").closest("tr").remove(),$table.find("tbody > tr").length<2&&$(this).prop("disabled",!0)}))}))})),$(document).on("wooccm-enhanced-select",(function(e){$(".wooccm-enhanced-select").filter(":not(.enhanced)").each((function(){var select2_args=$.extend({minimumResultsForSearch:10,allowClear:!!$(this).data("allow_clear"),placeholder:$(this).data("placeholder")},getEnhancedSelectFormatString()),name=$(this).attr("name");$(this).selectWoo(select2_args).addClass("enhanced")})),$(".wooccm-product-search").filter(":not(.enhanced)").each((function(){var select2_args={allowClear:!!$(this).data("allow_clear"),placeholder:$(this).data("placeholder"),minimumInputLength:$(this).data("minimum_input_length")?$(this).data("minimum_input_length"):"3",escapeMarkup:function(m){return m},ajax:{url:wc_enhanced_select_params.ajax_url,dataType:"json",delay:250,data:function(params){return{term:params.term,action:$(this).data("action")||"wooccm_select_search_products",security:wc_enhanced_select_params.search_products_nonce,selected:$(this).select2("val")||0,exclude:$(this).data("exclude"),include:$(this).data("include"),limit:$(this).data("limit"),display_stock:$(this).data("display_stock")}},processResults:function(data){var terms=[];return data&&$.each(data,(function(id,text){terms.push({id:id,text:text})})),{results:terms}},cache:!0}};select2_args=$.extend(select2_args,getEnhancedSelectFormatString());var name=$(this).attr("name");if($(this).selectWoo(select2_args).addClass("enhanced"),$(this).data("sortable")){var $select=$(this),$list=$(this).next(".select2-container").find("ul.select2-selection__rendered");$list.sortable({placeholder:"ui-state-highlight select2-selection__choice",forcePlaceholderSize:!0,items:"li:not(.select2-search__field)",tolerance:"pointer",stop:function(){$($list.find(".select2-selection__choice").get().reverse()).each((function(){var id=$(this).data("data").id,option=$select.find('option[value="'+id+'"]')[0];$select.prepend(option)}))}})}else $(this).prop("multiple")&&$(this).on("change",(function(){var $children=$(this).children();$children.filter("option").sort((function(a,b){var atext=a.text.toLowerCase(),btext=b.text.toLowerCase();return atext>btext?1:atext<btext?-1:0})),$(this).html($children)}))}))})),$(".wooccm-enhanced-search").filter(":not(.enhanced)").each((function(){var select2_args={allowClear:!!$(this).data("allow_clear"),placeholder:$(this).data("placeholder"),minimumInputLength:$(this).data("minimum_input_length")||"3",escapeMarkup:function(m){return m},ajax:{url:wooccm_admin.ajax_url,dataType:"json",cache:!0,delay:250,data:function(params){return{term:params.term,key:$(this).data("key"),action:"wooccm_search_field",nonce:wooccm_admin.nonce}},processResults:function(data,params){var terms=[];return data&&$.each(data,(function(id,text){terms.push({id:id,text:text})})),{results:terms}}}};select2_args=$.extend(select2_args,getEnhancedSelectFormatString()),$(this).select2(select2_args).addClass("enhanced")}))}(jQuery);
|
|
assets/frontend/css/checkout.css
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
.woocommerce form .wooccm-clearfix:before,.woocommerce form .wooccm-clearfix:after{content:'';display:table}.woocommerce form .wooccm-clearfix:after{clear:both}.woocommerce form .wooccm-conditional-child{display:none}.woocommerce form .wooccm-type-radio .woocommerce-radio-wrapper label{display:inline-block}.woocommerce form .wooccm-colorpicker-iris .iris-picker{display:none}.woocommerce form .wooccm-colorpicker-iris.active .iris-picker{display:block}.button.fileinput-button{position:relative;overflow:hidden !important}.button.fileinput-button input{position:absolute;top:0;right:0;margin:0;opacity:0;-ms-filter:'alpha(opacity=0)';font-size:200px;direction:ltr;cursor:pointer}.wooccm-file-list{margin:0 -5px;padding:0;display:flex;flex-wrap:wrap;align-items:center;justify-content:start}.wooccm-file-list .wooccm-file-file{display:flex;justify-content:center;align-items:stretch;box-sizing:border-box;padding:10px 5px 0 5px;width:25%;position:relative}.wooccm-file-list .wooccm-file-file .wooccm-file-list-delete{z-index:1;position:absolute;top:2px;right:-3px;width:16px;height:16px;background-color:#222;display:block;line-height:16px;text-align:center;color:#fefefe;font-weight:900;border-radius:50%;font-size:12px;cursor:pointer;font-family:code;text-decoration:none !important}.wooccm-file-list .wooccm-file-file .wooccm-file-list-container{width:100%;overflow:hidden}.wooccm-file-list .wooccm-file-file .wooccm-file-list-image-container{display:flex;justify-content:center;align-items:center;overflow:hidden;width:100%;padding-top:100%;position:relative;background:#eee}.wooccm-file-list .wooccm-file-file .wooccm-file-list-image-container>img{overflow:hidden;object-fit:cover;position:absolute;top:30%;bottom:auto;height:40%;opacity:0.8}.wooccm-file-list .wooccm-file-file .wooccm-file-list-image-container>img.image{top:0;bottom:0;left:0;right:0;max-height:100%;max-height:100%;height:100%;width:100%}.wooccm-file-list .ui-timepicker-table a{word-break:normal}.wooccm-file-list .ui-state-disabled,.wooccm-file-list .ui-widget-content .ui-state-disabled,.wooccm-file-list .ui-widget-header .ui-state-disabled{width:100%}
|
assets/frontend/css/wooccm.css
DELETED
@@ -1,128 +0,0 @@
|
|
1 |
-
.woocommerce form {
|
2 |
-
/* @media (min-width: 768px) {
|
3 |
-
.wooccm-field {
|
4 |
-
&.form-row-first {
|
5 |
-
width: 47.0588235294%;
|
6 |
-
float: left;
|
7 |
-
margin-right: 5.8823529412%;
|
8 |
-
clear: both;
|
9 |
-
}
|
10 |
-
&.form-row-last {
|
11 |
-
width: 45.4545454545%;
|
12 |
-
float: right;
|
13 |
-
margin-right: 0;
|
14 |
-
}
|
15 |
-
}
|
16 |
-
}*/
|
17 |
-
}
|
18 |
-
.woocommerce form .wooccm-clearfix:before,
|
19 |
-
.woocommerce form .wooccm-clearfix:after {
|
20 |
-
content: '';
|
21 |
-
display: table;
|
22 |
-
}
|
23 |
-
.woocommerce form .wooccm-clearfix:after {
|
24 |
-
clear: both;
|
25 |
-
}
|
26 |
-
.woocommerce form .wooccm-conditional-child {
|
27 |
-
display: none;
|
28 |
-
}
|
29 |
-
.woocommerce form .wooccm-type-radio .woocommerce-radio-wrapper label {
|
30 |
-
display: inline-block;
|
31 |
-
}
|
32 |
-
.woocommerce form .wooccm-colorpicker-iris .iris-picker {
|
33 |
-
display: none;
|
34 |
-
}
|
35 |
-
.woocommerce form .wooccm-colorpicker-iris.active .iris-picker {
|
36 |
-
display: block;
|
37 |
-
}
|
38 |
-
.button.fileinput-button {
|
39 |
-
position: relative;
|
40 |
-
overflow: hidden!important;
|
41 |
-
}
|
42 |
-
.button.fileinput-button input {
|
43 |
-
position: absolute;
|
44 |
-
top: 0;
|
45 |
-
right: 0;
|
46 |
-
margin: 0;
|
47 |
-
opacity: 0;
|
48 |
-
-ms-filter: 'alpha(opacity=0)';
|
49 |
-
font-size: 200px;
|
50 |
-
direction: ltr;
|
51 |
-
cursor: pointer;
|
52 |
-
}
|
53 |
-
.wooccm-file-list {
|
54 |
-
margin: 0 -5px;
|
55 |
-
padding: 0;
|
56 |
-
display: flex;
|
57 |
-
flex-wrap: wrap;
|
58 |
-
align-items: center;
|
59 |
-
justify-content: start;
|
60 |
-
}
|
61 |
-
.wooccm-file-list .wooccm-file-file {
|
62 |
-
display: flex;
|
63 |
-
justify-content: center;
|
64 |
-
align-items: stretch;
|
65 |
-
box-sizing: border-box;
|
66 |
-
padding: 10px 5px 0 5px;
|
67 |
-
width: 25%;
|
68 |
-
position: relative;
|
69 |
-
}
|
70 |
-
.wooccm-file-list .wooccm-file-file .wooccm-file-list-delete {
|
71 |
-
z-index: 1;
|
72 |
-
position: absolute;
|
73 |
-
top: 2px;
|
74 |
-
right: -3px;
|
75 |
-
width: 16px;
|
76 |
-
height: 16px;
|
77 |
-
background-color: #222;
|
78 |
-
display: block;
|
79 |
-
line-height: 16px;
|
80 |
-
text-align: center;
|
81 |
-
color: #fefefe;
|
82 |
-
font-weight: 900;
|
83 |
-
border-radius: 50%;
|
84 |
-
font-size: 12px;
|
85 |
-
cursor: pointer;
|
86 |
-
font-family: code;
|
87 |
-
text-decoration: none!important;
|
88 |
-
}
|
89 |
-
.wooccm-file-list .wooccm-file-file .wooccm-file-list-container {
|
90 |
-
width: 100%;
|
91 |
-
overflow: hidden;
|
92 |
-
}
|
93 |
-
.wooccm-file-list .wooccm-file-file .wooccm-file-list-image-container {
|
94 |
-
display: flex;
|
95 |
-
justify-content: center;
|
96 |
-
align-items: center;
|
97 |
-
overflow: hidden;
|
98 |
-
width: 100%;
|
99 |
-
padding-top: 100%;
|
100 |
-
position: relative;
|
101 |
-
background: #eee;
|
102 |
-
}
|
103 |
-
.wooccm-file-list .wooccm-file-file .wooccm-file-list-image-container > img {
|
104 |
-
overflow: hidden;
|
105 |
-
object-fit: cover;
|
106 |
-
position: absolute;
|
107 |
-
top: 30%;
|
108 |
-
bottom: auto;
|
109 |
-
height: 40%;
|
110 |
-
opacity: 0.8;
|
111 |
-
}
|
112 |
-
.wooccm-file-list .wooccm-file-file .wooccm-file-list-image-container > img.image {
|
113 |
-
top: 0;
|
114 |
-
bottom: 0;
|
115 |
-
left: 0;
|
116 |
-
right: 0;
|
117 |
-
max-height: 100%;
|
118 |
-
height: 100%;
|
119 |
-
width: 100%;
|
120 |
-
}
|
121 |
-
|
122 |
-
.ui-timepicker-table a {
|
123 |
-
word-break: normal;
|
124 |
-
}
|
125 |
-
.ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled{
|
126 |
-
width: 100%;
|
127 |
-
}
|
128 |
-
/*# sourceMappingURL=wooccm.css.map */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/frontend/css/wooccm.css.map
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
{"version":3,"sources":["../../less/wooccm.less"],"names":[],"mappings":"AAAA,YACE;;;;;;;;;;;;;;;;;AAEI,YAFJ,KACE,iBACG;AACC,YAHN,KACE,iBAEK;EACD,SAAQ,EAAR;EACA,cAAA;;AAEF,YAPJ,KACE,iBAMG;EACC,WAAA;;AATR,YACE,KAYE;EACE,aAAA;;AAdN,YACE,KAgBE,mBAEE,2BAEE;EACE,qBAAA;;AAtBV,YACE,KA2BE,yBACE;EACE,aAAA;;AAGF,YAhCJ,KA2BE,yBAKG,OACC;EACE,cAAA;;AAwBR,OAAC;EACC,kBAAA;EACA,0BAAA;;AAFF,OAAC,iBAIC;EACE,kBAAA;EACA,MAAA;EACA,QAAA;EACA,SAAA;EACA,UAAA;EACA,YAAW,kBAAX;EACA,gBAAA;EACA,cAAA;EACA,eAAA;;AAMN;EACE,cAAA;EACA,UAAA;EACA,aAAA;EACA,eAAA;EACA,mBAAA;EACA,sBAAA;;AANF,iBAQE;EACE,aAAA;EACA,uBAAA;EACA,oBAAA;EACA,sBAAA;EACA,uBAAA;EACA,UAAA;EAEA,kBAAA;;AAhBJ,iBAQE,kBAWE;EACE,UAAA;EACA,kBAAA;EACA,QAAA;EACA,WAAA;EACA,WAAA;EACA,YAAA;EACA,sBAAA;EACA,cAAA;EACA,iBAAA;EACA,kBAAA;EACA,cAAA;EACA,gBAAA;EACA,kBAAA;EACA,eAAA;EACA,eAAA;EACA,iBAAA;EACA,+BAAA;;AApCN,iBAQE,kBA+BE;EACE,WAAA;EACA,gBAAA;;AAzCN,iBAQE,kBAoCE;EACE,aAAA;EACA,uBAAA;EACA,mBAAA;EACA,gBAAA;EACA,WAAA;EACA,iBAAA;EACA,kBAAA;EACA,gBAAA;;AApDN,iBAQE,kBAoCE,kCAUE;EACE,gBAAA;EACA,iBAAA;EACA,kBAAA;EACA,QAAA;EACA,YAAA;EACA,WAAA;EACA,YAAA;;AAEA,iBAvDN,kBAoCE,kCAUE,MASG;EACC,MAAA;EACA,SAAA;EACA,OAAA;EACA,QAAA;EAEA,gBAAA;EACA,YAAA;EACA,WAAA","file":"wooccm.css"}
|
|
assets/frontend/css/wooccm.min.css
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
.woocommerce form .wooccm-clearfix:after,.woocommerce form .wooccm-clearfix:before{content:'';display:table}.woocommerce form .wooccm-clearfix:after{clear:both}.woocommerce form .wooccm-conditional-child{display:none}.woocommerce form .wooccm-type-radio .woocommerce-radio-wrapper label{display:inline-block}.woocommerce form .wooccm-colorpicker-iris .iris-picker{display:none}.woocommerce form .wooccm-colorpicker-iris.active .iris-picker{display:block}.button.fileinput-button{position:relative;overflow:hidden!important}.button.fileinput-button input{position:absolute;top:0;right:0;margin:0;opacity:0;-ms-filter:'alpha(opacity=0)';font-size:200px;direction:ltr;cursor:pointer}.wooccm-file-list{margin:0 -5px;padding:0;display:flex;flex-wrap:wrap;align-items:center;justify-content:start}.wooccm-file-list .wooccm-file-file{display:flex;justify-content:center;align-items:stretch;box-sizing:border-box;padding:10px 5px 0 5px;width:25%;position:relative}.wooccm-file-list .wooccm-file-file .wooccm-file-list-delete{z-index:1;position:absolute;top:2px;right:-3px;width:16px;height:16px;background-color:#222;display:block;line-height:16px;text-align:center;color:#fefefe;font-weight:900;border-radius:50%;font-size:12px;cursor:pointer;font-family:code;text-decoration:none!important}.wooccm-file-list .wooccm-file-file .wooccm-file-list-container{width:100%;overflow:hidden}.wooccm-file-list .wooccm-file-file .wooccm-file-list-image-container{display:flex;justify-content:center;align-items:center;overflow:hidden;width:100%;padding-top:100%;position:relative;background:#eee}.wooccm-file-list .wooccm-file-file .wooccm-file-list-image-container>img{overflow:hidden;object-fit:cover;position:absolute;top:30%;bottom:auto;height:40%;opacity:.8}.wooccm-file-list .wooccm-file-file .wooccm-file-list-image-container>img.image{top:0;bottom:0;left:0;right:0;max-height:100%;height:100%;width:100%}.ui-timepicker-table a{word-break:normal}.ui-state-disabled,.ui-widget-content .ui-state-disabled,.ui-widget-header .ui-state-disabled{width:100%}
|
|
assets/frontend/js/checkout.asset.php
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
<?php return array('dependencies' => array('jquery', 'selectWoo'), 'version' => 'acb3437adce2bd11ff9c4881456b2708');
|
assets/frontend/js/checkout.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
!function(e){var t={};function o(c){if(t[c])return t[c].exports;var i=t[c]={i:c,l:!1,exports:{}};return e[c].call(i.exports,i,i.exports,o),i.l=!0,i.exports}o.m=e,o.c=t,o.d=function(e,t,c){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:c})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var c=Object.create(null);if(o.r(c),Object.defineProperty(c,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)o.d(c,i,function(t){return e[t]}.bind(null,i));return c},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s=0)}([function(e,t,o){"use strict";o.r(t);o(3),o(1),o(2);!function(e){var t=function(e){return e.is(".processing")||e.parents(".processing").length};e(document).on("country_to_state_changing",(function(t,o,c){var i=c,n=e.parseJSON(wc_address_i18n_params.locale_fields);e.each(n,(function(e,t){var o=i.find(t),c=o.find("[data-required]").data("required")||o.find(".wooccm-required-field").length;!function(e,t){t?(e.find("label .optional").remove(),e.addClass("validate-required"),0===e.find("label .required").length&&e.find("label").append('<abbr class="required" title="'+wc_address_i18n_params.i18n_required_text+'">*</abbr>'),e.show(),e.find("input[type=hidden]").prop("type","text")):(e.find("label .required").remove(),e.removeClass("validate-required woocommerce-invalid woocommerce-invalid-required-field"),0===e.find("label .optional").length&&e.find("label").append('<span class="optional">('+wc_address_i18n_params.i18n_optional_text+")</span>"))}(o,c)}))}));var o={};if(e(".wooccm-type-file").each((function(t,c){var i=e(c),n=i.find("[type=file]"),a=i.find(".wooccm-file-button"),r=i.find(".wooccm-file-list");o[i.attr("id")]=[],a.on("click",(function(e){e.preventDefault(),n.trigger("click")})),r.on("click",".wooccm-file-list-delete",(function(t){var c=e(this).closest(".wooccm-file-file"),n=e(this).closest("[data-file_id]").data("file_id");o[i.attr("id")]=e.grep(o[i.attr("id")],(function(e,t){return t!=n})),c.remove(),e("#order_review").trigger("wooccm_upload")})),n.on("change",(function(t){var c=e(this)[0].files;c.length&&window.FileReader&&e.each(c,(function(t,c){if(r.find("span[data-file_id]").length+t>=wooccm_upload.limit.max_files)return alert("Exeeds max files limit of "+wooccm_upload.limit.max_files),!1;if(c.size>wooccm_upload.limit.max_file_size)return alert("Exeeds max file size of "+wooccm_upload.limit.max_file_size),!0;var n,a=new FileReader;a.onload=(n=c,function(t){setTimeout((function(){!function(t,o,c,i,n){var a,r=e(t);n.match("image.*")?a="image":n.match("application/ms.*")?(c=wooccm_upload.icons.spreadsheet,a="spreadsheet"):n.match("application/x.*")?(c=wooccm_upload.icons.archive,a="application"):n.match("audio.*")?(c=wooccm_upload.icons.audio,a="audio"):n.match("text.*")?(c=wooccm_upload.icons.text,a="text"):n.match("video.*")?(c=wooccm_upload.icons.video,a="video"):(c=wooccm_upload.icons.interactive,a="interactive");var l='<span data-file_id="'+o+'" title="'+i+'" class="wooccm-file-file">\n <span class="wooccm-file-list-container">\n <a title="'+i+'" class="wooccm-file-list-delete">×</a>\n <span class="wooccm-file-list-image-container">\n <img class="'+a+'" alt="'+i+'" src="'+c+'"/>\n </span>\n </span>\n </span>';r.append(l).fadeIn()}(r,o[i.attr("id")].push(c)-1,t.target.result,n.name,n.type),e("#order_review").trigger("wooccm_upload")}),200)}),a.readAsDataURL(c)}))}))})),e("#order_review").on("ajaxSuccess wooccm_upload",(function(t,o,c){var i=e(t.target).find("#place_order");e(".wooccm-type-file").length?i.addClass("wooccm-upload-process"):i.removeClass("wooccm-upload-process")})),e(document).on("click","#place_order.wooccm-upload-process",(function(c){c.preventDefault();var i,n=e("form.checkout"),a=e(this);e(".wooccm-type-file").length&&(window.FormData&&Object.keys(o).length&&(t(n)||(a.html(wooccm_upload.message.uploading),t(i=n)||i.addClass("processing").block({message:null,overlayCSS:{background:"#fff",opacity:.6}})),e.each(o,(function(t,o){var c=e("#"+t).find(".wooccm-file-field"),i=new FormData;e.each(o,(function(e,t){return e>wooccm_upload.limit.max_files?(console.log("Exeeds max files limit of "+wooccm_upload.limit.max_files),!1):t.size>wooccm_upload.limit.max_file_size?(console.log("Exeeds max file size of "+wooccm_upload.limit.max_files),!0):(console.log("We're ready to upload "+t.name),void i.append("wooccm_checkout_attachment_upload[]",t))})),i.append("action","wooccm_checkout_attachment_upload"),i.append("nonce",wooccm_upload.nonce),e.ajax({async:!1,url:wooccm_upload.ajax_url,type:"POST",cache:!1,data:i,processData:!1,contentType:!1,beforeSend:function(e){},success:function(t){t.success?c.val(t.data):e("body").trigger("update_checkout")},complete:function(e){}})})),function(e){e.removeClass("processing").unblock()}(n),a.removeClass("wooccm-upload-process").trigger("click")))})),e(document).on("change",".wooccm-add-price",(function(t){e("body").trigger("update_checkout")})),e(".wooccm-field").each((function(t,o){e(o).find("input,textarea,select").on("change keyup wooccm_change",(function(t){var o=e(t.target).attr("name").replace("[]",""),c=e(t.target).prop("type"),i=e(t.target).val();"checkbox"==c&&(i=-1!==e(t.target).attr("name").indexOf("[]")?e(t.target).closest(".wooccm-field").find("input:checked").map((function(e,t){return t.value})).toArray():e(t.target).is(":checked")),e("*[data-conditional-parent="+o+"]").closest(".wooccm-field").hide(),e("*[data-conditional-parent="+o+"]").each((function(t,o){var c=e(o),n=c&&c.data("conditional-parent-value");(i==n||e.isArray(i)&&i.indexOf(n)>-1)&&c.closest(".wooccm-field").fadeIn()}))}))})),e(".wooccm-conditional-child").each((function(t,o){var c=e(o),i=e("#"+c.find("[data-conditional-parent]").data("conditional-parent")+"_field");i.find("select:first").trigger("wooccm_change"),i.find("textarea:first").trigger("wooccm_change"),i.find("input[type=button]:first").trigger("wooccm_change"),i.find("input[type=radio]:checked:first").trigger("wooccm_change"),i.find("input[type=checkbox]:checked:first").trigger("wooccm_change"),i.find("input[type=color]:first").trigger("wooccm_change"),i.find("input[type=date]:first").trigger("wooccm_change"),i.find("input[type=datetime-local]:first").trigger("wooccm_change"),i.find("input[type=email]:first").trigger("wooccm_change"),i.find("input[type=file]:first").trigger("wooccm_change"),i.find("input[type=hidden]:first").trigger("wooccm_change"),i.find("input[type=image]:first").trigger("wooccm_change"),i.find("input[type=month]:first").trigger("wooccm_change"),i.find("input[type=number]:first").trigger("wooccm_change"),i.find("input[type=password]:first").trigger("wooccm_change"),i.find("input[type=range]:first").trigger("wooccm_change"),i.find("input[type=reset]:first").trigger("wooccm_change"),i.find("input[type=search]:first").trigger("wooccm_change"),i.find("input[type=submit]:first").trigger("wooccm_change"),i.find("input[type=tel]:first").trigger("wooccm_change"),i.find("input[type=text]:first").trigger("wooccm_change"),i.find("input[type=time]:first").trigger("wooccm_change"),i.find("input[type=url]:first").trigger("wooccm_change"),i.find("input[type=week]:first").trigger("wooccm_change")})),e(".wooccm-enhanced-datepicker").each((function(t,o){var c=e(this),i=c.data("disable")||!1;e.isFunction(e.fn.datepicker)&&c.datepicker({dateFormat:c.data("formatdate")||"dd-mm-yy",minDate:c.data("mindate"),maxDate:c.data("maxdate"),beforeShowDay:function(t){var o=null!=t.getDay()&&t.getDay().toString();return i?[-1===e.inArray(o,i)]:[!0]}})})),e(".wooccm-enhanced-timepicker").each((function(t,o){var c=e(this);e.isFunction(e.fn.timepicker)&&(console.log(c.data("format-ampm")),c.timepicker({showPeriodLabels:!!c.data("format-ampm"),showPeriod:!!c.data("format-ampm"),showLeadingZero:!0,hours:c.data("hours")||void 0,minutes:c.data("minutes")||void 0}))})),e(".wooccm-colorpicker-farbtastic").each((function(t,o){var c=e(o),i=c.find("input[type=text]"),n=c.find(".wooccmcolorpicker_container");i.hide(),e.isFunction(e.fn.farbtastic)&&(n.farbtastic("#"+i.attr("id")),n.on("click",(function(e){i.fadeIn()})))})),e(".wooccm-colorpicker-iris").each((function(t,o){var c=e(o),i=c.find("input[type=text]");i.css("background",i.val()),i.on("click",(function(e){c.toggleClass("active")})),i.iris({class:i.attr("id"),palettes:!0,color:"",hide:!1,change:function(e,t){i.css("background",t.color.toString()).fadeIn()}})})),e(document).on("click",(function(t){0===e(t.target).closest(".iris-picker").length&&e(".wooccm-colorpicker-iris").removeClass("active")})),"undefined"==typeof wc_country_select_params)return!1;if(e().selectWoo){e("select.wooccm-enhanced-select").each((function(){var t=e.extend({width:"100%",placeholder:e(this).data("placeholder")||"",allowClear:e(this).data("allowclear")||!1,selectOnClose:e(this).data("selectonclose")||!1,closeOnSelect:e(this).data("closeonselect")||!1,minimumResultsForSearch:e(this).data("search")||-1},{language:{errorLoading:function(){return wc_country_select_params.i18n_searching},inputTooLong:function(e){var t=e.input.length-e.maximum;return 1===t?wc_country_select_params.i18n_input_too_long_1:wc_country_select_params.i18n_input_too_long_n.replace("%qty%",t)},inputTooShort:function(e){var t=e.minimum-e.input.length;return 1===t?wc_country_select_params.i18n_input_too_short_1:wc_country_select_params.i18n_input_too_short_n.replace("%qty%",t)},loadingMore:function(){return wc_country_select_params.i18n_load_more},maximumSelected:function(e){return 1===e.maximum?wc_country_select_params.i18n_selection_too_long_1:wc_country_select_params.i18n_selection_too_long_n.replace("%qty%",e.maximum)},noResults:function(){return wc_country_select_params.i18n_no_matches},searching:function(){return wc_country_select_params.i18n_searching}}});e(this).on("select2:select",(function(){e(this).focus()})).selectWoo(t)}))}}(jQuery)},function(e,t){!function(){e.exports=this.jQuery}()},function(e,t){!function(){e.exports=this.window.selectWoo}()},function(e,t){}]);
|
assets/frontend/js/order-upload.asset.php
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
<?php return array('dependencies' => array('jquery'), 'version' => '21579d17fba223671216029a4af5bd89');
|
assets/frontend/js/order-upload.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
!function(e){var t={};function o(a){if(t[a])return t[a].exports;var c=t[a]={i:a,l:!1,exports:{}};return e[a].call(c.exports,c,c.exports,o),c.l=!0,c.exports}o.m=e,o.c=t,o.d=function(e,t,a){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var a=Object.create(null);if(o.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var c in e)o.d(a,c,function(t){return e[t]}.bind(null,c));return a},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s=0)}([function(e,t,o){"use strict";o.r(t);o(1);jQuery(document).ready((function(e){e(document).on("click",".wooccm_delete_attachment",(function(t){var o=e(this).closest("tr"),a=e(this).data("attachment_id");o.hide(),e("#wooccm_order_attachment_update").prop("disabled",!1),e("#delete_attachments_ids").val(e("#delete_attachments_ids").val().replace(a,""))})),e(document).on("click","#wooccm_order_attachment_update",(function(t){e.ajax({url:wooccm_upload.ajax_url,type:"POST",cache:!1,data:{action:"wooccm_order_attachment_update",nonce:wooccm_upload.nonce,delete_attachments_ids:e("#delete_attachments_ids").val(),all_attachments_ids:e("#all_attachments_ids").val()},beforeSend:function(t){e(".wooccm_upload_results").html(wooccm_upload.message.saving)},success:function(t){t.success?(e(".wooccm_upload_results").html(wooccm_upload.message.deleted),e("#wooccm_order_attachment_update").prop("disabled",!0)):e(".wooccm_upload_results").html(t.data)}})})),e(document).on("change","#wooccm_order_attachment_upload",(function(t){var o=!1,a=e(this).data("order_id");window.FormData&&(o=new FormData);for(var c,n=0,r=this.files.length;n<r;n++)c=this.files[n],o&&o.append("wooccm_order_attachment_upload[]",c);o&&(o.append("action","wooccm_order_attachment_upload"),o.append("nonce",wooccm_upload.nonce),o.append("order_id",a),e.ajax({url:wooccm_upload.ajax_url,type:"POST",cache:!1,data:o,processData:!1,contentType:!1,beforeSend:function(t){var o;e(".wooccm_upload_results").html(wooccm_upload.message.uploading),function(e){return e.is(".processing")||e.parents(".processing").length}(o=e(".wooccm_order_attachments_wrapper"))||o.addClass("processing").block({message:null,overlayCSS:{background:"#fff",opacity:.6}})},success:function(t){t.success?(e(".wooccm_order_attachments_wrapper").fadeOut(),e(".wooccm_order_attachments_wrapper").replaceWith(e(t.data).fadeIn()),e(".wooccm_upload_results").html(wooccm_upload.message.success)):e(".wooccm_upload_results").html(t.data),e(".wooccm_order_attachments_wrapper").removeClass("processing").unblock()}}))}))}))},function(e,t){!function(){e.exports=this.jQuery}()}]);
|
assets/frontend/js/wooccm-checkout.js
DELETED
@@ -1,610 +0,0 @@
|
|
1 |
-
(function ($) {
|
2 |
-
"use strict";
|
3 |
-
|
4 |
-
var is_blocked = function ($node) {
|
5 |
-
return $node.is('.processing') || $node.parents('.processing').length;
|
6 |
-
};
|
7 |
-
var block = function ($node) {
|
8 |
-
if (!is_blocked($node)) {
|
9 |
-
$node.addClass('processing').block({
|
10 |
-
message: null,
|
11 |
-
overlayCSS: {
|
12 |
-
background: '#fff',
|
13 |
-
opacity: 0.6
|
14 |
-
}
|
15 |
-
});
|
16 |
-
}
|
17 |
-
};
|
18 |
-
var unblock = function ($node) {
|
19 |
-
$node.removeClass('processing').unblock();
|
20 |
-
};
|
21 |
-
var append_image = function (list, i, source, name, filetype) {
|
22 |
-
|
23 |
-
var $field_list = $(list),
|
24 |
-
source_class;
|
25 |
-
if (filetype.match('image.*')) {
|
26 |
-
source_class = 'image';
|
27 |
-
} else if (filetype.match('application/ms.*')) {
|
28 |
-
source = wooccm_upload.icons.spreadsheet;
|
29 |
-
source_class = 'spreadsheet';
|
30 |
-
} else if (filetype.match('application/x.*')) {
|
31 |
-
source = wooccm_upload.icons.archive;
|
32 |
-
source_class = 'application';
|
33 |
-
} else if (filetype.match('audio.*')) {
|
34 |
-
source = wooccm_upload.icons.audio;
|
35 |
-
source_class = 'audio';
|
36 |
-
} else if (filetype.match('text.*')) {
|
37 |
-
source = wooccm_upload.icons.text;
|
38 |
-
source_class = 'text';
|
39 |
-
} else if (filetype.match('video.*')) {
|
40 |
-
source = wooccm_upload.icons.video;
|
41 |
-
source_class = 'video';
|
42 |
-
} else {
|
43 |
-
//if ((false === filetype.match('application/ms.*') && false === filetype.match('application/x.*') && false === filetype.match('audio.*') && false === filetype.match('text.*') && false === filetype.match('video.*')) || (0 === filetype.length || !filetype)) {
|
44 |
-
source = wooccm_upload.icons.interactive;
|
45 |
-
source_class = 'interactive';
|
46 |
-
}
|
47 |
-
|
48 |
-
|
49 |
-
var html = '<span data-file_id="' + i + '" title="' + name + '" class="wooccm-file-file">\n\
|
50 |
-
<span class="wooccm-file-list-container">\n\
|
51 |
-
<a title="' + name + '" class="wooccm-file-list-delete">×</a>\n\
|
52 |
-
<span class="wooccm-file-list-image-container">\n\
|
53 |
-
<img class="' + source_class + '" alt="' + name + '" src="' + source + '"/>\n\
|
54 |
-
</span>\n\
|
55 |
-
</span>\n\
|
56 |
-
</span>';
|
57 |
-
$field_list.append(html).fadeIn();
|
58 |
-
}
|
59 |
-
|
60 |
-
|
61 |
-
function field_is_required(field, is_required) {
|
62 |
-
if (is_required) {
|
63 |
-
field.find('label .optional').remove();
|
64 |
-
field.addClass('validate-required');
|
65 |
-
if (field.find('label .required').length === 0) {
|
66 |
-
field.find('label').append(
|
67 |
-
'<abbr class="required" title="' +
|
68 |
-
wc_address_i18n_params.i18n_required_text +
|
69 |
-
'">*</abbr>'
|
70 |
-
);
|
71 |
-
}
|
72 |
-
|
73 |
-
//fix state hidden
|
74 |
-
field.show();
|
75 |
-
field.find('input[type=hidden]').prop('type', 'text');
|
76 |
-
|
77 |
-
} else {
|
78 |
-
field.find('label .required').remove();
|
79 |
-
field.removeClass('validate-required woocommerce-invalid woocommerce-invalid-required-field');
|
80 |
-
if (field.find('label .optional').length === 0) {
|
81 |
-
field.find('label').append('<span class="optional">(' + wc_address_i18n_params.i18n_optional_text + ')</span>');
|
82 |
-
}
|
83 |
-
}
|
84 |
-
}
|
85 |
-
|
86 |
-
|
87 |
-
$(document).on('country_to_state_changing', function (event, country, wrapper) {
|
88 |
-
|
89 |
-
var thisform = wrapper, thislocale;
|
90 |
-
var locale_fields = $.parseJSON(wc_address_i18n_params.locale_fields);
|
91 |
-
$.each(locale_fields, function (key, value) {
|
92 |
-
|
93 |
-
var field = thisform.find(value),
|
94 |
-
required = field.find('[data-required]').data('required') || field.find('.wooccm-required-field').length;
|
95 |
-
|
96 |
-
field_is_required(field, required);
|
97 |
-
});
|
98 |
-
});
|
99 |
-
// Field
|
100 |
-
// ---------------------------------------------------------------------------
|
101 |
-
|
102 |
-
var fileList = {};
|
103 |
-
|
104 |
-
$('.wooccm-type-file').each(function (i, field) {
|
105 |
-
|
106 |
-
var $field = $(field),
|
107 |
-
$button_file = $field.find('[type=file]'),
|
108 |
-
$button_click = $field.find('.wooccm-file-button'),
|
109 |
-
$field_list = $field.find('.wooccm-file-list');
|
110 |
-
|
111 |
-
fileList[$field.attr('id')] = [];
|
112 |
-
|
113 |
-
// Simulate click
|
114 |
-
// -------------------------------------------------------------------------
|
115 |
-
|
116 |
-
$button_click.on('click', function (e) {
|
117 |
-
e.preventDefault();
|
118 |
-
$button_file.trigger('click');
|
119 |
-
});
|
120 |
-
|
121 |
-
// Delete images
|
122 |
-
// ---------------------------------------------------------------------------
|
123 |
-
|
124 |
-
$field_list.on('click', '.wooccm-file-list-delete', function (e) {
|
125 |
-
|
126 |
-
var $file = $(this).closest('.wooccm-file-file'),
|
127 |
-
file_id = $(this).closest('[data-file_id]').data('file_id');
|
128 |
-
|
129 |
-
fileList[$field.attr('id')] = $.grep(fileList[$field.attr('id')], function (value, index) {
|
130 |
-
return index != file_id;
|
131 |
-
});
|
132 |
-
|
133 |
-
$file.remove();
|
134 |
-
|
135 |
-
$('#order_review').trigger('wooccm_upload');
|
136 |
-
});
|
137 |
-
// Append images
|
138 |
-
// -------------------------------------------------------------------------
|
139 |
-
|
140 |
-
$button_file.on('change', function (e) {
|
141 |
-
|
142 |
-
var files = $(this)[0].files;
|
143 |
-
if (files.length) {
|
144 |
-
|
145 |
-
if (window.FileReader) {
|
146 |