Version Description
Download this release
Release Info
Developer | yithemes |
Plugin | YITH WooCommerce Zoom Magnifier |
Version | 1.3.20 |
Comparing to | |
See all releases |
Code changes from version 1.3.19 to 1.3.20
- README.txt +10 -2
- assets/css/frontend.css +31 -63
- assets/js/yith_magnifier.js +853 -950
- assets/js/yith_magnifier.min.js +1 -1
- assets/js/ywzm_frontend.js +8 -212
- assets/js/ywzm_frontend.min.js +1 -1
- class.yith-wcmg-frontend.php +31 -32
- init.php +5 -5
- plugin-fw/assets/css/yith-fields.css +139 -65
- plugin-fw/init.php +1 -1
- plugin-fw/lib/yit-plugin-licence.php +2 -2
- plugin-fw/templates/fields/dimensions.php +24 -25
- plugin-fw/templates/sysinfo/system-information-panel.php +10 -2
- plugin-fw/yit-plugin.php +2 -2
- plugin-options/premium-options.php +2 -2
- templates/single-product/product-image-magnifier.php +1 -5
- templates/single-product/product-thumbnails-magnifier.php +35 -45
README.txt
CHANGED
@@ -3,8 +3,8 @@
|
|
3 |
Contributors: yithemes
|
4 |
Tags: zoom, magnifier, slider, carousel, woocommerce
|
5 |
Requires at least: 4.0
|
6 |
-
Tested up to: 5.
|
7 |
-
Stable tag: 1.3.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
Documentation: https://docs.yithemes.com/yith-woocommerce-zoom-magnifier/
|
@@ -52,6 +52,14 @@ YITH WooCommerce Zoom Magnifier will add a new tab called "Zoom Magnifier" in "Y
|
|
52 |
|
53 |
== Changelog ==
|
54 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
55 |
= Version 1.3.19 - Released: Oct 01, 2020 =
|
56 |
|
57 |
* New: support for WooCommerce 4.6
|
3 |
Contributors: yithemes
|
4 |
Tags: zoom, magnifier, slider, carousel, woocommerce
|
5 |
Requires at least: 4.0
|
6 |
+
Tested up to: 5.6
|
7 |
+
Stable tag: 1.3.20
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
Documentation: https://docs.yithemes.com/yith-woocommerce-zoom-magnifier/
|
52 |
|
53 |
== Changelog ==
|
54 |
|
55 |
+
= Version 1.3.20 - Released: Oct 30, 2020 =
|
56 |
+
|
57 |
+
* New: support for WooCommerce 4.7
|
58 |
+
* New: support for WordPress 5.6
|
59 |
+
* Update: Plugin-fw
|
60 |
+
* Fix: reverting previous versions changes to fix different problems
|
61 |
+
|
62 |
+
|
63 |
= Version 1.3.19 - Released: Oct 01, 2020 =
|
64 |
|
65 |
* New: support for WooCommerce 4.6
|
assets/css/frontend.css
CHANGED
@@ -1,97 +1,65 @@
|
|
1 |
/* gallery */
|
2 |
.yith_magnifier_gallery {
|
3 |
-
|
4 |
-
|
5 |
-
text-align: center;
|
6 |
}
|
7 |
|
8 |
.yith_magnifier_gallery li {
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
top: 0;
|
13 |
}
|
14 |
|
15 |
.yith_magnifier_gallery li.last {
|
16 |
-
|
17 |
}
|
18 |
|
19 |
.yith_magnifier_gallery li a {
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
}
|
25 |
|
26 |
/* next/prev */
|
27 |
.single-product.woocommerce .thumbnails {
|
28 |
-
|
29 |
-
overflow: hidden;
|
30 |
}
|
31 |
|
32 |
.single-product.woocommerce .thumbnails #slider-prev,
|
33 |
.single-product.woocommerce .thumbnails #slider-next {
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
}
|
43 |
|
44 |
.single-product.woocommerce .thumbnails #slider-prev {
|
45 |
-
|
46 |
-
|
47 |
}
|
48 |
|
49 |
.single-product.woocommerce .thumbnails #slider-next {
|
50 |
-
|
51 |
-
|
52 |
}
|
53 |
|
54 |
.single-product.woocommerce .thumbnails:hover #slider-prev,
|
55 |
.single-product.woocommerce .thumbnails:hover #slider-next {
|
56 |
-
|
57 |
}
|
58 |
|
59 |
span.onsale {
|
60 |
-
|
61 |
}
|
62 |
|
63 |
-
div.pp_woocommerce a.
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
box-sizing: border-box;
|
70 |
-
cursor: pointer;
|
71 |
-
font-size: 25px;
|
72 |
-
position: absolute;
|
73 |
-
text-align: left;
|
74 |
-
text-decoration: none;
|
75 |
-
text-indent: -10000px;
|
76 |
-
z-index: 20000;
|
77 |
-
border-radius: 100%;
|
78 |
-
height: 25px;
|
79 |
-
width: 25px;
|
80 |
-
text-shadow: 0 1px 2px rgba(0, 0, 0, .5);
|
81 |
-
line-height: 1em;
|
82 |
-
transition: all ease-in-out .2s;
|
83 |
-
color: #fff !important;
|
84 |
-
}
|
85 |
-
|
86 |
-
a.yith_expand:before {
|
87 |
-
font-family: WooCommerce;
|
88 |
-
content: "\e005";
|
89 |
-
display: block;
|
90 |
-
position: absolute;
|
91 |
-
top: 0;
|
92 |
-
left: 0;
|
93 |
-
right: 0;
|
94 |
-
bottom: 0;
|
95 |
-
text-align: center;
|
96 |
-
text-indent: 0;
|
97 |
-
}
|
1 |
/* gallery */
|
2 |
.yith_magnifier_gallery {
|
3 |
+
margin: 0;
|
4 |
+
padding: 0;
|
|
|
5 |
}
|
6 |
|
7 |
.yith_magnifier_gallery li {
|
8 |
+
position: relative;
|
9 |
+
float: left;
|
10 |
+
display: block;
|
|
|
11 |
}
|
12 |
|
13 |
.yith_magnifier_gallery li.last {
|
14 |
+
margin-right: 0;
|
15 |
}
|
16 |
|
17 |
.yith_magnifier_gallery li a {
|
18 |
+
width: 100% !important;
|
19 |
+
display: block;
|
20 |
+
margin-top: 10px;
|
21 |
+
height: auto !important;
|
22 |
}
|
23 |
|
24 |
/* next/prev */
|
25 |
.single-product.woocommerce .thumbnails {
|
26 |
+
position: relative;
|
|
|
27 |
}
|
28 |
|
29 |
.single-product.woocommerce .thumbnails #slider-prev,
|
30 |
.single-product.woocommerce .thumbnails #slider-next {
|
31 |
+
display: none !important;
|
32 |
+
cursor: pointer;
|
33 |
+
width: 27px;
|
34 |
+
height: 26px;
|
35 |
+
background: url('../images/slider-arrow.png') no-repeat left center;
|
36 |
+
position: absolute;
|
37 |
+
top: 48%;
|
38 |
+
margin-top: -2px;
|
39 |
}
|
40 |
|
41 |
.single-product.woocommerce .thumbnails #slider-prev {
|
42 |
+
background-position: left center;
|
43 |
+
left: 0px;
|
44 |
}
|
45 |
|
46 |
.single-product.woocommerce .thumbnails #slider-next {
|
47 |
+
background-position: right center;
|
48 |
+
right: 0px;
|
49 |
}
|
50 |
|
51 |
.single-product.woocommerce .thumbnails:hover #slider-prev,
|
52 |
.single-product.woocommerce .thumbnails:hover #slider-next {
|
53 |
+
display: block !important;
|
54 |
}
|
55 |
|
56 |
span.onsale {
|
57 |
+
z-index: 10000
|
58 |
}
|
59 |
|
60 |
+
div.pp_woocommerce a.pp_expand {
|
61 |
+
display: inline;
|
62 |
+
bottom: 10px;
|
63 |
+
top: initial;
|
64 |
+
left: 10px;
|
65 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/yith_magnifier.js
CHANGED
@@ -1,950 +1,853 @@
|
|
1 |
-
/**
|
2 |
-
* YITH Magnifier
|
3 |
-
*
|
4 |
-
* @version 0.1
|
5 |
-
* @author Your Inspiration Themes Team <info@yithemes.com>
|
6 |
-
*
|
7 |
-
* MIT License.
|
8 |
-
*/
|
9 |
-
|
10 |
-
;
|
11 |
-
(function (window, $, undefined) {
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
self.
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
}
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
}
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
-
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
-
|
447 |
-
});
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
|
455 |
-
|
456 |
-
|
457 |
-
|
458 |
-
|
459 |
-
|
460 |
-
|
461 |
-
|
462 |
-
|
463 |
-
|
464 |
-
|
465 |
-
|
466 |
-
|
467 |
-
|
468 |
-
|
469 |
-
|
470 |
-
|
471 |
-
|
472 |
-
|
473 |
-
|
474 |
-
|
475 |
-
|
476 |
-
|
477 |
-
|
478 |
-
|
479 |
-
|
480 |
-
|
481 |
-
|
482 |
-
|
483 |
-
|
484 |
-
|
485 |
-
|
486 |
-
|
487 |
-
|
488 |
-
|
489 |
-
|
490 |
-
|
491 |
-
|
492 |
-
|
493 |
-
|
494 |
-
|
495 |
-
|
496 |
-
|
497 |
-
|
498 |
-
|
499 |
-
|
500 |
-
|
501 |
-
|
502 |
-
|
503 |
-
|
504 |
-
|
505 |
-
|
506 |
-
|
507 |
-
|
508 |
-
|
509 |
-
|
510 |
-
|
511 |
-
|
512 |
-
|
513 |
-
|
514 |
-
|
515 |
-
|
516 |
-
|
517 |
-
|
518 |
-
|
519 |
-
|
520 |
-
|
521 |
-
|
522 |
-
|
523 |
-
|
524 |
-
|
525 |
-
|
526 |
-
|
527 |
-
|
528 |
-
|
529 |
-
|
530 |
-
|
531 |
-
|
532 |
-
|
533 |
-
|
534 |
-
|
535 |
-
|
536 |
-
|
537 |
-
|
538 |
-
|
539 |
-
|
540 |
-
|
541 |
-
|
542 |
-
|
543 |
-
|
544 |
-
|
545 |
-
|
546 |
-
|
547 |
-
|
548 |
-
|
549 |
-
|
550 |
-
|
551 |
-
|
552 |
-
|
553 |
-
|
554 |
-
|
555 |
-
|
556 |
-
|
557 |
-
|
558 |
-
|
559 |
-
|
560 |
-
|
561 |
-
|
562 |
-
|
563 |
-
|
564 |
-
|
565 |
-
|
566 |
-
|
567 |
-
|
568 |
-
|
569 |
-
|
570 |
-
|
571 |
-
|
572 |
-
|
573 |
-
|
574 |
-
|
575 |
-
|
576 |
-
|
577 |
-
|
578 |
-
|
579 |
-
|
580 |
-
|
581 |
-
|
582 |
-
|
583 |
-
|
584 |
-
|
585 |
-
|
586 |
-
|
587 |
-
|
588 |
-
|
589 |
-
|
590 |
-
|
591 |
-
|
592 |
-
|
593 |
-
|
594 |
-
|
595 |
-
|
596 |
-
|
597 |
-
|
598 |
-
|
599 |
-
|
600 |
-
|
601 |
-
|
602 |
-
|
603 |
-
|
604 |
-
|
605 |
-
|
606 |
-
|
607 |
-
|
608 |
-
|
609 |
-
|
610 |
-
|
611 |
-
|
612 |
-
|
613 |
-
|
614 |
-
|
615 |
-
|
616 |
-
|
617 |
-
|
618 |
-
|
619 |
-
|
620 |
-
|
621 |
-
|
622 |
-
|
623 |
-
|
624 |
-
|
625 |
-
|
626 |
-
|
627 |
-
|
628 |
-
|
629 |
-
|
630 |
-
|
631 |
-
|
632 |
-
|
633 |
-
|
634 |
-
|
635 |
-
|
636 |
-
|
637 |
-
|
638 |
-
|
639 |
-
|
640 |
-
|
641 |
-
|
642 |
-
|
643 |
-
|
644 |
-
|
645 |
-
|
646 |
-
|
647 |
-
|
648 |
-
|
649 |
-
|
650 |
-
|
651 |
-
|
652 |
-
|
653 |
-
|
654 |
-
|
655 |
-
|
656 |
-
|
657 |
-
|
658 |
-
|
659 |
-
|
660 |
-
|
661 |
-
|
662 |
-
|
663 |
-
|
664 |
-
|
665 |
-
|
666 |
-
|
667 |
-
|
668 |
-
|
669 |
-
|
670 |
-
|
671 |
-
|
672 |
-
|
673 |
-
|
674 |
-
|
675 |
-
|
676 |
-
|
677 |
-
|
678 |
-
|
679 |
-
|
680 |
-
|
681 |
-
|
682 |
-
|
683 |
-
|
684 |
-
|
685 |
-
|
686 |
-
|
687 |
-
|
688 |
-
|
689 |
-
|
690 |
-
|
691 |
-
|
692 |
-
|
693 |
-
|
694 |
-
|
695 |
-
|
696 |
-
|
697 |
-
|
698 |
-
|
699 |
-
|
700 |
-
|
701 |
-
|
702 |
-
|
703 |
-
|
704 |
-
|
705 |
-
|
706 |
-
|
707 |
-
|
708 |
-
|
709 |
-
|
710 |
-
|
711 |
-
|
712 |
-
|
713 |
-
|
714 |
-
|
715 |
-
|
716 |
-
|
717 |
-
|
718 |
-
|
719 |
-
|
720 |
-
|
721 |
-
|
722 |
-
|
723 |
-
|
724 |
-
|
725 |
-
|
726 |
-
|
727 |
-
|
728 |
-
|
729 |
-
|
730 |
-
|
731 |
-
|
732 |
-
|
733 |
-
|
734 |
-
|
735 |
-
|
736 |
-
|
737 |
-
|
738 |
-
|
739 |
-
|
740 |
-
|
741 |
-
|
742 |
-
|
743 |
-
|
744 |
-
|
745 |
-
|
746 |
-
|
747 |
-
|
748 |
-
|
749 |
-
|
750 |
-
|
751 |
-
|
752 |
-
|
753 |
-
|
754 |
-
|
755 |
-
|
756 |
-
|
757 |
-
|
758 |
-
|
759 |
-
|
760 |
-
|
761 |
-
|
762 |
-
|
763 |
-
|
764 |
-
|
765 |
-
|
766 |
-
|
767 |
-
|
768 |
-
|
769 |
-
|
770 |
-
|
771 |
-
|
772 |
-
|
773 |
-
|
774 |
-
|
775 |
-
|
776 |
-
|
777 |
-
|
778 |
-
|
779 |
-
|
780 |
-
|
781 |
-
|
782 |
-
|
783 |
-
|
784 |
-
|
785 |
-
|
786 |
-
|
787 |
-
|
788 |
-
|
789 |
-
|
790 |
-
|
791 |
-
|
792 |
-
|
793 |
-
|
794 |
-
|
795 |
-
|
796 |
-
|
797 |
-
|
798 |
-
|
799 |
-
|
800 |
-
|
801 |
-
|
802 |
-
|
803 |
-
|
804 |
-
|
805 |
-
|
806 |
-
|
807 |
-
|
808 |
-
|
809 |
-
|
810 |
-
|
811 |
-
|
812 |
-
|
813 |
-
|
814 |
-
|
815 |
-
|
816 |
-
|
817 |
-
|
818 |
-
|
819 |
-
|
820 |
-
|
821 |
-
|
822 |
-
|
823 |
-
|
824 |
-
|
825 |
-
|
826 |
-
|
827 |
-
|
828 |
-
|
829 |
-
|
830 |
-
|
831 |
-
|
832 |
-
|
833 |
-
|
834 |
-
|
835 |
-
|
836 |
-
|
837 |
-
|
838 |
-
|
839 |
-
|
840 |
-
|
841 |
-
|
842 |
-
|
843 |
-
|
844 |
-
|
845 |
-
|
846 |
-
|
847 |
-
|
848 |
-
|
849 |
-
|
850 |
-
|
851 |
-
|
852 |
-
|
853 |
-
|
854 |
-
* @private
|
855 |
-
*/
|
856 |
-
_removeElements: function () {
|
857 |
-
if (this.lens) {
|
858 |
-
this.lens.remove();
|
859 |
-
this.lens = null;
|
860 |
-
}
|
861 |
-
|
862 |
-
if (this.tint) {
|
863 |
-
this.tint.remove();
|
864 |
-
this.tint = null;
|
865 |
-
}
|
866 |
-
|
867 |
-
if (this.softFocus) {
|
868 |
-
this.softFocus.remove();
|
869 |
-
this.softFocus = null;
|
870 |
-
}
|
871 |
-
|
872 |
-
if (this.element.find('.yith_magnifier_loading').length > 0) {
|
873 |
-
this.element.find('.yith_magnifier_loading').remove();
|
874 |
-
}
|
875 |
-
},
|
876 |
-
|
877 |
-
/**
|
878 |
-
* Detect if user is using a phone device (eg iPhone)
|
879 |
-
*
|
880 |
-
* @private
|
881 |
-
*/
|
882 |
-
_isPhone: function () {
|
883 |
-
var userAgent = navigator.userAgent.toLowerCase();
|
884 |
-
|
885 |
-
return ( userAgent.match(/iphone/i) || userAgent.match(/ipod/i) || userAgent.match(/android/i) );
|
886 |
-
},
|
887 |
-
|
888 |
-
/**
|
889 |
-
* Destroy the instance
|
890 |
-
*
|
891 |
-
*/
|
892 |
-
destroy: function () {
|
893 |
-
if (this.zoom) {
|
894 |
-
this.zoom.unwrap();
|
895 |
-
}
|
896 |
-
|
897 |
-
if (this.mouseTrap) {
|
898 |
-
this.mouseTrap.unbind();
|
899 |
-
this.mouseTrap.remove();
|
900 |
-
this.mouseTrap = null;
|
901 |
-
}
|
902 |
-
|
903 |
-
if (this.zoomDiv) {
|
904 |
-
this.zoomDiv.remove();
|
905 |
-
this.zoomDiv = null;
|
906 |
-
}
|
907 |
-
|
908 |
-
if (this.options.disableRightClick) {
|
909 |
-
$(document).unbind();
|
910 |
-
}
|
911 |
-
|
912 |
-
this._removeElements();
|
913 |
-
this.options.elements.gallery.unbind();
|
914 |
-
this.element.removeData('yith_magnifier');
|
915 |
-
}
|
916 |
-
};
|
917 |
-
|
918 |
-
$.fn.yith_magnifier = function (options) {
|
919 |
-
|
920 |
-
if (typeof options === 'string') {
|
921 |
-
var args = Array.prototype.slice.call(arguments, 1);
|
922 |
-
|
923 |
-
this.each(function () {
|
924 |
-
var instance = $.data(this, 'yith_magnifier');
|
925 |
-
if (!instance) {
|
926 |
-
$.error("cannot call methods on yith_magnifier prior to initialization; " +
|
927 |
-
"attempted to call method '" + options + "'");
|
928 |
-
return;
|
929 |
-
}
|
930 |
-
if (!$.isFunction(instance[options]) || options.charAt(0) === "_") {
|
931 |
-
$.error("no such method '" + options + "' for yith_magnifier instance");
|
932 |
-
return;
|
933 |
-
}
|
934 |
-
instance[options].apply(instance, args);
|
935 |
-
});
|
936 |
-
} else {
|
937 |
-
this.each(function () {
|
938 |
-
var instance = $.data(this, 'yith_magnifier');
|
939 |
-
if (!instance) {
|
940 |
-
$.data(this, 'yith_magnifier', new $.yith_magnifier(options, this));
|
941 |
-
} else {
|
942 |
-
$.error('yith_magnifier already istantiated.');
|
943 |
-
}
|
944 |
-
});
|
945 |
-
}
|
946 |
-
return this;
|
947 |
-
};
|
948 |
-
|
949 |
-
|
950 |
-
})(window, jQuery);
|
1 |
+
/**
|
2 |
+
* YITH Magnifier
|
3 |
+
*
|
4 |
+
* @version 0.1
|
5 |
+
* @author Your Inspiration Themes Team <info@yithemes.com>
|
6 |
+
*
|
7 |
+
* MIT License.
|
8 |
+
*/
|
9 |
+
|
10 |
+
;
|
11 |
+
(function (window, $, undefined) {
|
12 |
+
'use strict';
|
13 |
+
|
14 |
+
//include imagesLoaded plugin
|
15 |
+
if ($.fn.imagesLoaded === undefined) {
|
16 |
+
/*!
|
17 |
+
* jQuery imagesLoaded plugin v2.1.1
|
18 |
+
* http://github.com/desandro/imagesloaded
|
19 |
+
*
|
20 |
+
* MIT License. by Paul Irish et al.
|
21 |
+
*/
|
22 |
+
|
23 |
+
/*jshint curly: true, eqeqeq: true, noempty: true, strict: true, undef: true, browser: true */
|
24 |
+
/*global jQuery: false */
|
25 |
+
|
26 |
+
;
|
27 |
+
(function ($, undefined) {
|
28 |
+
'use strict';
|
29 |
+
|
30 |
+
// blank image data-uri bypasses webkit log warning (thx doug jones)
|
31 |
+
var BLANK = 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==';
|
32 |
+
|
33 |
+
$.fn.imagesLoaded = function (callback) {
|
34 |
+
var $this = this,
|
35 |
+
deferred = $.isFunction($.Deferred) ? $.Deferred() : 0,
|
36 |
+
hasNotify = $.isFunction(deferred.notify),
|
37 |
+
$images = $this.find('img').add($this.filter('img')),
|
38 |
+
loaded = [],
|
39 |
+
proper = [],
|
40 |
+
broken = [];
|
41 |
+
|
42 |
+
// Register deferred callbacks
|
43 |
+
if ($.isPlainObject(callback)) {
|
44 |
+
$.each(callback, function (key, value) {
|
45 |
+
if (key === 'callback') {
|
46 |
+
callback = value;
|
47 |
+
} else if (deferred) {
|
48 |
+
deferred[key](value);
|
49 |
+
}
|
50 |
+
});
|
51 |
+
}
|
52 |
+
|
53 |
+
function doneLoading() {
|
54 |
+
var $proper = $(proper),
|
55 |
+
$broken = $(broken);
|
56 |
+
|
57 |
+
if (deferred) {
|
58 |
+
if (broken.length) {
|
59 |
+
deferred.reject($images, $proper, $broken);
|
60 |
+
} else {
|
61 |
+
deferred.resolve($images);
|
62 |
+
}
|
63 |
+
}
|
64 |
+
|
65 |
+
if ($.isFunction(callback)) {
|
66 |
+
callback.call($this, $images, $proper, $broken);
|
67 |
+
}
|
68 |
+
}
|
69 |
+
|
70 |
+
function imgLoadedHandler(event) {
|
71 |
+
imgLoaded(event.target, event.type === 'error');
|
72 |
+
}
|
73 |
+
|
74 |
+
function imgLoaded(img, isBroken) {
|
75 |
+
// don't proceed if BLANK image, or image is already loaded
|
76 |
+
if (img.src === BLANK || $.inArray(img, loaded) !== -1) {
|
77 |
+
return;
|
78 |
+
}
|
79 |
+
|
80 |
+
// store element in loaded images array
|
81 |
+
loaded.push(img);
|
82 |
+
|
83 |
+
// keep track of broken and properly loaded images
|
84 |
+
if (isBroken) {
|
85 |
+
broken.push(img);
|
86 |
+
} else {
|
87 |
+
proper.push(img);
|
88 |
+
}
|
89 |
+
|
90 |
+
// cache image and its state for future calls
|
91 |
+
$.data(img, 'imagesLoaded', {isBroken: isBroken, src: img.src});
|
92 |
+
|
93 |
+
// trigger deferred progress method if present
|
94 |
+
if (hasNotify) {
|
95 |
+
deferred.notifyWith($(img), [isBroken, $images, $(proper), $(broken)]);
|
96 |
+
}
|
97 |
+
|
98 |
+
// call doneLoading and clean listeners if all images are loaded
|
99 |
+
if ($images.length === loaded.length) {
|
100 |
+
setTimeout(doneLoading);
|
101 |
+
$images.unbind('.imagesLoaded', imgLoadedHandler);
|
102 |
+
}
|
103 |
+
}
|
104 |
+
|
105 |
+
// if no images, trigger immediately
|
106 |
+
if (!$images.length) {
|
107 |
+
doneLoading();
|
108 |
+
} else {
|
109 |
+
$images.bind('load.imagesLoaded error.imagesLoaded', imgLoadedHandler)
|
110 |
+
.each(function (i, el) {
|
111 |
+
var src = el.src;
|
112 |
+
|
113 |
+
// find out if this image has been already checked for status
|
114 |
+
// if it was, and src has not changed, call imgLoaded on it
|
115 |
+
var cached = $.data(el, 'imagesLoaded');
|
116 |
+
if (cached && cached.src === src) {
|
117 |
+
imgLoaded(el, cached.isBroken);
|
118 |
+
return;
|
119 |
+
}
|
120 |
+
|
121 |
+
// if complete is true and browser supports natural sizes, try
|
122 |
+
// to check for image status manually
|
123 |
+
if (el.complete && el.naturalWidth !== undefined) {
|
124 |
+
imgLoaded(el, el.naturalWidth === 0 || el.naturalHeight === 0);
|
125 |
+
return;
|
126 |
+
}
|
127 |
+
|
128 |
+
// cached images don't fire load sometimes, so we reset src, but only when
|
129 |
+
// dealing with IE, or image is complete (loaded) and failed manual check
|
130 |
+
// webkit hack from http://groups.google.com/group/jquery-dev/browse_thread/thread/eee6ab7b2da50e1f
|
131 |
+
if (el.readyState || el.complete) {
|
132 |
+
el.src = BLANK;
|
133 |
+
el.src = src;
|
134 |
+
}
|
135 |
+
});
|
136 |
+
}
|
137 |
+
|
138 |
+
return deferred ? deferred.promise($this) : $this;
|
139 |
+
};
|
140 |
+
|
141 |
+
})(jQuery);
|
142 |
+
}
|
143 |
+
|
144 |
+
$.yith_magnifier = function (options, element) {
|
145 |
+
this.t = element;
|
146 |
+
this.element = $(element);
|
147 |
+
this._init(options);
|
148 |
+
};
|
149 |
+
|
150 |
+
$.yith_magnifier.defaults = {
|
151 |
+
zoomWidth: 'auto',
|
152 |
+
zoomHeight: 'auto',
|
153 |
+
position: 'right',
|
154 |
+
tint: false,
|
155 |
+
tintOpacity: 0.5,
|
156 |
+
lensOpacity: 0.5,
|
157 |
+
softFocus: false,
|
158 |
+
smoothMove: 3,
|
159 |
+
showTitle: true,
|
160 |
+
titleOpacity: 0.5,
|
161 |
+
adjustX: 0,
|
162 |
+
adjustY: 0,
|
163 |
+
|
164 |
+
phoneBehavior: 'inside', //allowed values: inside, disable, default
|
165 |
+
loadingLabel: 'Loading...',
|
166 |
+
|
167 |
+
enableSlider: true,
|
168 |
+
slider: 'carouFredSel',
|
169 |
+
sliderOptions: {},
|
170 |
+
|
171 |
+
from_gallery : 'no',
|
172 |
+
|
173 |
+
onLoad: function () {
|
174 |
+
return false;
|
175 |
+
},
|
176 |
+
onEnter: function () {
|
177 |
+
return false
|
178 |
+
},
|
179 |
+
onLeave: function () {
|
180 |
+
return false
|
181 |
+
},
|
182 |
+
onMove: function () {
|
183 |
+
return false
|
184 |
+
},
|
185 |
+
onClick: function () {
|
186 |
+
return false;
|
187 |
+
},
|
188 |
+
|
189 |
+
elements: {
|
190 |
+
zoom: $('.yith_magnifier_zoom'),
|
191 |
+
zoomImage: $('.yith_magnifier_zoom img').first(),
|
192 |
+
gallery: $('.yith_magnifier_gallery li a')
|
193 |
+
}
|
194 |
+
};
|
195 |
+
|
196 |
+
$.yith_magnifier.prototype = {
|
197 |
+
/**
|
198 |
+
* Let's start the magnifier
|
199 |
+
*
|
200 |
+
* @param {Object} options
|
201 |
+
*
|
202 |
+
* @private
|
203 |
+
*/
|
204 |
+
_init: function (options) {
|
205 |
+
var self = this;
|
206 |
+
|
207 |
+
$(document).trigger('yith_magnifier_before_init');
|
208 |
+
|
209 |
+
$.each($.yith_magnifier.defaults.elements, function (i, v) {
|
210 |
+
var el = $.yith_magnifier.defaults.elements;
|
211 |
+
el[i] = $(v, self);
|
212 |
+
});
|
213 |
+
self.options = $.extend(true, {}, $.yith_magnifier.defaults, options);
|
214 |
+
self.isPhone = self._isPhone();
|
215 |
+
|
216 |
+
self._loading();
|
217 |
+
|
218 |
+
self.element.imagesLoaded(function () {
|
219 |
+
self.options.onLoad();
|
220 |
+
self._initZoom();
|
221 |
+
self._initGallery();
|
222 |
+
});
|
223 |
+
|
224 |
+
$(document).trigger('yith_magnifier_after_init');
|
225 |
+
},
|
226 |
+
|
227 |
+
|
228 |
+
/**
|
229 |
+
* Init gallery handlers
|
230 |
+
*
|
231 |
+
* @private
|
232 |
+
*
|
233 |
+
*/
|
234 |
+
_initGallery: function () {
|
235 |
+
var self = this;
|
236 |
+
var elements = self.options.elements;
|
237 |
+
|
238 |
+
var gallery = elements.gallery;
|
239 |
+
var zoom = elements.zoom;
|
240 |
+
var zoomImage = elements.zoomImage;
|
241 |
+
|
242 |
+
if (gallery.length > 0) {
|
243 |
+
gallery.on('click', function (e) {
|
244 |
+
e.preventDefault();
|
245 |
+
|
246 |
+
self.options.from_gallery = 'yes';
|
247 |
+
|
248 |
+
var t = $(this);
|
249 |
+
self.destroy();
|
250 |
+
|
251 |
+
zoom.attr('href', this.href);
|
252 |
+
zoomImage.attr('src', t.data('small'))
|
253 |
+
.attr('srcset', t.data('small'))
|
254 |
+
.attr('src-orig', t.data('small'))
|
255 |
+
.attr('title', '')
|
256 |
+
.attr('title', t.attr('title'));
|
257 |
+
|
258 |
+
$.data(self.t, 'yith_magnifier', new $.yith_magnifier(self.options, self.element));
|
259 |
+
});
|
260 |
+
|
261 |
+
//gallery.filter(':first').trigger('click');
|
262 |
+
|
263 |
+
if (self.options.enableSlider) {
|
264 |
+
gallery.closest('ul').trigger('yith_magnifier_slider_destroy');
|
265 |
+
gallery.closest('ul')[self.options.slider](self.options.sliderOptions);
|
266 |
+
}
|
267 |
+
|
268 |
+
} else {
|
269 |
+
gallery.on('click', function (e) {
|
270 |
+
e.preventDefault();
|
271 |
+
return false;
|
272 |
+
})
|
273 |
+
}
|
274 |
+
},
|
275 |
+
|
276 |
+
/**
|
277 |
+
* Show a loading icon while image isn't properly loaded
|
278 |
+
*
|
279 |
+
* @private
|
280 |
+
*/
|
281 |
+
_loading: function () {
|
282 |
+
if (this.options.disableRightClick) {
|
283 |
+
$(document).on('contextmenu', function (e) {
|
284 |
+
return false;
|
285 |
+
});
|
286 |
+
}
|
287 |
+
|
288 |
+
if (this.mouseTrap === undefined) {
|
289 |
+
var w = this.options.elements.zoom.width();
|
290 |
+
|
291 |
+
if (this.options.loadingLabel) {
|
292 |
+
$('<div class="yith_magnifier_loading">' + this.options.loadingLabel + '</div>').css({
|
293 |
+
'width': w,
|
294 |
+
'text-align': 'center',
|
295 |
+
opacity: .5
|
296 |
+
}).appendTo(this.options.elements.zoom.parent());
|
297 |
+
}
|
298 |
+
}
|
299 |
+
},
|
300 |
+
|
301 |
+
/**
|
302 |
+
* Initialize the zoom images
|
303 |
+
*
|
304 |
+
* @private
|
305 |
+
*/
|
306 |
+
_initZoom: function () {
|
307 |
+
var self = this;
|
308 |
+
|
309 |
+
self.zoom = self.options.elements.zoom;
|
310 |
+
self.zoomImage = self.options.elements.zoomImage;
|
311 |
+
|
312 |
+
//wrap the zoom image with a div
|
313 |
+
var zoom_wrap_css_class = "yith_magnifier_zoom_wrap";
|
314 |
+
|
315 |
+
|
316 |
+
if (self.options.zoom_wrap_additional_css) {
|
317 |
+
if ( !$('.' + zoom_wrap_css_class).length ) {
|
318 |
+
|
319 |
+
zoom_wrap_css_class += " " + self.options.zoom_wrap_additional_css;
|
320 |
+
}
|
321 |
+
}
|
322 |
+
|
323 |
+
self.zoom.wrap('<div class="' + zoom_wrap_css_class + '"></div>');
|
324 |
+
|
325 |
+
self.IMG_zoomImage = new Image();
|
326 |
+
|
327 |
+
var product_id = $( '.woocommerce-variation-add-to-cart .variation_id' ).val();
|
328 |
+
if ( $.isNumeric( product_id ) && product_id != 0 && self.options.from_gallery == 'no' ){
|
329 |
+
|
330 |
+
var data = {
|
331 |
+
action : 'yith_wc_zoom_magnifier_get_main_image',
|
332 |
+
product_id : product_id,
|
333 |
+
context : 'frontend'
|
334 |
+
}
|
335 |
+
|
336 |
+
$.ajax({
|
337 |
+
data : data,
|
338 |
+
url : yith_wc_zoom_magnifier_storage_object.ajax_url,
|
339 |
+
type : 'post',
|
340 |
+
error : function ( response ) {
|
341 |
+
console.log( 'ERROR - Yith_WC_Zoom_Magnifier' );
|
342 |
+
console.log( response );
|
343 |
+
},
|
344 |
+
success : function ( response ) {
|
345 |
+
self.IMG_zoomImage.src = response.url;
|
346 |
+
|
347 |
+
self.IMG_smallImage = new Image();
|
348 |
+
self.IMG_smallImage.src = self.zoomImage.attr('src');
|
349 |
+
|
350 |
+
// set new gallery
|
351 |
+
if( response.gallery ) {
|
352 |
+
|
353 |
+
if ($('.yith_magnifier_gallery').length)
|
354 |
+
$('.yith_magnifier_gallery').closest('.thumbnails').replaceWith( response.gallery );
|
355 |
+
else
|
356 |
+
$( '.images').append( response.gallery );
|
357 |
+
|
358 |
+
self.options.elements.gallery = $('.yith_magnifier_gallery li a' );
|
359 |
+
}
|
360 |
+
|
361 |
+
if ($.browser && $.browser.msie && $.browser.version == 8) {
|
362 |
+
$(self.IMG_zoomImage).load(function () {
|
363 |
+
self._initGallery();
|
364 |
+
self._initTrap();
|
365 |
+
});
|
366 |
+
} else {
|
367 |
+
|
368 |
+
$([self.IMG_zoomImage, self.IMG_smallImage]).imagesLoaded(function () {
|
369 |
+
self._initGallery();
|
370 |
+
self._initTrap();
|
371 |
+
});
|
372 |
+
}
|
373 |
+
|
374 |
+
$(document).trigger('yith_magnifier_after_init_zoom');
|
375 |
+
|
376 |
+
}
|
377 |
+
});
|
378 |
+
|
379 |
+
}
|
380 |
+
else{
|
381 |
+
self.IMG_zoomImage.src = self.zoom.attr('href');
|
382 |
+
|
383 |
+
self.IMG_smallImage = new Image();
|
384 |
+
self.IMG_smallImage.src = self.zoomImage.attr('src');
|
385 |
+
|
386 |
+
if ($.browser && $.browser.msie && $.browser.version == 8) {
|
387 |
+
$(self.IMG_zoomImage).load(function () {
|
388 |
+
|
389 |
+
self._initTrap();
|
390 |
+
});
|
391 |
+
} else {
|
392 |
+
|
393 |
+
$([self.IMG_zoomImage, self.IMG_smallImage]).imagesLoaded(function () {
|
394 |
+
|
395 |
+
self._initTrap();
|
396 |
+
});
|
397 |
+
}
|
398 |
+
|
399 |
+
$(document).trigger('yith_magnifier_after_init_zoom')
|
400 |
+
|
401 |
+
}
|
402 |
+
|
403 |
+
},
|
404 |
+
|
405 |
+
/**
|
406 |
+
* Create the mouse trap
|
407 |
+
*
|
408 |
+
* @private
|
409 |
+
*/
|
410 |
+
_initTrap: function () {
|
411 |
+
var self = this;
|
412 |
+
var zoomImg = self.IMG_zoomImage,
|
413 |
+
thumbImg = self.IMG_smallImage;
|
414 |
+
|
415 |
+
self.mx = 0;
|
416 |
+
self.my = 0;
|
417 |
+
self.controlTimer = 0;
|
418 |
+
self.lens = null;
|
419 |
+
self.tint = null;
|
420 |
+
self.softFocus = null;
|
421 |
+
self.zoomDiv = null;
|
422 |
+
self.cw = 0;
|
423 |
+
self.ch = 0;
|
424 |
+
self.zw = 0;
|
425 |
+
self.destU = 0;
|
426 |
+
self.destV = 0;
|
427 |
+
self.currU = 0;
|
428 |
+
self.currV = 0;
|
429 |
+
self.mouseTrap = null;
|
430 |
+
|
431 |
+
var zoom = self.options.elements.zoom;
|
432 |
+
var zoomImage = self.options.elements.zoomImage;
|
433 |
+
|
434 |
+
//remove loading div
|
435 |
+
//this.zoom.parent().siblings('.yith_magnifier_loading').remove();
|
436 |
+
$('.yith_magnifier_loading').remove();
|
437 |
+
|
438 |
+
if (this.element.find('.yith_magnifier_mousetrap')) {
|
439 |
+
this.element.find('.yith_magnifier_mousetrap').remove();
|
440 |
+
}
|
441 |
+
|
442 |
+
this.mouseTrap = $('<div class="yith_magnifier_mousetrap" />').css({
|
443 |
+
width: '100%', //zoomImage.outerWidth(),
|
444 |
+
height: '100%', //zoomImage.outerHeight(),
|
445 |
+
top: 0,
|
446 |
+
left: 0
|
447 |
+
}).appendTo(zoom.parent());
|
448 |
+
|
449 |
+
// Detect device type, normal mouse or touchy(ipad android) by albanx
|
450 |
+
var touchy = ("ontouchstart" in document.documentElement) ? true : false;
|
451 |
+
var event_move = 'touchmove mousemove';
|
452 |
+
var event_end = 'touchend mouseleave';
|
453 |
+
var event_ent = 'touchstart mouseenter';
|
454 |
+
var event_click = 'touchstart click';
|
455 |
+
|
456 |
+
this.mouseTrap.on(event_move, this, function (e) {
|
457 |
+
self.options.onMove();
|
458 |
+
|
459 |
+
self.mx = ( typeof(e.originalEvent.touches) != 'undefined' ) ? e.originalEvent.touches[0].pageX : e.pageX;
|
460 |
+
self.my = ( typeof(e.originalEvent.touches) != 'undefined' ) ? e.originalEvent.touches[0].pageY : e.pageY;
|
461 |
+
|
462 |
+
}).on(event_end, this, function (e) {
|
463 |
+
|
464 |
+
clearTimeout(self.controlTimer);
|
465 |
+
//event.data.removeBits();
|
466 |
+
if (self.lens) {
|
467 |
+
self.lens.fadeOut(299);
|
468 |
+
}
|
469 |
+
if (self.tint) {
|
470 |
+
self.tint.fadeOut(299);
|
471 |
+
}
|
472 |
+
if (self.softFocus) {
|
473 |
+
self.softFocus.fadeOut(299);
|
474 |
+
}
|
475 |
+
self.zoomDiv.fadeOut(300, function () {
|
476 |
+
self._onLeave();
|
477 |
+
});
|
478 |
+
|
479 |
+
return false;
|
480 |
+
|
481 |
+
}).on(event_click, this, function (e) {
|
482 |
+
self.options.onClick();
|
483 |
+
}).on(event_ent, this, function (e) {
|
484 |
+
self.options.onEnter();
|
485 |
+
|
486 |
+
if (touchy) {
|
487 |
+
e.preventDefault();
|
488 |
+
}
|
489 |
+
|
490 |
+
self.mx = ( typeof(e.originalEvent.touches) != 'undefined' ) ? e.originalEvent.touches[0].pageX : e.pageX;
|
491 |
+
self.my = ( typeof(e.originalEvent.touches) != 'undefined' ) ? e.originalEvent.touches[0].pageY : e.pageY;
|
492 |
+
|
493 |
+
self.zw = e.data;
|
494 |
+
if (self.zoomDiv) {
|
495 |
+
self.zoomDiv.stop(true, false);
|
496 |
+
self.zoomDiv.remove();
|
497 |
+
}
|
498 |
+
|
499 |
+
var xPos = self.options.adjustX,
|
500 |
+
yPos = self.options.adjustY;
|
501 |
+
|
502 |
+
var siw = zoomImage.outerWidth();
|
503 |
+
var sih = zoomImage.outerHeight();
|
504 |
+
|
505 |
+
var w = self.options.zoomWidth;
|
506 |
+
var h = self.options.zoomHeight;
|
507 |
+
|
508 |
+
if (self.options.zoomWidth == 'auto') {
|
509 |
+
w = siw;
|
510 |
+
}
|
511 |
+
|
512 |
+
if (self.options.zoomHeight == 'auto') {
|
513 |
+
h = sih;
|
514 |
+
}
|
515 |
+
|
516 |
+
var appendTo = zoom.parent();
|
517 |
+
switch (self.options.position) {
|
518 |
+
case 'top':
|
519 |
+
yPos -= h;
|
520 |
+
break;
|
521 |
+
case 'right':
|
522 |
+
xPos += siw;
|
523 |
+
break;
|
524 |
+
case 'bottom':
|
525 |
+
yPos += sih;
|
526 |
+
break;
|
527 |
+
case 'left':
|
528 |
+
xPos -= w;
|
529 |
+
break;
|
530 |
+
case 'inside':
|
531 |
+
w = siw;
|
532 |
+
h = sih;
|
533 |
+
break;
|
534 |
+
|
535 |
+
// All other values, try and find an id in the dom to attach to.
|
536 |
+
default:
|
537 |
+
appendTo = $('#' + self.options.position);
|
538 |
+
// If dom element doesn't exit, just use 'right' position as default.
|
539 |
+
if (!appendTo.length) {
|
540 |
+
appendTo = zoom;
|
541 |
+
xPos += siw; //+ opts.adjustX;
|
542 |
+
yPos += sih; // + opts.adjustY;
|
543 |
+
} else {
|
544 |
+
w = appendTo.innerWidth();
|
545 |
+
h = appendTo.innerHeight();
|
546 |
+
}
|
547 |
+
}
|
548 |
+
|
549 |
+
if (self.isPhone && self.options.phoneBehavior == 'inside') {
|
550 |
+
w = siw;
|
551 |
+
h = sih;
|
552 |
+
xPos = 0;
|
553 |
+
yPos = 0;
|
554 |
+
}
|
555 |
+
|
556 |
+
self.zoomDiv = $('<div class="yith_magnifier_zoom_magnifier" />').css({
|
557 |
+
left: xPos,
|
558 |
+
top: yPos,
|
559 |
+
width: w,
|
560 |
+
height: h,
|
561 |
+
'background-repeat': 'no-repeat',
|
562 |
+
backgroundImage: 'url(' + zoomImg.src + ')'
|
563 |
+
}).appendTo(appendTo);
|
564 |
+
|
565 |
+
// Add the title from title tag.
|
566 |
+
if (zoomImage.attr('title') && self.options.showTitle) {
|
567 |
+
$('<div class="yith_magnifier_title">' + zoomImage.attr('title') + '</div>').appendTo(self.zoomDiv);
|
568 |
+
}
|
569 |
+
|
570 |
+
if (self.isPhone) {
|
571 |
+
if (self.options.phoneBehavior != 'disable') {
|
572 |
+
self.zoomDiv.fadeIn(500);
|
573 |
+
} else {
|
574 |
+
self.lens.fadeOut(299);
|
575 |
+
}
|
576 |
+
} else {
|
577 |
+
self.zoomDiv.fadeIn(500);
|
578 |
+
}
|
579 |
+
|
580 |
+
if (self.lens) {
|
581 |
+
self.lens.remove();
|
582 |
+
self.lens = null;
|
583 |
+
}
|
584 |
+
|
585 |
+
if (zoomImg.width <= 1) {
|
586 |
+
self.cw = (zoomImage.outerWidth() / zoomImg.naturalWidth) * self.zoomDiv.width();
|
587 |
+
} else {
|
588 |
+
self.cw = (zoomImage.outerWidth() / zoomImg.width) * self.zoomDiv.width();
|
589 |
+
}
|
590 |
+
|
591 |
+
if (zoomImg.height <= 1) {
|
592 |
+
self.ch = (zoomImage.outerHeight() / zoomImg.naturalHeight) * self.zoomDiv.height();
|
593 |
+
} else {
|
594 |
+
self.ch = (zoomImage.outerHeight() / zoomImg.height) * self.zoomDiv.height();
|
595 |
+
}
|
596 |
+
|
597 |
+
// Attach mouse, initially invisible to prevent first frame glitch
|
598 |
+
self.lens = $('<div class="yith_magnifier_lens" />').css({
|
599 |
+
width: self.cw,
|
600 |
+
height: self.ch
|
601 |
+
}).appendTo(zoom);
|
602 |
+
|
603 |
+
self.mouseTrap.css('cursor', self.lens.css('cursor'));
|
604 |
+
|
605 |
+
var noTrans = false;
|
606 |
+
|
607 |
+
|
608 |
+
// Init tint layer if needed. (Not relevant if using inside mode)
|
609 |
+
if (self.options.tint) {
|
610 |
+
//self.lens.css('background', 'url("' + zoomImage.attr('src') + '")');
|
611 |
+
self.tint = $('<div />').css({
|
612 |
+
display: 'none',
|
613 |
+
position: 'absolute',
|
614 |
+
left: 0,
|
615 |
+
top: 0,
|
616 |
+
width: zoomImage.outerWidth(),
|
617 |
+
height: zoomImage.outerHeight(),
|
618 |
+
backgroundColor: self.options.tint,
|
619 |
+
opacity: self.options.tintOpacity
|
620 |
+
}).appendTo(zoom);
|
621 |
+
|
622 |
+
|
623 |
+
self.lens.append($('<img />', {
|
624 |
+
src: zoomImage.attr('src')
|
625 |
+
}));
|
626 |
+
|
627 |
+
noTrans = true;
|
628 |
+
self.tint.fadeIn(500);
|
629 |
+
}
|
630 |
+
|
631 |
+
if (self.options.softFocus) {
|
632 |
+
//self.lens.css('background', 'url("' + zoomImage.attr('src') + '")');
|
633 |
+
self.softFocus = $('<div />').css({
|
634 |
+
position: 'absolute',
|
635 |
+
display: 'none',
|
636 |
+
top: '1px',
|
637 |
+
left: '1px',
|
638 |
+
width: zoomImage.outerWidth(),
|
639 |
+
height: zoomImage.outerHeight(),
|
640 |
+
//background: 'url("' + zoomImage.attr('src') + '")',
|
641 |
+
//backgroundSize: '100%',
|
642 |
+
opacity: .5
|
643 |
+
}).appendTo(zoom);
|
644 |
+
|
645 |
+
self.softFocus.append($('<img />', {
|
646 |
+
src: zoomImage.attr('src')
|
647 |
+
}));
|
648 |
+
|
649 |
+
if (self.lens.find('img').length == 0) {
|
650 |
+
self.lens.append($('<img />', {
|
651 |
+
src: zoomImage.attr('src')
|
652 |
+
}));
|
653 |
+
}
|
654 |
+
|
655 |
+
noTrans = true;
|
656 |
+
self.softFocus.fadeIn(500);
|
657 |
+
}
|
658 |
+
|
659 |
+
|
660 |
+
if (!noTrans) {
|
661 |
+
self.lens.css('opacity', self.options.lensOpacity);
|
662 |
+
}
|
663 |
+
if (self.options.position !== 'inside') {
|
664 |
+
self.lens.fadeIn(500);
|
665 |
+
}
|
666 |
+
|
667 |
+
// Start processing.
|
668 |
+
self.zw._controlLoop();
|
669 |
+
|
670 |
+
return; // Don't return false here otherwise opera will not detect change of the mouse pointer type.
|
671 |
+
});
|
672 |
+
},
|
673 |
+
|
674 |
+
/**
|
675 |
+
*
|
676 |
+
*
|
677 |
+
* @private
|
678 |
+
*/
|
679 |
+
_controlLoop: function () {
|
680 |
+
var self = this;
|
681 |
+
|
682 |
+
if (this.lens) {
|
683 |
+
var x = (this.mx - this.zoomImage.offset().left - (this.cw * 0.5)) >> 0;
|
684 |
+
var y = (this.my - this.zoomImage.offset().top - (this.ch * 0.5)) >> 0;
|
685 |
+
|
686 |
+
if (x < 0) {
|
687 |
+
x = 0;
|
688 |
+
} else if (x > (this.zoomImage.outerWidth() - this.cw)) {
|
689 |
+
x = (this.zoomImage.outerWidth() - this.cw);
|
690 |
+
}
|
691 |
+
|
692 |
+
if (y < 0) {
|
693 |
+
y = 0;
|
694 |
+
} else if (y > (this.zoomImage.outerHeight() - this.ch)) {
|
695 |
+
y = (this.zoomImage.outerHeight() - this.ch);
|
696 |
+
}
|
697 |
+
|
698 |
+
this.lens.css({
|
699 |
+
left: x - 2,
|
700 |
+
top: y - 1
|
701 |
+
});
|
702 |
+
|
703 |
+
//this.lens.css('background-position', (-x) + 'px ' + (-y) + 'px');
|
704 |
+
|
705 |
+
|
706 |
+
this.lens.find('img').css({
|
707 |
+
width: this.zoomImage.outerWidth(),
|
708 |
+
height: this.zoomImage.outerHeight(),
|
709 |
+
marginLeft: (-x) + 'px ',
|
710 |
+
marginTop: (-y) + 'px'
|
711 |
+
});
|
712 |
+
|
713 |
+
|
714 |
+
if (this.IMG_zoomImage.width <= 1) {
|
715 |
+
this.destU = (((x) / this.zoomImage.outerWidth()) * this.IMG_zoomImage.naturalWidth) >> 0;
|
716 |
+
} else {
|
717 |
+
this.destU = (((x) / this.zoomImage.outerWidth()) * this.IMG_zoomImage.width) >> 0;
|
718 |
+
}
|
719 |
+
|
720 |
+
if (this.IMG_zoomImage.height <= 1) {
|
721 |
+
this.destV = (((y) / this.zoomImage.outerHeight()) * this.IMG_zoomImage.naturalHeight) >> 0;
|
722 |
+
} else {
|
723 |
+
this.destV = (((y) / this.zoomImage.outerHeight()) * this.IMG_zoomImage.height) >> 0;
|
724 |
+
}
|
725 |
+
|
726 |
+
|
727 |
+
this.currU += (this.destU - this.currU) / this.options.smoothMove;
|
728 |
+
this.currV += (this.destV - this.currV) / this.options.smoothMove;
|
729 |
+
|
730 |
+
this.zoomDiv.css('background-position', (-(this.currU >> 0) + 'px ') + (-(this.currV >> 0) + 'px'));
|
731 |
+
}
|
732 |
+
|
733 |
+
this.controlTimer = setTimeout(function () {
|
734 |
+
self._controlLoop();
|
735 |
+
}, 30);
|
736 |
+
},
|
737 |
+
|
738 |
+
/**
|
739 |
+
* This method is called when the mouse leave the image
|
740 |
+
*
|
741 |
+
* @private
|
742 |
+
*/
|
743 |
+
_onLeave: function () {
|
744 |
+
this.options.onLeave();
|
745 |
+
|
746 |
+
if (this.zoomDiv) {
|
747 |
+
this.zoomDiv.remove();
|
748 |
+
this.zoomDiv = null;
|
749 |
+
}
|
750 |
+
|
751 |
+
this._removeElements();
|
752 |
+
},
|
753 |
+
|
754 |
+
/**
|
755 |
+
* Remove lens, tint and softfocus
|
756 |
+
*
|
757 |
+
* @private
|
758 |
+
*/
|
759 |
+
_removeElements: function () {
|
760 |
+
if (this.lens) {
|
761 |
+
this.lens.remove();
|
762 |
+
this.lens = null;
|
763 |
+
}
|
764 |
+
|
765 |
+
if (this.tint) {
|
766 |
+
this.tint.remove();
|
767 |
+
this.tint = null;
|
768 |
+
}
|
769 |
+
|
770 |
+
if (this.softFocus) {
|
771 |
+
this.softFocus.remove();
|
772 |
+
this.softFocus = null;
|
773 |
+
}
|
774 |
+
|
775 |
+
if (this.element.find('.yith_magnifier_loading').length > 0) {
|
776 |
+
this.element.find('.yith_magnifier_loading').remove();
|
777 |
+
}
|
778 |
+
},
|
779 |
+
|
780 |
+
/**
|
781 |
+
* Detect if user is using a phone device (eg iPhone)
|
782 |
+
*
|
783 |
+
* @private
|
784 |
+
*/
|
785 |
+
_isPhone: function () {
|
786 |
+
var userAgent = navigator.userAgent.toLowerCase();
|
787 |
+
|
788 |
+
return ( userAgent.match(/iphone/i) || userAgent.match(/ipod/i) || userAgent.match(/android/i) );
|
789 |
+
},
|
790 |
+
|
791 |
+
/**
|
792 |
+
* Destroy the instance
|
793 |
+
*
|
794 |
+
*/
|
795 |
+
destroy: function () {
|
796 |
+
if (this.zoom) {
|
797 |
+
this.zoom.unwrap();
|
798 |
+
}
|
799 |
+
|
800 |
+
if (this.mouseTrap) {
|
801 |
+
this.mouseTrap.unbind();
|
802 |
+
this.mouseTrap.remove();
|
803 |
+
this.mouseTrap = null;
|
804 |
+
}
|
805 |
+
|
806 |
+
if (this.zoomDiv) {
|
807 |
+
this.zoomDiv.remove();
|
808 |
+
this.zoomDiv = null;
|
809 |
+
}
|
810 |
+
|
811 |
+
if (this.options.disableRightClick) {
|
812 |
+
$(document).unbind();
|
813 |
+
}
|
814 |
+
|
815 |
+
this._removeElements();
|
816 |
+
this.options.elements.gallery.unbind();
|
817 |
+
this.element.removeData('yith_magnifier');
|
818 |
+
}
|
819 |
+
};
|
820 |
+
|
821 |
+
$.fn.yith_magnifier = function (options) {
|
822 |
+
|
823 |
+
if (typeof options === 'string') {
|
824 |
+
var args = Array.prototype.slice.call(arguments, 1);
|
825 |
+
|
826 |
+
this.each(function () {
|
827 |
+
var instance = $.data(this, 'yith_magnifier');
|
828 |
+
if (!instance) {
|
829 |
+
$.error("cannot call methods on yith_magnifier prior to initialization; " +
|
830 |
+
"attempted to call method '" + options + "'");
|
831 |
+
return;
|
832 |
+
}
|
833 |
+
if (!$.isFunction(instance[options]) || options.charAt(0) === "_") {
|
834 |
+
$.error("no such method '" + options + "' for yith_magnifier instance");
|
835 |
+
return;
|
836 |
+
}
|
837 |
+
instance[options].apply(instance, args);
|
838 |
+
});
|
839 |
+
} else {
|
840 |
+
this.each(function () {
|
841 |
+
var instance = $.data(this, 'yith_magnifier');
|
842 |
+
if (!instance) {
|
843 |
+
$.data(this, 'yith_magnifier', new $.yith_magnifier(options, this));
|
844 |
+
} else {
|
845 |
+
$.error('yith_magnifier already istantiated.');
|
846 |
+
}
|
847 |
+
});
|
848 |
+
}
|
849 |
+
return this;
|
850 |
+
};
|
851 |
+
|
852 |
+
|
853 |
+
})(window, jQuery);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/yith_magnifier.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
!function(t,i,o){"use strict";void 0===i.fn.imagesLoaded&&function(t,i){var o="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==";t.fn.imagesLoaded=function(i){var e=this,n=t.isFunction(t.Deferred)?t.Deferred():0,a=t.isFunction(n.notify),s=e.find("img").add(e.filter("img")),r=[],m=[],h=[];function l(){var o=t(m),a=t(h);n&&(h.length?n.reject(s,o,a):n.resolve(s)),t.isFunction(i)&&i.call(e,s,o,a)}function c(t){d(t.target,"error"===t.type)}function d(i,e){i.src!==o&&-1===t.inArray(i,r)&&(r.push(i),e?h.push(i):m.push(i),t.data(i,"imagesLoaded",{isBroken:e,src:i.src}),a&&n.notifyWith(t(i),[e,s,t(m),t(h)]),r.length&&(setTimeout(l),s.unbind(".imagesLoaded",c)))}return t.isPlainObject(i)&&t.each(i,function(t,o){"callback"===t?i=o:n&&n[t](o)}),s.length?s.bind("load.imagesLoaded error.imagesLoaded",c).each(function(i,e){var n=e.src,a=t.data(e,"imagesLoaded");a&&a.src===n?d(e,a.isBroken):e.complete&&void 0!==e.naturalWidth?d(e,0===e.naturalWidth||0===e.naturalHeight):(e.readyState||e.complete)&&(e.src=o,e.src=n)}):l(),n?n.promise(e):e}}(jQuery),i.yith_magnifier=function(t,o){this.t=o,this.element=i(o),this._init(t)},i.yith_magnifier.defaults={zoomWidth:"auto",zoomHeight:"auto",position:"right",tint:!1,tintOpacity:.5,lensOpacity:.5,softFocus:!1,smoothMove:3,showTitle:!0,titleOpacity:.5,adjustX:0,adjustY:0,phoneBehavior:"inside",loadingLabel:"Loading...",enableSlider:!0,slider:"carouFredSel",sliderOptions:{},from_gallery:"no",onLoad:function(){return!1},onEnter:function(){return!1},onLeave:function(){return!1},onMove:function(){return!1},onClick:function(){return!1},elements:{zoom:i(".yith_magnifier_zoom"),zoomImage:i(".yith_magnifier_zoom img").first(),gallery:i(".yith_magnifier_gallery li a")}},i.yith_magnifier.prototype={_init:function(t){var o=this;i(document).trigger("yith_magnifier_before_init"),i.each(i.yith_magnifier.defaults.elements,function(t,e){i.yith_magnifier.defaults.elements[t]=i(e,o)}),o.options=i.extend(!0,{},i.yith_magnifier.defaults,t),o.isPhone=o._isPhone(),o._loading(),o.element.imagesLoaded(function(){o.options.onLoad(),o._initZoom(),o._initGallery()}),i(document).trigger("yith_magnifier_after_init")},_initGallery:function(){var t=this,o=t.options.elements,e=o.gallery,n=o.zoom,a=o.zoomImage;e.length>0?(e.on("click",function(o){if(o.preventDefault(),o.stopImmediatePropagation(),"free"==i("#yith_wczm_traffic_light").val()){i("#yith_wczm_traffic_light").val("blocked"),t.options.from_gallery="yes";var e=i(this);t.destroy(),n.attr("href",this.href),a.attr("src",e.data("small")).attr("srcset",e.data("small")).attr("src-orig",e.data("small")).attr("title","").attr("title",e.attr("title")),i.data(t.t,"yith_magnifier",new i.yith_magnifier(t.options,t.element)),i("#yith_wczm_traffic_light").val("free")}}),t.options.enableSlider&&e.closest("ul").trigger("yith_magnifier_slider_destroy")):e.on("click",function(t){return t.preventDefault(),!1})},_loading:function(){if(this.options.disableRightClick&&i(document).on("contextmenu",function(t){return!1}),void 0===this.mouseTrap){var t=this.options.elements.zoom.width();this.options.loadingLabel&&i('<div class="yith_magnifier_loading">'+this.options.loadingLabel+"</div>").css({width:t,"text-align":"center",opacity:.5}).appendTo(this.options.elements.zoom.parent())}},_initZoom:function(){if("free"==i("#yith_wczm_traffic_light").val()){i("#yith_wczm_traffic_light").val("blocked");var t=this;t.zoom=t.options.elements.zoom,t.zoomImage=t.options.elements.zoomImage;var o="yith_magnifier_zoom_wrap";if(t.options.zoom_wrap_additional_css){if(i("."+o).length)return;o+=" "+t.options.zoom_wrap_additional_css}t.zoom.wrap('<div class="'+o+'"></div>'),t.IMG_zoomImage=new Image;var e=i(".woocommerce-variation-add-to-cart .variation_id").val();if(i.isNumeric(e)&&0!=e&&"no"==t.options.from_gallery&&"1"==yith_wc_zoom_magnifier_storage_object.zoom_condition){var n={action:"yith_wc_zoom_magnifier_get_main_image",product_id:e,context:"frontend"};i.ajax({data:n,url:yith_wc_zoom_magnifier_storage_object.ajax_url,type:"post",error:function(t){console.log("ERROR - Yith_WC_Zoom_Magnifier"),console.log(t),i("#yith_wczm_traffic_light").val("free")},success:function(o){t.zoom.attr("href",o.url),t.IMG_zoomImage.src=o.url,t.IMG_smallImage=new Image,t.IMG_smallImage.src=t.zoomImage.attr("src"),o.gallery&&(i(".yith_magnifier_gallery").length?i(".yith_magnifier_gallery").closest(".thumbnails").replaceWith(o.gallery):i(".images").append(o.gallery),t.options.elements.gallery=i(".yith_magnifier_gallery li a")),i.browser&&i.browser.msie&&8==i.browser.version?i(t.IMG_zoomImage).load(function(){t._initGallery(),t._initTrap()}):i([t.IMG_zoomImage,t.IMG_smallImage]).imagesLoaded(function(){t._initGallery(),t._initTrap()}),i(document).on("click","a.yith_expand",function(o){o.preventDefault(),i().prettyPhoto({social_tools:!1,theme:"pp_woocommerce",horizontal_padding:20,opacity:.8,deeplinking:!1,callback:function(){i(".yith_expand").css("display","inline")}}),i.prettyPhoto.open(t.zoom[0].href,"",""),i(".yith_expand").css("display","none"),i(".pp_woocommerce .ppt").css({height:0,marginBottom:0})}),i(document).trigger("yith_magnifier_after_init_zoom"),i("#yith_wczm_traffic_light").val("free")}})}else t.IMG_zoomImage.src=t.zoom.attr("href"),t.IMG_smallImage=new Image,t.IMG_smallImage.src=t.zoomImage.attr("src"),i.browser&&i.browser.msie&&8==i.browser.version?i(t.IMG_zoomImage).load(function(){t._initTrap()}):i([t.IMG_zoomImage,t.IMG_smallImage]).imagesLoaded(function(){t._initTrap()}),i(document).on("click","a.yith_expand",function(o){o.preventDefault(),i().prettyPhoto({social_tools:!1,theme:"pp_woocommerce",horizontal_padding:20,opacity:.8,deeplinking:!1,callback:function(){i(".yith_expand").css("display","inline")}}),i.prettyPhoto.open(t.zoom[0].href,"",""),i(".yith_expand").css("display","none"),i(".pp_woocommerce .ppt").css({height:0,marginBottom:0})}),i(document).trigger("yith_magnifier_after_init_zoom"),i("#yith_wczm_traffic_light").val("free")}},_initTrap:function(){var t=this,o=t.IMG_zoomImage;t.IMG_smallImage;t.mx=0,t.my=0,t.controlTimer=0,t.lens=null,t.tint=null,t.softFocus=null,t.zoomDiv=null,t.cw=0,t.ch=0,t.zw=0,t.destU=0,t.destV=0,t.currU=0,t.currV=0,t.mouseTrap=null;var e=t.options.elements.zoom,n=t.options.elements.zoomImage;if(i(".yith_magnifier_loading").remove(),this.element.find(".yith_magnifier_mousetrap")&&this.element.find(".yith_magnifier_mousetrap").remove(),this.mouseTrap=i('<div class="yith_magnifier_mousetrap pp_woocommerce" />').css({width:"100%",height:"100%",top:0,left:0}).appendTo(e.parent()),"undefined"!=typeof ywzm_data&&i('<a href="#" class="yith_expand" title="'+ywzm_data.expand_label+'" style="display: inline;">Expand</a>').appendTo(this.mouseTrap),!t.isPhone||"disable"!=t.options.phoneBehavior){var a="ontouchstart"in document.documentElement;this.mouseTrap.on("touchmove mousemove",this,function(i){t.options.onMove(),t.mx=void 0!==i.originalEvent.touches?i.originalEvent.touches[0].pageX:i.pageX,t.my=void 0!==i.originalEvent.touches?i.originalEvent.touches[0].pageY:i.pageY}).on("touchend mouseleave",this,function(i){return clearTimeout(t.controlTimer),t.lens&&t.lens.fadeOut(299),t.tint&&t.tint.fadeOut(299),t.softFocus&&t.softFocus.fadeOut(299),t.zoomDiv.fadeOut(300,function(){t._onLeave()}),!1}).on("touchstart click",this,function(i){t.options.onClick()}).on("touchstart mouseenter",this,function(s){if("free"==i("#yith_wczm_traffic_light").val()){t.options.onEnter(),a&&s.preventDefault(),t.mx=void 0!==s.originalEvent.touches?s.originalEvent.touches[0].pageX:s.pageX,t.my=void 0!==s.originalEvent.touches?s.originalEvent.touches[0].pageY:s.pageY,t.zw=s.data,t.zoomDiv&&(t.zoomDiv.stop(!0,!1),t.zoomDiv.remove());var r=t.options.adjustX,m=t.options.adjustY,h=n.outerWidth(),l=n.outerHeight(),c=t.options.zoomWidth,d=t.options.zoomHeight;"auto"==t.options.zoomWidth&&(c=h),"auto"==t.options.zoomHeight&&(d=l);var g=e.parent();switch(t.options.position){case"top":m-=d;break;case"right":r+=h;break;case"bottom":m+=l;break;case"left":r-=c;break;case"inside":c=h,d=l;break;default:(g=i("#"+t.options.position)).length?(c=g.innerWidth(),d=g.innerHeight()):(g=e,r+=h,m+=l)}t.isPhone&&"inside"==t.options.phoneBehavior&&(c=h,d=l,r=0,m=0),t.zoomDiv=i('<div class="yith_magnifier_zoom_magnifier" />').css({left:r,top:m,width:c,height:d,"background-repeat":"no-repeat",backgroundImage:"url("+o.src+")"}).appendTo(g),n.attr("title")&&t.options.showTitle&&i('<div class="yith_magnifier_title">'+n.attr("title")+"</div>").appendTo(t.zoomDiv),t.isPhone?"disable"!=t.options.phoneBehavior?t.zoomDiv.fadeIn(500):t.lens.fadeOut(299):t.zoomDiv.fadeIn(500),t.lens&&(t.lens.remove(),t.lens=null),o.width<=1?t.cw=n.outerWidth()/o.naturalWidth*t.zoomDiv.width():t.cw=n.outerWidth()/o.width*t.zoomDiv.width(),o.height<=1?t.ch=n.outerHeight()/o.naturalHeight*t.zoomDiv.height():t.ch=n.outerHeight()/o.height*t.zoomDiv.height(),t.lens=i('<div class="yith_magnifier_lens" />').css({width:t.cw,height:t.ch}).appendTo(e),t.mouseTrap.css("cursor",t.lens.css("cursor"));var u=!1;return t.options.tint&&(t.tint=i("<div />").css({display:"none",position:"absolute",left:0,top:0,width:n.outerWidth(),height:n.outerHeight(),backgroundColor:t.options.tint,opacity:t.options.tintOpacity}).appendTo(e),t.lens.append(i("<img />",{src:n.attr("src")})),u=!0,t.tint.fadeIn(500)),t.options.softFocus&&(t.softFocus=i("<div />").css({position:"absolute",display:"none",top:"1px",left:"1px",width:n.outerWidth(),height:n.outerHeight(),opacity:.5}).appendTo(e),t.softFocus.append(i("<img />",{src:n.attr("src")})),0==t.lens.find("img").length&&t.lens.append(i("<img />",{src:n.attr("src")})),u=!0,t.softFocus.fadeIn(500)),u||t.lens.css("opacity",t.options.lensOpacity),"inside"!==t.options.position&&t.lens.fadeIn(500),void t.zw._controlLoop()}})}},_controlLoop:function(){var t=this;if(this.lens){var i=this.mx-this.zoomImage.offset().left-.5*this.cw>>0,o=this.my-this.zoomImage.offset().top-.5*this.ch>>0;i<0?i=0:i>this.zoomImage.outerWidth()-this.cw&&(i=this.zoomImage.outerWidth()-this.cw),o<0?o=0:o>this.zoomImage.outerHeight()-this.ch&&(o=this.zoomImage.outerHeight()-this.ch),this.lens.css({left:i-2,top:o-1}),this.lens.find("img").css({width:this.zoomImage.outerWidth(),height:this.zoomImage.outerHeight(),marginLeft:-i+"px ",marginTop:-o+"px"}),this.IMG_zoomImage.width<=1?this.destU=i/this.zoomImage.outerWidth()*this.IMG_zoomImage.naturalWidth>>0:this.destU=i/this.zoomImage.outerWidth()*this.IMG_zoomImage.width>>0,this.IMG_zoomImage.height<=1?this.destV=o/this.zoomImage.outerHeight()*this.IMG_zoomImage.naturalHeight>>0:this.destV=o/this.zoomImage.outerHeight()*this.IMG_zoomImage.height>>0,this.currU+=(this.destU-this.currU)/this.options.smoothMove,this.currV+=(this.destV-this.currV)/this.options.smoothMove,this.zoomDiv.css("background-position",-(this.currU>>0)+"px "+-(this.currV>>0)+"px")}this.controlTimer=setTimeout(function(){t._controlLoop()},30)},_onLeave:function(){this.options.onLeave(),this.zoomDiv&&(this.zoomDiv.remove(),this.zoomDiv=null),this._removeElements()},_removeElements:function(){this.lens&&(this.lens.remove(),this.lens=null),this.tint&&(this.tint.remove(),this.tint=null),this.softFocus&&(this.softFocus.remove(),this.softFocus=null),this.element.find(".yith_magnifier_loading").length>0&&this.element.find(".yith_magnifier_loading").remove()},_isPhone:function(){var t=navigator.userAgent.toLowerCase();return t.match(/iphone/i)||t.match(/ipod/i)||t.match(/android/i)},destroy:function(){this.zoom&&this.zoom.unwrap(),this.mouseTrap&&(this.mouseTrap.unbind(),this.mouseTrap.remove(),this.mouseTrap=null),this.zoomDiv&&(this.zoomDiv.remove(),this.zoomDiv=null),this.options.disableRightClick&&i(document).unbind(),this._removeElements(),this.options.elements.gallery.unbind(),this.element.removeData("yith_magnifier")}},i.fn.yith_magnifier=function(t){if("string"==typeof t){var o=Array.prototype.slice.call(arguments,1);this.each(function(){var e=i.data(this,"yith_magnifier");e?i.isFunction(e[t])&&"_"!==t.charAt(0)?e[t].apply(e,o):i.error("no such method '"+t+"' for yith_magnifier instance"):i.error("cannot call methods on yith_magnifier prior to initialization; attempted to call method '"+t+"'")})}else this.each(function(){i.data(this,"yith_magnifier")?i.error("yith_magnifier already istantiated."):i.data(this,"yith_magnifier",new i.yith_magnifier(t,this))});return this}}(window,jQuery);
|
1 |
+
!function(t,i,o){"use strict";void 0===i.fn.imagesLoaded&&function(t,i){var o="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==";t.fn.imagesLoaded=function(i){var e=this,n=t.isFunction(t.Deferred)?t.Deferred():0,s=t.isFunction(n.notify),a=e.find("img").add(e.filter("img")),r=[],m=[],h=[];function l(){var o=t(m),s=t(h);n&&(h.length?n.reject(a,o,s):n.resolve(a)),t.isFunction(i)&&i.call(e,a,o,s)}function c(t){g(t.target,"error"===t.type)}function g(i,e){i.src!==o&&-1===t.inArray(i,r)&&(r.push(i),e?h.push(i):m.push(i),t.data(i,"imagesLoaded",{isBroken:e,src:i.src}),s&&n.notifyWith(t(i),[e,a,t(m),t(h)]),a.length===r.length&&(setTimeout(l),a.unbind(".imagesLoaded",c)))}return t.isPlainObject(i)&&t.each(i,function(t,o){"callback"===t?i=o:n&&n[t](o)}),a.length?a.bind("load.imagesLoaded error.imagesLoaded",c).each(function(i,e){var n=e.src,s=t.data(e,"imagesLoaded");s&&s.src===n?g(e,s.isBroken):e.complete&&void 0!==e.naturalWidth?g(e,0===e.naturalWidth||0===e.naturalHeight):(e.readyState||e.complete)&&(e.src=o,e.src=n)}):l(),n?n.promise(e):e}}(jQuery),i.yith_magnifier=function(t,o){this.t=o,this.element=i(o),this._init(t)},i.yith_magnifier.defaults={zoomWidth:"auto",zoomHeight:"auto",position:"right",tint:!1,tintOpacity:.5,lensOpacity:.5,softFocus:!1,smoothMove:3,showTitle:!0,titleOpacity:.5,adjustX:0,adjustY:0,phoneBehavior:"inside",loadingLabel:"Loading...",enableSlider:!0,slider:"carouFredSel",sliderOptions:{},from_gallery:"no",onLoad:function(){return!1},onEnter:function(){return!1},onLeave:function(){return!1},onMove:function(){return!1},onClick:function(){return!1},elements:{zoom:i(".yith_magnifier_zoom"),zoomImage:i(".yith_magnifier_zoom img").first(),gallery:i(".yith_magnifier_gallery li a")}},i.yith_magnifier.prototype={_init:function(t){var o=this;i(document).trigger("yith_magnifier_before_init"),i.each(i.yith_magnifier.defaults.elements,function(t,e){i.yith_magnifier.defaults.elements[t]=i(e,o)}),o.options=i.extend(!0,{},i.yith_magnifier.defaults,t),o.isPhone=o._isPhone(),o._loading(),o.element.imagesLoaded(function(){o.options.onLoad(),o._initZoom(),o._initGallery()}),i(document).trigger("yith_magnifier_after_init")},_initGallery:function(){var t=this,o=t.options.elements,e=o.gallery,n=o.zoom,s=o.zoomImage;e.length>0?(e.on("click",function(o){o.preventDefault(),t.options.from_gallery="yes";var e=i(this);t.destroy(),n.attr("href",this.href),s.attr("src",e.data("small")).attr("srcset",e.data("small")).attr("src-orig",e.data("small")).attr("title","").attr("title",e.attr("title")),i.data(t.t,"yith_magnifier",new i.yith_magnifier(t.options,t.element))}),t.options.enableSlider&&(e.closest("ul").trigger("yith_magnifier_slider_destroy"),e.closest("ul")[t.options.slider](t.options.sliderOptions))):e.on("click",function(t){return t.preventDefault(),!1})},_loading:function(){if(this.options.disableRightClick&&i(document).on("contextmenu",function(t){return!1}),void 0===this.mouseTrap){var t=this.options.elements.zoom.width();this.options.loadingLabel&&i('<div class="yith_magnifier_loading">'+this.options.loadingLabel+"</div>").css({width:t,"text-align":"center",opacity:.5}).appendTo(this.options.elements.zoom.parent())}},_initZoom:function(){var t=this;t.zoom=t.options.elements.zoom,t.zoomImage=t.options.elements.zoomImage;var o="yith_magnifier_zoom_wrap";t.options.zoom_wrap_additional_css&&(i("."+o).length||(o+=" "+t.options.zoom_wrap_additional_css)),t.zoom.wrap('<div class="'+o+'"></div>'),t.IMG_zoomImage=new Image;var e=i(".woocommerce-variation-add-to-cart .variation_id").val();if(i.isNumeric(e)&&0!=e&&"no"==t.options.from_gallery){var n={action:"yith_wc_zoom_magnifier_get_main_image",product_id:e,context:"frontend"};i.ajax({data:n,url:yith_wc_zoom_magnifier_storage_object.ajax_url,type:"post",error:function(t){console.log("ERROR - Yith_WC_Zoom_Magnifier"),console.log(t)},success:function(o){t.IMG_zoomImage.src=o.url,t.IMG_smallImage=new Image,t.IMG_smallImage.src=t.zoomImage.attr("src"),o.gallery&&(i(".yith_magnifier_gallery").length?i(".yith_magnifier_gallery").closest(".thumbnails").replaceWith(o.gallery):i(".images").append(o.gallery),t.options.elements.gallery=i(".yith_magnifier_gallery li a")),i.browser&&i.browser.msie&&8==i.browser.version?i(t.IMG_zoomImage).load(function(){t._initGallery(),t._initTrap()}):i([t.IMG_zoomImage,t.IMG_smallImage]).imagesLoaded(function(){t._initGallery(),t._initTrap()}),i(document).trigger("yith_magnifier_after_init_zoom")}})}else t.IMG_zoomImage.src=t.zoom.attr("href"),t.IMG_smallImage=new Image,t.IMG_smallImage.src=t.zoomImage.attr("src"),i.browser&&i.browser.msie&&8==i.browser.version?i(t.IMG_zoomImage).load(function(){t._initTrap()}):i([t.IMG_zoomImage,t.IMG_smallImage]).imagesLoaded(function(){t._initTrap()}),i(document).trigger("yith_magnifier_after_init_zoom")},_initTrap:function(){var t=this,o=t.IMG_zoomImage;t.IMG_smallImage;t.mx=0,t.my=0,t.controlTimer=0,t.lens=null,t.tint=null,t.softFocus=null,t.zoomDiv=null,t.cw=0,t.ch=0,t.zw=0,t.destU=0,t.destV=0,t.currU=0,t.currV=0,t.mouseTrap=null;var e=t.options.elements.zoom,n=t.options.elements.zoomImage;i(".yith_magnifier_loading").remove(),this.element.find(".yith_magnifier_mousetrap")&&this.element.find(".yith_magnifier_mousetrap").remove(),this.mouseTrap=i('<div class="yith_magnifier_mousetrap" />').css({width:"100%",height:"100%",top:0,left:0}).appendTo(e.parent());var s="ontouchstart"in document.documentElement;this.mouseTrap.on("touchmove mousemove",this,function(i){t.options.onMove(),t.mx=void 0!==i.originalEvent.touches?i.originalEvent.touches[0].pageX:i.pageX,t.my=void 0!==i.originalEvent.touches?i.originalEvent.touches[0].pageY:i.pageY}).on("touchend mouseleave",this,function(i){return clearTimeout(t.controlTimer),t.lens&&t.lens.fadeOut(299),t.tint&&t.tint.fadeOut(299),t.softFocus&&t.softFocus.fadeOut(299),t.zoomDiv.fadeOut(300,function(){t._onLeave()}),!1}).on("touchstart click",this,function(i){t.options.onClick()}).on("touchstart mouseenter",this,function(a){t.options.onEnter(),s&&a.preventDefault(),t.mx=void 0!==a.originalEvent.touches?a.originalEvent.touches[0].pageX:a.pageX,t.my=void 0!==a.originalEvent.touches?a.originalEvent.touches[0].pageY:a.pageY,t.zw=a.data,t.zoomDiv&&(t.zoomDiv.stop(!0,!1),t.zoomDiv.remove());var r=t.options.adjustX,m=t.options.adjustY,h=n.outerWidth(),l=n.outerHeight(),c=t.options.zoomWidth,g=t.options.zoomHeight;"auto"==t.options.zoomWidth&&(c=h),"auto"==t.options.zoomHeight&&(g=l);var u=e.parent();switch(t.options.position){case"top":m-=g;break;case"right":r+=h;break;case"bottom":m+=l;break;case"left":r-=c;break;case"inside":c=h,g=l;break;default:(u=i("#"+t.options.position)).length?(c=u.innerWidth(),g=u.innerHeight()):(u=e,r+=h,m+=l)}t.isPhone&&"inside"==t.options.phoneBehavior&&(c=h,g=l,r=0,m=0),t.zoomDiv=i('<div class="yith_magnifier_zoom_magnifier" />').css({left:r,top:m,width:c,height:g,"background-repeat":"no-repeat",backgroundImage:"url("+o.src+")"}).appendTo(u),n.attr("title")&&t.options.showTitle&&i('<div class="yith_magnifier_title">'+n.attr("title")+"</div>").appendTo(t.zoomDiv),t.isPhone?"disable"!=t.options.phoneBehavior?t.zoomDiv.fadeIn(500):t.lens.fadeOut(299):t.zoomDiv.fadeIn(500),t.lens&&(t.lens.remove(),t.lens=null),o.width<=1?t.cw=n.outerWidth()/o.naturalWidth*t.zoomDiv.width():t.cw=n.outerWidth()/o.width*t.zoomDiv.width(),o.height<=1?t.ch=n.outerHeight()/o.naturalHeight*t.zoomDiv.height():t.ch=n.outerHeight()/o.height*t.zoomDiv.height(),t.lens=i('<div class="yith_magnifier_lens" />').css({width:t.cw,height:t.ch}).appendTo(e),t.mouseTrap.css("cursor",t.lens.css("cursor"));var d=!1;t.options.tint&&(t.tint=i("<div />").css({display:"none",position:"absolute",left:0,top:0,width:n.outerWidth(),height:n.outerHeight(),backgroundColor:t.options.tint,opacity:t.options.tintOpacity}).appendTo(e),t.lens.append(i("<img />",{src:n.attr("src")})),d=!0,t.tint.fadeIn(500)),t.options.softFocus&&(t.softFocus=i("<div />").css({position:"absolute",display:"none",top:"1px",left:"1px",width:n.outerWidth(),height:n.outerHeight(),opacity:.5}).appendTo(e),t.softFocus.append(i("<img />",{src:n.attr("src")})),0==t.lens.find("img").length&&t.lens.append(i("<img />",{src:n.attr("src")})),d=!0,t.softFocus.fadeIn(500)),d||t.lens.css("opacity",t.options.lensOpacity),"inside"!==t.options.position&&t.lens.fadeIn(500),t.zw._controlLoop()})},_controlLoop:function(){var t=this;if(this.lens){var i=this.mx-this.zoomImage.offset().left-.5*this.cw>>0,o=this.my-this.zoomImage.offset().top-.5*this.ch>>0;i<0?i=0:i>this.zoomImage.outerWidth()-this.cw&&(i=this.zoomImage.outerWidth()-this.cw),o<0?o=0:o>this.zoomImage.outerHeight()-this.ch&&(o=this.zoomImage.outerHeight()-this.ch),this.lens.css({left:i-2,top:o-1}),this.lens.find("img").css({width:this.zoomImage.outerWidth(),height:this.zoomImage.outerHeight(),marginLeft:-i+"px ",marginTop:-o+"px"}),this.IMG_zoomImage.width<=1?this.destU=i/this.zoomImage.outerWidth()*this.IMG_zoomImage.naturalWidth>>0:this.destU=i/this.zoomImage.outerWidth()*this.IMG_zoomImage.width>>0,this.IMG_zoomImage.height<=1?this.destV=o/this.zoomImage.outerHeight()*this.IMG_zoomImage.naturalHeight>>0:this.destV=o/this.zoomImage.outerHeight()*this.IMG_zoomImage.height>>0,this.currU+=(this.destU-this.currU)/this.options.smoothMove,this.currV+=(this.destV-this.currV)/this.options.smoothMove,this.zoomDiv.css("background-position",-(this.currU>>0)+"px "+-(this.currV>>0)+"px")}this.controlTimer=setTimeout(function(){t._controlLoop()},30)},_onLeave:function(){this.options.onLeave(),this.zoomDiv&&(this.zoomDiv.remove(),this.zoomDiv=null),this._removeElements()},_removeElements:function(){this.lens&&(this.lens.remove(),this.lens=null),this.tint&&(this.tint.remove(),this.tint=null),this.softFocus&&(this.softFocus.remove(),this.softFocus=null),this.element.find(".yith_magnifier_loading").length>0&&this.element.find(".yith_magnifier_loading").remove()},_isPhone:function(){var t=navigator.userAgent.toLowerCase();return t.match(/iphone/i)||t.match(/ipod/i)||t.match(/android/i)},destroy:function(){this.zoom&&this.zoom.unwrap(),this.mouseTrap&&(this.mouseTrap.unbind(),this.mouseTrap.remove(),this.mouseTrap=null),this.zoomDiv&&(this.zoomDiv.remove(),this.zoomDiv=null),this.options.disableRightClick&&i(document).unbind(),this._removeElements(),this.options.elements.gallery.unbind(),this.element.removeData("yith_magnifier")}},i.fn.yith_magnifier=function(t){if("string"==typeof t){var o=Array.prototype.slice.call(arguments,1);this.each(function(){var e=i.data(this,"yith_magnifier");e?i.isFunction(e[t])&&"_"!==t.charAt(0)?e[t].apply(e,o):i.error("no such method '"+t+"' for yith_magnifier instance"):i.error("cannot call methods on yith_magnifier prior to initialization; attempted to call method '"+t+"'")})}else this.each(function(){i.data(this,"yith_magnifier")?i.error("yith_magnifier already istantiated."):i.data(this,"yith_magnifier",new i.yith_magnifier(t,this))});return this}}(window,jQuery);
|
assets/js/ywzm_frontend.js
CHANGED
@@ -6,15 +6,12 @@
|
|
6 |
*/
|
7 |
jQuery(document).ready(function ($) {
|
8 |
|
9 |
-
var yith_wcmg
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
var yith_wcmg_default_gallery = yith_wcmg.find('.thumbnails');
|
17 |
-
|
18 |
|
19 |
if (typeof yith_magnifier_options == 'undefined') {
|
20 |
return false;
|
@@ -23,6 +20,7 @@ jQuery(document).ready(function ($) {
|
|
23 |
yith_wcmg.yith_magnifier(yith_magnifier_options);
|
24 |
|
25 |
$(document).on('found_variation', 'form.variations_form', function (event, variation) {
|
|
|
26 |
var image_magnifier = variation.image_magnifier ? variation.image_magnifier : yith_wcmg_default_zoom;
|
27 |
|
28 |
var image_src = yith_wcmg_default_image;
|
@@ -46,7 +44,6 @@ jQuery(document).ready(function ($) {
|
|
46 |
|
47 |
yith_wcmg.yith_magnifier(yith_magnifier_options);
|
48 |
}).on('reset_image', function (event) {
|
49 |
-
|
50 |
yith_wcmg_zoom.attr('href', yith_wcmg_default_zoom);
|
51 |
yith_wcmg_image.attr('src', yith_wcmg_default_image);
|
52 |
yith_wcmg_image.attr('srcset', yith_wcmg_default_image);
|
@@ -61,206 +58,5 @@ jQuery(document).ready(function ($) {
|
|
61 |
yith_wcmg.yith_magnifier(yith_magnifier_options);
|
62 |
});
|
63 |
|
64 |
-
|
65 |
-
|
66 |
-
$('form.variations_form .variations select').trigger('change');
|
67 |
-
|
68 |
-
function yith_wc_zm_carousel(){
|
69 |
-
|
70 |
-
$( ".single-product.woocommerce div.product div.images div.thumbnails" ).css( 'width', $( ".single-product.woocommerce div.product div.images div.thumbnails" ).width() );
|
71 |
-
|
72 |
-
var yith_wc_zm_circular = $( '.single-product.woocommerce div.product div.images ul.yith_magnifier_gallery' ).data( 'circular' );
|
73 |
-
var yith_wc_zm_columns = $( '.single-product.woocommerce div.product div.images ul.yith_magnifier_gallery' ).data( 'columns' );
|
74 |
-
|
75 |
-
var slider_infinite = $( '.single-product.woocommerce div.product div.images ul.yith_magnifier_gallery' ).data( 'slider_infinite' );
|
76 |
-
|
77 |
-
// We retrieve the value of the width of a li and the margin to later on multiple it for the numeber of li's and set the width of the ul parent
|
78 |
-
var li_width = $( ".single-product.woocommerce div.product div.images .yith_magnifier_gallery li" ).width();
|
79 |
-
var li_margin_left = $( ".single-product.woocommerce div.product div.images .yith_magnifier_gallery li" ).css( 'margin-left' );
|
80 |
-
|
81 |
-
if ( typeof li_margin_left == 'undefined') {
|
82 |
-
var li_margin_left_num = 0;
|
83 |
-
} else {
|
84 |
-
var li_margin_left_num = li_margin_left.split( "px" ).shift();
|
85 |
-
}
|
86 |
-
|
87 |
-
|
88 |
-
// We create an array with all the possible positions and adjust all the li's with a width width px because they were created by % via PHP
|
89 |
-
// and we are goint to set the width of the ul which contains the li's
|
90 |
-
var yith_margins_array = [];
|
91 |
-
var yith_margins_option = 0;
|
92 |
-
yith_margins_array.push( yith_margins_option );
|
93 |
-
|
94 |
-
var loop = 1;
|
95 |
-
$( '.single-product.woocommerce div.product div.images ul.yith_magnifier_gallery li' ).each( function() {
|
96 |
-
|
97 |
-
$( this ).css( 'width', li_width + 'px' );
|
98 |
-
$( this ).css( 'margin-left', li_margin_left );
|
99 |
-
$( this ).css( 'margin-right', li_margin_left );
|
100 |
-
$( this ).show();
|
101 |
-
|
102 |
-
yith_margins_option = yith_margins_option + ( ( li_margin_left_num * 2 ) + li_width );
|
103 |
-
|
104 |
-
yith_margins_array.push( yith_margins_option );
|
105 |
-
|
106 |
-
loop++;
|
107 |
-
|
108 |
-
});
|
109 |
-
|
110 |
-
// set the width of the ul parent
|
111 |
-
var ul_w = yith_margins_option;
|
112 |
-
$( ".single-product.woocommerce div.product div.images .yith_magnifier_gallery" ).css( 'width', ul_w + 'px' );
|
113 |
-
|
114 |
-
$( "#slider-next" ).css( 'top', '50%' );
|
115 |
-
$( "#slider-next" ).css( 'transform', 'translateY( -50% )' );
|
116 |
-
|
117 |
-
$( "#slider-prev" ).css( 'top', '50%' );
|
118 |
-
$( "#slider-prev" ).css( 'transform', 'translateY( -50% )' );
|
119 |
-
|
120 |
-
var index_yith_margins_array = 0;
|
121 |
-
|
122 |
-
$( "body" ).on( "click", "#slider-next", function () {
|
123 |
-
|
124 |
-
if ( $( '.single-product.woocommerce div.product div.images .yith_magnifier_gallery li.last' ).next().is( 'li' ) ){
|
125 |
-
|
126 |
-
index_yith_margins_array++;
|
127 |
-
$( ".single-product.woocommerce div.product div.images ul.yith_magnifier_gallery" ).animate({
|
128 |
-
marginLeft: '-' + yith_margins_array[ index_yith_margins_array ] + 'px',
|
129 |
-
});
|
130 |
-
|
131 |
-
var next = $( '.single-product.woocommerce div.product div.images .yith_magnifier_gallery li.first' ).next();
|
132 |
-
$( '.single-product.woocommerce div.product div.images .yith_magnifier_gallery li.first' ).removeClass( 'first' );
|
133 |
-
next.addClass( 'first' );
|
134 |
-
|
135 |
-
next = $( '.single-product.woocommerce div.product div.images .yith_magnifier_gallery li.last' ).next();
|
136 |
-
$( '.single-product.woocommerce div.product div.images .yith_magnifier_gallery li.last' ).removeClass( 'last' );
|
137 |
-
next.addClass( 'last' );
|
138 |
-
|
139 |
-
}
|
140 |
-
else
|
141 |
-
if ( ( yith_wc_zm_circular == 'yes' ) && ! $( ".single-product.woocommerce div.product div.images ul.yith_magnifier_gallery" ).is(':animated') ){
|
142 |
-
|
143 |
-
index_yith_margins_array--;
|
144 |
-
$( ".single-product.woocommerce div.product div.images ul.yith_magnifier_gallery" ).css( 'margin-left', '-' + yith_margins_array[ index_yith_margins_array ] + 'px' );
|
145 |
-
|
146 |
-
var last = $( '.single-product.woocommerce div.product div.images .yith_magnifier_gallery li' ).first();
|
147 |
-
$( '.single-product.woocommerce div.product div.images .yith_magnifier_gallery li.last' ).after( last );
|
148 |
-
|
149 |
-
$( '.single-product.woocommerce div.product div.images .yith_magnifier_gallery li.last' ).removeClass( 'last' );
|
150 |
-
last.addClass( 'last' );
|
151 |
-
|
152 |
-
var first = $( '.single-product.woocommerce div.product div.images .yith_magnifier_gallery li.first' ).next();
|
153 |
-
$( '.single-product.woocommerce div.product div.images .yith_magnifier_gallery li.first' ).removeClass( 'first' );
|
154 |
-
first.addClass( 'first' );
|
155 |
-
|
156 |
-
index_yith_margins_array++;
|
157 |
-
$( ".single-product.woocommerce div.product div.images ul.yith_magnifier_gallery" ).animate({
|
158 |
-
marginLeft: '-' + yith_margins_array[ index_yith_margins_array ] + 'px',
|
159 |
-
});
|
160 |
-
|
161 |
-
}
|
162 |
-
else
|
163 |
-
if ( ( slider_infinite == 'yes' ) && ! $( ".single-product.woocommerce div.product div.images ul.yith_magnifier_gallery" ).is(':animated') ){
|
164 |
-
|
165 |
-
while( $( '.single-product.woocommerce div.product div.images .yith_magnifier_gallery li.first' ).prev().is( 'li' ) ){
|
166 |
-
|
167 |
-
var prev = $( '.single-product.woocommerce div.product div.images .yith_magnifier_gallery li.first' ).prev();
|
168 |
-
$( '.single-product.woocommerce div.product div.images .yith_magnifier_gallery li.first' ).removeClass( 'first' );
|
169 |
-
prev.addClass( 'first' );
|
170 |
-
|
171 |
-
prev = $( '.single-product.woocommerce div.product div.images .yith_magnifier_gallery li.last' ).prev();
|
172 |
-
$( '.single-product.woocommerce div.product div.images .yith_magnifier_gallery li.last' ).removeClass( 'last' );
|
173 |
-
prev.addClass( 'last' );
|
174 |
-
|
175 |
-
}
|
176 |
-
|
177 |
-
index_yith_margins_array = 0;
|
178 |
-
$( ".single-product.woocommerce div.product div.images ul.yith_magnifier_gallery" ).animate({
|
179 |
-
marginLeft: '-' + yith_margins_array[ index_yith_margins_array ] + 'px',
|
180 |
-
});
|
181 |
-
}
|
182 |
-
|
183 |
-
});
|
184 |
-
|
185 |
-
$( "body" ).on( "click", "#slider-prev", function () {
|
186 |
-
|
187 |
-
if ( $( '.single-product.woocommerce div.product div.images .yith_magnifier_gallery li.first' ).prev().is( 'li' ) ){
|
188 |
-
|
189 |
-
index_yith_margins_array--;
|
190 |
-
$( ".single-product.woocommerce div.product div.images ul.yith_magnifier_gallery" ).animate({
|
191 |
-
marginLeft: '-' + yith_margins_array[ index_yith_margins_array ] + 'px',
|
192 |
-
});
|
193 |
-
|
194 |
-
var prev = $( '.single-product.woocommerce div.product div.images .yith_magnifier_gallery li.first' ).prev();
|
195 |
-
$( '.single-product.woocommerce div.product div.images .yith_magnifier_gallery li.first' ).removeClass( 'first' );
|
196 |
-
prev.addClass( 'first' );
|
197 |
-
|
198 |
-
prev = $( '.single-product.woocommerce div.product div.images .yith_magnifier_gallery li.last' ).prev();
|
199 |
-
$( '.single-product.woocommerce div.product div.images .yith_magnifier_gallery li.last' ).removeClass( 'last' );
|
200 |
-
prev.addClass( 'last' );
|
201 |
-
|
202 |
-
}
|
203 |
-
else
|
204 |
-
if ( ( yith_wc_zm_circular == 'yes' ) && ! $( ".single-product.woocommerce div.product div.images ul.yith_magnifier_gallery" ).is(':animated') ) {
|
205 |
-
|
206 |
-
index_yith_margins_array++;
|
207 |
-
$(".single-product.woocommerce div.product div.images ul.yith_magnifier_gallery").css('margin-left', '-' + yith_margins_array[index_yith_margins_array] + 'px');
|
208 |
-
|
209 |
-
var first = $('.single-product.woocommerce div.product div.images .yith_magnifier_gallery li').last();
|
210 |
-
$('.single-product.woocommerce div.product div.images .yith_magnifier_gallery li.first').before(first);
|
211 |
-
|
212 |
-
$('.single-product.woocommerce div.product div.images .yith_magnifier_gallery li.first').removeClass('first');
|
213 |
-
first.addClass('first');
|
214 |
-
|
215 |
-
var last = $('.single-product.woocommerce div.product div.images .yith_magnifier_gallery li.last').prev();
|
216 |
-
$('.single-product.woocommerce div.product div.images .yith_magnifier_gallery li.last').removeClass('last');
|
217 |
-
last.addClass('last');
|
218 |
-
|
219 |
-
index_yith_margins_array--;
|
220 |
-
$(".single-product.woocommerce div.product div.images ul.yith_magnifier_gallery").animate({
|
221 |
-
marginLeft: '-' + yith_margins_array[index_yith_margins_array] + 'px',
|
222 |
-
});
|
223 |
-
|
224 |
-
}
|
225 |
-
else
|
226 |
-
if ( ( slider_infinite == 'yes' ) && ! $( ".single-product.woocommerce div.product div.images ul.yith_magnifier_gallery" ).is(':animated') ){
|
227 |
-
|
228 |
-
while( $( '.single-product.woocommerce div.product div.images .yith_magnifier_gallery li.last' ).next().is( 'li' ) ){
|
229 |
-
|
230 |
-
var next = $( '.single-product.woocommerce div.product div.images .yith_magnifier_gallery li.first' ).next();
|
231 |
-
$( '.single-product.woocommerce div.product div.images .yith_magnifier_gallery li.first' ).removeClass( 'first' );
|
232 |
-
next.addClass( 'first' );
|
233 |
-
|
234 |
-
next = $( '.single-product.woocommerce div.product div.images .yith_magnifier_gallery li.last' ).next();
|
235 |
-
$( '.single-product.woocommerce div.product div.images .yith_magnifier_gallery li.last' ).removeClass( 'last' );
|
236 |
-
next.addClass( 'last' );
|
237 |
-
|
238 |
-
}
|
239 |
-
|
240 |
-
index_yith_margins_array = yith_margins_array.length -1 -yith_wc_zm_columns;
|
241 |
-
$( ".single-product.woocommerce div.product div.images ul.yith_magnifier_gallery" ).animate({
|
242 |
-
marginLeft: '-' + yith_margins_array[ index_yith_margins_array ] + 'px',
|
243 |
-
});
|
244 |
-
}
|
245 |
-
|
246 |
-
});
|
247 |
-
|
248 |
-
}
|
249 |
-
|
250 |
-
function yith_wc_zm_auto_carousel(){
|
251 |
-
|
252 |
-
$( '#slider-next' ).click();
|
253 |
-
|
254 |
-
setTimeout( yith_wc_zm_auto_carousel, 3000);
|
255 |
-
|
256 |
-
}
|
257 |
-
|
258 |
-
yith_wc_zm_carousel();
|
259 |
-
|
260 |
-
var auto_carousel = $( '.single-product.woocommerce div.product div.images ul.yith_magnifier_gallery' ).data( 'auto_carousel' );
|
261 |
-
|
262 |
-
if ( auto_carousel == 'yes' )
|
263 |
-
setTimeout( yith_wc_zm_auto_carousel, 3000);
|
264 |
-
}
|
265 |
-
|
266 |
});
|
6 |
*/
|
7 |
jQuery(document).ready(function ($) {
|
8 |
|
9 |
+
var yith_wcmg = $('.images'),
|
10 |
+
yith_wcmg_zoom = $('.yith_magnifier_zoom'),
|
11 |
+
yith_wcmg_image = $('.yith_magnifier_zoom img').first(),
|
12 |
+
yith_wcmg_default_zoom = yith_wcmg.find('.yith_magnifier_zoom').attr('href'),
|
13 |
+
yith_wcmg_default_image = yith_wcmg.find('.yith_magnifier_zoom img').attr('src');
|
14 |
+
yith_wcmg_default_gallery = yith_wcmg.find('.thumbnails');
|
|
|
|
|
|
|
15 |
|
16 |
if (typeof yith_magnifier_options == 'undefined') {
|
17 |
return false;
|
20 |
yith_wcmg.yith_magnifier(yith_magnifier_options);
|
21 |
|
22 |
$(document).on('found_variation', 'form.variations_form', function (event, variation) {
|
23 |
+
|
24 |
var image_magnifier = variation.image_magnifier ? variation.image_magnifier : yith_wcmg_default_zoom;
|
25 |
|
26 |
var image_src = yith_wcmg_default_image;
|
44 |
|
45 |
yith_wcmg.yith_magnifier(yith_magnifier_options);
|
46 |
}).on('reset_image', function (event) {
|
|
|
47 |
yith_wcmg_zoom.attr('href', yith_wcmg_default_zoom);
|
48 |
yith_wcmg_image.attr('src', yith_wcmg_default_image);
|
49 |
yith_wcmg_image.attr('srcset', yith_wcmg_default_image);
|
58 |
yith_wcmg.yith_magnifier(yith_magnifier_options);
|
59 |
});
|
60 |
|
61 |
+
$('form.variations_form .variations select').trigger('change');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
62 |
});
|
assets/js/ywzm_frontend.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
jQuery(document).ready(function(i){var e=i(".images"),
|
1 |
+
jQuery(document).ready(function(i){var e=i(".images"),n=i(".yith_magnifier_zoom"),m=i(".yith_magnifier_zoom img").first(),_=e.find(".yith_magnifier_zoom").attr("href"),f=e.find(".yith_magnifier_zoom img").attr("src");if(yith_wcmg_default_gallery=e.find(".thumbnails"),"undefined"==typeof yith_magnifier_options)return!1;e.yith_magnifier(yith_magnifier_options),i(document).on("found_variation","form.variations_form",function(i,t){var r=t.image_magnifier?t.image_magnifier:_,a=f;ywzm_data.wc_before_3_0?t.image_src&&(a=t.image_src):t.image.src&&(a=t.image.src),n.attr("href",r),m.attr("src",a),m.attr("srcset",a),m.attr("src-orig",a),e.data("yith_magnifier")&&e.yith_magnifier("destroy"),e.yith_magnifier(yith_magnifier_options)}).on("reset_image",function(i){n.attr("href",_),m.attr("src",f),m.attr("srcset",f),m.attr("src-orig",f),e.find(".thumbnails").replaceWith(yith_wcmg_default_gallery),e.data("yith_magnifier")&&e.yith_magnifier("destroy"),e.yith_magnifier(yith_magnifier_options)}),i("form.variations_form .variations select").trigger("change")});
|
class.yith-wcmg-frontend.php
CHANGED
@@ -19,8 +19,8 @@ if ( ! class_exists ( 'YITH_WCMG_Frontend' ) ) {
|
|
19 |
* @since 1.0.0
|
20 |
*/
|
21 |
class YITH_WCMG_Frontend {
|
22 |
-
|
23 |
-
|
24 |
/**
|
25 |
* Constructor
|
26 |
*
|
@@ -41,16 +41,16 @@ if ( ! class_exists ( 'YITH_WCMG_Frontend' ) ) {
|
|
41 |
remove_action ( 'woocommerce_product_thumbnails', 'woocommerce_show_product_thumbnails', 20 );
|
42 |
add_action ( 'woocommerce_before_single_product_summary', array( $this, 'show_product_images' ), 20 );
|
43 |
add_action ( 'woocommerce_product_thumbnails', array( $this, 'show_product_thumbnails' ), 20 );
|
44 |
-
|
45 |
//custom styles and javascripts
|
46 |
add_action ( 'wp_enqueue_scripts', array( $this, 'enqueue_styles_scripts' ) );
|
47 |
-
|
48 |
//add attributes to product variations
|
49 |
add_filter ( 'woocommerce_available_variation', array( $this, 'available_variation' ), 10, 3 );
|
50 |
}
|
51 |
}
|
52 |
-
|
53 |
-
|
54 |
/**
|
55 |
* Change product-single.php template
|
56 |
*
|
@@ -59,13 +59,13 @@ if ( ! class_exists ( 'YITH_WCMG_Frontend' ) ) {
|
|
59 |
* @since 1.0.0
|
60 |
*/
|
61 |
public function show_product_images() {
|
62 |
-
|
63 |
/** FIX WOO 2.1 */
|
64 |
$wc_get_template = function_exists ( 'wc_get_template' ) ? 'wc_get_template' : 'woocommerce_get_template';
|
65 |
$wc_get_template( 'single-product/product-image-magnifier.php', array(), '', YITH_YWZM_DIR . 'templates/' );
|
66 |
}
|
67 |
-
|
68 |
-
|
69 |
/**
|
70 |
* Change product-thumbnails.php template
|
71 |
*
|
@@ -74,14 +74,14 @@ if ( ! class_exists ( 'YITH_WCMG_Frontend' ) ) {
|
|
74 |
* @since 1.0.0
|
75 |
*/
|
76 |
public function show_product_thumbnails() {
|
77 |
-
|
78 |
/** FIX WOO 2.1 */
|
79 |
$wc_get_template = function_exists ( 'wc_get_template' ) ? 'wc_get_template' : 'woocommerce_get_template';
|
80 |
-
|
81 |
$wc_get_template( 'single-product/product-thumbnails-magnifier.php', array(), '', YITH_YWZM_DIR . 'templates/' );
|
82 |
}
|
83 |
-
|
84 |
-
|
85 |
/**
|
86 |
* Enqueue styles and scripts
|
87 |
*
|
@@ -91,9 +91,9 @@ if ( ! class_exists ( 'YITH_WCMG_Frontend' ) ) {
|
|
91 |
*/
|
92 |
public function enqueue_styles_scripts() {
|
93 |
global $post;
|
94 |
-
|
95 |
$suffix = defined ( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
|
96 |
-
|
97 |
wp_register_script ( 'ywzm-magnifier-slider',
|
98 |
YITH_WCMG_URL . 'assets/js/' . yit_load_js_file ( 'jquery.carouFredSel.js' ),
|
99 |
array(
|
@@ -102,46 +102,45 @@ if ( ! class_exists ( 'YITH_WCMG_Frontend' ) ) {
|
|
102 |
),
|
103 |
'6.2.1',
|
104 |
true );
|
105 |
-
|
106 |
wp_register_script ( 'ywzm-magnifier',
|
107 |
YITH_WCMG_URL . 'assets/js/' . yit_load_js_file ( 'yith_magnifier.js' ),
|
108 |
array( 'jquery' ),
|
109 |
-
|
110 |
true );
|
111 |
|
112 |
wp_localize_script( 'ywzm-magnifier', 'yith_wc_zoom_magnifier_storage_object', apply_filters( 'yith_wc_zoom_magnifier_front_magnifier_localize', array(
|
113 |
'ajax_url' => admin_url( 'admin-ajax.php' ),
|
114 |
-
'zoom_condition' => apply_filters('ywzm_zoom_init_condition', true ),
|
115 |
) ) );
|
116 |
-
|
117 |
wp_register_script ( 'ywzm_frontend',
|
118 |
YITH_WCMG_URL . 'assets/js/' . yit_load_js_file ( 'ywzm_frontend.js' ),
|
119 |
array(
|
120 |
'jquery',
|
121 |
'ywzm-magnifier',
|
122 |
),
|
123 |
-
|
124 |
true );
|
125 |
-
|
126 |
wp_register_style ( 'ywzm-magnifier', YITH_WCMG_URL . 'assets/css/yith_magnifier.css' );
|
127 |
-
|
128 |
if ( is_product () || ( ! empty( $post->post_content ) && strstr ( $post->post_content, '[product_page' ) ) ) {
|
129 |
-
|
130 |
wp_localize_script ( 'ywzm_frontend',
|
131 |
'ywzm_data', array(
|
132 |
'wc_before_3_0' => version_compare ( WC ()->version, '3.0', '<' ),
|
133 |
)
|
134 |
);
|
135 |
-
|
136 |
// Enqueue PrettyPhoto style and script
|
137 |
$wc_assets_path = str_replace ( array( 'http:', 'https:' ), '', WC ()->plugin_url () ) . '/assets/';
|
138 |
-
|
139 |
// Enqueue scripts
|
140 |
wp_enqueue_script ( 'prettyPhoto', $wc_assets_path . 'js/prettyPhoto/jquery.prettyPhoto' . $suffix . '.js', array( 'jquery' ), '3.1.6', true );
|
141 |
wp_enqueue_script ( 'ywzm-magnifier-slider' );
|
142 |
wp_enqueue_script ( 'ywzm-magnifier' );
|
143 |
wp_enqueue_script ( 'ywzm_frontend' );
|
144 |
-
|
145 |
// Enqueue Style
|
146 |
$css = file_exists ( get_stylesheet_directory () . '/woocommerce/yith_magnifier.css' ) ? get_stylesheet_directory_uri () . '/woocommerce/yith_magnifier.css' : YITH_WCMG_URL . 'assets/css/frontend.css';
|
147 |
wp_enqueue_style ( 'ywzm-prettyPhoto', $wc_assets_path . 'css/prettyPhoto.css' );
|
@@ -149,8 +148,8 @@ if ( ! class_exists ( 'YITH_WCMG_Frontend' ) ) {
|
|
149 |
wp_enqueue_style ( 'ywzm_frontend', $css );
|
150 |
}
|
151 |
}
|
152 |
-
|
153 |
-
|
154 |
/**
|
155 |
* Add attributes to product variations
|
156 |
*
|
@@ -161,14 +160,14 @@ if ( ! class_exists ( 'YITH_WCMG_Frontend' ) ) {
|
|
161 |
* @return mixed
|
162 |
*/
|
163 |
public function available_variation( $data, $wc_prod, $variation ) {
|
164 |
-
|
165 |
$attachment_id = get_post_thumbnail_id ( version_compare ( WC ()->version, '3.0', '<' ) ? $variation->get_variation_id () : $variation->get_id () );
|
166 |
$attachment = wp_get_attachment_image_src ( $attachment_id, 'shop_magnifier' );
|
167 |
-
|
168 |
$data['image_magnifier'] = $attachment ? current ( $attachment ) : '';
|
169 |
-
|
170 |
return $data;
|
171 |
}
|
172 |
-
|
173 |
}
|
174 |
}
|
19 |
* @since 1.0.0
|
20 |
*/
|
21 |
class YITH_WCMG_Frontend {
|
22 |
+
|
23 |
+
|
24 |
/**
|
25 |
* Constructor
|
26 |
*
|
41 |
remove_action ( 'woocommerce_product_thumbnails', 'woocommerce_show_product_thumbnails', 20 );
|
42 |
add_action ( 'woocommerce_before_single_product_summary', array( $this, 'show_product_images' ), 20 );
|
43 |
add_action ( 'woocommerce_product_thumbnails', array( $this, 'show_product_thumbnails' ), 20 );
|
44 |
+
|
45 |
//custom styles and javascripts
|
46 |
add_action ( 'wp_enqueue_scripts', array( $this, 'enqueue_styles_scripts' ) );
|
47 |
+
|
48 |
//add attributes to product variations
|
49 |
add_filter ( 'woocommerce_available_variation', array( $this, 'available_variation' ), 10, 3 );
|
50 |
}
|
51 |
}
|
52 |
+
|
53 |
+
|
54 |
/**
|
55 |
* Change product-single.php template
|
56 |
*
|
59 |
* @since 1.0.0
|
60 |
*/
|
61 |
public function show_product_images() {
|
62 |
+
|
63 |
/** FIX WOO 2.1 */
|
64 |
$wc_get_template = function_exists ( 'wc_get_template' ) ? 'wc_get_template' : 'woocommerce_get_template';
|
65 |
$wc_get_template( 'single-product/product-image-magnifier.php', array(), '', YITH_YWZM_DIR . 'templates/' );
|
66 |
}
|
67 |
+
|
68 |
+
|
69 |
/**
|
70 |
* Change product-thumbnails.php template
|
71 |
*
|
74 |
* @since 1.0.0
|
75 |
*/
|
76 |
public function show_product_thumbnails() {
|
77 |
+
|
78 |
/** FIX WOO 2.1 */
|
79 |
$wc_get_template = function_exists ( 'wc_get_template' ) ? 'wc_get_template' : 'woocommerce_get_template';
|
80 |
+
|
81 |
$wc_get_template( 'single-product/product-thumbnails-magnifier.php', array(), '', YITH_YWZM_DIR . 'templates/' );
|
82 |
}
|
83 |
+
|
84 |
+
|
85 |
/**
|
86 |
* Enqueue styles and scripts
|
87 |
*
|
91 |
*/
|
92 |
public function enqueue_styles_scripts() {
|
93 |
global $post;
|
94 |
+
|
95 |
$suffix = defined ( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
|
96 |
+
|
97 |
wp_register_script ( 'ywzm-magnifier-slider',
|
98 |
YITH_WCMG_URL . 'assets/js/' . yit_load_js_file ( 'jquery.carouFredSel.js' ),
|
99 |
array(
|
102 |
),
|
103 |
'6.2.1',
|
104 |
true );
|
105 |
+
|
106 |
wp_register_script ( 'ywzm-magnifier',
|
107 |
YITH_WCMG_URL . 'assets/js/' . yit_load_js_file ( 'yith_magnifier.js' ),
|
108 |
array( 'jquery' ),
|
109 |
+
YITH_YWZM_VERSION,
|
110 |
true );
|
111 |
|
112 |
wp_localize_script( 'ywzm-magnifier', 'yith_wc_zoom_magnifier_storage_object', apply_filters( 'yith_wc_zoom_magnifier_front_magnifier_localize', array(
|
113 |
'ajax_url' => admin_url( 'admin-ajax.php' ),
|
|
|
114 |
) ) );
|
115 |
+
|
116 |
wp_register_script ( 'ywzm_frontend',
|
117 |
YITH_WCMG_URL . 'assets/js/' . yit_load_js_file ( 'ywzm_frontend.js' ),
|
118 |
array(
|
119 |
'jquery',
|
120 |
'ywzm-magnifier',
|
121 |
),
|
122 |
+
YITH_YWZM_VERSION,
|
123 |
true );
|
124 |
+
|
125 |
wp_register_style ( 'ywzm-magnifier', YITH_WCMG_URL . 'assets/css/yith_magnifier.css' );
|
126 |
+
|
127 |
if ( is_product () || ( ! empty( $post->post_content ) && strstr ( $post->post_content, '[product_page' ) ) ) {
|
128 |
+
|
129 |
wp_localize_script ( 'ywzm_frontend',
|
130 |
'ywzm_data', array(
|
131 |
'wc_before_3_0' => version_compare ( WC ()->version, '3.0', '<' ),
|
132 |
)
|
133 |
);
|
134 |
+
|
135 |
// Enqueue PrettyPhoto style and script
|
136 |
$wc_assets_path = str_replace ( array( 'http:', 'https:' ), '', WC ()->plugin_url () ) . '/assets/';
|
137 |
+
|
138 |
// Enqueue scripts
|
139 |
wp_enqueue_script ( 'prettyPhoto', $wc_assets_path . 'js/prettyPhoto/jquery.prettyPhoto' . $suffix . '.js', array( 'jquery' ), '3.1.6', true );
|
140 |
wp_enqueue_script ( 'ywzm-magnifier-slider' );
|
141 |
wp_enqueue_script ( 'ywzm-magnifier' );
|
142 |
wp_enqueue_script ( 'ywzm_frontend' );
|
143 |
+
|
144 |
// Enqueue Style
|
145 |
$css = file_exists ( get_stylesheet_directory () . '/woocommerce/yith_magnifier.css' ) ? get_stylesheet_directory_uri () . '/woocommerce/yith_magnifier.css' : YITH_WCMG_URL . 'assets/css/frontend.css';
|
146 |
wp_enqueue_style ( 'ywzm-prettyPhoto', $wc_assets_path . 'css/prettyPhoto.css' );
|
148 |
wp_enqueue_style ( 'ywzm_frontend', $css );
|
149 |
}
|
150 |
}
|
151 |
+
|
152 |
+
|
153 |
/**
|
154 |
* Add attributes to product variations
|
155 |
*
|
160 |
* @return mixed
|
161 |
*/
|
162 |
public function available_variation( $data, $wc_prod, $variation ) {
|
163 |
+
|
164 |
$attachment_id = get_post_thumbnail_id ( version_compare ( WC ()->version, '3.0', '<' ) ? $variation->get_variation_id () : $variation->get_id () );
|
165 |
$attachment = wp_get_attachment_image_src ( $attachment_id, 'shop_magnifier' );
|
166 |
+
|
167 |
$data['image_magnifier'] = $attachment ? current ( $attachment ) : '';
|
168 |
+
|
169 |
return $data;
|
170 |
}
|
171 |
+
|
172 |
}
|
173 |
}
|
init.php
CHANGED
@@ -3,13 +3,13 @@
|
|
3 |
* Plugin Name: YITH WooCommerce Zoom Magnifier
|
4 |
* Plugin URI: https://yithemes.com/themes/plugins/yith-woocommerce-zoom-magnifier/
|
5 |
* Description: <code><strong>YITH WooCommerce Zoom Magnifier</strong></code> allows you to add a zoom effect to product images and a thumbnail slider for the product image gallery. <a href="https://yithemes.com/" target="_blank">Get more plugins for your e-commerce shop on <strong>YITH</strong></a>.
|
6 |
-
* Version: 1.3.
|
7 |
* Author: YITH
|
8 |
* Author URI: https://yithemes.com/
|
9 |
* Text Domain: yith-woocommerce-zoom-magnifier
|
10 |
* Domain Path: /languages/
|
11 |
-
* WC requires at least:
|
12 |
-
* WC tested up to: 4.
|
13 |
**/
|
14 |
|
15 |
/* Copyright 2013-2018 Your Inspiration Themes (email : plugins@yithemes.com)
|
@@ -78,8 +78,8 @@ register_activation_hook ( __FILE__, 'yith_plugin_registration_hook' );
|
|
78 |
|
79 |
defined ( 'YITH_YWZM_FREE_INIT' ) || define ( 'YITH_YWZM_FREE_INIT', plugin_basename ( __FILE__ ) );
|
80 |
defined ( 'YITH_YWZM_SLUG' ) || define ( 'YITH_YWZM_SLUG', 'yith-woocommerce-zoom-magnifier' );
|
81 |
-
defined ( 'YITH_YWZM_VERSION' ) || define ( 'YITH_YWZM_VERSION', '1.3.
|
82 |
-
defined ( 'YITH_YWZM_JS_VERSION' ) || define ( 'YITH_YWZM_JS_VERSION', '1.3.
|
83 |
|
84 |
defined ( 'YITH_YWZM_FILE' ) || define ( 'YITH_YWZM_FILE', __FILE__ );
|
85 |
defined ( 'YITH_YWZM_DIR' ) || define ( 'YITH_YWZM_DIR', plugin_dir_path ( __FILE__ ) );
|
3 |
* Plugin Name: YITH WooCommerce Zoom Magnifier
|
4 |
* Plugin URI: https://yithemes.com/themes/plugins/yith-woocommerce-zoom-magnifier/
|
5 |
* Description: <code><strong>YITH WooCommerce Zoom Magnifier</strong></code> allows you to add a zoom effect to product images and a thumbnail slider for the product image gallery. <a href="https://yithemes.com/" target="_blank">Get more plugins for your e-commerce shop on <strong>YITH</strong></a>.
|
6 |
+
* Version: 1.3.20
|
7 |
* Author: YITH
|
8 |
* Author URI: https://yithemes.com/
|
9 |
* Text Domain: yith-woocommerce-zoom-magnifier
|
10 |
* Domain Path: /languages/
|
11 |
+
* WC requires at least: 4.0
|
12 |
+
* WC tested up to: 4.7
|
13 |
**/
|
14 |
|
15 |
/* Copyright 2013-2018 Your Inspiration Themes (email : plugins@yithemes.com)
|
78 |
|
79 |
defined ( 'YITH_YWZM_FREE_INIT' ) || define ( 'YITH_YWZM_FREE_INIT', plugin_basename ( __FILE__ ) );
|
80 |
defined ( 'YITH_YWZM_SLUG' ) || define ( 'YITH_YWZM_SLUG', 'yith-woocommerce-zoom-magnifier' );
|
81 |
+
defined ( 'YITH_YWZM_VERSION' ) || define ( 'YITH_YWZM_VERSION', '1.3.20' );
|
82 |
+
defined ( 'YITH_YWZM_JS_VERSION' ) || define ( 'YITH_YWZM_JS_VERSION', '1.3.20' );
|
83 |
|
84 |
defined ( 'YITH_YWZM_FILE' ) || define ( 'YITH_YWZM_FILE', __FILE__ );
|
85 |
defined ( 'YITH_YWZM_DIR' ) || define ( 'YITH_YWZM_DIR', plugin_dir_path ( __FILE__ ) );
|
plugin-fw/assets/css/yith-fields.css
CHANGED
@@ -23,9 +23,9 @@
|
|
23 |
}
|
24 |
|
25 |
.yith-plugin-fw-field-wrapper .yith-inline-fields > div {
|
26 |
-
display: inline-block;
|
27 |
-
vertical-align: middle;
|
28 |
-
margin-right: 5px;
|
29 |
}
|
30 |
|
31 |
.yith-plugin-fw-field-wrapper span.desc {
|
@@ -286,7 +286,7 @@ ul.yit-icons-manager-list li.active {
|
|
286 |
|
287 |
.yith-plugin-fw-checkbox-array__row {
|
288 |
margin-bottom : 10px;
|
289 |
-
display:flex;
|
290 |
}
|
291 |
|
292 |
.yith-plugin-fw-checkbox-array__row label {
|
@@ -298,10 +298,11 @@ ul.yit-icons-manager-list li.active {
|
|
298 |
font-weight : 400 !important;
|
299 |
}
|
300 |
|
301 |
-
.yith-plugin-fw-checkbox-array__row label small{
|
302 |
-
display:block;
|
303 |
-
line-height: 2em;
|
304 |
}
|
|
|
305 |
/* ------- Sidebar Layout ------- */
|
306 |
.yith-plugin-fw-sidebar-layout input[type="radio"] {
|
307 |
display : none;
|
@@ -735,7 +736,7 @@ YITH UI
|
|
735 |
font-size : 15px;
|
736 |
padding : 7px 20px;
|
737 |
border : 0;
|
738 |
-
transition: background-color 0.3s linear;
|
739 |
}
|
740 |
|
741 |
.yith-plugin-ui .nav-tab:first-child {
|
@@ -745,9 +746,10 @@ YITH UI
|
|
745 |
.yith-plugin-ui .nav-tab.yith-premium {
|
746 |
background-color : #be421c;
|
747 |
}
|
|
|
748 |
.yith-plugin-ui .yith-nav-tab-wrapper .yith-plugin-fw-tab-element:hover > a.nav-tab:not(.nav-tab-active),
|
749 |
-
.yith-plugin-ui .yith-nav-tab-wrapper .nav-tab:not(.nav-tab-active):hover{
|
750 |
-
background-color
|
751 |
}
|
752 |
|
753 |
.yith-plugin-ui .nav-tab-active {
|
@@ -1225,8 +1227,8 @@ span.select2.select2-container.select2-container--default.yith-plugin-fw-select2
|
|
1225 |
font-size : 13px;
|
1226 |
}
|
1227 |
|
1228 |
-
.wc-wp-version-gte-53 .yith-plugin-ui .select2-container .select2-selection--single .select2-selection__arrow{
|
1229 |
-
background-image: none;
|
1230 |
}
|
1231 |
|
1232 |
.yith-plugin-ui .select2-container--default .select2-selection--single .select2-selection__arrow:before {
|
@@ -1438,7 +1440,7 @@ span.select2.select2-container.select2-container--default.yith-plugin-fw-select2
|
|
1438 |
background-color : #fff;
|
1439 |
width : 58px;
|
1440 |
height : 24px;
|
1441 |
-
line-height :14px;
|
1442 |
}
|
1443 |
|
1444 |
.yith-plugin-ui .yith-plugin-fw-onoff-container input + span:before {
|
@@ -1475,7 +1477,7 @@ span.select2.select2-container.select2-container--default.yith-plugin-fw-select2
|
|
1475 |
.yith-plugin-ui .yith-plugin-fw-onoff-container input:checked + span:before,
|
1476 |
.yith-plugin-ui.yith-plugin-fw-onoff-container input.onoffchecked + span:before {
|
1477 |
background-color : #98aa36;
|
1478 |
-
left: 38px;
|
1479 |
}
|
1480 |
|
1481 |
.yith-plugin-ui .yith-plugin-fw-onoff-container input:checked + span:after,
|
@@ -2114,11 +2116,12 @@ div#ui-datepicker-div.yith-plugin-fw-datepicker-div {
|
|
2114 |
margin-top : 10px;
|
2115 |
line-height : 20px;
|
2116 |
max-width : 40%;
|
|
|
2117 |
}
|
2118 |
|
2119 |
.yith-plugin-fw-option-with-description {
|
2120 |
display : table-cell;
|
2121 |
-
width :
|
2122 |
vertical-align : top;
|
2123 |
}
|
2124 |
|
@@ -2174,17 +2177,23 @@ div#ui-datepicker-div.yith-plugin-fw-datepicker-div {
|
|
2174 |
*/
|
2175 |
|
2176 |
.yith-plugin-fw-dimensions {
|
2177 |
-
|
|
|
2178 |
}
|
2179 |
|
2180 |
.yith-plugin-fw-dimensions__units {
|
2181 |
-
|
2182 |
-
|
|
|
|
|
|
|
|
|
|
|
2183 |
}
|
2184 |
|
2185 |
.yith-plugin-fw-dimensions__unit {
|
2186 |
display : inline-block;
|
2187 |
-
padding :
|
2188 |
cursor : pointer;
|
2189 |
font-weight : 700;
|
2190 |
}
|
@@ -2195,38 +2204,60 @@ div#ui-datepicker-div.yith-plugin-fw-datepicker-div {
|
|
2195 |
}
|
2196 |
|
2197 |
.yith-plugin-fw-dimensions__dimensions {
|
2198 |
-
display
|
2199 |
-
margin
|
|
|
|
|
2200 |
}
|
2201 |
|
2202 |
.yith-plugin-fw-dimensions__dimension {
|
2203 |
text-align : center;
|
|
|
2204 |
}
|
2205 |
|
2206 |
-
.yith-plugin-fw-dimensions__dimension > input[type=number].yith-plugin-fw-dimensions__dimension__number
|
2207 |
-
|
2208 |
-
|
2209 |
-
|
2210 |
-
|
2211 |
-
border-
|
2212 |
-
|
|
|
|
|
2213 |
text-align : center;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2214 |
}
|
2215 |
|
2216 |
-
.yith-plugin-fw-dimensions__dimension:
|
2217 |
-
|
2218 |
-
|
|
|
2219 |
}
|
2220 |
|
2221 |
-
.
|
2222 |
-
|
|
|
|
|
|
|
|
|
|
|
2223 |
}
|
2224 |
|
2225 |
-
.yith-plugin-fw-dimensions__dimension__label
|
|
|
|
|
2226 |
text-transform : uppercase;
|
2227 |
-
|
2228 |
-
|
2229 |
-
|
|
|
2230 |
}
|
2231 |
|
2232 |
.yith-plugin-fw-dimensions__linked {
|
@@ -2264,9 +2295,41 @@ div#ui-datepicker-div.yith-plugin-fw-datepicker-div {
|
|
2264 |
.yith-plugin-ui .yith-toggle-row:not(.fixed) {
|
2265 |
width : 80%;
|
2266 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2267 |
}
|
2268 |
|
2269 |
@media screen and (max-width : 1024px) {
|
|
|
2270 |
.yith-plugin-ui .yith-add-box,
|
2271 |
.yith-plugin-ui .yith-toggle-row:not(.fixed) {
|
2272 |
width : 90%;
|
@@ -2291,6 +2354,7 @@ div#ui-datepicker-div.yith-plugin-fw-datepicker-div {
|
|
2291 |
.yith-plugin-ui td.forminp-checkbox.three-cols fieldset:nth-child(3n+1) {
|
2292 |
clear : initial;
|
2293 |
}
|
|
|
2294 |
}
|
2295 |
|
2296 |
@media screen and (max-width : 782px) {
|
@@ -2322,76 +2386,86 @@ div#ui-datepicker-div.yith-plugin-fw-datepicker-div {
|
|
2322 |
#yith-plugin-fw-panel table.form-table th.titledesc,
|
2323 |
.yith-plugin-ui #plugin-fw-wc table.form-table td,
|
2324 |
#yith-plugin-fw-panel table.form-table td.forminp {
|
2325 |
-
padding: 20px 20px;
|
2326 |
}
|
2327 |
|
2328 |
.yith-plugin-ui #plugin-fw-wc table.form-table th.titledesc,
|
2329 |
#yith-plugin-fw-panel table.form-table th.titledesc {
|
2330 |
-
padding-bottom: 0;
|
2331 |
}
|
2332 |
}
|
2333 |
|
2334 |
-
@media (max-width: 480px) {
|
2335 |
.yith-plugin-ui .nav-tab {
|
2336 |
-
font-size: 12px;
|
2337 |
}
|
|
|
2338 |
.yith-plugin-ui h2 {
|
2339 |
-
padding: 20px 20px;
|
2340 |
}
|
|
|
2341 |
.yith-plugin-ui [type="radio"]:checked + label:before, .yith-plugin-ui [type="radio"]:not(:checked) + label:before {
|
2342 |
-
width: 14px;
|
2343 |
-
height: 14px;
|
2344 |
}
|
|
|
2345 |
.yith-plugin-ui [type="radio"]:checked + label:after, .yith-plugin-ui [type="radio"]:not(:checked) + label:after {
|
2346 |
-
width: 10px;
|
2347 |
-
height: 10px;
|
2348 |
-
top: 3px;
|
2349 |
-
left: 3px;
|
2350 |
}
|
|
|
2351 |
.yith-plugin-ui [type="radio"]:checked + label, .yith-plugin-ui [type="radio"]:not(:checked) + label {
|
2352 |
-
padding-left: 25px;
|
2353 |
}
|
2354 |
|
2355 |
.yith-plugin-ui [type="radio"]:checked + label, .yith-plugin-ui [type="radio"]:not(:checked) + label {
|
2356 |
-
font-size: 13px;
|
2357 |
}
|
|
|
2358 |
.yith-plugin-ui span.description {
|
2359 |
-
font-size: 12px;
|
2360 |
}
|
|
|
2361 |
.yith-plugin-ui #plugin-fw-wc table.form-table th,
|
2362 |
#yith-plugin-fw-panel table.form-table th.titledesc,
|
2363 |
.yith-plugin-ui #plugin-fw-wc table.form-table td,
|
2364 |
#yith-plugin-fw-panel table.form-table td.forminp {
|
2365 |
-
padding: 15px 20px;
|
2366 |
}
|
2367 |
|
2368 |
.yith-plugin-ui .yith-plugin-fw-onoff-container input + span {
|
2369 |
-
width: 48px;
|
2370 |
-
height: 20px;
|
2371 |
}
|
|
|
2372 |
.yith-plugin-ui .yith-plugin-fw-onoff-container input + span:before {
|
2373 |
-
top: 3px;
|
2374 |
-
left: 3px;
|
2375 |
}
|
|
|
2376 |
.yith-plugin-ui .yith-plugin-fw-onoff-container input:checked + span:before, .yith-plugin-ui.yith-plugin-fw-onoff-container input.onoffchecked + span:before {
|
2377 |
-
left: 30px;
|
2378 |
}
|
|
|
2379 |
.yith-plugin-ui .yith-plugin-fw-onoff-container input:checked + span:after, .yith-plugin-ui.yith-plugin-fw-onoff-container input.onoffchecked + span:after {
|
2380 |
-
font-size: 11px;
|
2381 |
-
padding: 0px 6px;
|
2382 |
-
margin-top: 3px;
|
2383 |
}
|
|
|
2384 |
.yith-plugin-ui .yith-plugin-fw-onoff-container input + span:after {
|
2385 |
-
font-size: 11px;
|
2386 |
-
padding-left: 24px;
|
2387 |
-
margin-top: 3px;
|
2388 |
}
|
2389 |
|
2390 |
.yith-plugin-fw .select2-container .select2-selection--single .select2-selection__rendered {
|
2391 |
-
font-size: 14px;
|
2392 |
}
|
2393 |
|
2394 |
.yith-plugin-ui input {
|
2395 |
-
font-size: 14px;
|
2396 |
}
|
2397 |
}
|
23 |
}
|
24 |
|
25 |
.yith-plugin-fw-field-wrapper .yith-inline-fields > div {
|
26 |
+
display : inline-block;
|
27 |
+
vertical-align : middle;
|
28 |
+
margin-right : 5px;
|
29 |
}
|
30 |
|
31 |
.yith-plugin-fw-field-wrapper span.desc {
|
286 |
|
287 |
.yith-plugin-fw-checkbox-array__row {
|
288 |
margin-bottom : 10px;
|
289 |
+
display : flex;
|
290 |
}
|
291 |
|
292 |
.yith-plugin-fw-checkbox-array__row label {
|
298 |
font-weight : 400 !important;
|
299 |
}
|
300 |
|
301 |
+
.yith-plugin-fw-checkbox-array__row label small {
|
302 |
+
display : block;
|
303 |
+
line-height : 2em;
|
304 |
}
|
305 |
+
|
306 |
/* ------- Sidebar Layout ------- */
|
307 |
.yith-plugin-fw-sidebar-layout input[type="radio"] {
|
308 |
display : none;
|
736 |
font-size : 15px;
|
737 |
padding : 7px 20px;
|
738 |
border : 0;
|
739 |
+
transition : background-color 0.3s linear;
|
740 |
}
|
741 |
|
742 |
.yith-plugin-ui .nav-tab:first-child {
|
746 |
.yith-plugin-ui .nav-tab.yith-premium {
|
747 |
background-color : #be421c;
|
748 |
}
|
749 |
+
|
750 |
.yith-plugin-ui .yith-nav-tab-wrapper .yith-plugin-fw-tab-element:hover > a.nav-tab:not(.nav-tab-active),
|
751 |
+
.yith-plugin-ui .yith-nav-tab-wrapper .nav-tab:not(.nav-tab-active):hover {
|
752 |
+
background-color : #207a92;
|
753 |
}
|
754 |
|
755 |
.yith-plugin-ui .nav-tab-active {
|
1227 |
font-size : 13px;
|
1228 |
}
|
1229 |
|
1230 |
+
.wc-wp-version-gte-53 .yith-plugin-ui .select2-container .select2-selection--single .select2-selection__arrow {
|
1231 |
+
background-image : none;
|
1232 |
}
|
1233 |
|
1234 |
.yith-plugin-ui .select2-container--default .select2-selection--single .select2-selection__arrow:before {
|
1440 |
background-color : #fff;
|
1441 |
width : 58px;
|
1442 |
height : 24px;
|
1443 |
+
line-height : 14px;
|
1444 |
}
|
1445 |
|
1446 |
.yith-plugin-ui .yith-plugin-fw-onoff-container input + span:before {
|
1477 |
.yith-plugin-ui .yith-plugin-fw-onoff-container input:checked + span:before,
|
1478 |
.yith-plugin-ui.yith-plugin-fw-onoff-container input.onoffchecked + span:before {
|
1479 |
background-color : #98aa36;
|
1480 |
+
left : 38px;
|
1481 |
}
|
1482 |
|
1483 |
.yith-plugin-ui .yith-plugin-fw-onoff-container input:checked + span:after,
|
2116 |
margin-top : 10px;
|
2117 |
line-height : 20px;
|
2118 |
max-width : 40%;
|
2119 |
+
min-width : min(100%, 360px);
|
2120 |
}
|
2121 |
|
2122 |
.yith-plugin-fw-option-with-description {
|
2123 |
display : table-cell;
|
2124 |
+
width : 90%;
|
2125 |
vertical-align : top;
|
2126 |
}
|
2127 |
|
2177 |
*/
|
2178 |
|
2179 |
.yith-plugin-fw-dimensions {
|
2180 |
+
display : flex;
|
2181 |
+
align-items : flex-end;
|
2182 |
}
|
2183 |
|
2184 |
.yith-plugin-fw-dimensions__units {
|
2185 |
+
flex : 1;
|
2186 |
+
display : flex;
|
2187 |
+
margin-left : 5px;
|
2188 |
+
width : calc(100% - 105px);
|
2189 |
+
flex-wrap : wrap;
|
2190 |
+
min-height : 38px;
|
2191 |
+
margin-bottom : -8px;
|
2192 |
}
|
2193 |
|
2194 |
.yith-plugin-fw-dimensions__unit {
|
2195 |
display : inline-block;
|
2196 |
+
padding : 0 3px;
|
2197 |
cursor : pointer;
|
2198 |
font-weight : 700;
|
2199 |
}
|
2204 |
}
|
2205 |
|
2206 |
.yith-plugin-fw-dimensions__dimensions {
|
2207 |
+
display : flex;
|
2208 |
+
margin : 0;
|
2209 |
+
align-items : flex-end;
|
2210 |
+
max-width : 400px;
|
2211 |
}
|
2212 |
|
2213 |
.yith-plugin-fw-dimensions__dimension {
|
2214 |
text-align : center;
|
2215 |
+
flex : 1;
|
2216 |
}
|
2217 |
|
2218 |
+
.yith-plugin-fw-dimensions__dimension > input[type=number].yith-plugin-fw-dimensions__dimension__number,
|
2219 |
+
.woocommerce.yith-plugin-fw-panel .yith-plugin-ui .yith-plugin-fw-dimensions__dimension > input[type=number].yith-plugin-fw-dimensions__dimension__number,
|
2220 |
+
.yith-plugin-ui .yith-plugin-fw-dimensions__dimension > input[type=number].yith-plugin-fw-dimensions__dimension__number {
|
2221 |
+
width : 100%;
|
2222 |
+
min-width : 0;
|
2223 |
+
border-radius : 0;
|
2224 |
+
border : 1px solid #d8d8d8;
|
2225 |
+
border-left : none;
|
2226 |
+
height : 38px;
|
2227 |
text-align : center;
|
2228 |
+
padding-right : 0;
|
2229 |
+
}
|
2230 |
+
|
2231 |
+
.yith-plugin-fw-dimensions__dimension:first-child > input[type=number].yith-plugin-fw-dimensions__dimension__number,
|
2232 |
+
.woocommerce.yith-plugin-fw-panel .yith-plugin-ui .yith-plugin-fw-dimensions__dimension:first-child > input[type=number].yith-plugin-fw-dimensions__dimension__number,
|
2233 |
+
.yith-plugin-ui .yith-plugin-fw-dimensions__dimension:first-child > input[type=number].yith-plugin-fw-dimensions__dimension__number {
|
2234 |
+
border-left : 1px solid #d8d8d8;
|
2235 |
+
border-radius : 6px 0 0 6px;
|
2236 |
}
|
2237 |
|
2238 |
+
.yith-plugin-fw-dimensions__dimension:last-child > input[type=number].yith-plugin-fw-dimensions__dimension__number,
|
2239 |
+
.woocommerce.yith-plugin-fw-panel .yith-plugin-ui .yith-plugin-fw-dimensions__dimension:last-child > input[type=number].yith-plugin-fw-dimensions__dimension__number,
|
2240 |
+
.yith-plugin-ui .yith-plugin-fw-dimensions__dimension:last-child > input[type=number].yith-plugin-fw-dimensions__dimension__number {
|
2241 |
+
border-radius : 0 6px 6px 0;
|
2242 |
}
|
2243 |
|
2244 |
+
.metaboxes-tab .yith-plugin-fw-dimensions__dimension__label,
|
2245 |
+
.yith-plugin-ui.metaboxes-tab label.yith-plugin-fw-dimensions__dimension__label {
|
2246 |
+
float : none;
|
2247 |
+
margin : 0;
|
2248 |
+
width : auto;
|
2249 |
+
font-weight : inherit;
|
2250 |
+
line-height : inherit;
|
2251 |
}
|
2252 |
|
2253 |
+
.yith-plugin-fw-dimensions__dimension__label,
|
2254 |
+
.metaboxes-tab .yith-plugin-fw-dimensions__dimension__label,
|
2255 |
+
.yith-plugin-ui.metaboxes-tab label.yith-plugin-fw-dimensions__dimension__label {
|
2256 |
text-transform : uppercase;
|
2257 |
+
letter-spacing : 2px;
|
2258 |
+
font-size : 11px;
|
2259 |
+
margin-bottom : 5px;
|
2260 |
+
display : inline-block;
|
2261 |
}
|
2262 |
|
2263 |
.yith-plugin-fw-dimensions__linked {
|
2295 |
.yith-plugin-ui .yith-toggle-row:not(.fixed) {
|
2296 |
width : 80%;
|
2297 |
}
|
2298 |
+
|
2299 |
+
|
2300 |
+
.yith-plugin-ui .yith-add-box-row,
|
2301 |
+
.yith-plugin-ui .yith-toggle-row-opened .yith-toggle-content .yith-toggle-content-row,
|
2302 |
+
.yith-plugin-ui .yith-add-box-row label {
|
2303 |
+
display : block;
|
2304 |
+
}
|
2305 |
+
|
2306 |
+
.yith-plugin-ui .yith-toggle-row-opened .yith-toggle-content .yith-toggle-content-row > label {
|
2307 |
+
display : block;
|
2308 |
+
}
|
2309 |
+
|
2310 |
+
.yith-plugin-ui .yith-toggle-row-opened .yith-plugin-fw-option-with-description {
|
2311 |
+
width : 100%;
|
2312 |
+
}
|
2313 |
+
|
2314 |
+
.yith-plugin-ui .yith-add-box-row,
|
2315 |
+
.yith-plugin-ui .yith-add-box-row label {
|
2316 |
+
display : block;
|
2317 |
+
}
|
2318 |
+
|
2319 |
+
.yith-plugin-ui .yith-toggle-row-opened .yith-toggle-content .yith-plugin-fw-option-with-description,
|
2320 |
+
.yith-plugin-ui .yith-add-box-row .yith-plugin-fw-option-with-description {
|
2321 |
+
display : block;
|
2322 |
+
padding-top : 20px;
|
2323 |
+
}
|
2324 |
+
|
2325 |
+
|
2326 |
+
.yith-plugin-ui .yith-add-box-row .yith-plugin-fw-option-with-description span.description {
|
2327 |
+
max-width : 100%;
|
2328 |
+
}
|
2329 |
}
|
2330 |
|
2331 |
@media screen and (max-width : 1024px) {
|
2332 |
+
|
2333 |
.yith-plugin-ui .yith-add-box,
|
2334 |
.yith-plugin-ui .yith-toggle-row:not(.fixed) {
|
2335 |
width : 90%;
|
2354 |
.yith-plugin-ui td.forminp-checkbox.three-cols fieldset:nth-child(3n+1) {
|
2355 |
clear : initial;
|
2356 |
}
|
2357 |
+
|
2358 |
}
|
2359 |
|
2360 |
@media screen and (max-width : 782px) {
|
2386 |
#yith-plugin-fw-panel table.form-table th.titledesc,
|
2387 |
.yith-plugin-ui #plugin-fw-wc table.form-table td,
|
2388 |
#yith-plugin-fw-panel table.form-table td.forminp {
|
2389 |
+
padding : 20px 20px;
|
2390 |
}
|
2391 |
|
2392 |
.yith-plugin-ui #plugin-fw-wc table.form-table th.titledesc,
|
2393 |
#yith-plugin-fw-panel table.form-table th.titledesc {
|
2394 |
+
padding-bottom : 0;
|
2395 |
}
|
2396 |
}
|
2397 |
|
2398 |
+
@media (max-width : 480px) {
|
2399 |
.yith-plugin-ui .nav-tab {
|
2400 |
+
font-size : 12px;
|
2401 |
}
|
2402 |
+
|
2403 |
.yith-plugin-ui h2 {
|
2404 |
+
padding : 20px 20px;
|
2405 |
}
|
2406 |
+
|
2407 |
.yith-plugin-ui [type="radio"]:checked + label:before, .yith-plugin-ui [type="radio"]:not(:checked) + label:before {
|
2408 |
+
width : 14px;
|
2409 |
+
height : 14px;
|
2410 |
}
|
2411 |
+
|
2412 |
.yith-plugin-ui [type="radio"]:checked + label:after, .yith-plugin-ui [type="radio"]:not(:checked) + label:after {
|
2413 |
+
width : 10px;
|
2414 |
+
height : 10px;
|
2415 |
+
top : 3px;
|
2416 |
+
left : 3px;
|
2417 |
}
|
2418 |
+
|
2419 |
.yith-plugin-ui [type="radio"]:checked + label, .yith-plugin-ui [type="radio"]:not(:checked) + label {
|
2420 |
+
padding-left : 25px;
|
2421 |
}
|
2422 |
|
2423 |
.yith-plugin-ui [type="radio"]:checked + label, .yith-plugin-ui [type="radio"]:not(:checked) + label {
|
2424 |
+
font-size : 13px;
|
2425 |
}
|
2426 |
+
|
2427 |
.yith-plugin-ui span.description {
|
2428 |
+
font-size : 12px;
|
2429 |
}
|
2430 |
+
|
2431 |
.yith-plugin-ui #plugin-fw-wc table.form-table th,
|
2432 |
#yith-plugin-fw-panel table.form-table th.titledesc,
|
2433 |
.yith-plugin-ui #plugin-fw-wc table.form-table td,
|
2434 |
#yith-plugin-fw-panel table.form-table td.forminp {
|
2435 |
+
padding : 15px 20px;
|
2436 |
}
|
2437 |
|
2438 |
.yith-plugin-ui .yith-plugin-fw-onoff-container input + span {
|
2439 |
+
width : 48px;
|
2440 |
+
height : 20px;
|
2441 |
}
|
2442 |
+
|
2443 |
.yith-plugin-ui .yith-plugin-fw-onoff-container input + span:before {
|
2444 |
+
top : 3px;
|
2445 |
+
left : 3px;
|
2446 |
}
|
2447 |
+
|
2448 |
.yith-plugin-ui .yith-plugin-fw-onoff-container input:checked + span:before, .yith-plugin-ui.yith-plugin-fw-onoff-container input.onoffchecked + span:before {
|
2449 |
+
left : 30px;
|
2450 |
}
|
2451 |
+
|
2452 |
.yith-plugin-ui .yith-plugin-fw-onoff-container input:checked + span:after, .yith-plugin-ui.yith-plugin-fw-onoff-container input.onoffchecked + span:after {
|
2453 |
+
font-size : 11px;
|
2454 |
+
padding : 0px 6px;
|
2455 |
+
margin-top : 3px;
|
2456 |
}
|
2457 |
+
|
2458 |
.yith-plugin-ui .yith-plugin-fw-onoff-container input + span:after {
|
2459 |
+
font-size : 11px;
|
2460 |
+
padding-left : 24px;
|
2461 |
+
margin-top : 3px;
|
2462 |
}
|
2463 |
|
2464 |
.yith-plugin-fw .select2-container .select2-selection--single .select2-selection__rendered {
|
2465 |
+
font-size : 14px;
|
2466 |
}
|
2467 |
|
2468 |
.yith-plugin-ui input {
|
2469 |
+
font-size : 14px;
|
2470 |
}
|
2471 |
}
|
plugin-fw/init.php
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
* Framework Name: YIT Plugin Framework
|
4 |
-
* Version: 3.4.
|
5 |
* Author: YITH
|
6 |
* Text Domain: yith-plugin-fw
|
7 |
* Domain Path: /languages/
|
1 |
<?php
|
2 |
/**
|
3 |
* Framework Name: YIT Plugin Framework
|
4 |
+
* Version: 3.4.32
|
5 |
* Author: YITH
|
6 |
* Text Domain: yith-plugin-fw
|
7 |
* Domain Path: /languages/
|
plugin-fw/lib/yit-plugin-licence.php
CHANGED
@@ -87,8 +87,8 @@ if ( ! class_exists( 'YIT_Plugin_Licence' ) ) {
|
|
87 |
* @author Andrea Grillo <andrea.grillo@yithemes.com>
|
88 |
* @since 3.0.17
|
89 |
*/
|
90 |
-
public static function get_license_activation_url(){
|
91 |
-
return function_exists( 'YITH_Plugin_Licence' ) ? YITH_Plugin_Licence()->get_license_activation_url() : false;
|
92 |
}
|
93 |
|
94 |
/**
|
87 |
* @author Andrea Grillo <andrea.grillo@yithemes.com>
|
88 |
* @since 3.0.17
|
89 |
*/
|
90 |
+
public static function get_license_activation_url( $plugin_slug = '' ){
|
91 |
+
return function_exists( 'YITH_Plugin_Licence' ) ? YITH_Plugin_Licence()->get_license_activation_url( $plugin_slug ) : false;
|
92 |
}
|
93 |
|
94 |
/**
|
plugin-fw/templates/fields/dimensions.php
CHANGED
@@ -57,25 +57,7 @@ if ( $allow_linked && 'yes' === $linked ) {
|
|
57 |
<?php echo $custom_attributes ?>
|
58 |
<?php echo isset( $data ) ? yith_plugin_fw_html_data_to_string( $data ) : ''; ?>
|
59 |
>
|
60 |
-
<div class="yith-plugin-fw-
|
61 |
-
<input class='yith-plugin-fw-dimensions__unit__value' type="hidden" name="<?php echo $name ?>[unit]" value="<?php echo isset( $value['unit'] ) ? $value['unit'] : current( array_keys( $units ) ) ?>">
|
62 |
-
<?php foreach ( $units as $key => $label ) : ?>
|
63 |
-
<?php
|
64 |
-
$key = sanitize_title( $key );
|
65 |
-
$classes = array(
|
66 |
-
'yith-plugin-fw-dimensions__unit',
|
67 |
-
"yith-plugin-fw-dimensions__unit--{$key}-unit",
|
68 |
-
);
|
69 |
-
if ( $unit_value === $key ) {
|
70 |
-
$classes[] = 'yith-plugin-fw-dimensions__unit--selected';
|
71 |
-
}
|
72 |
-
$classes = implode( ' ', $classes );
|
73 |
-
?>
|
74 |
-
<span class="<?php echo $classes; ?>" data-value="<?php echo $key; ?>"><?php echo $label; ?></span>
|
75 |
-
<?php endforeach ?>
|
76 |
-
</div>
|
77 |
-
|
78 |
-
<ul class="yith-plugin-fw-dimensions__dimensions">
|
79 |
<?php foreach ( $dimensions as $key => $dimension ) : ?>
|
80 |
<?php
|
81 |
$d_id = "{$id}-dimension-" . sanitize_title( $key );
|
@@ -104,20 +86,37 @@ if ( $allow_linked && 'yes' === $linked ) {
|
|
104 |
}
|
105 |
|
106 |
?>
|
107 |
-
<
|
|
|
108 |
<input id="<?php echo $d_id; ?>" class="yith-plugin-fw-dimensions__dimension__number"
|
109 |
type="number" name="<?php echo $d_name; ?>" value="<?php echo $d_value; ?>"
|
110 |
<?php echo $d_attributes; ?>
|
111 |
>
|
112 |
-
|
113 |
-
</li>
|
114 |
<?php endforeach ?>
|
115 |
|
116 |
<?php if ( $allow_linked ): ?>
|
117 |
-
<
|
118 |
<input class='yith-plugin-fw-dimensions__linked__value' type="hidden" name="<?php echo $name ?>[linked]" value="<?php echo $linked ?>">
|
119 |
<span class="dashicons dashicons-admin-links"></span>
|
120 |
-
</
|
121 |
<?php endif; ?>
|
122 |
-
</
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
123 |
</div>
|
57 |
<?php echo $custom_attributes ?>
|
58 |
<?php echo isset( $data ) ? yith_plugin_fw_html_data_to_string( $data ) : ''; ?>
|
59 |
>
|
60 |
+
<div class="yith-plugin-fw-dimensions__dimensions">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
61 |
<?php foreach ( $dimensions as $key => $dimension ) : ?>
|
62 |
<?php
|
63 |
$d_id = "{$id}-dimension-" . sanitize_title( $key );
|
86 |
}
|
87 |
|
88 |
?>
|
89 |
+
<div class="yith-plugin-fw-dimensions__dimension yith-plugin-fw-dimensions__dimension--<?php echo sanitize_title( $key ); ?>">
|
90 |
+
<label for="<?php echo $d_id; ?>" class="yith-plugin-fw-dimensions__dimension__label"><?php echo $d_label; ?></label>
|
91 |
<input id="<?php echo $d_id; ?>" class="yith-plugin-fw-dimensions__dimension__number"
|
92 |
type="number" name="<?php echo $d_name; ?>" value="<?php echo $d_value; ?>"
|
93 |
<?php echo $d_attributes; ?>
|
94 |
>
|
95 |
+
</div>
|
|
|
96 |
<?php endforeach ?>
|
97 |
|
98 |
<?php if ( $allow_linked ): ?>
|
99 |
+
<div class="yith-plugin-fw-dimensions__linked" title="<?php _ex( 'Link values together', 'Tooltip in the "Dimensions" field', 'yith-plugin-fw' ); ?>">
|
100 |
<input class='yith-plugin-fw-dimensions__linked__value' type="hidden" name="<?php echo $name ?>[linked]" value="<?php echo $linked ?>">
|
101 |
<span class="dashicons dashicons-admin-links"></span>
|
102 |
+
</div>
|
103 |
<?php endif; ?>
|
104 |
+
</div>
|
105 |
+
<div class="yith-plugin-fw-dimensions__units">
|
106 |
+
<input class='yith-plugin-fw-dimensions__unit__value' type="hidden" name="<?php echo $name ?>[unit]" value="<?php echo isset( $value['unit'] ) ? $value['unit'] : current( array_keys( $units ) ) ?>">
|
107 |
+
<?php foreach ( $units as $key => $label ) : ?>
|
108 |
+
<?php
|
109 |
+
$key = sanitize_title( $key );
|
110 |
+
$classes = array(
|
111 |
+
'yith-plugin-fw-dimensions__unit',
|
112 |
+
"yith-plugin-fw-dimensions__unit--{$key}-unit",
|
113 |
+
);
|
114 |
+
if ( $unit_value === $key ) {
|
115 |
+
$classes[] = 'yith-plugin-fw-dimensions__unit--selected';
|
116 |
+
}
|
117 |
+
$classes = implode( ' ', $classes );
|
118 |
+
?>
|
119 |
+
<span class="<?php echo $classes; ?>" data-value="<?php echo $key; ?>"><?php echo $label; ?></span>
|
120 |
+
<?php endforeach ?>
|
121 |
+
</div>
|
122 |
</div>
|
plugin-fw/templates/sysinfo/system-information-panel.php
CHANGED
@@ -104,7 +104,7 @@ if ( 'n/a' === $output_ip && function_exists( 'curl_init' ) && apply_filters( 'y
|
|
104 |
<?php esc_html_e( 'Site URL', 'yith-plugin-fw' ); ?>
|
105 |
</th>
|
106 |
<td class="requirement-value">
|
107 |
-
<?php echo get_site_url(); ?>
|
108 |
</td>
|
109 |
</tr>
|
110 |
<tr>
|
@@ -112,7 +112,7 @@ if ( 'n/a' === $output_ip && function_exists( 'curl_init' ) && apply_filters( 'y
|
|
112 |
<?php esc_html_e( 'Output IP Address', 'yith-plugin-fw' ); ?>
|
113 |
</th>
|
114 |
<td class="requirement-value">
|
115 |
-
<?php echo $output_ip; ?>
|
116 |
</td>
|
117 |
</tr>
|
118 |
<tr>
|
@@ -123,6 +123,14 @@ if ( 'n/a' === $output_ip && function_exists( 'curl_init' ) && apply_filters( 'y
|
|
123 |
<?php echo( defined( 'WP_CACHE' ) && WP_CACHE ? esc_html__( 'Yes', 'yith-plugin-fw' ) : esc_html__( 'No', 'yith-plugin-fw' ) ); ?>
|
124 |
</td>
|
125 |
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
126 |
</table>
|
127 |
|
128 |
<table class="widefat striped">
|
104 |
<?php esc_html_e( 'Site URL', 'yith-plugin-fw' ); ?>
|
105 |
</th>
|
106 |
<td class="requirement-value">
|
107 |
+
<?php echo esc_attr( get_site_url() ); ?>
|
108 |
</td>
|
109 |
</tr>
|
110 |
<tr>
|
112 |
<?php esc_html_e( 'Output IP Address', 'yith-plugin-fw' ); ?>
|
113 |
</th>
|
114 |
<td class="requirement-value">
|
115 |
+
<?php echo esc_attr( $output_ip ); ?>
|
116 |
</td>
|
117 |
</tr>
|
118 |
<tr>
|
123 |
<?php echo( defined( 'WP_CACHE' ) && WP_CACHE ? esc_html__( 'Yes', 'yith-plugin-fw' ) : esc_html__( 'No', 'yith-plugin-fw' ) ); ?>
|
124 |
</td>
|
125 |
</tr>
|
126 |
+
<tr>
|
127 |
+
<th>
|
128 |
+
<?php esc_html_e( 'External object cache', 'yith-plugin-fw' ); ?>
|
129 |
+
</th>
|
130 |
+
<td class="requirement-value">
|
131 |
+
<?php echo( wp_using_ext_object_cache() ? esc_html__( 'Yes', 'yith-plugin-fw' ) : esc_html__( 'No', 'yith-plugin-fw' ) ); ?>
|
132 |
+
</td>
|
133 |
+
</tr>
|
134 |
</table>
|
135 |
|
136 |
<table class="widefat striped">
|
plugin-fw/yit-plugin.php
CHANGED
@@ -184,14 +184,14 @@ if( ! function_exists( 'yith_add_action_links' ) ){
|
|
184 |
* @return mixed
|
185 |
* @use plugin_action_links_{$plugin_file_name}
|
186 |
*/
|
187 |
-
function yith_add_action_links( $links, $panel_page = '', $is_premium = false ) {
|
188 |
$links = is_array( $links ) ? $links : array();
|
189 |
if( ! empty( $panel_page ) ){
|
190 |
$links[] = sprintf( '<a href="%s">%s</a>', admin_url( "admin.php?page={$panel_page}" ), _x( 'Settings', 'Action links', 'yith-plugin-fw' ) );
|
191 |
}
|
192 |
|
193 |
if( $is_premium && class_exists( 'YIT_Plugin_Licence' ) ){
|
194 |
-
$links[] = sprintf( '<a href="%s">%s</a>', YIT_Plugin_Licence()->get_license_activation_url(),__( 'License', 'yith-plugin-fw' ) );
|
195 |
}
|
196 |
|
197 |
return $links;
|
184 |
* @return mixed
|
185 |
* @use plugin_action_links_{$plugin_file_name}
|
186 |
*/
|
187 |
+
function yith_add_action_links( $links, $panel_page = '', $is_premium = false, $plugin_slug = '' ) {
|
188 |
$links = is_array( $links ) ? $links : array();
|
189 |
if( ! empty( $panel_page ) ){
|
190 |
$links[] = sprintf( '<a href="%s">%s</a>', admin_url( "admin.php?page={$panel_page}" ), _x( 'Settings', 'Action links', 'yith-plugin-fw' ) );
|
191 |
}
|
192 |
|
193 |
if( $is_premium && class_exists( 'YIT_Plugin_Licence' ) ){
|
194 |
+
$links[] = sprintf( '<a href="%s">%s</a>', YIT_Plugin_Licence()->get_license_activation_url( $plugin_slug ),__( 'License', 'yith-plugin-fw' ) );
|
195 |
}
|
196 |
|
197 |
return $links;
|
plugin-options/premium-options.php
CHANGED
@@ -15,10 +15,10 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
15 |
|
16 |
|
17 |
return array(
|
18 |
-
'premium' => array(
|
19 |
'home' => array(
|
20 |
'type' => 'custom_tab',
|
21 |
'action' => 'yith_zoom_magnifier_premium'
|
22 |
)
|
23 |
)
|
24 |
-
);
|
15 |
|
16 |
|
17 |
return array(
|
18 |
+
'premium-landing' => array(
|
19 |
'home' => array(
|
20 |
'type' => 'custom_tab',
|
21 |
'action' => 'yith_zoom_magnifier_premium'
|
22 |
)
|
23 |
)
|
24 |
+
);
|
templates/single-product/product-image-magnifier.php
CHANGED
@@ -25,10 +25,6 @@ if( is_array( $extra_classes ) ){
|
|
25 |
$extra_classes = implode( " ", $extra_classes );
|
26 |
}
|
27 |
?>
|
28 |
-
|
29 |
-
<input type="hidden" id="yith_wczm_traffic_light" value="free">
|
30 |
-
|
31 |
-
|
32 |
<div class="images<?php if ( $is_IE ): ?> ie<?php endif ?>">
|
33 |
|
34 |
<?php
|
@@ -101,4 +97,4 @@ if( is_array( $extra_classes ) ){
|
|
101 |
loadingLabel: '<?php echo stripslashes ( get_option ( 'yith_wcmg_loading_label' ) ) ?>',
|
102 |
zoom_wrap_additional_css: '<?php echo apply_filters ( 'yith_ywzm_zoom_wrap_additional_css', '', $post->ID ); ?>'
|
103 |
};
|
104 |
-
</script>
|
25 |
$extra_classes = implode( " ", $extra_classes );
|
26 |
}
|
27 |
?>
|
|
|
|
|
|
|
|
|
28 |
<div class="images<?php if ( $is_IE ): ?> ie<?php endif ?>">
|
29 |
|
30 |
<?php
|
97 |
loadingLabel: '<?php echo stripslashes ( get_option ( 'yith_wcmg_loading_label' ) ) ?>',
|
98 |
zoom_wrap_additional_css: '<?php echo apply_filters ( 'yith_ywzm_zoom_wrap_additional_css', '', $post->ID ); ?>'
|
99 |
};
|
100 |
+
</script>
|
templates/single-product/product-thumbnails-magnifier.php
CHANGED
@@ -2,78 +2,68 @@
|
|
2 |
/**
|
3 |
* Single Product Image
|
4 |
*
|
5 |
-
* @author
|
6 |
-
* @package
|
|
|
7 |
*/
|
8 |
|
9 |
-
if (!defined('ABSPATH')) exit; // Exit if accessed directly
|
10 |
|
11 |
global $post, $product, $woocommerce;
|
12 |
|
13 |
$enable_slider = get_option('yith_wcmg_enableslider') == 'yes' ? true : false;
|
14 |
-
$post_thumbnail_id = apply_filters( 'yith_wcmg_get_post_thumbnail_id', get_post_thumbnail_id(), $post->ID );
|
15 |
|
16 |
-
$attachment_ids = version_compare(WC()->version, '
|
17 |
-
|
|
|
18 |
|
19 |
// make sure attachments ids are unique
|
20 |
$attachment_ids = array_unique($attachment_ids);
|
21 |
-
if ($attachment_ids) {
|
22 |
-
|
23 |
-
$columns = apply_filters('woocommerce_product_thumbnails_columns', get_option('yith_wcmg_slider_items', 3));
|
24 |
-
if ( ! isset( $columns ) || $columns == null ) $columns = 3;
|
25 |
-
|
26 |
-
$li_width = floor( 90 / $columns );
|
27 |
-
$li_width = 90 / $columns;
|
28 |
-
|
29 |
-
$li_margins_l_r = 10 / ( $columns * 2 );
|
30 |
-
|
31 |
-
$li_style = apply_filters( 'woocommerce_single_product_image_thumbnail_html_cloumns_style', 'width: ' . $li_width . '%; margin-left: ' . $li_margins_l_r . '%; margin-right: ' . $li_margins_l_r . '%;' , $columns );
|
32 |
|
|
|
33 |
?>
|
34 |
-
|
35 |
<div class="thumbnails <?php echo $enable_slider ? 'slider' : 'noslider' ?>">
|
36 |
-
<ul class="yith_magnifier_gallery"
|
37 |
-
|
38 |
-
|
|
|
39 |
|
40 |
-
|
41 |
|
42 |
-
|
|
|
43 |
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
}
|
48 |
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
|
53 |
-
|
54 |
-
|
|
|
55 |
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
|
60 |
-
|
61 |
-
|
62 |
|
63 |
-
|
64 |
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
</ul>
|
69 |
|
70 |
-
<?php if ( $enable_slider
|
71 |
<div id="slider-prev"></div>
|
72 |
<div id="slider-next"></div>
|
73 |
<?php endif; ?>
|
74 |
-
<input id="yith_wc_zm_carousel_controler" type="hidden" value="1">
|
75 |
</div>
|
76 |
-
|
77 |
-
<?php
|
78 |
}
|
79 |
?>
|
2 |
/**
|
3 |
* Single Product Image
|
4 |
*
|
5 |
+
* @author YIThemes
|
6 |
+
* @package YITH_Magnifier/Templates
|
7 |
+
* @version 1.1.2
|
8 |
*/
|
9 |
|
10 |
+
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
11 |
|
12 |
global $post, $product, $woocommerce;
|
13 |
|
14 |
$enable_slider = get_option('yith_wcmg_enableslider') == 'yes' ? true : false;
|
|
|
15 |
|
16 |
+
$attachment_ids = version_compare(WC()->version, '3.0.0', '<') ? $product->get_gallery_attachment_ids() : $product->get_gallery_image_ids();
|
17 |
+
$post_thumbnail_id = apply_filters( 'yith_wcmg_get_post_thumbnail_id', get_post_thumbnail_id(), $post->ID );
|
18 |
+
if ( ! empty( $attachment_ids ) ) array_unshift( $attachment_ids, $post_thumbnail_id );
|
19 |
|
20 |
// make sure attachments ids are unique
|
21 |
$attachment_ids = array_unique($attachment_ids);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
|
23 |
+
if ( $attachment_ids ) {
|
24 |
?>
|
|
|
25 |
<div class="thumbnails <?php echo $enable_slider ? 'slider' : 'noslider' ?>">
|
26 |
+
<ul class="yith_magnifier_gallery">
|
27 |
+
<?php
|
28 |
+
$loop = 0;
|
29 |
+
$columns = apply_filters( 'woocommerce_product_thumbnails_columns', get_option( 'yith_wcmg_slider_items', 3 ) );
|
30 |
|
31 |
+
if( !isset( $columns ) || $columns == null ) $columns = 3;
|
32 |
|
33 |
+
foreach ( $attachment_ids as $attachment_id ) {
|
34 |
+
$classes = array( 'yith_magnifier_thumbnail' );
|
35 |
|
36 |
+
if ( $loop == 0 || $loop % $columns == 0 ) {
|
37 |
+
$classes[] = 'first';
|
38 |
+
}
|
|
|
39 |
|
40 |
+
if ( ( $loop + 1 ) % $columns == 0 ) {
|
41 |
+
$classes[] = 'last';
|
42 |
+
}
|
43 |
|
44 |
+
if( $loop == 0 && defined( 'YWCFAV_PREMIUM') ){
|
45 |
+
$classes[] = 'ywfav_magnifier_thumbnail';
|
46 |
+
}
|
47 |
|
48 |
+
$image = wp_get_attachment_image( $attachment_id, apply_filters( 'single_product_small_thumbnail_size', 'shop_thumbnail' ) );
|
49 |
+
$image_class = esc_attr( implode( ' ', $classes ) );
|
50 |
+
$image_title = esc_attr( get_the_title( $attachment_id ) );
|
51 |
|
52 |
+
list( $thumbnail_url, $thumbnail_width, $thumbnail_height ) = wp_get_attachment_image_src( $attachment_id, "shop_single" );
|
53 |
+
list( $magnifier_url, $magnifier_width, $magnifier_height ) = wp_get_attachment_image_src( $attachment_id, "shop_magnifier" );
|
54 |
|
55 |
+
echo apply_filters( 'woocommerce_single_product_image_thumbnail_html', sprintf( '<li class="%s"><a href="%s" class="%s" title="%s" data-small="%s">%s</a></li>', $image_class, $magnifier_url, $image_class, $image_title, $thumbnail_url, $image ), $attachment_id, $post->ID, $image_class );
|
56 |
|
57 |
+
$loop++;
|
58 |
+
}
|
59 |
+
?>
|
60 |
</ul>
|
61 |
|
62 |
+
<?php if ( $enable_slider ) : ?>
|
63 |
<div id="slider-prev"></div>
|
64 |
<div id="slider-next"></div>
|
65 |
<?php endif; ?>
|
|
|
66 |
</div>
|
67 |
+
<?php
|
|
|
68 |
}
|
69 |
?>
|